X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_MeshCollection.cxx;h=f4b4e92d89e2da1c2fb7c6099f5f25b1da71c5b2;hb=662a2a2393a25baef77e42f74204b11b70a9646c;hp=bbaba7b05bf3c85aacc7ecbf5916788e72774726;hpb=b219559763498c4bd10c730cd3d2c62b1eed45db;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx index bbaba7b05..f4b4e92d8 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D +// Copyright (C) 2007-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -151,7 +151,7 @@ MEDPARTITIONER::MeshCollection::MeshCollection(MeshCollection& initialCollection this->getMesh(), initialCollection.getCellFamilyIds(), "cellFamily"); - castIntField(initialCollection.getFaceMesh(), + castIntField(initialCollection.getFaceMesh(), this->getFaceMesh(), initialCollection.getFaceFamilyIds(), "faceFamily"); @@ -591,13 +591,14 @@ void MEDPARTITIONER::MeshCollection::castFaceMeshes(MeshCollection& initialColle meshesCastTo.resize(nbNewDomain); for (int inew=0; inew myMeshes; + vector myMeshes; for (int iold=0; ioldgetNumberOfCells()>0) myMeshes.push_back(umesh); + } MEDCoupling::MEDCouplingUMesh *bndMesh = 0; @@ -608,12 +609,28 @@ void MEDPARTITIONER::MeshCollection::castFaceMeshes(MeshCollection& initialColle bndMesh = ((MEDCoupling::MEDCouplingUMesh *)_mesh[inew]->buildBoundaryMesh(/*keepCoords=*/true)); if (bndMesh->getNumberOfCells()>0) - myMeshes.push_back( bndMesh ); + myMeshes.push_back( bndMesh ); } if (myMeshes.size()>0) { - meshesCastTo[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshes(myMeshes); + // Need to merge faces that are both in the initial set of faces and in the boundary mesh + // which is the last element in myMeshes: + if(bndMesh) + { + for (int iold2 = 0; iold2 < (int)myMeshes.size()-1; iold2++) + myMeshes[iold2]->tryToShareSameCoordsPermute(*bndMesh, 1.e-10); + vector myMeshes_c; + for (auto & mesh: myMeshes) myMeshes_c.push_back(mesh); + meshesCastTo[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords(myMeshes_c); + MCAuto tmp = meshesCastTo[inew]->zipConnectivityTraducer(2); + } + else + { + vector myMeshes_c; + for (auto & mesh: myMeshes) myMeshes_c.push_back(mesh); + meshesCastTo[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshes(myMeshes_c); + } meshesCastTo[inew]->sortCellsInMEDFileFrmt()->decrRef(); } else @@ -2169,7 +2186,7 @@ MEDPARTITIONER::Topology* MEDPARTITIONER::MeshCollection::createPartition(int nb #endif } if ( !cellGraph ) - throw INTERP_KERNEL::Exception("MeshCollection::createPartition : PARMETIS/METIS is not available. Check your products, please."); + throw INTERP_KERNEL::Exception("MeshCollection::createPartition : PARMETIS/METIS is not available (or you're not running in //). Check your products, please."); break; case Graph::SCOTCH: