OGS
anonymous_namespace{readMeshFromFile.cpp} Namespace Reference

Functions

MeshLib::MeshreadMeshFromFileSerial (const std::string &file_name, bool const compute_element_neighbors)
 

Function Documentation

◆ readMeshFromFileSerial()

MeshLib::Mesh * anonymous_namespace{readMeshFromFile.cpp}::readMeshFromFileSerial ( const std::string & file_name,
bool const compute_element_neighbors )

Definition at line 36 of file readMeshFromFile.cpp.

38{
39 if (BaseLib::hasFileExtension(".msh", file_name))
40 {
42 return meshIO.loadMeshFromFile(file_name);
43 }
44
45 if (BaseLib::hasFileExtension(".vtu", file_name))
46 {
48 file_name, compute_element_neighbors);
49 }
50
51 if (BaseLib::hasFileExtension(".vtk", file_name))
52 {
54 file_name, compute_element_neighbors);
55 }
56
57 ERR("readMeshFromFile(): Unknown mesh file format in file {:s}.",
58 file_name);
59 return nullptr;
60}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
Interface for handling mesh files from OGS-5 and below. (*.msh files)
Definition MeshIO.h:37
MeshLib::Mesh * loadMeshFromFile(const std::string &file_name)
Read mesh from file.
Definition MeshIO.cpp:278
static MeshLib::Mesh * readVTUFile(std::string const &file_name, bool const compute_element_neighbors=false)
static MeshLib::Mesh * readVTKFile(std::string const &file_name, bool const compute_element_neighbors=false)
bool hasFileExtension(std::string const &extension, std::string const &filename)

References ERR(), BaseLib::hasFileExtension(), MeshLib::IO::Legacy::MeshIO::loadMeshFromFile(), MeshLib::IO::VtuInterface::readVTKFile(), and MeshLib::IO::VtuInterface::readVTUFile().