Go to the documentation of this file.
20 #ifndef LIBMESH_EXODUSII_IO_H
21 #define LIBMESH_EXODUSII_IO_H
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/mesh_input.h"
27 #include "libmesh/mesh_output.h"
28 #include "libmesh/parallel_object.h"
29 #include "libmesh/boundary_info.h"
35 class EquationSystems;
36 class ExodusII_IO_Helper;
63 bool single_precision=
false);
77 virtual void read (
const std::string &
name)
override;
82 virtual void write (
const std::string & fname)
override;
87 void verbose (
bool set_verbosity);
110 #ifdef LIBMESH_ENABLE_DEPRECATED
112 std::string var_name,
113 unsigned int timestep=1);
121 std::string system_var_name,
122 std::string exodus_var_name,
123 unsigned int timestep=1);
130 std::string system_var_name,
131 std::string exodus_var_name,
132 unsigned int timestep=1);
138 std::vector<std::string> system_var_names,
139 std::vector<std::string> exodus_var_names,
140 unsigned int timestep=1);
154 unsigned int timestep,
155 std::map<unsigned int, Real> & unique_id_to_value_map);
165 unsigned int timestep,
166 std::vector<Real> & global_values);
173 const std::set<std::string> * system_names=
nullptr);
187 const std::set<std::string> * system_names=
nullptr);
218 const std::set<std::string> * system_names =
nullptr,
219 const std::string & var_suffix =
"_elem_node_");
232 const std::vector<Number> &,
233 const std::vector<std::string> &)
override;
239 const std::vector<Number> &,
240 const std::vector<std::string> &)
override;
246 const std::vector<std::string> &);
265 const std::set<std::string> * system_names=
nullptr);
283 const std::vector<std::string> & var_names,
284 const std::vector<std::set<boundary_id_type>> & side_ids,
285 const std::vector<std::map<BoundaryInfo::BCTuple, Real>> & bc_vals);
295 std::vector<std::string> & var_names,
296 std::vector<std::set<boundary_id_type>> & side_ids,
297 std::vector<std::map<BoundaryInfo::BCTuple, Real>> & bc_vals);
308 bool allow_empty =
true);
372 #ifdef LIBMESH_HAVE_EXODUS_API
384 const std::vector<std::string> & names,
385 bool continuous=
true);
393 #ifdef LIBMESH_HAVE_EXODUS_API
433 #endif // LIBMESH_EXODUSII_IO_H
void write_nodal_data_common(std::string fname, const std::vector< std::string > &names, bool continuous=true)
This function factors out a bunch of code which is common to the write_nodal_data() and write_nodal_d...
Manages consistently variables, degrees of freedom, and coefficient vectors.
void copy_elemental_solution(System &system, std::string system_var_name, std::string exodus_var_name, unsigned int timestep=1)
If we read in a elemental solution while reading in a mesh, we can attempt to copy that elemental sol...
void read_global_variable(std::vector< std::string > global_var_names, unsigned int timestep, std::vector< Real > &global_values)
Given a vector of global variables and a time step, returns the values of the global variable at the ...
void write_as_dimension(unsigned dim)
Directly control the num_dim which is written to the Exodus file.
void verbose(bool set_verbosity)
Set the flag indicating if we should be verbose.
This is the ExodusII_IO_Helper class.
void write_sideset_data(int timestep, const std::vector< std::string > &var_names, const std::vector< std::set< boundary_id_type >> &side_ids, const std::vector< std::map< BoundaryInfo::BCTuple, Real >> &bc_vals)
The Exodus format can also store values on sidesets.
The libMesh namespace provides an interface to certain functionality in the library.
void write_element_data(const EquationSystems &es)
Write out element solution.
void copy_scalar_solution(System &system, std::vector< std::string > system_var_names, std::vector< std::string > exodus_var_names, unsigned int timestep=1)
Copy global variables into scalar variables of a System object.
int _timestep
Stores the current value of the timestep when calling ExodusII_IO::write_timestep().
ExodusII_IO_Helper & get_exio_helper()
Return a reference to the ExodusII_IO_Helper object.
void write_timestep(const std::string &fname, const EquationSystems &es, const int timestep, const Real time, const std::set< std::string > *system_names=nullptr)
Writes out the solution at a specific timestep.
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
void write_discontinuous_exodusII(const std::string &name, const EquationSystems &es, const std::set< std::string > *system_names=nullptr)
Writes a exodusII file with discontinuous data.
void write_information_records(const std::vector< std::string > &)
Write out information records.
void write_element_data_from_discontinuous_nodal_data(const EquationSystems &es, const std::set< std::string > *system_names=nullptr, const std::string &var_suffix="_elem_node_")
Similar to the function above, but instead of only handling (CONSTANT, MONOMIAL) data,...
void use_mesh_dimension_instead_of_spatial_dimension(bool val)
In the general case, meshes containing 2D elements can be manifolds living in 3D space,...
void write_global_data(const std::vector< Number > &, const std::vector< std::string > &)
Write out global variables.
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override
Write out a nodal solution.
bool _verbose
should we be verbose?
void set_coordinate_offset(Point p)
Allows you to set a vector that is added to the coordinates of all of the nodes.
void copy_nodal_solution(System &system, std::string var_name, unsigned int timestep=1)
Backward compatibility version of function that takes a single variable name.
This is the MeshBase class.
virtual ~ExodusII_IO()
Destructor.
const std::vector< std::string > & get_global_var_names()
Return list of the global variable names.
void read_sideset_data(int timestep, std::vector< std::string > &var_names, std::vector< std::set< boundary_id_type >> &side_ids, std::vector< std::map< BoundaryInfo::BCTuple, Real >> &bc_vals)
Similar to write_sideset_data(), this function is used to read the data at a particular timestep.
std::vector< std::string > _output_variables
The names of the variables to be output.
bool _append
Default false.
A Point defines a location in LIBMESH_DIM dimensional Real space.
std::unique_ptr< ExodusII_IO_Helper > exio_helper
Only attempt to instantiate an ExodusII helper class if the Exodus API is defined.
bool _allow_empty_variables
If true, _output_variables is allowed to remain empty.
const std::vector< Real > & get_time_steps()
const std::vector< std::string > & get_nodal_var_names()
Return list of the nodal variable names.
void append(bool val)
If true, this flag will cause the ExodusII_IO object to attempt to open an existing file for writing,...
void read_elemental_variable(std::string elemental_var_name, unsigned int timestep, std::map< unsigned int, Real > &unique_id_to_value_map)
Given an elemental variable and a time step, returns a mapping from the elements (top parent) unique ...
This is the EquationSystems class.
This class defines an abstract interface for Mesh output.
void write_timestep_discontinuous(const std::string &fname, const EquationSystems &es, const int timestep, const Real time, const std::set< std::string > *system_names=nullptr)
Writes a discontinuous solution at a specific timestep.
const std::vector< std::string > & get_elem_var_names()
Return list of the elemental variable names.
ExodusII_IO(MeshBase &mesh, bool single_precision=false)
Constructor.
void write_nodal_data_discontinuous(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override
Write out a discontinuous nodal solution.
virtual void write(const std::string &fname) override
This method implements writing a mesh to a specified file.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
An object whose state is distributed along a set of processors.
virtual void read(const std::string &name) override
This method implements reading a mesh from a specified file.
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
void set_output_variables(const std::vector< std::string > &output_variables, bool allow_empty=true)
Sets the list of variable names to be included in the output.