PAL9022. Attach generated mesh elements to whatever meshed shape, SHELL or SOLID

This commit is contained in:
eap 2005-09-07 04:33:54 +00:00
parent ea90d8a33a
commit e339065f45

View File

@ -125,16 +125,6 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
SMESHDS_Mesh* meshDS = aMesh.GetMeshDS(); 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 // 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; nodeVec[ n_id->second ] = n_id->first;
// create and insert new nodes into nodeVec // create and insert new nodes into nodeVec
int nodeIndex = Netgen_NbOfNodes; int nodeIndex = Netgen_NbOfNodes;
int shapeID = meshDS->ShapeToIndex( aShape );
for ( ; nodeIndex <= Netgen_NbOfNodesNew; ++nodeIndex ) for ( ; nodeIndex <= Netgen_NbOfNodesNew; ++nodeIndex )
{ {
Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point ); Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point );
SMDS_MeshNode * node = meshDS->AddNode(Netgen_point[0], SMDS_MeshNode * node = meshDS->AddNode(Netgen_point[0],
Netgen_point[1], Netgen_point[1],
Netgen_point[2]); Netgen_point[2]);
meshDS->SetNodeInVolume(node, aShell); meshDS->SetNodeInVolume(node, shapeID);
nodeVec[nodeIndex] = node; nodeVec[nodeIndex] = node;
} }
@ -289,7 +280,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
nodeVec[ Netgen_tetrahedron[1] ], nodeVec[ Netgen_tetrahedron[1] ],
nodeVec[ Netgen_tetrahedron[2] ], nodeVec[ Netgen_tetrahedron[2] ],
nodeVec[ Netgen_tetrahedron[3] ]); nodeVec[ Netgen_tetrahedron[3] ]);
meshDS->SetMeshElementOnShape(elt, aShell); meshDS->SetMeshElementOnShape(elt, shapeID );
} }
} }