Salome HOME
Corrections for parallel smesh
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_NETGEN_3D.cxx
index d4712aaa56a84c209657f44d1069958ae0a8b56d..8435688dc96c3851ce51a3455f9d75c47e903d9f 100644 (file)
@@ -218,7 +218,7 @@ bool NETGENPlugin_NETGEN_3D::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
 )
 {
   SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
@@ -309,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;
@@ -338,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;