Salome HOME
Revert "Corrections for parallel smesh"
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_DriverParam.cxx
index dffeca891fa5ba0794c9421b624b02a971bcb7d4..c61b04c658a0e2b684404d8fe44475d720c08fdf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 #include "NETGENPlugin_DriverParam.hxx"
 
-#include "NETGENPlugin_Hypothesis.hxx"
-
-#include <SMESH_Gen.hxx>
-#include <StdMeshers_MaxElementVolume.hxx>
 
 #include <iostream>
 #include <fstream>
@@ -63,6 +59,7 @@ void printNetgenParams(netgen_params& aParams){
   std::cout << "checkoverlap: " << aParams.checkoverlap << std::endl;
   std::cout << "checkchartboundary: " << aParams.checkchartboundary << std::endl;
   std::cout << "closeedgefac: " << aParams.closeedgefac << std::endl;
+  std::cout << "nbThreadMesher: " << aParams.nbThreads << std::endl;
   std::cout << "has_local_size: " << aParams.has_local_size << std::endl;
   std::cout << "meshsizefilename: " << aParams.meshsizefilename << std::endl;
   std::cout << "has_maxelementvolume_hyp: " << aParams.has_maxelementvolume_hyp << std::endl;
@@ -76,7 +73,7 @@ void printNetgenParams(netgen_params& aParams){
  * @param param_file Name of the file
  * @param aParams Structure to fill
  */
-void importNetgenParams(const std::string param_file, netgen_params& aParams, SMESH_Gen *gen){
+void importNetgenParams(const std::string param_file, netgen_params& aParams){
   std::ifstream myfile(param_file);
   std::string line;
 
@@ -123,6 +120,8 @@ void importNetgenParams(const std::string param_file, netgen_params& aParams, SM
   std::getline(myfile, line);
   aParams.closeedgefac = std::stoi(line);
   std::getline(myfile, line);
+  aParams.nbThreads = std::stoi(line);
+  std::getline(myfile, line);
   aParams.has_local_size = std::stoi(line);
   std::getline(myfile, line);
   aParams.meshsizefilename = line;
@@ -133,36 +132,6 @@ void importNetgenParams(const std::string param_file, netgen_params& aParams, SM
   std::getline(myfile, line);
   aParams.maxElementVolume = std::stoi(line);
 
-  if(aParams.has_netgen_param){
-    aParams._hypParameters = new NETGENPlugin_Hypothesis(0, gen);
-
-    aParams._hypParameters->SetMaxSize(aParams.maxh);
-    aParams._hypParameters->SetMinSize(aParams.minh);
-    aParams._hypParameters->SetNbSegPerEdge(aParams.segmentsperedge);
-    aParams._hypParameters->SetGrowthRate(aParams.grading);
-    aParams._hypParameters->SetNbSegPerRadius(aParams.curvaturesafety);
-    aParams._hypParameters->SetSecondOrder(aParams.secondorder);
-    aParams._hypParameters->SetQuadAllowed(aParams.quad);
-    aParams._hypParameters->SetOptimize(aParams.optimize);
-    aParams._hypParameters->SetFineness((NETGENPlugin_Hypothesis::Fineness)aParams.fineness);
-    aParams._hypParameters->SetSurfaceCurvature(aParams.uselocalh);
-    aParams._hypParameters->SetFuseEdges(aParams.merge_solids);
-    aParams._hypParameters->SetChordalErrorEnabled(aParams.chordalError);
-    if(aParams.optimize){
-      aParams._hypParameters->SetNbSurfOptSteps(aParams.optsteps2d);
-      aParams._hypParameters->SetNbVolOptSteps(aParams.optsteps3d);
-    }
-    aParams._hypParameters->SetElemSizeWeight(aParams.elsizeweight);
-    aParams._hypParameters->SetWorstElemMeasure(aParams.opterrpow);
-    aParams._hypParameters->SetUseDelauney(aParams.delaunay);
-    aParams._hypParameters->SetCheckOverlapping(aParams.checkoverlap);
-    aParams._hypParameters->SetCheckChartBoundary(aParams.checkchartboundary);
-    aParams._hypParameters->SetMeshSizeFile(aParams.meshsizefilename);
-  }
-  if(aParams.has_maxelementvolume_hyp){
-    aParams._hypMaxElementVolume = new StdMeshers_MaxElementVolume(1, gen);
-  }
-  // TODO: Handle viscous layer
 };
 
 /**
@@ -194,6 +163,7 @@ void exportNetgenParams(const std::string param_file, netgen_params& aParams){
   myfile << aParams.checkoverlap << std::endl;
   myfile << aParams.checkchartboundary << std::endl;
   myfile << aParams.closeedgefac << std::endl;
+  myfile << aParams.nbThreads << std::endl;
   myfile << aParams.has_local_size << std::endl;
   myfile << aParams.meshsizefilename << std::endl;
   myfile << aParams.has_maxelementvolume_hyp << std::endl;