Salome HOME
Merge branch 'OCCT780'
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_NETGEN_3D_SA.cxx
index 1ea0ad7048af72e95083c846d23d2255739ef4e1..faaf2f85bcf0b615bc7b949dd3a6463961c07a0e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #include <SMESHDS_Mesh.hxx>
 
 
+#ifdef WIN32
+#include <filesystem>
+namespace fs = std::filesystem;
+#else
 #include <boost/filesystem.hpp>
 namespace fs = boost::filesystem;
+#endif
 
 /*
   Netgen include files
@@ -106,8 +111,6 @@ NETGENPlugin_NETGEN_3D_SA::~NETGENPlugin_NETGEN_3D_SA()
  */
 void NETGENPlugin_NETGEN_3D_SA::fillHyp(netgen_params aParams)
 {
-  if(_gen)
-    std::cout << "_gen is set"  << std::endl;
   if(aParams.has_netgen_param){
     NETGENPlugin_Hypothesis * hypParameters = new NETGENPlugin_Hypothesis(0, GetGen());
 
@@ -160,11 +163,11 @@ bool NETGENPlugin_NETGEN_3D_SA::computeFillNewElementFile(
     int &Netgen_NbOfNodes
 )
 {
+  MESSAGE("Writting new elements")
   Ng_Mesh* Netgen_mesh = ngLib.ngMesh();
 
   int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh);
   int Netgen_NbOfTetra    = Ng_GetNE(Netgen_mesh);
-
   bool isOK = ( Netgen_NbOfTetra > 0 );
   if ( isOK && !new_element_file.empty() )
   {
@@ -220,6 +223,7 @@ bool NETGENPlugin_NETGEN_3D_SA::Compute(
         std::string new_element_file,
         bool output_mesh)
 {
+  MESSAGE("Compute");
   // vector of nodes in which node index == netgen ID
   vector< const SMDS_MeshNode* > nodeVec;
   NETGENPlugin_NetgenLibWrapper ngLib;
@@ -230,6 +234,7 @@ bool NETGENPlugin_NETGEN_3D_SA::Compute(
 
   // Changing netgen log_file putting it next to new_element_file
   fs::path netgen_log_file = fs::path(new_element_file).remove_filename() / fs::path("NETGEN.out");
+  MESSAGE("netgen ouput"<<netgen_log_file.string());
 
   ngLib.setOutputFile(netgen_log_file.string());
 
@@ -272,18 +277,17 @@ int NETGENPlugin_NETGEN_3D_SA::run(const std::string input_mesh_file,
 
   std::unique_ptr<SMESH_Mesh> myMesh(_gen->CreateMesh(false));
 
-  importMesh(input_mesh_file, *myMesh);
+  SMESH_DriverMesh::importMesh(input_mesh_file, *myMesh);
 
   // Importing shape
   TopoDS_Shape myShape;
-  importShape(shape_file, myShape);
+  SMESH_DriverShape::importShape(shape_file, myShape);
 
   // Importing hypothesis
   netgen_params myParams;
 
   importNetgenParams(hypo_file, myParams);
   fillHyp(myParams);
-
   MESSAGE("Meshing with netgen3d");
   int ret = Compute(myShape, *myMesh, myParams,
                       new_element_file,
@@ -297,7 +301,7 @@ int NETGENPlugin_NETGEN_3D_SA::run(const std::string input_mesh_file,
 
   if(!output_mesh_file.empty()){
     std::string meshName = "MESH";
-    exportMesh(output_mesh_file, *myMesh, meshName);
+    SMESH_DriverMesh::exportMesh(output_mesh_file, *myMesh, meshName);
   }
 
   return ret;
@@ -322,7 +326,7 @@ bool NETGENPlugin_NETGEN_3D_SA::getSurfaceElements(
     SMESH_ProxyMesh::Ptr proxyMesh,
     NETGENPlugin_Internals &internals,
     SMESH_MesherHelper &helper,
-    std::map<const SMDS_MeshElement*, tuple<bool, bool>>& listElements
+    std::map<const SMDS_MeshElement*, tuple<bool, bool>, TIDCompare>& listElements
     )
 {
   // To remove compilation warnings
@@ -389,7 +393,7 @@ bool NETGENPlugin_NETGEN_3D_SA::getSurfaceElements(
     // Get orientation
     // Netgen requires that all the triangle point outside
     isRev = elemOrientation[elem->GetID()];
-    listElements[elem] = tuple(isRev, false);
+    listElements[elem] = tuple<bool, bool>(isRev, false);
   }
 
   return false;