From: eap Date: Wed, 24 Jun 2015 15:58:16 +0000 (+0300) Subject: 23118: EDF 11115 SMESH: Hexahedric mesh produces degenerate elements in quadratic... X-Git-Tag: V7_7_0a1~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aba3768b2fb489bffaaf6ef830e2bf0d87b0483f;p=modules%2Fsmesh.git 23118: EDF 11115 SMESH: Hexahedric mesh produces degenerate elements in quadratic conversion. Fix an invalid commit --- diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index 595aff2d9..ea94c3b4a 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -105,6 +105,7 @@ public: const _FaceSide* GetSide(const int i) const; int size() const { return myChildren.size(); } int NbVertices() const; + int NbCommonVertices( const TopTools_MapOfShape& VV ) const; TopoDS_Vertex FirstVertex() const; TopoDS_Vertex LastVertex() const; TopoDS_Vertex Vertex(int i) const; @@ -1172,26 +1173,22 @@ bool _QuadFaceGrid::isContinuousMesh(TopoDS_Edge E1, TopoDS_Edge E2, SMESH_Mesh& bool _QuadFaceGrid::needContinuationAtSide( int iSide, const TopTools_MapOfShape& cornerVertices ) const { - if ( cornerVertices.empty() ) + if ( cornerVertices.IsEmpty() ) return false; + // current solution is rough. Take more care of composite sides! + // check presence of corners at iSide - int nbCorners = 0; const _FaceSide* side = mySides.GetSide( iSide ); if ( !side ) return false; - int iV, nbV = side->NbVertices(); - for ( iV = 0; iV < nbV && nbCorners == 0; ++iV ) - nbCorners += cornerVertices.Contains( side->Vertex( iV )); + int nbCorners = side->NbCommonVertices( cornerVertices ); if ( nbCorners > 0 ) return false; // check presence of corners at other sides - nbCorners = 0; - nbV = mySides.NbVertices(); - for ( iV = 0; iV < nbV && nbCorners == 0; ++iV ) - nbCorners += cornerVertices.Contains( mySides.Vertex( iV )); + nbCorners = mySides.NbCommonVertices( cornerVertices ); - return ( nbCorners > 0 ); // if nbCorners == 2 additional check is needed!!! + return ( 0 < nbCorners && nbCorners <= 2 ); // if nbCorners == 2 additional check is needed!!! } //================================================================================ @@ -1605,9 +1602,24 @@ int _FaceSide::NbVertices() const return myNbChildren + 1; } +//======================================================================= +//function : NbCommonVertices +//purpose : Returns number of my vertices common with the given ones +//======================================================================= + +int _FaceSide::NbCommonVertices( const TopTools_MapOfShape& VV ) const +{ + int nbCommon = 0; + TopTools_MapIteratorOfMapOfShape vIt ( myVertices ); + for ( ; vIt.More(); vIt.Next() ) + nbCommon += ( VV.Contains( vIt.Key() )); + + return nbCommon; +} + //======================================================================= //function : FirstVertex -//purpose : +//purpose : //======================================================================= TopoDS_Vertex _FaceSide::FirstVertex() const