#include <ensight_io.h>
Classes | |
struct | Scalars |
struct | SystemVars |
struct | Vectors |
Public Member Functions | |
EnsightIO (const std::string &filename, const EquationSystems &eq) | |
~EnsightIO () | |
void | add_scalar (const std::string &system, const std::string &scalar_description, const std::string &s) |
void | add_vector (const std::string &system, const std::string &vec_description, const std::string &u, const std::string &v) |
void | add_vector (const std::string &system, const std::string &vec_description, const std::string &u, const std::string &v, const std::string &w) |
void | write (Real time=0) |
virtual void | write (const std::string &name) override |
virtual void | write_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr) |
virtual void | write_discontinuous_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr) |
virtual void | write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) |
virtual void | write_nodal_data (const std::string &, const NumericVector< Number > &, const std::vector< std::string > &) |
virtual void | write_nodal_data_discontinuous (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) |
unsigned int & | ascii_precision () |
Protected Member Functions | |
const MeshBase & | mesh () const |
Protected Attributes | |
const bool | _is_parallel_format |
const bool | _serial_only_needed_on_proc_0 |
Private Member Functions | |
void | write_ascii (Real time=0) |
void | write_scalar_ascii (const std::string &sys, const std::string &var) |
void | write_vector_ascii (const std::string &sys, const std::vector< std::string > &vec, const std::string &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 55 of file ensight_io.h.
libMesh::EnsightIO::EnsightIO | ( | const std::string & | filename, |
const EquationSystems & | eq | ||
) |
Constructor.
Definition at line 64 of file ensight_io.C.
References _ensight_file_name, _equation_systems, libMesh::ParallelObject::n_processors(), and libMesh::ParallelObject::processor_id().
|
inline |
void libMesh::EnsightIO::add_scalar | ( | const std::string & | system, |
const std::string & | scalar_description, | ||
const std::string & | s | ||
) |
Tell the EnsightIO interface to output the finite element (not SCALAR) variable named "s".
Definition at line 121 of file ensight_io.C.
References _equation_systems, _system_vars_map, libMesh::EnsightIO::Scalars::description, libMesh::EquationSystems::get_system(), and libMesh::EquationSystems::has_system().
void libMesh::EnsightIO::add_vector | ( | const std::string & | system, |
const std::string & | vec_description, | ||
const std::string & | u, | ||
const 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 81 of file ensight_io.C.
References _equation_systems, _system_vars_map, libMesh::EnsightIO::Vectors::description, libMesh::EquationSystems::get_system(), and libMesh::EquationSystems::has_system().
void libMesh::EnsightIO::add_vector | ( | const std::string & | system, |
const std::string & | vec_description, | ||
const std::string & | u, | ||
const std::string & | v, | ||
const 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 100 of file ensight_io.C.
References _equation_systems, _system_vars_map, libMesh::EnsightIO::Vectors::description, libMesh::EquationSystems::get_system(), and libMesh::EquationSystems::has_system().
|
inlineinherited |
Return/set the precision to use when writing ASCII files.
By default we use numeric_limits<Real>::digits10 + 2, which should be enough to write out to ASCII and get the exact same Real back when reading in.
Definition at line 244 of file mesh_output.h.
Referenced by libMesh::TecplotIO::write_ascii(), libMesh::GMVIO::write_ascii_new_impl(), and libMesh::GMVIO::write_ascii_old_impl().
|
staticprivate |
Definition at line 44 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.
|
inlineprotectedinherited |
Definition at line 234 of file mesh_output.h.
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 151 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 139 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 159 of file ensight_io.C.
References _time_steps, write_geometry_ascii(), and write_solution_ascii().
Referenced by write().
|
private |
Definition at line 275 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 92 of file mesh_output.C.
References libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::EquationSystems::get_mesh(), 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_parallel_solution_vector(), libMesh::EquationSystems::build_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::EquationSystems::get_mesh(), and libMesh::out.
Referenced by libMesh::Nemesis_IO::write_timestep(), and libMesh::ExodusII_IO::write_timestep().
|
private |
Definition at line 169 of file ensight_io.C.
References _element_map, _ensight_file_name, _time_steps, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::HEX27, libMesh::index_range(), libMesh::MeshOutput< MT >::mesh(), 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::UCDIO, libMesh::NameBasedIO, libMesh::GmshIO, libMesh::GMVIO, libMesh::VTKIO, libMesh::MEDITIO, libMesh::GnuPlotIO, and libMesh::TecplotIO.
Definition at line 105 of file mesh_output.h.
|
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 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 150 of file mesh_output.C.
References libMesh::NumericVector< T >::localize().
|
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 114 of file mesh_output.h.
|
private |
Definition at line 337 of file ensight_io.C.
References _ensight_file_name, _equation_systems, _time_steps, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::System::current_solution(), 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 321 of file ensight_io.C.
References _system_vars_map, write_scalar_ascii(), and write_vector_ascii().
Referenced by write_ascii().
|
private |
Definition at line 408 of file ensight_io.C.
References _ensight_file_name, _equation_systems, _time_steps, libMesh::MeshBase::active_local_element_ptr_range(), libMesh::System::current_solution(), 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 162 of file ensight_io.h.
Referenced by write_geometry_ascii().
|
private |
Definition at line 152 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 159 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 159 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 168 of file mesh_output.h.
|
private |
Definition at line 156 of file ensight_io.h.
Referenced by add_scalar(), add_vector(), write_case(), and write_solution_ascii().
|
private |
Definition at line 153 of file ensight_io.h.
Referenced by write_ascii(), write_case(), write_geometry_ascii(), write_scalar_ascii(), and write_vector_ascii().