From 960e3674527e5f6da53d3c63d31f77ab7cc96b87 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Wed, 23 Jan 2013 10:34:04 +0100 Subject: [PATCH] Using OGS-6 data structures to read the mesh. --- Utils/FileConverter/GMSH2OGS.cpp | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/Utils/FileConverter/GMSH2OGS.cpp b/Utils/FileConverter/GMSH2OGS.cpp index adb59dd84d4..7b2fa23429a 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; -- GitLab