This class defines an abstract interface for Mesh output. Specific classes derived from this class actually implement writing various mesh formats.
Author:
Benjamin S. Kirk
Date:
2004
Version:
Revision:
3391
Definition at line 51 of file mesh_output.h.
Constructor & Destructor Documentation
template<class MT > MeshOutput< MT >::MeshOutput (const boolis_parallel_format = false) [inline, protected]Default constructor. Will set the _obj to NULL, effectively rendering this object useless.
template<class MT> MeshOutput< MT >::MeshOutput (const MT &obj, const boolis_parallel_format = false) [inline, protected]Constructor. Takes a reference to a constant object. This constructor will only allow us to write the object.
Definition at line 146 of file mesh_output.h.
References MeshOutput< MT >::_is_parallel_format, MeshOutput< MT >::mesh(), and libMesh::processor_id().
:
_obj (&obj),
_is_parallel_format(is_parallel_format)
{
if (!_is_parallel_format && !this->mesh().is_serial())
{
if (libMesh::processor_id() == 0)
{
std::cerr << 'WARNING: This I/O operation may only be supported for meshes which have been serialized!'
<< std::endl;
libmesh_here();
}
// libmesh_error();
}
}
template<class MT > void MeshOutput< MT >::_build_variable_names_and_solution_vector (const EquationSystems &es, std::vector< Number > &soln, std::vector< std::string > &names) [private]A helper function which allows us to fill temporary name and solution vectors with an EquationSystems object
Definition at line 28 of file mesh_output.C.
References EquationSystems::build_solution_vector(), and EquationSystems::build_variable_names().
{
// We need a serial mesh for MeshOutput for now
const_cast<EquationSystems&>(es).allgather();
es.build_variable_names (names);
es.build_solution_vector (soln);
}
template<class MT > const MT & MeshOutput< MT >::mesh () const [inline, protected]Returns the object as a read-only reference.
Definition at line 193 of file mesh_output.h.
Referenced by MeshOutput< MT >::MeshOutput().
{
libmesh_assert (_obj != NULL);
return *_obj;
}
template<class MT> virtual void MeshOutput< MT >::write (const std::string &) [pure virtual]This method implements writing a mesh to a specified file.
Implemented in DivaIO, EnsightIO, ExodusII_IO, FroIO, GmshIO, GMVIO, GnuPlotIO, LegacyXdrIO, MEDITIO, PostscriptIO, TecplotIO, TetGenIO, UCDIO, UNVIO, VTKIO, and XdrIO.
template<class MT > void MeshOutput< MT >::write_equation_systems (const std::string &fname, const EquationSystems &es) [inline, virtual]This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems object.
Reimplemented in VTKIO.
Definition at line 174 of file mesh_output.h.
Referenced by ErrorVector::plot_error().
{
// Build the nodal solution values & get the variable
// names from the EquationSystems object
std::vector<Number> soln;
std::vector<std::string> names;
this->_build_variable_names_and_solution_vector(es, soln, names);
//es.build_variable_names (names);
//es.build_solution_vector (soln);
this->write_nodal_data (fname, soln, names);
}
template<class MT> virtual void MeshOutput< MT >::write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) [inline, virtual]This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided.
Reimplemented in ExodusII_IO, GmshIO, GMVIO, GnuPlotIO, MEDITIO, and TecplotIO.
Definition at line 91 of file mesh_output.h.
Referenced by UnstructuredMesh::write().
{ libmesh_error(); }
Member Data Documentation
template<class MT> const bool MeshOutput< MT >::_is_parallel_format [private]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 120 of file mesh_output.h.
Referenced by MeshOutput< MT >::MeshOutput().
template<class MT> const MT* const MeshOutput< MT >::_obj [private]A pointer to a constant object. This allows us to write the object to file.
Definition at line 113 of file mesh_output.h.
Author
Generated automatically by Doxygen for libMesh from the source code.