From 9b504e486741f715fe6169a33418954712c314c2 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 27 Jan 2017 22:16:01 +0300 Subject: [PATCH] Fix SALOME_TESTS/Grids/smesh/bugs_07/H5 as the geometry changed --- src/SMESH/SMESH_Algo.cxx | 6 ++++-- src/SMESH/SMESH_MesherHelper.cxx | 6 ++++++ src/StdMeshers/StdMeshers_Hexa_3D.cxx | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index a6806c3d8..a20e16a05 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -440,13 +440,15 @@ bool SMESH_Algo::GetSortedNodesOnEdge(const SMESHDS_Mesh* theM TopExp::Vertices(theEdge, v1, v2); const SMDS_MeshNode* n1 = VertexNode( v1, eSubMesh, 0 ); const SMDS_MeshNode* n2 = VertexNode( v2, eSubMesh, 0 ); + const SMDS_MeshNode* nEnd[2] = { nbNodes ? theNodes.begin()->second : 0, + nbNodes ? theNodes.rbegin()->second : 0 }; Standard_Real f, l; BRep_Tool::Range(theEdge, f, l); if ( v1.Orientation() != TopAbs_FORWARD ) std::swap( f, l ); - if ( n1 && ++nbNodes ) + if ( n1 && n1 != nEnd[0] && n1 != nEnd[1] && ++nbNodes ) theNodes.insert( make_pair( f, n1 )); - if ( n2 && ++nbNodes ) + if ( n2 && n2 != nEnd[0] && n2 != nEnd[1] && ++nbNodes ) theNodes.insert( make_pair( l, n2 )); return (int)theNodes.size() == nbNodes; diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 68014fbd9..a1f9b3963 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -2568,6 +2568,7 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2 } // get nodes on theBaseEdge sorted by param on edge and initialize theParam2ColumnMap with them + const SMDS_MeshNode* prevEndNodes[2] = { 0, 0 }; edge = theBaseSide.begin(); for ( int iE = 0; edge != theBaseSide.end(); ++edge, ++iE ) { @@ -2635,11 +2636,16 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2 const double prevPar = theParam2ColumnMap.empty() ? 0 : theParam2ColumnMap.rbegin()->first; for ( u_n = sortedBaseNN.begin(); u_n != sortedBaseNN.end(); u_n++ ) { + if ( u_n->second == prevEndNodes[0] || + u_n->second == prevEndNodes[1] ) + continue; double par = prevPar + coeff * ( u_n->first - f ); TParam2ColumnMap::iterator u2nn = theParam2ColumnMap.insert( theParam2ColumnMap.end(), make_pair( par, TNodeColumn())); u2nn->second.push_back( u_n->second ); } + prevEndNodes[0] = sortedBaseNN.begin()->second; + prevEndNodes[1] = sortedBaseNN.rbegin()->second; } if ( theParam2ColumnMap.size() < 2 ) return false; diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 4e1ee652d..335a36a78 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -380,7 +380,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), GetStudyId(), _gen); for ( int i = 0; i < 6; ++i ) { - if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 ))))) + if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 ), + /*considerMesh=*/true)))) return error( quadAlgo.GetComputeError() ); if ( quad[i]->side.size() != 4 ) return error( COMPERR_BAD_SHAPE, "Not a quadrangular box side" ); -- 2.39.2