Go to the documentation of this file.
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;
50 # include "ne_nemesisI.h"
73 bool verbose=
false,
bool single_precision=
false);
261 std::vector<Real> & x_coor,
262 std::vector<Real> & y_coor,
263 std::vector<Real> & z_coor);
291 virtual void create(std::string filename)
override;
315 const std::vector<std::string> & names,
317 const std::vector<std::string> & output_names);
323 const std::vector<std::pair<unsigned int, unsigned int>> & var_nums,
325 const std::vector<std::string> & output_names);
331 const std::vector<std::string> & names,
340 const std::vector<std::set<subdomain_id_type>> & vars_active_subdomains)
override;
347 const std::vector<std::pair<unsigned int, unsigned int>> &var_nums,
349 const std::vector<std::set<subdomain_id_type>> & vars_active_subdomains);
696 const std::string &
title);
701 #endif // #if defined(LIBMESH_HAVE_NEMESIS_API) && defined(LIBMESH_HAVE_EXODUS_API)
702 #endif // LIBMESH_NEMESIS_IO_HELPER_H
int num_internal_nodes
To be used with the Nemesis::ne_get_loadbal_param() routine.
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::vector< int > node_cmap_node_cnts
std::vector< std::vector< int > > elem_cmap_proc_ids
virtual void write_elements(const MeshBase &mesh, bool use_discontinuous=false) override
This function is specialized to write the connectivity.
int num_proc
The number of processors for which the NEMESIS I file was created.
void compute_num_global_sidesets(const MeshBase &pmesh)
This function uses global communication routines to determine the number of sidesets across the entir...
std::vector< int > elem_cmap_elem_cnts
std::vector< std::vector< int > > elem_cmap_side_ids
virtual ~Nemesis_IO_Helper()
Destructor.
void compute_element_maps()
This function computes element maps (really just packs vectors) which map the elements to internal an...
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.
Nemesis_IO_Helper(const ParallelObject &parent, bool verbose=false, bool single_precision=false)
Constructor.
std::vector< int > global_sideset_ids
Containers for reading global sideset (boundary conditions) information.
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.
int num_external_nodes
The number of FEM nodes that reside on another processor but whose element partially resides on the c...
void compute_border_node_ids(const MeshBase &pmesh)
This function constructs the set of border node IDs present on the current mesh.
This is the ExodusII_IO_Helper class.
virtual void create(std::string filename) override
This function is specialized from ExodusII_IO_Helper to create the nodal coordinates stored on the lo...
The libMesh namespace provides an interface to certain functionality in the library.
std::string construct_nemesis_filename(const std::string &base_filename)
Given base_filename, foo.e, constructs the Nemesis filename foo.e.X.Y, where X=n.
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_map(std::vector< int > &elem_mapi, std::vector< int > &elem_mapb)
Outputs IDs of internal and border elements.
void get_ss_param_global()
Fills: global_sideset_ids, num_global_side_counts, num_global_side_df_counts Call after: get_init_glo...
std::set< unsigned > border_elem_ids
A set of border elem IDs for this processor.
std::vector< int > elem_mapb
Vector which stores border element IDs.
std::vector< int > node_mapi
Vector which stores internal node IDs.
std::vector< int > global_elem_blk_ids
Read the global element block IDs and counts.
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...
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.
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.
void compute_communication_map_parameters()
This function determines the communication map parameters which will eventually be written to file.
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 ...
int num_proc_in_file
The number of processors for which the NEMESIS I file stores information.
void write_exodus_initialization_info(const MeshBase &pmesh, const std::string &title)
This function writes exodus-specific initialization information.
std::vector< int > num_global_node_counts
void compute_elem_communication_maps()
This function computes element communication maps (really just packs vectors) in preparation for writ...
char ftype
The type of file to be written.
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.
This is the MeshBase class.
This is the Nemesis_IO_Helper class.
std::vector< int > global_elem_blk_cnts
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...
int num_elem_cmaps
The number of elemental communication maps for this processor.
std::vector< int > node_mape
Vector which stores external node IDs.
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.
std::vector< std::vector< int > > node_cmap_proc_ids
std::map< unsigned, std::set< unsigned > > proc_nodes_touched_intersections
Another map to store sets of intersections with each other processor (other than ourself,...
std::set< unsigned > internal_elem_ids
A set of internal elem IDs for this processor.
std::vector< char > title
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_mapi
Vector which stores internal element 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.
std::vector< int > node_cmap_ids
Vectors for storing the communication map parameters.
void compute_node_maps()
Compute the node maps (really just pack vectors) which map the nodes to internal, border,...
std::vector< int > elem_cmap_ids
void put_n_coord(unsigned start_node_num, unsigned num_nodes, std::vector< Real > &x_coor, std::vector< Real > &y_coor, std::vector< Real > &z_coor)
Writes the specified number of coordinate values starting at the specified index.
int num_nodes_global
Global initial information.
void get_eb_info_global()
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::vector< int > node_mapb
Vector which stores border node IDs.
int nemesis_err_flag
Member data.
This is the EquationSystems class.
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.
std::set< int > nodes_attached_to_local_elems
libMesh numbered node ids attached to local elems.
void get_ns_param_global()
std::set< unsigned > border_node_ids
The set which will eventually contain the IDs of "border nodes".
void put_init_info(unsigned num_proc, unsigned num_proc_in_file, const char *ftype)
Writing functions.
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 > num_global_side_counts
int num_node_cmaps
The number of nodal communication maps for this processor.
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...
std::set< unsigned > internal_node_ids
A set of internal node IDs for this processor.
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_nodesets(const MeshBase &mesh) override
Writes the nodesets 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...
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 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 ....
void get_init_global()
Reading functions.
int num_internal_elems
The number of internal FEM elements.
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
An object whose state is distributed along a set of processors.
std::map< subdomain_id_type, std::vector< dof_id_type > > subdomain_map
Map of subdomains to element numbers.
std::vector< std::vector< int > > node_cmap_node_ids
2 vectors of vectors for storing the node communication IDs for this processor.
std::vector< int > num_global_node_df_counts
std::map< int, std::vector< int > > block_id_to_elem_connectivity
This is the block connectivity, i.e.
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 build_element_and_node_maps(const MeshBase &pmesh)
This function builds the libmesh -> exodus and exodus -> libmesh node and element maps.
int num_border_elems
The number of border FEM elements.