Skip to content
Snippets Groups Projects
Commit ce050ad8 authored by wenqing's avatar wenqing
Browse files

[IO] Check more mesh file extensions

parent f00ff776
No related branches found
No related tags found
No related merge requests found
......@@ -44,8 +44,12 @@ MeshLib::Mesh* readMeshFromFile(const std::string &file_name)
{
#ifdef USE_PETSC
NodePartitionedMeshReader read_pmesh(PETSC_COMM_WORLD);
std::size_t pos = file_name.find_last_of(".");
std::string file_name_ext = file_name.substr(pos, file_name.size()-1);
std::string const file_name_base =
boost::erase_last_copy(file_name, ".vtk");
boost::erase_last_copy(file_name, file_name_ext);
return read_pmesh.read(file_name_base);
#else
if (BaseLib::hasFileExtension("msh", 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