]> SALOME platform Git repositories - plugins/netgenplugin.git/blobdiff - src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx
Salome HOME
updated copyright message
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_NETGEN_3D.cxx
index dd209162f745eef046fd04f3c2b42874ea017977..46897d90b84f924d93a0854a58238f0a0f0c86b4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  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
@@ -198,18 +198,27 @@ bool NETGENPlugin_NETGEN_3D::CheckHypothesis (SMESH_Mesh&         aMesh,
  */
 //=============================================================================
 
+
 /**
- * @brief Get an iterator on the Surface element with their orientation
+ * @brief Compute the list of already meshed Surface elements and info
+ *        on their orientation and if they are internal
  *
+ * @param aMesh Global Mesh
+ * @param aShape Shape associated to the mesh
+ * @param proxyMesh pointer to mesh used fo find the elements
+ * @param internals information on internal sub shapes
+ * @param helper helper associated to the mesh
+ * @param listElements map of surface element associated with
+ *                     their orientation and internal status
+ * @return true if their was some error
  */
-
 bool NETGENPlugin_NETGEN_3D::getSurfaceElements(
     SMESH_Mesh&         aMesh,
     const TopoDS_Shape& aShape,
     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
 )
 {
   SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
@@ -257,6 +266,18 @@ bool NETGENPlugin_NETGEN_3D::getSurfaceElements(
   return false;
 }
 
+/**
+ * @brief Part of Compute: adding already meshed elements
+ *        into netgen structure
+ *
+ * @param aMesh Global mesh
+ * @param aShape Shape associated with the mesh
+ * @param nodeVec Mapping between nodes mesh id and netgen structure id
+ * @param ngLib Wrapper on netgen lib
+ * @param helper helper assocaited to the mesh
+ * @param Netgen_NbOfNodes Number of nodes in netge structure
+ * @return true if there was some error
+ */
 
 bool NETGENPlugin_NETGEN_3D::computeFillNgMesh(
   SMESH_Mesh&         aMesh,
@@ -288,6 +309,8 @@ bool NETGENPlugin_NETGEN_3D::computeFillNgMesh(
     SMESH::Controls::TSequenceOfXYZ nodesCoords;
 
     // maps nodes to ng ID
+    // map must be sorted by ID to ensure that we will have the same number of
+    // 3D element if we recompute
     typedef map< const SMDS_MeshNode*, int, TIDCompare > TNodeToIDMap;
     typedef TNodeToIDMap::value_type                     TN2ID;
     TNodeToIDMap nodeToNetgenID;
@@ -317,7 +340,9 @@ bool NETGENPlugin_NETGEN_3D::computeFillNgMesh(
       proxyMesh.reset( Adaptor );
     }
 
-    std::map<const SMDS_MeshElement*, tuple<bool, bool>> listElements;
+    // map must be sorted by ID to ensure that we will have the same number of
+    // 3D element if we recompute
+    std::map<const SMDS_MeshElement*, tuple<bool, bool>, TIDCompare> listElements;
     bool ret = getSurfaceElements(aMesh, aShape, proxyMesh, internals, helper, listElements);
     if(ret)
       return ret;
@@ -388,6 +413,16 @@ bool NETGENPlugin_NETGEN_3D::computeFillNgMesh(
   return false;
 }
 
+/**
+ * @brief Part of Compute: Setting the netgen parameters from the Hypothesis
+ *
+ * @param aMesh Global mesh
+ * @param ngLib Wrapper on netgen lib
+ * @param occgeo Mapping between nodes mesh id and netgen structure id
+ * @param helper helper assocaited to the mesh
+ * @param endWith end step of netgen
+ * @return true if there was some error
+ */
 bool NETGENPlugin_NETGEN_3D::computePrepareParam(
   SMESH_Mesh&         aMesh,
   NETGENPlugin_NetgenLibWrapper &ngLib,
@@ -451,6 +486,17 @@ bool NETGENPlugin_NETGEN_3D::computePrepareParam(
   return false;
 }
 
+/**
+ * @brief Part of Compute: call to the netgen mesher
+ *
+ * @param occgeo netgen geometry structure
+ * @param nodeVec Mapping between nodes mesh id and netgen structure id
+ * @param ngMesh netgen mesh structure
+ * @param ngLib Wrapper on netgen lib
+ * @param startWith starting step of netgen
+ * @param endWith end step of netgen
+ * @return true if there was some error
+ */
 bool NETGENPlugin_NETGEN_3D::computeRunMesher(
   netgen::OCCGeometry &occgeo,
   vector< const SMDS_MeshNode* > &nodeVec,
@@ -509,6 +555,15 @@ bool NETGENPlugin_NETGEN_3D::computeRunMesher(
   return false;
 }
 
+/**
+ * @brief Part of Compute: Adding new element created by mesher to SMESH_Mesh
+ *
+ * @param nodeVec Mapping between nodes mesh id and netgen structure id
+ * @param ngLib Wrapper on netgen lib
+ * @param helper tool associated to the mesh to add element
+ * @param Netgen_NbOfNodes Number of nodes in netgen structure
+ * @return true if there was some error
+ */
 bool NETGENPlugin_NETGEN_3D::computeFillMesh(
   vector< const SMDS_MeshNode* > &nodeVec,
   NETGENPlugin_NetgenLibWrapper &ngLib,
@@ -555,6 +610,14 @@ bool NETGENPlugin_NETGEN_3D::computeFillMesh(
   return false;
 }
 
+
+/**
+ * @brief Compute mesh associate to shape
+ *
+ * @param aMesh The mesh
+ * @param aShape The shape
+ * @return true fi there are some error
+ */
 bool NETGENPlugin_NETGEN_3D::Compute(
   SMESH_Mesh&         aMesh,
   const TopoDS_Shape& aShape)