From: eap Date: Thu, 14 Jan 2021 16:11:42 +0000 (+0300) Subject: bos #20553: EDF 22656 - Error after computation but mesh seems OK X-Git-Tag: V9_7_0a1~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9e3db5ed1d2fc44ca6560ae3fd5570b7bca6323f;p=modules%2Fsmesh.git bos #20553: EDF 22656 - Error after computation but mesh seems OK bos #20561: 22656 - Strange behavior with submeshes --- diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index fc01cab16..5f4796266 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -208,8 +208,8 @@ bool StdMeshers_Quadrangle_2D::CheckHypothesis */ //============================================================================= -bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape) +bool StdMeshers_Quadrangle_2D::Compute( SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape ) { const TopoDS_Face& F = TopoDS::Face(aShape); aMesh.GetSubMesh( F ); @@ -4776,6 +4776,7 @@ bool StdMeshers_Quadrangle_2D::check() const SMDS_MeshNode* nInFace = 0; if ( myHelper->HasSeam() ) + { for ( int i = 0; i < nbN && !nInFace; ++i ) if ( !myHelper->IsSeamShape( nn[i]->getshapeId() )) { @@ -4784,6 +4785,33 @@ bool StdMeshers_Quadrangle_2D::check() if ( myHelper->IsOnSeam( uv )) nInFace = NULL; } + } + if ( myHelper->GetPeriodicIndex() && !nInFace ) + { + for ( int i = 0; i < nbN && !nInFace; ++i ) + if ( fSubMesh->Contains( nn[i] )) + nInFace = nn[i]; + if ( !nInFace ) + for ( int i = 0; i < nbN && !nInFace; ++i ) + { + SMDS_ElemIteratorPtr fIt = nn[i]->GetInverseElementIterator( SMDSAbs_Face ); + while ( fIt->more() && !nInFace ) + { + const SMDS_MeshElement* face = fIt->next(); + if ( !fSubMesh->Contains( face )) + continue; + for ( int iN = 0, nN = face->NbCornerNodes(); iN < nN; ++iN ) + { + const SMDS_MeshNode* n = face->GetNode( iN ); + if ( fSubMesh->Contains( n )) + { + nInFace = n; + break; + } + } + } + } + } toCheckUV = true; for ( int i = 0; i < nbN; ++i )