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... | |
Public Member Functions inherited from BaseLib::IO::Writer | |
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... | |
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 | |
Protected Attributes inherited from BaseLib::IO::Writer | |
std::ostringstream | out |
The stream to write to. More... | |
|
default |
Constructor.
|
overridedefault |
|
staticprivate |
Definition at line 397 of file MeshIO.cpp.
References MeshLib::HEXAHEDRON, MeshLib::LINE, MeshLib::PRISM, MeshLib::PYRAMID, MeshLib::QUAD, 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 41 of file MeshIO.cpp.
References MeshLib::Cell, MeshLib::Properties::createNewPropertyVector(), ERR(), BaseLib::extractBaseNameWithoutExtension(), MeshLib::Mesh::getProperties(), INFO(), readElement(), readMaterialID(), BaseLib::trim(), and WARN().
Referenced by OGSFileConverter::convertMSH2VTU(), and anonymous_namespace{readMeshFromFile.cpp}::readMeshFromFileSerial().
|
private |
Definition at line 175 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 |
void MeshLib::IO::Legacy::MeshIO::setMesh | ( | const MeshLib::Mesh * | mesh | ) |
Set mesh for writing.
Definition at line 363 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 325 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 368 of file MeshIO.cpp.
References ElemType2StringOutput(), and BaseLib::IO::Writer::out.
Referenced by write().
|
private |