From: eap Date: Wed, 17 Nov 2010 08:27:46 +0000 (+0000) Subject: 0021073: EDF 1683 NETGENPLUGIN: Local size on edge creates unreguler 1D elements X-Git-Tag: V5_1_5~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=57c8dcbc0d8c0ea39b27ff02dfea754618f26f67;p=plugins%2Fnetgenplugin.git 0021073: EDF 1683 NETGENPLUGIN: Local size on edge creates unreguler 1D elements 1) attune setting local size to netgen realization specifics 2) prevent from negative nb of nodes in Evaluate() --- diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 89e9ca8..0363ae9 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -1505,7 +1505,7 @@ bool NETGENPlugin_Mesher::Compute() Handle(Geom_Curve) curve = BRep_Tool::Curve(e, u1, u2); GeomAdaptor_Curve AdaptCurve(curve); double length = GCPnts_AbscissaPoint::Length(AdaptCurve, u1, u2); - int nb = length/hi; + int nb = length/hi * 10; if(nb<2) nb=2; Standard_Real delta = (u2-u1)/nb; for(int i=0; iValue(u); netgen::Point3d pi(p.X(), p.Y(), p.Z()); ngMesh->RestrictLocalH(pi, hi); + if ( ngMesh->GetH(pi) - hi > 0.1*hi ) + // netgen does restriction iff oldH/newH > 1.2 (localh.cpp:136) + ngMesh->RestrictLocalH(pi, ngMesh->GetH(pi)/1.201); } } for(std::map::const_iterator it=VertexId2LocalSize.begin(); it!=VertexId2LocalSize.end(); it++) @@ -1938,7 +1941,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap) aVec[SMDSEntity_Quad_Triangle] = nbFaces; } else { - aVec[SMDSEntity_Node] = nbNodes; + aVec[SMDSEntity_Node] = Max ( nbNodes, 0 ); aVec[SMDSEntity_Triangle] = nbFaces; } aResMap[sm].swap(aVec);