From 1ead0a723df2991ec52962e06df15749715cb755 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 2 Nov 2011 08:56:59 +0000 Subject: [PATCH] Fix regression of test grid 2d_mesh_NETGEN/D2 fix restricting local H, which was broken by a defaut netgen::mparam.minh --- src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx index 06a5bc4..40acc11 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx @@ -301,15 +301,14 @@ static TError addSegmentsToMesh(netgen::Mesh& ngMesh, ngMesh.AddSegment (seg); { // restrict size of elements near the segment - netgen::Point3d ngP1(n->X(), n->Y(), n->Z()); - n = uvPtVec[ i+1 ].node; - netgen::Point3d ngP2(n->X(), n->Y(), n->Z()); + 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; - ngMesh.RestrictLocalH( netgen::Center( ngP1,ngP2), avgH ); + + NETGENPlugin_Mesher::RestrictLocalSize( ngMesh, 0.5*(np1+np2), avgH ); } #ifdef DUMP_SEGMENTS cout << "Segment: " << seg.edgenr << endl -- 2.39.2