X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_VolumeTool.cxx;fp=src%2FSMDS%2FSMDS_VolumeTool.cxx;h=4475f7a829ecdb484e7f2685aacd85c9ee5d7c34;hp=cdf86308cbc7c91da86adf5eee94ad34598b4231;hb=29136aef517f93e86346d4e8552735ad3eaa27b3;hpb=bdcf8f151aff76aafe97a377fd978fdea36a51fa diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index cdf86308c..4475f7a82 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -2137,6 +2137,52 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex, const SMDS_MeshElement** otherV return isFree; } +//================================================================================ +/*! + * \brief Check that only one volume is built on the face nodes + * Different to IsFreeFace function, all nodes of the face are checked. + * For non conforming meshes, the face that is not conform with the neighbor + * will be identify as free. + */ +//================================================================================ + +bool SMDS_VolumeTool::IsFreeFaceCheckAllNodes( int faceIndex, const SMDS_MeshElement** otherVol/*=0*/ ) const +{ + const bool isFree = true; + + if ( !setFace( faceIndex )) + return !isFree; + + const SMDS_MeshNode** nodes = GetFaceNodes( faceIndex ); + + const int di = myVolume->IsQuadratic() ? 2 : 1; + const int nbN = myCurFace.myNbNodes/di; + std::vector allNodesCoincideWithNeighbor(nbN,false); + + for (int nodeId = 0; nodeId < nbN; nodeId++) + { + SMDS_ElemIteratorPtr eIt = nodes[nodeId]->GetInverseElementIterator( SMDSAbs_Volume ); + int count = 0; + while ( eIt->more() ) + { + const SMDS_MeshElement* vol = eIt->next(); + if ( vol == myVolume ) + continue; + else + { + count++; + } + } + + if ( count==0 /*free corner in the face means free face*/) + { + if ( otherVol ) *otherVol = 0; + return true; + } + } + return IsFreeFace( faceIndex, otherVol ); +} + //================================================================================ /*! * \brief Thorough check that only one volume is built on the face nodes