Skip to content
Snippets Groups Projects
Commit 649fbb46 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL/IO] Make readMeshFromFileSerial private.

Move implementation to cpp in anonymous namespace.
parent eb3c7b82
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,32 @@ ...@@ -35,6 +35,32 @@
#include "MeshLib/NodePartitionedMesh.h" #include "MeshLib/NodePartitionedMesh.h"
#endif #endif
namespace
{
MeshLib::Mesh* readMeshFromFileSerial(const std::string& file_name)
{
if (BaseLib::hasFileExtension(".msh", file_name))
{
MeshLib::IO::Legacy::MeshIO meshIO;
return meshIO.loadMeshFromFile(file_name);
}
if (BaseLib::hasFileExtension(".vtu", file_name))
{
return MeshLib::IO::VtuInterface::readVTUFile(file_name);
}
if (BaseLib::hasFileExtension(".vtk", file_name))
{
return MeshLib::IO::VtuInterface::readVTKFile(file_name);
}
ERR("readMeshFromFile(): Unknown mesh file format in file {:s}.",
file_name);
return nullptr;
}
} // namespace
namespace MeshLib namespace MeshLib
{ {
namespace IO namespace IO
...@@ -65,28 +91,5 @@ MeshLib::Mesh* readMeshFromFile(const std::string& file_name) ...@@ -65,28 +91,5 @@ MeshLib::Mesh* readMeshFromFile(const std::string& file_name)
#endif #endif
} }
MeshLib::Mesh* readMeshFromFileSerial(const std::string& file_name)
{
if (BaseLib::hasFileExtension(".msh", file_name))
{
MeshLib::IO::Legacy::MeshIO meshIO;
return meshIO.loadMeshFromFile(file_name);
}
if (BaseLib::hasFileExtension(".vtu", file_name))
{
return MeshLib::IO::VtuInterface::readVTUFile(file_name);
}
if (BaseLib::hasFileExtension(".vtk", file_name))
{
return MeshLib::IO::VtuInterface::readVTKFile(file_name);
}
ERR("readMeshFromFile(): Unknown mesh file format in file {:s}.",
file_name);
return nullptr;
}
} // end namespace IO } // end namespace IO
} // end namespace MeshLib } // end namespace MeshLib
...@@ -26,7 +26,6 @@ class Mesh; ...@@ -26,7 +26,6 @@ class Mesh;
namespace IO namespace IO
{ {
MeshLib::Mesh* readMeshFromFileSerial(const std::string &file_name);
MeshLib::Mesh* readMeshFromFile(const std::string &file_name); MeshLib::Mesh* readMeshFromFile(const std::string &file_name);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment