libMesh
|
This class implements writing meshes in the mesh format used by the MEdit visualization tool developed in the Gamma Project at INRIA Roquencourt. More...
#include <medit_io.h>
Public Member Functions | |
MEDITIO (const MeshBase &) | |
Constructor. More... | |
MEDITIO (const MeshBase &, unsigned int c) | |
Constructor. More... | |
virtual void | write (const std::string &) override |
This method implements writing a mesh to a specified ".mesh" file. More... | |
virtual void | write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided. More... | |
bool & | binary () |
Flag indicating whether or not to write a binary file. 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 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 |
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 (const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr) |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are optionally provided. More... | |
Private Attributes | |
bool | _binary |
Flag to write binary data. More... | |
unsigned int | scalar_idx |
const MeshBase *const | _obj |
A pointer to a constant object. More... | |
unsigned int | _ascii_precision |
Precision to use when writing ASCII files. More... | |
This class implements writing meshes in the mesh format used by the MEdit visualization tool developed in the Gamma Project at INRIA Roquencourt.
For a full description of the mesh format and to obtain the MEdit software see the MEdit home page.
Definition at line 47 of file medit_io.h.
|
inlineexplicit |
Constructor.
Takes a reference to a constant mesh object. This constructor will only allow us to write the mesh.
Definition at line 113 of file medit_io.h.
Constructor.
Takes a reference to a constant mesh object. and the desired scalar index for mesh colouring. MEdit seems to understand only one scalar value.
Definition at line 121 of file medit_io.h.
|
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 257 of file mesh_output.h.
|
inline |
Flag indicating whether or not to write a binary file.
Definition at line 130 of file medit_io.h.
References _binary.
Referenced by write(), and write_nodal_data().
|
inlineprotectedinherited |
Definition at line 247 of file mesh_output.h.
|
overridevirtual |
This method implements writing a mesh to a specified ".mesh" file.
Implements libMesh::MeshOutput< MeshBase >.
Definition at line 37 of file medit_io.C.
References binary(), libMesh::MeshOutput< MeshBase >::mesh(), and write_ascii().
Referenced by libMesh::NameBasedIO::write().
|
private |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are optionally provided.
This will write an ASCII file.
Definition at line 59 of file medit_io.C.
References libMesh::MeshBase::active_element_ptr_range(), libMesh::MeshOutput< MeshBase >::ascii_precision(), libMesh::MeshTools::Generation::Private::idx(), libMesh::MeshOutput< MT >::mesh(), libMesh::MeshBase::n_nodes(), n_vars, libMesh::MeshBase::point(), libMesh::QUAD4, libMesh::QUAD9, scalar_idx, libMesh::TET4, and libMesh::TRI3.
Referenced by write(), and write_nodal_data().
|
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 87 of file mesh_output.C.
|
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.
|
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 158 of file mesh_output.C.
|
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 145 of file mesh_output.C.
|
overridevirtual |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided.
Reimplemented from libMesh::MeshOutput< MeshBase >.
Definition at line 46 of file medit_io.C.
References binary(), libMesh::MeshOutput< MeshBase >::mesh(), and write_ascii().
Referenced by libMesh::NameBasedIO::write_nodal_data().
|
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.
|
privateinherited |
Precision to use when writing ASCII files.
Definition at line 195 of file mesh_output.h.
|
private |
|
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 172 of file mesh_output.h.
|
privateinherited |
A pointer to a constant object.
This allows us to write the object to file.
Definition at line 190 of file mesh_output.h.
|
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 181 of file mesh_output.h.
|
private |
Definition at line 105 of file medit_io.h.
Referenced by write_ascii().