From: eap Date: Thu, 21 Nov 2013 08:23:01 +0000 (+0000) Subject: 22401: [CEA 992] Regression on SMESH using NETGEN 2D X-Git-Tag: V7_3_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=65e846d888ef130cbd78966a50ae0e594d72a24f;p=plugins%2Fnetgenplugin.git 22401: [CEA 992] Regression on SMESH using NETGEN 2D In AddSegmentsToMesh() do not take into account length of degenerated segments --- diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 0514939..5992141 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -1665,9 +1665,10 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh& ngMesh, SMESH_TNodeXYZ np1( n ), np2( uvPtVec[ i+1 ].node ); // get an average size of adjacent segments to avoid sharp change of // element size (regression on issue 0020452, note 0010898) - int iPrev = SMESH_MesherHelper::WrapIndex( i-1, nbSegments ); - int iNext = SMESH_MesherHelper::WrapIndex( i+1, nbSegments ); - double avgH = ( segLen[ iPrev ] + segLen[ i ] + segLen[ iNext ]) / 3; + int iPrev = SMESH_MesherHelper::WrapIndex( i-1, nbSegments ); + int iNext = SMESH_MesherHelper::WrapIndex( i+1, nbSegments ); + 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 ); }