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 37 of file readMeshFromFile.cpp.

39{
40 if (BaseLib::hasFileExtension(".msh", file_name))
41 {
43 return meshIO.loadMeshFromFile(file_name);
44 }
45
46 if (BaseLib::hasFileExtension(".vtu", file_name))
47 {
49 file_name, compute_element_neighbors);
50 }
51
52 if (BaseLib::hasFileExtension(".vtk", file_name))
53 {
55 file_name, compute_element_neighbors);
56 }
57
58 ERR("readMeshFromFile(): Unknown mesh file format in file {:s}.",
59 file_name);
60 return nullptr;
61}
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().