![]() |
OGS
|
Interface for handling mesh files from OGS-5 and below. (*.msh files)
#include <MeshIO.h>
Public Member Functions | |
MeshIO () | |
Constructor. More... | |
~MeshIO () override=default | |
MeshLib::Mesh * | loadMeshFromFile (const std::string &file_name) |
Read mesh from file. More... | |
void | setMesh (const MeshLib::Mesh *mesh) |
Set mesh for writing. More... | |
![]() | |
Writer () | |
virtual | ~Writer ()=default |
std::string | writeToString () |
Writes the object to a string. More... | |
Protected Member Functions | |
bool | write () override |
Write mesh to stream. More... | |
virtual bool | write ()=0 |
Writes the object to the internal stream. This method must be implemented by a subclass. The implementation should return true on success, else false. More... | |
Private Member Functions | |
void | writeElements (std::vector< MeshLib::Element * > const &ele_vec, MeshLib::PropertyVector< int > const *const material_ids, std::ostream &out) const |
MeshLib::Element * | readElement (std::istream &in, const std::vector< MeshLib::Node * > &nodes) const |
Static Private Member Functions | |
static std::size_t | readMaterialID (std::istream &in) |
static std::string | ElemType2StringOutput (const MeshLib::MeshElemType t) |
Private Attributes | |
const MeshLib::Mesh * | _mesh {nullptr} |
Additional Inherited Members | |
![]() | |
std::ostringstream | out |
The stream to write to. More... | |
|
default |
Constructor.
|
overridedefault |
|
staticprivate |
Definition at line 407 of file MeshIO.cpp.
References MeshLib::HEXAHEDRON, MeshLib::LINE, MeshLib::PRISM, MeshLib::PYRAMID, MeshLib::QUAD, MathLib::t, MeshLib::TETRAHEDRON, and MeshLib::TRIANGLE.
Referenced by writeElements().
MeshLib::Mesh * MeshLib::IO::Legacy::MeshIO::loadMeshFromFile | ( | const std::string & | file_name | ) |
Read mesh from file.
Definition at line 42 of file MeshIO.cpp.
References MeshLib::Cell, MeshLib::Properties::createNewPropertyVector(), ERR(), BaseLib::extractBaseNameWithoutExtension(), MeshLib::Mesh::getProperties(), INFO(), readElement(), readMaterialID(), MathLib::s, BaseLib::trim(), and WARN().
Referenced by OGSFileConverter::convertMSH2VTU(), and anonymous_namespace{readMeshFromFile.cpp}::readMeshFromFileSerial().
|
private |
Definition at line 176 of file MeshIO.cpp.
References MeshLib::HEXAHEDRON, MeshLib::INVALID, MeshLib::LINE, MeshLib::PRISM, MeshLib::PYRAMID, MeshLib::QUAD, MeshLib::String2MeshElemType(), MeshLib::TETRAHEDRON, and MeshLib::TRIANGLE.
Referenced by loadMeshFromFile().
|
staticprivate |
Definition at line 165 of file MeshIO.cpp.
Referenced by loadMeshFromFile().
void MeshLib::IO::Legacy::MeshIO::setMesh | ( | const MeshLib::Mesh * | mesh | ) |
Set mesh for writing.
Definition at line 364 of file MeshIO.cpp.
References _mesh.
Referenced by SaveMeshDialog::accept(), OGSFileConverter::convertVTU2MSH(), main(), and MeshLib::IO::writeMeshToFile().
|
overrideprotectedvirtual |
Write mesh to stream.
Implements BaseLib::IO::Writer.
Definition at line 326 of file MeshIO.cpp.
References _mesh, MeshLib::Properties::existsPropertyVector(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getNode(), MeshLib::Mesh::getNumberOfNodes(), MeshLib::Mesh::getProperties(), MeshLib::Properties::getPropertyVector(), BaseLib::IO::Writer::out, WARN(), and writeElements().
|
private |
Definition at line 369 of file MeshIO.cpp.
References ElemType2StringOutput(), OGS_FATAL, and BaseLib::IO::Writer::out.
Referenced by write().
|
private |