libMesh
|
This class implements writing meshes and solutions in Ensight's Gold format. More...
#include <ensight_io.h>
Classes | |
struct | Scalars |
struct | SystemVars |
struct | Vectors |
Public Member Functions | |
EnsightIO (const std::string &filename, const EquationSystems &eq) | |
Constructor. More... | |
~EnsightIO ()=default | |
Empty destructor. More... | |
void | add_scalar (const std::string &system, std::string_view scalar_description, std::string_view s) |
Tell the EnsightIO interface to output the finite element (not SCALAR) variable named "s". More... | |
void | add_vector (const std::string &system, std::string_view vec_description, std::string u, std::string v) |
Tell the EnsightIO interface that the variables (u,v) constitute a vector. More... | |
void | add_vector (const std::string &system, std::string_view vec_description, std::string u, std::string v, std::string w) |
Tell the EnsightIO interface that the variables (u, v, w) constitute a vector. More... | |
void | write (Real time=0) |
Calls write_ascii() and write_case(). More... | |
virtual void | write (const std::string &name) override |
Calls this->write(0);. More... | |
virtual void | write_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr) |
This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems object. More... | |
virtual void | write_discontinuous_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr) |
This method implements writing a mesh with discontinuous data to a specified file where the data is taken from the EquationSystems object. More... | |
virtual void | write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided. More... | |
virtual void | write_nodal_data (const std::string &, const NumericVector< Number > &, const std::vector< std::string > &) |
This method may be overridden by "parallel" output formats for writing nodal data. More... | |
virtual void | write_nodal_data (const std::string &, const EquationSystems &, const std::set< std::string > *) |
This method should be overridden by "parallel" output formats for writing nodal data. More... | |
virtual void | write_nodal_data_discontinuous (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) |
This method implements writing a mesh with discontinuous data to a specified file where the nodal data and variables names are provided. More... | |
unsigned int & | ascii_precision () |
Return/set the precision to use when writing ASCII files. More... | |
Protected Member Functions | |
const MeshBase & | mesh () const |
virtual bool | get_add_sides () |
Protected Attributes | |
const bool | _is_parallel_format |
Flag specifying whether this format is parallel-capable. More... | |
const bool | _serial_only_needed_on_proc_0 |
Flag specifying whether this format can be written by only serializing the mesh to processor zero. More... | |
Private Member Functions | |
void | write_ascii (Real time=0) |
void | write_scalar_ascii (std::string_view sys, std::string_view var) |
void | write_vector_ascii (std::string_view sys, const std::vector< std::string > &vec, std::string_view var_name) |
void | write_solution_ascii () |
void | write_geometry_ascii () |
void | write_case () |
Static Private Member Functions | |
static std::map< ElemType, std::string > | build_element_map () |
Private Attributes | |
std::string | _ensight_file_name |
std::vector< Real > | _time_steps |
std::map< std::string, SystemVars > | _system_vars_map |
const EquationSystems & | _equation_systems |
Static Private Attributes | |
static std::map< ElemType, std::string > | _element_map = EnsightIO::build_element_map() |
This class implements writing meshes and solutions in Ensight's Gold format.
Definition at line 47 of file ensight_io.h.
libMesh::EnsightIO::EnsightIO | ( | const std::string & | filename, |
const EquationSystems & | eq | ||
) |
Constructor.
Definition at line 65 of file ensight_io.C.
References _ensight_file_name, _equation_systems, libMesh::ParallelObject::n_processors(), and libMesh::ParallelObject::processor_id().
|
default |
Empty destructor.
void libMesh::EnsightIO::add_scalar | ( | const std::string & | system, |
std::string_view | scalar_description, | ||
std::string_view | s | ||
) |
Tell the EnsightIO interface to output the finite element (not SCALAR) variable named "s".
Definition at line 122 of file ensight_io.C.
References _equation_systems, _system_vars_map, libMesh::EnsightIO::Scalars::description, libMesh::EquationSystems::get_system(), libMesh::EquationSystems::has_system(), and libMesh::libmesh_assert().
void libMesh::EnsightIO::add_vector | ( | const std::string & | system, |
std::string_view | vec_description, | ||
std::string | u, | ||
std::string | v | ||
) |
Tell the EnsightIO interface that the variables (u,v) constitute a vector.
u
and v
must have the same FEType, and be defined in the same system. Definition at line 82 of file ensight_io.C.
References _equation_systems, _system_vars_map, libMesh::EnsightIO::Vectors::description, libMesh::EquationSystems::get_system(), libMesh::EquationSystems::has_system(), and libMesh::libmesh_assert().
void libMesh::EnsightIO::add_vector | ( | const std::string & | system, |
std::string_view | vec_description, | ||
std::string | u, | ||
std::string | v, | ||
std::string | w | ||
) |
Tell the EnsightIO interface that the variables (u, v, w) constitute a vector.
u
, v
, and w
must have the same FEType, and must be defined in the same system. Definition at line 101 of file ensight_io.C.
References _equation_systems, _system_vars_map, libMesh::EnsightIO::Vectors::description, libMesh::EquationSystems::get_system(), libMesh::EquationSystems::has_system(), and libMesh::libmesh_assert().
|
inlineinherited |
Return/set the precision to use when writing ASCII files.
By default we use numeric_limits<Real>::max_digits10, which should be enough to write out to ASCII and get the exact same Real back when reading in.
Definition at line 269 of file mesh_output.h.
Referenced by libMesh::UNVIO::nodes_out(), libMesh::FroIO::write(), libMesh::MEDITIO::write_ascii(), libMesh::TecplotIO::write_ascii(), libMesh::GMVIO::write_ascii_new_impl(), and libMesh::GMVIO::write_ascii_old_impl().
|
staticprivate |
Definition at line 45 of file ensight_io.C.
References libMesh::EDGE2, libMesh::EDGE3, libMesh::HEX20, libMesh::HEX8, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, and libMesh::TRI6.
|
inlineprotectedvirtualinherited |
Reimplemented in libMesh::ExodusII_IO.
Definition at line 176 of file mesh_output.h.
|
inlineprotectedinherited |
Definition at line 259 of file mesh_output.h.
References libMesh::libmesh_assert().
Referenced by libMesh::FroIO::write(), libMesh::TecplotIO::write(), libMesh::MEDITIO::write(), libMesh::PostscriptIO::write(), write(), libMesh::TecplotIO::write_ascii(), libMesh::TecplotIO::write_binary(), libMesh::TecplotIO::write_nodal_data(), libMesh::MEDITIO::write_nodal_data(), and libMesh::GnuPlotIO::write_solution().
void libMesh::EnsightIO::write | ( | Real | time = 0 | ) |
Calls write_ascii() and write_case().
Writes case, mesh, and solution files named: name.case (contains a description of other files) name.geo000 (mesh) name_{varname}.scl000 (one file per scalar variable) name_{vecname}.vec000 (one file per vector variable)
Definition at line 152 of file ensight_io.C.
References write_ascii(), and write_case().
Referenced by write().
|
overridevirtual |
Calls this->write(0);.
Implements libMesh::MeshOutput< MeshBase >.
Definition at line 140 of file ensight_io.C.
References _ensight_file_name, libMesh::MeshOutput< MeshBase >::_is_parallel_format, libMesh::MeshOutput< MeshBase >::mesh(), libMesh::Quality::name(), and write().
|
private |
Definition at line 160 of file ensight_io.C.
References _time_steps, write_geometry_ascii(), and write_solution_ascii().
Referenced by write().
|
private |
Definition at line 272 of file ensight_io.C.
References _ensight_file_name, _system_vars_map, and _time_steps.
Referenced by write().
|
virtualinherited |
This method implements writing a mesh with discontinuous data to a specified file where the data is taken from the EquationSystems
object.
Definition at line 89 of file mesh_output.C.
References libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::EquationSystems::get_mesh(), libMesh::libmesh_assert(), and libMesh::out.
Referenced by libMesh::ExodusII_IO::write_timestep_discontinuous().
|
virtualinherited |
This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems
object.
Reimplemented in libMesh::NameBasedIO.
Definition at line 31 of file mesh_output.C.
References libMesh::EquationSystems::build_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::EquationSystems::get_mesh(), libMesh::libmesh_assert(), and libMesh::out.
Referenced by libMesh::Nemesis_IO::write_timestep(), and libMesh::ExodusII_IO::write_timestep().
|
private |
Definition at line 170 of file ensight_io.C.
References _element_map, _ensight_file_name, _time_steps, libMesh::HEX27, libMesh::MeshTools::Generation::Private::idx(), libMesh::index_range(), libMesh::MeshOutput< MT >::mesh(), libMesh::Quality::name(), and libMesh::QUAD9.
Referenced by write_ascii().
|
inlinevirtualinherited |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided.
Reimplemented in libMesh::ExodusII_IO, libMesh::Nemesis_IO, libMesh::GmshIO, libMesh::NameBasedIO, libMesh::VTKIO, libMesh::UCDIO, libMesh::GMVIO, libMesh::MEDITIO, libMesh::GnuPlotIO, and libMesh::TecplotIO.
Definition at line 109 of file mesh_output.h.
|
virtualinherited |
This method may be overridden by "parallel" output formats for writing nodal data.
Instead of getting a localized copy of the nodal solution vector, it is passed a NumericVector of type=PARALLEL which is in node-major order i.e. (u0,v0,w0, u1,v1,w1, u2,v2,w2, u3,v3,w3, ...) and contains n_nodes*n_vars total entries. Then, it is up to the individual I/O class to extract the required solution values from this vector and write them in parallel.
If not implemented, localizes the parallel vector into a std::vector and calls the other version of this function.
Reimplemented in libMesh::Nemesis_IO.
Definition at line 149 of file mesh_output.C.
References libMesh::NumericVector< T >::localize().
|
virtualinherited |
This method should be overridden by "parallel" output formats for writing nodal data.
Instead of getting a localized copy of the nodal solution vector, it directly uses EquationSystems current_local_solution vectors to look up nodal values.
If not implemented, reorders the solutions into a nodal-only NumericVector and calls the above version of this function.
Reimplemented in libMesh::Nemesis_IO.
Definition at line 162 of file mesh_output.C.
References libMesh::EquationSystems::build_parallel_solution_vector(), and libMesh::EquationSystems::build_variable_names().
|
inlinevirtualinherited |
This method implements writing a mesh with discontinuous data to a specified file where the nodal data and variables names are provided.
Reimplemented in libMesh::ExodusII_IO.
Definition at line 118 of file mesh_output.h.
|
private |
Definition at line 334 of file ensight_io.C.
References _ensight_file_name, _equation_systems, _time_steps, libMesh::System::current_solution(), dim, libMesh::DofMap::dof_indices(), libMesh::System::get_dof_map(), libMesh::EquationSystems::get_system(), libMesh::index_range(), libMesh::libmesh_real(), libMesh::MeshOutput< MT >::mesh(), libMesh::MeshBase::mesh_dimension(), libMesh::FEInterface::nodal_soln(), libMesh::System::variable_number(), and libMesh::System::variable_type().
Referenced by write_solution_ascii().
|
private |
Definition at line 318 of file ensight_io.C.
References _system_vars_map, write_scalar_ascii(), and write_vector_ascii().
Referenced by write_ascii().
|
private |
Definition at line 405 of file ensight_io.C.
References _ensight_file_name, _equation_systems, _time_steps, libMesh::System::current_solution(), dim, libMesh::DofMap::dof_indices(), libMesh::System::get_dof_map(), libMesh::EquationSystems::get_system(), libMesh::index_range(), libMesh::libmesh_real(), libMesh::MeshOutput< MT >::mesh(), libMesh::MeshBase::mesh_dimension(), libMesh::FEInterface::nodal_soln(), libMesh::System::variable_number(), and libMesh::System::variable_type().
Referenced by write_solution_ascii().
|
staticprivate |
Definition at line 154 of file ensight_io.h.
Referenced by write_geometry_ascii().
|
private |
Definition at line 144 of file ensight_io.h.
Referenced by EnsightIO(), write(), write_case(), write_geometry_ascii(), write_scalar_ascii(), and write_vector_ascii().
|
private |
Definition at line 151 of file ensight_io.h.
Referenced by add_scalar(), add_vector(), EnsightIO(), write_scalar_ascii(), and write_vector_ascii().
|
protectedinherited |
Flag specifying whether this format is parallel-capable.
If this is false (default) I/O is only permitted when the mesh has been serialized.
Definition at line 184 of file mesh_output.h.
Referenced by libMesh::FroIO::write(), libMesh::PostscriptIO::write(), and write().
|
protectedinherited |
Flag specifying whether this format can be written by only serializing the mesh to processor zero.
If this is false (default) the mesh will be serialized to all processors
Definition at line 193 of file mesh_output.h.
|
private |
Definition at line 148 of file ensight_io.h.
Referenced by add_scalar(), add_vector(), write_case(), and write_solution_ascii().
|
private |
Definition at line 145 of file ensight_io.h.
Referenced by write_ascii(), write_case(), write_geometry_ascii(), write_scalar_ascii(), and write_vector_ascii().