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

29{
30 if (BaseLib::hasFileExtension(".msh", file_name))
31 {
33 return meshIO.loadMeshFromFile(file_name);
34 }
35
36 if (BaseLib::hasFileExtension(".vtu", file_name))
37 {
39 file_name, compute_element_neighbors);
40 }
41
42 if (BaseLib::hasFileExtension(".vtk", file_name))
43 {
45 file_name, compute_element_neighbors);
46 }
47
48 ERR("readMeshFromFile(): Unknown mesh file format in file {:s}.",
49 file_name);
50 return nullptr;
51}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
Interface for handling mesh files from OGS-5 and below. (*.msh files)
Definition MeshIO.h:26
MeshLib::Mesh * loadMeshFromFile(const std::string &file_name)
Read mesh from file.
Definition MeshIO.cpp:267
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().