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"    36 class EquationSystems;
    37 template <
typename T> 
class NumericVector;
    53 #  include "ne_nemesisI.h"    78                     bool verbose=
false, 
bool single_precision=
false);
   334                             const std::vector<std::string> & names,
   336                             const std::vector<std::string> & output_names);
   342                             const std::vector<std::pair<unsigned int, unsigned int>> & var_nums,
   344                             const std::vector<std::string> & output_names);
   350                             const std::vector<std::string> & names,
   359                                     const std::vector<std::set<subdomain_id_type>> & vars_active_subdomains) 
override;
   366                             const std::vector<std::pair<unsigned int, unsigned int>> &var_nums,
   368                             const std::vector<std::set<subdomain_id_type>> & vars_active_subdomains);
   609                                    std::vector<std::string> & result) 
override;
   723                                         const std::string & 
title);
   728 #endif // #if defined(LIBMESH_HAVE_NEMESIS_API) && defined(LIBMESH_HAVE_EXODUS_API)   729 #endif // LIBMESH_NEMESIS_IO_HELPER_H 
This is the EquationSystems class. 
Nemesis_IO_Helper(const ParallelObject &parent, bool verbose=false, bool single_precision=false)
Constructor. 
std::map< subdomain_id_type, std::vector< dof_id_type > > subdomain_map
Map of subdomains to element numbers. 
virtual ~Nemesis_IO_Helper()
Destructor. 
std::vector< int > num_global_node_counts
void compute_element_maps()
This function computes element maps (really just packs vectors) which map the elements to internal an...
std::vector< int > global_nodeset_ids
Containers for reading global nodeset information. 
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...
void read_nodeset(int id)
Reading functions. 
char ftype
The type of file to be written. 
std::vector< int > global_sideset_ids
Containers for reading global sideset (boundary conditions) information. 
void compute_num_global_nodesets(const MeshBase &pmesh)
This function uses global communication routines to determine the number of nodesets across the entir...
std::vector< int > node_cmap_ids
Vectors for storing the communication map parameters. 
void get_ss_param_global()
Fills: global_sideset_ids, num_global_side_counts, num_global_side_df_counts Call after: get_init_glo...
int num_external_nodes
The number of FEM nodes that reside on another processor but whose element partially resides on the c...
int nemesis_err_flag
Member data. 
std::vector< int > node_mape
Vector which stores external node IDs. 
void compute_elem_communication_maps()
This function computes element communication maps (really just packs vectors) in preparation for writ...
void compute_num_global_elem_blocks(const MeshBase &pmesh)
This function uses global communication routines to determine the number of element blocks across the...
int num_node_cmaps
The number of nodal communication maps for this processor. 
void put_elem_map(std::vector< int > &elem_mapi, std::vector< int > &elem_mapb)
Outputs IDs of internal and border elements. 
std::vector< int > num_global_node_df_counts
std::vector< std::vector< int > > elem_cmap_side_ids
std::vector< std::vector< int > > node_cmap_proc_ids
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. 
The libMesh namespace provides an interface to certain functionality in the library. 
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...
std::vector< int > node_list
void compute_border_node_ids(const MeshBase &pmesh)
This function constructs the set of border node IDs present on the current mesh. 
std::vector< char > & title
bool write_complex_abs
By default, when complex numbers are enabled, for each variable we write out three values: the real p...
void compute_communication_map_parameters()
This function determines the communication map parameters which will eventually be written to file...
virtual void write_elements(const MeshBase &mesh, bool use_discontinuous=false) override
This function is specialized to write the connectivity. 
int num_nodes_global
Global initial information. 
void compute_node_communication_maps()
Compute the node communication maps (really just pack vectors) in preparation for writing them to fil...
std::vector< int > num_global_side_df_counts
This is the MeshBase class. 
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...
void build_element_and_node_maps(const MeshBase &pmesh)
This function builds the libmesh -> exodus and exodus -> libmesh node and element maps...
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 ...
This is the Nemesis_IO_Helper class. 
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...
std::vector< int > num_global_side_counts
std::vector< int > global_elem_blk_ids
Read the global element block IDs and counts. 
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< std::vector< int > > elem_cmap_elem_ids
3 vectors of vectors for storing element communication IDs for this processor. 
void write_complex_magnitude(bool val)
Set the flag indicating whether the complex modulus should be written when complex numbers are enable...
std::set< unsigned > border_elem_ids
A set of border elem IDs for this processor. 
std::set< unsigned > internal_node_ids
A set of internal node IDs for this processor. 
std::vector< int > node_mapi
Vector which stores internal node IDs. 
int num_proc
The number of processors for which the NEMESIS I file was created. 
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. ...
This is the ExodusII_IO_Helper class. 
std::vector< std::vector< int > > elem_cmap_proc_ids
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. 
std::set< unsigned > border_node_ids
The set which will eventually contain the IDs of "border nodes". 
std::set< int > nodes_attached_to_local_elems
libMesh numbered node ids attached to local elems. 
void get_init_global()
Fills: num_nodes_global, num_elems_global, num_elem_blks_global, num_node_sets_global, num_side_sets_global Call after: read_and_store_header_info() Call before: Any other get_* function from this class. 
An object whose state is distributed along a set of processors. 
void compute_num_global_sidesets(const MeshBase &pmesh)
This function uses global communication routines to determine the number of sidesets across the entir...
void get_eb_info_global()
int num_internal_elems
The number of internal FEM elements. 
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 compute_node_maps()
Compute the node maps (really just pack vectors) which map the nodes to internal, border...
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< 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< int, std::vector< int > > block_id_to_elem_connectivity
This is the block connectivity, i.e. 
virtual void write_nodesets(const MeshBase &mesh) override
Writes the nodesets for this processor. 
std::map< unsigned, std::set< unsigned > >::iterator proc_nodes_touched_iterator
Typedef for an iterator into the data structure above. 
void get_ns_param_global()
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. 
std::vector< int > elem_cmap_elem_cnts
int num_elem_cmaps
The number of elemental communication maps for this processor. 
std::vector< int > elem_cmap_ids
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. 
virtual void write_sidesets(const MeshBase &mesh) override
Writes the sidesets for this processor. 
int num_proc_in_file
The number of processors for which the NEMESIS I file stores information. 
std::vector< int > node_cmap_node_cnts
std::map< unsigned, std::set< unsigned > > proc_nodes_touched_intersections
Another map to store sets of intersections with each other processor (other than ourself, of course). 
void write_exodus_initialization_info(const MeshBase &pmesh, const std::string &title)
This function writes exodus-specific initialization information. 
void put_init_info(unsigned num_proc, unsigned num_proc_in_file, const char *ftype)
Writing functions. 
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. 
std::vector< int > elem_mapb
Vector which stores border element IDs. 
std::vector< int > node_mapb
Vector which stores border node IDs. 
std::vector< std::vector< int > > node_cmap_node_ids
2 vectors of vectors for storing the node communication IDs for this processor. 
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::vector< int > global_elem_blk_cnts
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...
std::vector< int > elem_mapi
Vector which stores internal element IDs. 
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. 
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...
int num_internal_nodes
To be used with the Nemesis::ne_get_loadbal_param() routine. 
std::set< unsigned > internal_elem_ids
A set of internal elem IDs for this processor. 
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. 
int num_border_elems
The number of border FEM elements. 
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...