+ // 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<const MEDCoupling::MEDCouplingUMesh*> myMeshes_c;
+ for (auto & mesh: myMeshes) myMeshes_c.push_back(mesh);
+ meshesCastTo[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords(myMeshes_c);
+ MCAuto<DataArrayIdType> tmp = meshesCastTo[inew]->zipConnectivityTraducer(2);
+ }
+ else
+ {
+ vector<const MEDCoupling::MEDCouplingUMesh*> myMeshes_c;
+ for (auto & mesh: myMeshes) myMeshes_c.push_back(mesh);
+ meshesCastTo[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshes(myMeshes_c);
+ }