#include <namebased_io.h>
Public Member Functions | |
NameBasedIO (const MeshBase &) | |
NameBasedIO (MeshBase &) | |
virtual void | read (const std::string &mesh_file) override |
virtual void | write (const std::string &mesh_file) override |
virtual void | write_equation_systems (const std::string &filename, const EquationSystems &es, const std::set< std::string > *system_names=nullptr) override |
virtual void | write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override |
bool | is_parallel_file_format (const std::string &filename) |
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 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 | |
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 |
const bool | _serial_only_needed_on_proc_0 |
This class supports simple reads and writes in any libMesh-supported format, by dispatching to one of the other I/O classes based on filename.
Other I/O classes may have more advanced features that are not accessible via this interface.
Definition at line 44 of file namebased_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 110 of file namebased_io.h.
|
inlineexplicit |
Constructor. Takes a writable reference to a mesh object. This constructor is required to let us read in a mesh.
Definition at line 116 of file namebased_io.h.
|
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().
|
inline |
Definition at line 124 of file namebased_io.h.
References libMesh::Quality::name().
Referenced by read(), and write().
|
inlineprotectedinherited |
Definition at line 169 of file mesh_input.h.
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::Nemesis_IO::prepare_to_write_nodal_data(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::GMVIO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_bcs(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::UCDIO::read_implementation(), libMesh::UNVIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::CheckpointIO::read_nodes(), libMesh::CheckpointIO::read_nodesets(), libMesh::CheckpointIO::read_remote_elem(), libMesh::XdrIO::read_serialized_bcs_helper(), 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::Nemesis_IO::write(), libMesh::ExodusII_IO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::GMVIO::write_ascii_new_impl(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::Nemesis_IO::write_element_data(), libMesh::ExodusII_IO::write_element_data(), libMesh::UCDIO::write_header(), libMesh::UCDIO::write_implementation(), libMesh::UCDIO::write_interior_elems(), 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::UCDIO::write_nodes(), libMesh::CheckpointIO::write_nodesets(), libMesh::XdrIO::write_parallel(), libMesh::GmshIO::write_post(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::UCDIO::write_soln(), and libMesh::CheckpointIO::write_subdomain_names().
|
inlineprotectedinherited |
Definition at line 234 of file mesh_output.h.
Referenced by libMesh::FroIO::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().
|
overridevirtual |
This method implements reading a mesh from a specified file.
Implements libMesh::MeshInput< MeshBase >.
Definition at line 59 of file namebased_io.C.
References libMesh::MeshBase::allow_renumbering(), libMesh::XdrIO::binary(), libMesh::MeshCommunication::broadcast(), is_parallel_file_format(), libMesh::XdrIO::legacy(), libMesh::MeshInput< MT >::mesh(), libMesh::ParallelObject::n_processors(), libMesh::Quality::name(), libMesh::ParallelObject::processor_id(), libMesh::OFFIO::read(), libMesh::AbaqusIO::read(), libMesh::TetGenIO::read(), libMesh::Nemesis_IO::read(), libMesh::GmshIO::read(), libMesh::UNVIO::read(), libMesh::ExodusII_IO::read(), libMesh::UCDIO::read(), libMesh::GMVIO::read(), libMesh::XdrIO::read(), libMesh::MatlabIO::read(), libMesh::CheckpointIO::read(), and libMesh::VTKIO::read().
Referenced by libMesh::UnstructuredMesh::read().
|
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_header().
|
protectedinherited |
Reads input from in
, skipping all the lines that start with the character comment_start
.
Definition at line 179 of file mesh_input.h.
Referenced by libMesh::TetGenIO::read(), and libMesh::UCDIO::read_implementation().
|
overridevirtual |
This method implements writing a mesh to a specified file.
Implements libMesh::MeshOutput< MeshBase >.
Definition at line 276 of file namebased_io.C.
References libMesh::Parallel::Communicator::barrier(), libMesh::Parallel::Communicator::broadcast(), libMesh::ParallelObject::comm(), libMesh::err, is_parallel_file_format(), libMesh::MeshInput< MT >::mesh(), libMesh::MeshBase::n_partitions(), libMesh::Quality::name(), libMesh::GMVIO::partitioning(), libMesh::ParallelObject::processor_id(), libMesh::FroIO::write(), libMesh::TecplotIO::write(), libMesh::MEDITIO::write(), libMesh::TetGenIO::write(), libMesh::GMVIO::write(), libMesh::Nemesis_IO::write(), libMesh::GmshIO::write(), libMesh::ExodusII_IO::write(), libMesh::UNVIO::write(), libMesh::UCDIO::write(), libMesh::XdrIO::write(), and libMesh::VTKIO::write().
Referenced by libMesh::UnstructuredMesh::find_neighbors(), and libMesh::UnstructuredMesh::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().
|
overridevirtual |
This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems
object.
We override the default MeshOutput::write_equation_systems because it only outputs nodal data by default, whereas we want to output a proper restart file if the requested filename is an XDA or XDR type.
Reimplemented from libMesh::MeshOutput< MeshBase >.
Definition at line 487 of file namebased_io.C.
References libMesh::ENCODE, libMesh::WRITE, libMesh::EquationSystems::write(), libMesh::EquationSystems::WRITE_ADDITIONAL_DATA, libMesh::EquationSystems::WRITE_DATA, and libMesh::MeshOutput< MT >::write_equation_systems().
|
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 422 of file namebased_io.C.
References libMesh::err, libMesh::MeshInput< MT >::mesh(), libMesh::MeshBase::n_subdomains(), libMesh::Quality::name(), libMesh::GMVIO::partitioning(), libMesh::TecplotIO::write_nodal_data(), libMesh::MEDITIO::write_nodal_data(), libMesh::VTKIO::write_nodal_data(), libMesh::GMVIO::write_nodal_data(), libMesh::GmshIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::Nemesis_IO::write_nodal_data(), and libMesh::ExodusII_IO::write_nodal_data().
Referenced by libMesh::UnstructuredMesh::write().
|
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.
|
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 libMesh::EnsightIO::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.
|
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::ExodusII_IO::read(), libMesh::GMVIO::read(), libMesh::VTKIO::read(), libMesh::AbaqusIO::read_elements(), libMesh::UCDIO::read_implementation(), libMesh::UNVIO::read_implementation(), and libMesh::XdrIO::read_serialized_connectivity().