22401: [CEA 992] Regression on SMESH using NETGEN 2D

In AddSegmentsToMesh() do not take into account length of degenerated segments
This commit is contained in:
eap 2013-11-21 08:23:01 +00:00
parent 82cf5f8207
commit 65e846d888

View File

@ -1667,7 +1667,8 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh& ngMesh,
// element size (regression on issue 0020452, note 0010898) // element size (regression on issue 0020452, note 0010898)
int iPrev = SMESH_MesherHelper::WrapIndex( i-1, nbSegments ); int iPrev = SMESH_MesherHelper::WrapIndex( i-1, nbSegments );
int iNext = SMESH_MesherHelper::WrapIndex( i+1, nbSegments ); int iNext = SMESH_MesherHelper::WrapIndex( i+1, nbSegments );
double avgH = ( segLen[ iPrev ] + segLen[ i ] + segLen[ iNext ]) / 3; int nbSeg = 1 + ( segLen[ iPrev ] > 1e-20 ) + ( segLen[ iNext ] > 1e-20 );
double avgH = ( segLen[ iPrev ] + segLen[ i ] + segLen[ iNext ]) / nbSeg;
RestrictLocalSize( ngMesh, 0.5*(np1+np2), avgH ); RestrictLocalSize( ngMesh, 0.5*(np1+np2), avgH );
} }