Fix SIGSEGV of computing a quadratic sub-mesh
This commit is contained in:
parent
d195b60384
commit
671f63a4da
@ -3310,9 +3310,19 @@ bool NETGENPlugin_Mesher::Compute()
|
|||||||
FillSMesh( occgeo, *_ngMesh, initState, *_mesh, nodeVec, comment, &quadHelper );
|
FillSMesh( occgeo, *_ngMesh, initState, *_mesh, nodeVec, comment, &quadHelper );
|
||||||
|
|
||||||
if ( quadHelper.GetIsQuadratic() ) // remove free nodes
|
if ( quadHelper.GetIsQuadratic() ) // remove free nodes
|
||||||
|
{
|
||||||
for ( size_t i = 0; i < nodeVec.size(); ++i )
|
for ( size_t i = 0; i < nodeVec.size(); ++i )
|
||||||
if ( nodeVec[i] && nodeVec[i]->NbInverseElements() == 0 )
|
if ( nodeVec[i] && nodeVec[i]->NbInverseElements() == 0 )
|
||||||
|
{
|
||||||
_mesh->GetMeshDS()->RemoveFreeNode( nodeVec[i], 0, /*fromGroups=*/false );
|
_mesh->GetMeshDS()->RemoveFreeNode( nodeVec[i], 0, /*fromGroups=*/false );
|
||||||
|
nodeVec[i]=0;
|
||||||
|
}
|
||||||
|
for ( size_t i = nodeVec.size()-1; i > 0; --i ) // remove trailing removed nodes
|
||||||
|
if ( !nodeVec[i] )
|
||||||
|
nodeVec.resize( i );
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SMESH_ComputeErrorPtr readErr = ReadErrors(nodeVec);
|
SMESH_ComputeErrorPtr readErr = ReadErrors(nodeVec);
|
||||||
if ( readErr && readErr->HasBadElems() )
|
if ( readErr && readErr->HasBadElems() )
|
||||||
|
Loading…
Reference in New Issue
Block a user