]> SALOME platform Git repositories - plugins/netgenplugin.git/blobdiff - src/NETGENPlugin/run_mesher.cxx
Salome HOME
partial work for netgen2d in run_mesher + corrections for netgen3d nodeVec + restorin...
[plugins/netgenplugin.git] / src / NETGENPlugin / run_mesher.cxx
index 5733cd0e53ac1d254bd65e947078b1ef1da5394f..ae9c7a6ed13b25674b72d6d66dc68e58e169ca30 100644 (file)
@@ -36,6 +36,8 @@
 #include <TopoDS_Shape.hxx>
 #include <iostream>
 
+#include <chrono>
+
 /**
  * @brief Test of shape Import/Export
  *
@@ -183,7 +185,7 @@ int main(int argc, char *argv[]){
     std::cout << "           ELEM_ORIENT_FILE NEW_ELEMENT_FILE OUTPUT_MESH_FILE" << std::endl;
     std::cout << std::endl;
     std::cout << "Args:" << std::endl;
-    std::cout << "  MESHER: mesher to use from (NETGEN3D)" << std::endl;
+    std::cout << "  MESHER: mesher to use from (NETGEN3D, NETGEN2D)" << std::endl;
     std::cout << "  INPUT_MESH_FILE: MED File containing lower-dimension-elements already meshed" << std::endl;
     std::cout << "  SHAPE_FILE: STEP file containing the shape to mesh" << std::endl;
     std::cout << "  HYPO_FILE: Ascii file containint the list of parameters" << std::endl;
@@ -209,6 +211,7 @@ int main(int argc, char *argv[]){
     test_netgen_params();
     test_netgen3d();
   } else if (mesher=="NETGEN3D"){
+    auto begin = std::chrono::high_resolution_clock::now();
     netgen3d(input_mesh_file,
              shape_file,
              hypo_file,
@@ -216,6 +219,17 @@ int main(int argc, char *argv[]){
              new_element_file,
              output_mesh,
              output_mesh_file);
+    auto end = std::chrono::high_resolution_clock::now();
+    auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
+    std::cout << "Time elapsed: " << elapsed.count()*1e-9 << std::endl;
+  } else if (mesher=="NETGEN2D"){
+    netgen2d(input_mesh_file,
+             shape_file,
+             hypo_file,
+             element_orientation_file,
+             new_element_file,
+             output_mesh,
+             output_mesh_file);
   } else {
     std::cerr << "Unknown mesher:" << mesher << std::endl;
   }