From c365f36e981a2ebce6a3fd7dc5d3314d6214853a Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 30 May 2014 16:11:45 +0400 Subject: [PATCH] Regression of SALOME_TESTS/Grids/smesh/viscous_layers_00/A6 --- src/StdMeshers/StdMeshers_ViscousLayers.cxx | 38 +++++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 251cfc377..db9243881 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -1012,8 +1012,11 @@ namespace } //-------------------------------------------------------------------------------- // DEBUG. Dump intermediate node positions into a python script + // HOWTO use: run python commands written in a console to see + // construction steps of viscous layers #ifdef __myDEBUG ofstream* py; + int theNbFunc; struct PyDump { PyDump() { const char* fname = "/tmp/viscous.py"; @@ -1024,19 +1027,20 @@ namespace << "smesh = smeshBuilder.New(salome.myStudy)" << endl << "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:3')" << endl << "mesh = smesh.Mesh( meshSO.GetObject() )"< nodesToSmooth( smoothNodes.size() ); { + dumpFunction(SMESH_Comment("fixUVOnFace")<first); // debug const bool sortSimplices = isConcaveFace; for ( size_t i = 0; i < smoothNodes.size(); ++i ) { @@ -4907,6 +4920,17 @@ bool _ViscousBuilder::shrink() } } } + // TODO: check effect of this additional smooth + // additional laplacian smooth to increase allowed shrink step + // for ( int st = 1; st; --st ) + // { + // dumpFunction(SMESH_Comment("shrinkFace")<first<<"_st"<<++smooStep); // debug + // for ( size_t i = 0; i < nodesToSmooth.size(); ++i ) + // { + // nodesToSmooth[i].Smooth( badNb,surface,helper,refSign, + // _SmoothNode::LAPLACIAN,/*set3D=*/false); + // } + // } } // while ( shrinked ) // No wrongly shaped faces remain; final smooth. Set node XYZ. @@ -4980,7 +5004,7 @@ bool _ViscousBuilder::prepareEdgeToShrink( _LayerEdge& edge, gp_Vec2d uvDir( srcUV, tgtUV ); double uvLen = uvDir.Magnitude(); uvDir /= uvLen; - edge._normal.SetCoord( uvDir.X(),uvDir.Y(), 0); + edge._normal.SetCoord( uvDir.X(),uvDir.Y(), 0 ); edge._len = uvLen; edge._pos.resize(1); @@ -5210,7 +5234,7 @@ bool _LayerEdge::SetNewLength2d( Handle(Geom_Surface)& surface, const double kSafe = Max( 0.5, 1. - 0.1 * _simplices.size() ); // Select shrinking step such that not to make faces with wrong orientation. - double stepSize = uvLen; + double stepSize = 1e100; for ( size_t i = 0; i < _simplices.size(); ++i ) { // find intersection of 2 lines: curUV-tgtUV and that connecting simplex nodes @@ -5225,7 +5249,7 @@ bool _LayerEdge::SetNewLength2d( Handle(Geom_Surface)& surface, stepSize = Min( step, stepSize ); } gp_Pnt2d newUV; - if ( uvLen - stepSize < _len / 200. ) + if ( uvLen <= stepSize ) { newUV = tgtUV; _pos.clear(); -- 2.39.2