18#ifndef LIBMESH_NEMESIS_IO_HELPER_H
19#define LIBMESH_NEMESIS_IO_HELPER_H
21#include "libmesh/libmesh_config.h"
23#if defined(LIBMESH_HAVE_NEMESIS_API) && defined(LIBMESH_HAVE_EXODUS_API)
26#include "libmesh/exodusII_io_helper.h"
37template <
typename T>
class NumericVector;
60 bool verbose=
false,
bool single_precision=
false);
316 const std::vector<std::string> & names,
318 const std::vector<std::string> & output_names);
324 const std::vector<std::pair<unsigned int, unsigned int>> & var_nums,
326 const std::vector<std::string> & output_names);
332 const std::vector<std::string> & names,
341 const std::vector<std::set<subdomain_id_type>> & vars_active_subdomains)
override;
348 const std::vector<std::pair<unsigned int, unsigned int>> &var_nums,
350 const std::vector<std::set<subdomain_id_type>> & vars_active_subdomains);
591 std::vector<std::string> & result)
override;
705 const std::string &
title);
This is the EquationSystems class.
This is the ExodusII_IO_Helper class.
std::vector< char > & title
This is the MeshBase class.
This is the Nemesis_IO_Helper class.
void compute_node_maps()
Compute the node maps (really just pack vectors) which map the nodes to internal, border,...
int num_border_elems
The number of border FEM elements.
std::vector< std::vector< int > > elem_cmap_proc_ids
void write_nodal_solution(const NumericVector< Number > ¶llel_soln, const std::vector< std::string > &names, int timestep, const std::vector< std::string > &output_names)
Takes a parallel solution vector containing the node-major solution vector for all variables and outp...
int num_external_nodes
The number of FEM nodes that reside on another processor but whose element partially resides on the c...
void put_node_map(std::vector< int > &node_mapi, std::vector< int > &node_mapb, std::vector< int > &node_mape)
Outputs IDs of internal, border, and external nodes.
virtual void write_nodal_coordinates(const MeshBase &mesh, bool use_discontinuous=false) override
This function is specialized from ExodusII_IO_Helper to write only the nodal coordinates stored on th...
virtual void write_sidesets(const MeshBase &mesh) override
Writes the sidesets for this processor.
void put_loadbal_param(unsigned num_internal_nodes, unsigned num_border_nodes, unsigned num_external_nodes, unsigned num_internal_elems, unsigned num_border_elems, unsigned num_node_cmaps, unsigned num_elem_cmaps)
Writes load balance parameters, some of which are described below: .) num_internal_nodes - nodes "who...
int num_internal_nodes
To be used with the Nemesis::ne_get_loadbal_param() routine.
void put_node_cmap(std::vector< std::vector< int > > &node_cmap_node_ids, std::vector< std::vector< int > > &node_cmap_proc_ids)
Outputs all of the nodal communication maps for this processor.
int num_internal_elems
The number of internal FEM elements.
void get_ss_param_global()
Fills: global_sideset_ids, num_global_side_counts, num_global_side_df_counts Call after: get_init_glo...
void put_ns_param_global(std::vector< int > &global_nodeset_ids, std::vector< int > &num_global_node_counts, std::vector< int > &num_global_node_df_counts)
This function writes information about global node sets.
std::set< unsigned > internal_elem_ids
A set of internal elem IDs for this processor.
char ftype
The type of file to be written.
void put_init_info(unsigned num_proc, unsigned num_proc_in_file, const char *ftype)
Writing functions.
std::map< unsigned, std::set< unsigned > > proc_nodes_touched_intersections
Another map to store sets of intersections with each other processor (other than ourself,...
void put_ss_param_global(std::vector< int > &global_sideset_ids, std::vector< int > &num_global_side_counts, std::vector< int > &num_global_side_df_counts)
This function writes information about global side sets.
std::vector< int > elem_cmap_elem_cnts
void write_complex_magnitude(bool val)
Set the flag indicating whether the complex modulus should be written when complex numbers are enable...
int num_border_nodes
The number of FEM nodes local to a processor but residing in an element which also has FEM nodes on o...
std::vector< int > elem_mapb
Vector which stores border element IDs.
std::vector< int > global_elem_blk_cnts
int num_proc_in_file
The number of processors for which the NEMESIS I file stores information.
void compute_communication_map_parameters()
This function determines the communication map parameters which will eventually be written to file.
void read_nodeset(int id)
Reading functions.
std::set< unsigned > border_elem_ids
A set of border elem IDs for this processor.
std::map< subdomain_id_type, unsigned > local_subdomain_counts
This map keeps track of the number of elements in each subdomain (block) for this processor.
std::map< subdomain_id_type, std::vector< dof_id_type > > subdomain_map
Map of subdomains to element numbers.
void compute_num_global_elem_blocks(const MeshBase &pmesh)
This function uses global communication routines to determine the number of element blocks across the...
void get_init_global()
Fills: num_nodes_global, num_elems_global, num_elem_blks_global, num_node_sets_global,...
int num_node_cmaps
The number of nodal communication maps for this processor.
std::set< int > nodes_attached_to_local_elems
libMesh numbered node ids attached to local elems.
std::set< unsigned > internal_node_ids
A set of internal node IDs for this processor.
void compute_num_global_nodesets(const MeshBase &pmesh)
This function uses global communication routines to determine the number of nodesets across the entir...
void put_elem_cmap(std::vector< std::vector< int > > &elem_cmap_elem_ids, std::vector< std::vector< int > > &elem_cmap_side_ids, std::vector< std::vector< int > > &elem_cmap_proc_ids)
Writes information about elemental communication map.
std::map< unsigned, std::set< unsigned > >::iterator proc_nodes_touched_iterator
Typedef for an iterator into the data structure above.
std::vector< int > num_global_side_df_counts
std::vector< int > elem_mapi
Vector which stores internal element IDs.
void write_exodus_initialization_info(const MeshBase &pmesh, const std::string &title)
This function writes exodus-specific initialization information.
void compute_elem_communication_maps()
This function computes element communication maps (really just packs vectors) in preparation for writ...
std::vector< int > num_global_side_counts
int nemesis_err_flag
Member data.
void compute_element_maps()
This function computes element maps (really just packs vectors) which map the elements to internal an...
std::vector< int > node_mape
Vector which stores external node IDs.
std::vector< int > node_mapb
Vector which stores border node IDs.
std::vector< int > node_cmap_node_cnts
std::vector< int > node_cmap_ids
Vectors for storing the communication map parameters.
void put_elem_map(std::vector< int > &elem_mapi, std::vector< int > &elem_mapb)
Outputs IDs of internal and border elements.
int num_nodes_global
Global initial information.
virtual void initialize_element_variables(std::vector< std::string > names, const std::vector< std::set< subdomain_id_type > > &vars_active_subdomains) override
Override the Exodus Helper's implementation of this function so that it works correctly in parallel.
std::vector< int > global_elem_blk_ids
Read the global element block IDs and counts.
std::vector< int > node_list
void compute_internal_and_border_elems_and_internal_nodes(const MeshBase &pmesh)
This function constructs the set of border and internal element IDs and internal node IDs present on ...
void get_ns_param_global()
std::vector< int > num_global_node_df_counts
std::vector< std::vector< int > > node_cmap_proc_ids
void compute_num_global_sidesets(const MeshBase &pmesh)
This function uses global communication routines to determine the number of sidesets across the entir...
std::map< int, std::vector< int > > block_id_to_elem_connectivity
This is the block connectivity, i.e.
std::vector< int > global_nodeset_ids
Containers for reading global nodeset information.
std::vector< std::vector< int > > elem_cmap_elem_ids
3 vectors of vectors for storing element communication IDs for this processor.
void put_cmap_params(std::vector< int > &node_cmap_ids, std::vector< int > &node_cmap_node_cnts, std::vector< int > &elem_cmap_ids, std::vector< int > &elem_cmap_elem_cnts)
Outputs initial information for communication maps.
void get_eb_info_global()
std::vector< int > num_global_node_counts
void compute_border_node_ids(const MeshBase &pmesh)
This function constructs the set of border node IDs present on the current mesh.
void build_element_and_node_maps(const MeshBase &pmesh)
This function builds the libmesh -> exodus and exodus -> libmesh node and element maps.
bool write_complex_abs
By default, when complex numbers are enabled, for each variable we write out three values: the real p...
void put_eb_info_global(std::vector< int > &global_elem_blk_ids, std::vector< int > &global_elem_blk_cnts)
Writes global block information to the file .) global_elem_blk_ids - list of block IDs for all blocks...
void put_init_global(dof_id_type num_nodes_global, dof_id_type num_elems_global, unsigned num_elem_blks_global, unsigned num_node_sets_global, unsigned num_side_sets_global)
Writes global information including: .) global number of nodes .) global number of elems ....
std::vector< int > node_mapi
Vector which stores internal node IDs.
int num_elem_cmaps
The number of elemental communication maps for this processor.
void compute_node_communication_maps()
Compute the node communication maps (really just pack vectors) in preparation for writing them to fil...
virtual void initialize(std::string title, const MeshBase &mesh, bool use_discontinuous=false) override
Specialization of the initialize function from ExodusII_IO_Helper that also writes global initial dat...
std::set< unsigned > border_node_ids
The set which will eventually contain the IDs of "border nodes".
std::vector< int > elem_cmap_ids
std::vector< std::vector< int > > elem_cmap_side_ids
std::map< unsigned, std::set< std::pair< unsigned, unsigned > > >::iterator proc_border_elem_sets_iterator
Typedef for an iterator into the data structure above.
std::string construct_nemesis_filename(std::string_view base_filename)
Given base_filename, foo.e, constructs the Nemesis filename foo.e.X.Y, where X=n.
void write_element_values(const MeshBase &mesh, const EquationSystems &es, const std::vector< std::pair< unsigned int, unsigned int > > &var_nums, int timestep, const std::vector< std::set< subdomain_id_type > > &vars_active_subdomains)
Writes the vector of elemental variable values, one variable and one subdomain at a time.
virtual void write_elements(const MeshBase &mesh, bool use_discontinuous=false) override
This function is specialized to write the connectivity.
std::vector< std::vector< int > > node_cmap_node_ids
2 vectors of vectors for storing the node communication IDs for this processor.
virtual ~Nemesis_IO_Helper()
Destructor.
int num_proc
The number of processors for which the NEMESIS I file was created.
std::vector< int > global_sideset_ids
Containers for reading global sideset (boundary conditions) information.
virtual void write_nodesets(const MeshBase &mesh) override
Writes the nodesets for this processor.
std::map< unsigned, std::set< std::pair< unsigned, unsigned > > > proc_border_elem_sets
Map between processor ID and (element,side) pairs bordering that processor ID.
virtual void read_var_names_impl(const char *var_type, int &count, std::vector< std::string > &result) override
read_var_names() dispatches to this function.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
An object whose state is distributed along a set of processors.
The libMesh namespace provides an interface to certain functionality in the library.