diff --git a/Utils/FileConverter/GMSH2OGS.cpp b/Utils/FileConverter/GMSH2OGS.cpp index adb59dd84d451ead9ae6941e47a15d8d30b08cc1..7b2fa23429a76a3247738a7e60709af4be25f250 100644 --- a/Utils/FileConverter/GMSH2OGS.cpp +++ b/Utils/FileConverter/GMSH2OGS.cpp @@ -16,14 +16,11 @@ #include <string> // FileIO +#include "Legacy/MeshIO.h" #include "MeshIO/GMSHInterface.h" -#include "MeshIO/OGSMeshIO.h" -// MSH -#include "msh_lib.h" // for FEMRead -#include "msh_mesh.h" - -Problem* aproblem = NULL; +// MeshLib +#include "Mesh.h" int main (int argc, char* argv[]) { @@ -43,18 +40,7 @@ int main (int argc, char* argv[]) } tmp = argv[2]; - std::string file_base_name (tmp); - if (tmp.find (".msh") != std::string::npos) - file_base_name = tmp.substr (0, tmp.size() - 4); - - std::vector<MeshLib::CFEMesh*> mesh_vec; - FEMRead(file_base_name, mesh_vec); - if (mesh_vec.empty()) - { - std::cerr << "could not read mesh from file " << tmp << std::endl; - return -1; - } - MeshLib::CFEMesh* mesh (mesh_vec[mesh_vec.size() - 1]); + MeshLib::Mesh* mesh (FileIO::MeshIO().loadMeshFromFile(tmp)); // *** create new mesh tmp = argv[3]; @@ -64,13 +50,9 @@ int main (int argc, char* argv[]) return -1; } - if (mesh->GetNodesNumber(false) == 0) { - mesh->setNumberOfNodesFromNodesVectorSize(); - } - tmp = argv[4]; std::cout << "writing mesh to file " << tmp << " ... " << std::flush; - FileIO::OGSMeshIO mesh_io; + FileIO::MeshIO mesh_io; mesh_io.setMesh(mesh); mesh_io.writeToFile (tmp); std::cout << "ok" << std::endl;