#include <legacy_xdr_io.h>

Public Types | |
| enum | FileFormat { DEAL =0, MGF =1, LIBM =2 } |
Public Member Functions | |
| LegacyXdrIO (MeshBase &, const bool=false) | |
| LegacyXdrIO (const MeshBase &, const bool=false) | |
| virtual | ~LegacyXdrIO () |
| virtual void | read (const std::string &) libmesh_override |
| void | read_mgf (const std::string &) |
| virtual void | write (const std::string &) libmesh_override |
| void | write_mgf (const std::string &) |
| void | read_mgf_soln (const std::string &name, std::vector< Number > &soln, std::vector< std::string > &var_names) const |
| void | write_mgf_soln (const std::string &name, std::vector< Number > &soln, std::vector< std::string > &var_names) const |
| bool & | binary () |
| bool | binary () const |
| virtual void | write_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=libmesh_nullptr) |
| virtual void | write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) |
| unsigned int & | ascii_precision () |
Protected Member Functions | |
| MeshBase & | mesh () |
| void | set_n_partitions (unsigned int n_parts) |
| void | skip_comment_lines (std::istream &in, const char comment_start) |
| const MeshBase & | mesh () const |
Protected Attributes | |
| std::vector< bool > | elems_of_dimension |
| const bool | _is_parallel_format |
Private Member Functions | |
| void | read_ascii (const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM) |
| void | read_binary (const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM) |
| void | write_ascii (const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM) |
| void | write_binary (const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM) |
| void | read_mesh (const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM, MeshData *=libmesh_nullptr) |
| void | write_mesh (const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM) |
| void | read_soln (const std::string &, std::vector< Real > &, std::vector< std::string > &) const |
| void | write_soln (const std::string &name, std::vector< Real > &soln, std::vector< std::string > &) const |
Private Attributes | |
| bool | _binary |
The LegacyXdrIO class has been replaced by the XdrIO class.
Definition at line 45 of file legacy_xdr_io.h.
Enumeration flag for the type of software. DEAL is old-style LibMesh files without adaptivity MGF is for files created by the MGF software package LIBM is for new files generated by LibMesh with adaptivity. You will likely use this one most often.
| Enumerator | |
|---|---|
| DEAL | |
| MGF | |
| LIBM | |
Definition at line 56 of file legacy_xdr_io.h.
|
explicit |
Constructor. Takes a writeable reference to a mesh object. This is the constructor required to read a mesh. The optional parameter binary can be used to switch between ASCII (false, the default) or binary (true) files.
Definition at line 57 of file legacy_xdr_io.C.
|
explicit |
Constructor. Takes a reference to a constant mesh object. This constructor will only allow us to write the mesh. The optional parameter binary can be used to switch between ASCII (false, the default) or binary (true) files.
Definition at line 67 of file legacy_xdr_io.C.
|
virtual |
|
inherited |
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.
Referenced by libMesh::TecplotIO::write_ascii(), libMesh::GMVIO::write_ascii_new_impl(), and libMesh::GMVIO::write_ascii_old_impl().
| bool & libMesh::LegacyXdrIO::binary | ( | ) |
Set the flag indicating if we should read/write binary.
Definition at line 83 of file legacy_xdr_io.C.
References _binary.
Referenced by read(), read_mesh(), read_mgf(), read_soln(), write(), write_mesh(), write_mgf(), and write_soln().
| bool libMesh::LegacyXdrIO::binary | ( | ) | const |
Read the flag indicating if we should read/write binary.
Definition at line 91 of file legacy_xdr_io.C.
References _binary.
|
protectedinherited |
Returns the object as a writeable reference.
Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::VTKIO::cells_to_vtk(), libMesh::TetGenIO::element_in(), libMesh::UNVIO::elements_in(), libMesh::UNVIO::elements_out(), libMesh::UNVIO::groups_in(), libMesh::TetGenIO::node_in(), libMesh::UNVIO::nodes_in(), libMesh::UNVIO::nodes_out(), libMesh::VTKIO::nodes_to_vtk(), libMesh::GMVIO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), read_ascii(), libMesh::CheckpointIO::read_bcs(), libMesh::CheckpointIO::read_connectivity(), libMesh::UCDIO::read_implementation(), libMesh::UNVIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::CheckpointIO::read_nodes(), libMesh::CheckpointIO::read_nodesets(), libMesh::XdrIO::read_serialized_bcs(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::OFFIO::read_stream(), libMesh::MatlabIO::read_stream(), libMesh::CheckpointIO::read_subdomain_names(), libMesh::TetGenIO::write(), libMesh::ExodusII_IO::write(), libMesh::CheckpointIO::write(), libMesh::XdrIO::write(), libMesh::GMVIO::write_ascii_new_impl(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::CheckpointIO::write_bcs(), libMesh::GMVIO::write_binary(), libMesh::CheckpointIO::write_connectivity(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::UCDIO::write_implementation(), libMesh::GmshIO::write_mesh(), libMesh::VTKIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_common(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::CheckpointIO::write_nodes(), libMesh::CheckpointIO::write_nodesets(), libMesh::XdrIO::write_parallel(), libMesh::GmshIO::write_post(), libMesh::XdrIO::write_serialized_bcs(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), and libMesh::CheckpointIO::write_subdomain_names().
|
protectedinherited |
Returns the object as a read-only reference.
Referenced by libMesh::FroIO::write(), libMesh::DivaIO::write(), libMesh::TecplotIO::write(), libMesh::MEDITIO::write(), libMesh::PostscriptIO::write(), libMesh::EnsightIO::write(), libMesh::TecplotIO::write_ascii(), libMesh::TecplotIO::write_binary(), libMesh::TecplotIO::write_nodal_data(), libMesh::MEDITIO::write_nodal_data(), and libMesh::GnuPlotIO::write_solution().
|
virtual |
This method implements reading a mesh from a specified file.
Implements libMesh::MeshInput< MeshBase >.
Definition at line 98 of file legacy_xdr_io.C.
References binary(), libMesh::processor_id(), read_ascii(), and read_binary().
Referenced by libMesh::XdrIO::read().
|
private |
Read meshes in libMesh XDR format. Should be compatible with the mgf mesh file formats. This method actually expects an ASCII-file.
Definition at line 206 of file legacy_xdr_io.C.
References libMesh::MeshBase::clear(), libMesh::MeshInput< MT >::mesh(), libMesh::MeshInput< MeshBase >::mesh(), and read_mesh().
Referenced by read(), read_binary(), and read_mgf().
|
private |
Read meshes in libMesh XDR format. Should be compatible with the mgf mesh file formats. This method expects an XDR-encoded binary file.
Definition at line 222 of file legacy_xdr_io.C.
References libMesh::err, and read_ascii().
Referenced by read(), and read_mgf().
|
private |
Implements reading either a binary XDR or ASCII XDA mesh.
Definition at line 272 of file legacy_xdr_io.C.
References libMesh::MeshData::active(), libMesh::Elem::add_child(), libMesh::MeshBase::add_elem(), libMesh::MeshData::add_foreign_elem_id(), libMesh::MeshData::add_foreign_node_id(), libMesh::MeshBase::add_point(), libMesh::BoundaryInfo::add_side(), libMesh::XdrMESH::BC(), binary(), libMesh::Elem::build(), libMesh::MeshBase::clear(), libMesh::MeshData::close_foreign_id_maps(), libMesh::XdrMESH::coord(), DEAL, libMesh::XdrMGF::DECODE, libMesh::Elem::dim(), libMesh::MeshInput< MeshBase >::elems_of_dimension, libMesh::XdrMHEAD::get_block_elt_types(), libMesh::MeshBase::get_boundary_info(), libMesh::XdrMHEAD::get_n_blocks(), libMesh::XdrMHEAD::get_num_elem_each_block(), libMesh::XdrMGF::get_num_levels(), libMesh::XdrMGF::get_orig_flag(), libMesh::XdrHEAD::getNumBCs(), libMesh::XdrMHEAD::getNumEl(), libMesh::XdrHEAD::getNumNodes(), libMesh::XdrMHEAD::getSumWghts(), libMesh::XdrMESH::header(), libMesh::XdrMESH::Icon(), libMesh::MeshTools::Generation::Private::idx(), libMesh::Elem::INACTIVE, libMesh::XdrMESH::init(), libMesh::Elem::JUST_REFINED, LIBM, libmesh_nullptr, libMesh::MeshInput< MT >::mesh(), libMesh::MeshBase::mesh_dimension(), MGF, libMesh::MeshTools::n_levels(), libMesh::Elem::n_nodes(), libMesh::MeshBase::node_ptr(), libMesh::processor_id(), libMesh::XdrMGF::R_ASCII, libMesh::MeshBase::reserve_elem(), libMesh::MeshBase::reserve_nodes(), libMesh::DofObject::set_id(), libMesh::MeshBase::set_mesh_dimension(), libMesh::Elem::set_node(), libMesh::XdrMGF::set_orig_flag(), libMesh::Elem::set_refinement_flag(), libMesh::START_LOG(), libMesh::STOP_LOG(), and libMesh::Elem::type().
Referenced by read_ascii().
| void libMesh::LegacyXdrIO::read_mgf | ( | const std::string & | name | ) |
This method implements reading a mesh in the MGF format from a specified file.
Definition at line 114 of file legacy_xdr_io.C.
References binary(), MGF, read_ascii(), and read_binary().
Referenced by libMesh::NameBasedIO::read().
| void libMesh::LegacyXdrIO::read_mgf_soln | ( | const std::string & | name, |
| std::vector< Number > & | soln, | ||
| std::vector< std::string > & | var_names | ||
| ) | const |
Read solutions in mgflo's XDR format. Should be compatible with the MGF solution file format. This method expects an ASCII file. What is MGF? It was a microgravity fluid physics code developed under a NASA ESS Grand Challenge Grant. This method exists solely for backwards compatiblity with MGF and could be deprecated at any time.
Definition at line 144 of file legacy_xdr_io.C.
References libMesh::Utility::complex_filename(), libMesh::Utility::prepare_complex_data(), and read_soln().
|
private |
Implements reading either a binary or ASCII MGF solution.
Definition at line 965 of file legacy_xdr_io.C.
References binary(), libMesh::XdrMGF::DECODE, libMesh::XdrHEAD::getNumNodes(), libMesh::XdrSHEAD::getVarTitle(), libMesh::XdrSHEAD::getWrtVar(), libMesh::XdrSOLN::header(), libMesh::XdrSOLN::init(), libMesh::XdrMGF::R_ASCII, and libMesh::XdrSOLN::values().
Referenced by read_mgf_soln().
|
inlineprotectedinherited |
Sets the number of partitions in the mesh. Typically this gets done by the partitioner, but some parallel file formats begin "pre-partitioned".
Definition at line 91 of file mesh_input.h.
References libMesh::MeshInput< MT >::mesh().
Referenced by libMesh::Nemesis_IO::read(), and libMesh::XdrIO::read().
|
protectedinherited |
Reads input from in, skipping all the lines that start with the character comment_start.
Referenced by libMesh::TetGenIO::read(), and libMesh::UCDIO::read_implementation().
|
virtual |
This method implements writing a mesh to a specified file.
Implements libMesh::MeshOutput< MeshBase >.
Definition at line 124 of file legacy_xdr_io.C.
References binary(), write_ascii(), and write_binary().
Referenced by libMesh::XdrIO::write().
|
private |
Write meshes in libMesh XDR format. Note: MGF won't be able to read these meshes in general since they will be hybrid meshes. The types are: 0: "DEAL" old type libmesh meshes without refinement 1: "MGF " even older style meshes from MGF 2: "LIBM" new type meshes which contain refinement trees.
Definition at line 248 of file legacy_xdr_io.C.
References write_mesh().
Referenced by write(), write_binary(), and write_mgf().
|
private |
Write meshes in libMesh XDR format. Note: MGF won't be able to read these meshes in general since they will be hybrid meshes.
Definition at line 256 of file legacy_xdr_io.C.
References libMesh::err, and write_ascii().
Referenced by write(), and write_mgf().
|
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.
Referenced by libMesh::Nemesis_IO::write_timestep(), and libMesh::ExodusII_IO::write_timestep().
|
private |
Implements writing either a binary XDR or ASCII XDA mesh.
Definition at line 662 of file legacy_xdr_io.C.
References libMesh::XdrMESH::BC(), binary(), libMesh::BoundaryInfo::build_side_list(), libMesh::ParallelObject::comm(), libMesh::XdrMESH::coord(), DEAL, libMesh::MeshBase::elem(), libMesh::MeshTools::elem_types(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), libMesh::XdrMGF::ENCODE, end, libMesh::MeshBase::get_boundary_info(), libMesh::XdrMGF::get_orig_flag(), libMesh::XdrMESH::header(), libMesh::XdrMESH::Icon(), libMesh::DofObject::id(), libMesh::MeshTools::Generation::Private::idx(), libMesh::XdrMESH::init(), libMesh::MeshBase::is_serial(), libMesh::Elem::level(), LIBM, libMesh::libmesh_assert(), libMesh::libmesh_parallel_only(), libMesh::MeshOutput< MT >::mesh(), MGF, libMesh::BoundaryInfo::n_boundary_conds(), libMesh::MeshBase::n_elem(), libMesh::MeshTools::n_levels(), libMesh::Elem::n_nodes(), libMesh::MeshTools::n_non_subactive_elem_of_type_at_level(), libMesh::Elem::node(), libMesh::MeshBase::node(), libMesh::Elem::parent(), libMesh::XdrMHEAD::set_block_elt_types(), libMesh::XdrMHEAD::set_n_blocks(), libMesh::XdrMHEAD::set_num_elem_each_block(), libMesh::XdrMGF::set_num_levels(), libMesh::XdrMGF::set_orig_flag(), libMesh::XdrHEAD::setId(), libMesh::XdrHEAD::setNumBCs(), libMesh::XdrMHEAD::setNumEl(), libMesh::XdrHEAD::setNumNodes(), libMesh::XdrHEAD::setStrSize(), libMesh::XdrMHEAD::setSumWghts(), libMesh::XdrHEAD::setTitle(), libMesh::START_LOG(), libMesh::STOP_LOG(), libMesh::Elem::subactive(), libMesh::MeshTools::total_weight(), libMesh::Elem::type(), and libMesh::XdrMGF::W_ASCII.
Referenced by write_ascii().
| void libMesh::LegacyXdrIO::write_mgf | ( | const std::string & | name | ) |
This method implements writing a mesh in the MGF format from a specified file.
Definition at line 134 of file legacy_xdr_io.C.
References binary(), MGF, write_ascii(), and write_binary().
Referenced by libMesh::NameBasedIO::write().
| void libMesh::LegacyXdrIO::write_mgf_soln | ( | const std::string & | name, |
| std::vector< Number > & | soln, | ||
| std::vector< std::string > & | var_names | ||
| ) | const |
Write solutions in mgflo's XDR format. Should be compatible with the MGF solution file format. What is MGF? It was a microgravity fluid physics code developed under a NASA ESS Grand Challenge Grant. This method exists solely for backwards compatiblity with MGF and could be deprecated at any time.
Definition at line 175 of file legacy_xdr_io.C.
References libMesh::Utility::complex_filename(), libMesh::Utility::prepare_complex_data(), and write_soln().
|
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::GMVIO, libMesh::Nemesis_IO, libMesh::NameBasedIO, libMesh::GmshIO, libMesh::UCDIO, libMesh::VTKIO, libMesh::MEDITIO, libMesh::GnuPlotIO, and libMesh::TecplotIO.
Definition at line 95 of file mesh_output.h.
|
private |
Implements writing either a binary or ASCII MGF solution.
Definition at line 1026 of file legacy_xdr_io.C.
References binary(), libMesh::XdrMGF::ENCODE, libMesh::MeshBase::get_boundary_info(), libMesh::XdrSOLN::header(), libMesh::XdrSOLN::init(), libMesh::MeshOutput< MT >::mesh(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::MeshBase::n_nodes(), libMesh::XdrHEAD::setId(), libMesh::XdrSHEAD::setKstep(), libMesh::XdrSHEAD::setMeshCnt(), libMesh::XdrHEAD::setNumBCs(), libMesh::XdrHEAD::setNumNodes(), libMesh::XdrSHEAD::setNumVar(), libMesh::XdrHEAD::setStrSize(), libMesh::XdrSHEAD::setTime(), libMesh::XdrHEAD::setTitle(), libMesh::XdrSHEAD::setUserTitle(), libMesh::XdrSHEAD::setVarTitle(), libMesh::XdrSHEAD::setWrtVar(), libMesh::XdrSOLN::values(), and libMesh::XdrMGF::W_ASCII.
Referenced by write_mgf_soln().
|
private |
should we read/write binary?
Definition at line 220 of file legacy_xdr_io.h.
Referenced by binary().
|
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 123 of file mesh_output.h.
Referenced by libMesh::FroIO::write(), libMesh::DivaIO::write(), libMesh::PostscriptIO::write(), and libMesh::EnsightIO::write().
|
protectedinherited |
A vector of bools describing what dimension elements have been encountered when reading a mesh.
Definition at line 97 of file mesh_input.h.
Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::UNVIO::elements_in(), libMesh::UNVIO::max_elem_dimension_seen(), libMesh::AbaqusIO::max_elem_dimension_seen(), libMesh::AbaqusIO::read(), libMesh::Nemesis_IO::read(), libMesh::GMVIO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::AbaqusIO::read_elements(), libMesh::UCDIO::read_implementation(), libMesh::UNVIO::read_implementation(), read_mesh(), and libMesh::XdrIO::read_serialized_connectivity().