]> SALOME platform Git repositories - plugins/netgenplugin.git/commitdiff
Salome HOME
PAL9022. Attach generated mesh elements to whatever meshed shape, SHELL or SOLID
authoreap <eap@opencascade.com>
Wed, 7 Sep 2005 04:33:54 +0000 (04:33 +0000)
committereap <eap@opencascade.com>
Wed, 7 Sep 2005 04:33:54 +0000 (04:33 +0000)
src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx

index db0c493cba8683fa8fdf896403fb1c4e7bc25991..c6c23a1fffb1257e54683d63e55f028e25e2684f 100644 (file)
@@ -125,16 +125,6 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh&         aMesh,
 
   SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
 
-  // get a shell from aShape
-  TopoDS_Shell aShell;
-  TopExp_Explorer exp(aShape,TopAbs_SHELL);
-  if ( exp.More() )
-    aShell = TopoDS::Shell(exp.Current());
-
-  if ( aShell.IsNull() || !aMesh.GetSubMesh( aShell )) {
-    INFOS( "NETGENPlugin_NETGEN_3D::Compute(), bad shape");
-    return false;
-  }
   // -------------------------------------------------------------------
   // get triangles on aShell and make a map of nodes to Netgen node IDs
   // -------------------------------------------------------------------
@@ -271,13 +261,14 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh&         aMesh,
       nodeVec[ n_id->second ] = n_id->first;
     // create and insert new nodes into nodeVec
     int nodeIndex = Netgen_NbOfNodes;
+    int shapeID = meshDS->ShapeToIndex( aShape );
     for ( ; nodeIndex <= Netgen_NbOfNodesNew; ++nodeIndex )
     {
       Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point );
       SMDS_MeshNode * node = meshDS->AddNode(Netgen_point[0],
                                              Netgen_point[1],
                                              Netgen_point[2]);
-      meshDS->SetNodeInVolume(node, aShell);
+      meshDS->SetNodeInVolume(node, shapeID);
       nodeVec[nodeIndex] = node;
     }
 
@@ -289,7 +280,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh&         aMesh,
                                                  nodeVec[ Netgen_tetrahedron[1] ],
                                                  nodeVec[ Netgen_tetrahedron[2] ],
                                                  nodeVec[ Netgen_tetrahedron[3] ]);
-      meshDS->SetMeshElementOnShape(elt, aShell);
+      meshDS->SetMeshElementOnShape(elt, shapeID );
     }
   }