From: Afeef Date: Wed, 13 Jul 2022 13:48:42 +0000 (+0200) Subject: Fixes issue of extra nodes during compound meshing X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=16fddc348004611e1ad590ab7aa8fe1c82ccf9be;p=plugins%2Fgmshplugin.git Fixes issue of extra nodes during compound meshing issue discussed [spns #30577](https://codev-tuleap.cea.fr/plugins/tracker/\?aid\=30577\&group_id\=106)` --- diff --git a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx index 7fb7e56..3dceecc 100644 --- a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx +++ b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx @@ -400,44 +400,36 @@ void GMSHPlugin_Mesher::CreateGmshCompounds() void GMSHPlugin_Mesher::SetCompoundMeshVisibility() { - // Loop over all faces, if the face belongs to a compound entry then - // for all (boundary) edges whithin the face visibility is set to 0, - // if the face doesn't belong to a compound entry then visibility is - // set to 1 for all its (boundary) edges. Later, in FillSMesh() func - // getVisibility() (returns either 1 or 0) is used to decide weather - // the mesh of edge should be transmitted to SMESH or not. - - for ( GModel::fiter itF = _gModel->firstFace(); itF != _gModel->lastFace(); ++itF ) + // Loop over all regions (or faces), if the region (or face) belongs + // to a compound entry, then for all boundary faces (or Edges) within + // the region (or face) visibility is set to 0 otherwise is is set 1. + // Later, in FillSMesh() func getVisibility() (returns either 1 or 0) + // is used to decide weather the mesh of entry should be transmitted + // to SMESH or not. Note, visibility is set to 1 or 0 recurisvely, e.g. + // for a face its constructing edges and nodes will be effected. + + for ( GModel::riter itR = _gModel->firstRegion(); itR != _gModel->lastRegion(); ++itR) { - std::vector< GEdge *> faceEdges = (*itF)->edges(); - - for ( auto itE = faceEdges.begin(); itE != faceEdges.end(); ++itE ) + std::vector< GFace *> regionFaces = (*itR)->faces(); + for ( auto itF = regionFaces.begin(); itF != regionFaces.end(); ++itF ) { - if ( ((*itF)->compound.size()) ) - (*itE)->setVisibility(0); + if ( ((*itR)->compound.size()) ) + (*itF)->setVisibility(0,true); else - (*itE)->setVisibility(1); + (*itF)->setVisibility(1,true); } } - - // Loop over all edges, if the edge belongs to a compound entry then - // for all (boundary) vertices whithin the edge visibility is set to - // 0, if the edge doesn't belong to a compound entry then visibility - // is set to 1 for all its (boundary) vertices. Later, in FillSMesh() - // func getVisibility() (returns either 1 or 0) is used to decide we- - // ather the mesh of vertices should be transmitted to SMESH or not. - - for ( GModel::eiter itE = _gModel->firstEdge(); itE != _gModel->lastEdge(); ++itE ) + for ( GModel::fiter itF = _gModel->firstFace(); itF != _gModel->lastFace(); ++itF ) { - std::vector bndVerticies = (*itE)->vertices(); + std::vector< GEdge *> faceEdges = (*itF)->edges(); - for( auto itV = bndVerticies.begin(); itV != bndVerticies.end(); ++itV ) + for ( auto itE = faceEdges.begin(); itE != faceEdges.end(); ++itE ) { - if(((*itE)->compound.size())) - (*itV)->setVisibility(0); + if ( ((*itF)->compound.size()) ) + (*itE)->setVisibility(0,true); else - (*itV)->setVisibility(1); + (*itE)->setVisibility(1,true); } }