From: eap Date: Tue, 1 Nov 2011 10:25:17 +0000 (+0000) Subject: 0021405: EDF 1965 SMESH: X-Git-Tag: RELIQUAT_6x_15112011~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=20b845d01124e38c001fd7a57e1f04a4471d88fd;p=plugins%2Fnetgenplugin.git 0021405: EDF 1965 SMESH: In fillNgMesh(), add a node on VERTEX only if a VERTEX is shared by a not meshed EDGE --- diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index a7a1cb7..325b3c7 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -860,9 +860,23 @@ bool NETGENPlugin_Mesher::fillNgMesh(const netgen::OCCGeometry& occgeom, case TopAbs_VERTEX: { // VERTEX // -------------------------- - SMDS_NodeIteratorPtr nodeIt = smDS->GetNodes(); - if ( nodeIt->more() ) - ngNodeId( nodeIt->next(), ngMesh, nodeNgIdMap ); + // issue 21405. Add node only if a VERTEX is shared by a not meshed EDGE, + // else netgen removes a free node and nodeVector becomes invalid + PShapeIteratorPtr ansIt = helper.GetAncestors( sm->GetSubShape(), + *sm->GetFather(), + TopAbs_EDGE ); + bool toAdd = false; + while ( const TopoDS_Shape* e = ansIt->next() ) + { + SMESH_subMesh* eSub = helper.GetMesh()->GetSubMesh( *e ); + if (( toAdd = eSub->IsEmpty() )) break; + } + if ( toAdd ) + { + SMDS_NodeIteratorPtr nodeIt = smDS->GetNodes(); + if ( nodeIt->more() ) + ngNodeId( nodeIt->next(), ngMesh, nodeNgIdMap ); + } break; } default:;