diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index eaf327bb9d1bd2b1a03dca33d6ce7d204b3c3821..727aa805cf8cfaf4c353c63566f603655b0d6b1f 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -368,9 +368,17 @@ void createFaces { const polyPatch& pp = pbm[patchi]; - label newPatchi = newMasterPatches[i]; + const label newMasterPatchi = newMasterPatches[i]; + const label newSlavePatchi = newSlavePatches[i]; - if (pp.coupled() && pbm[newPatchi].coupled()) + if + ( + pp.coupled() + && ( + pbm[newMasterPatchi].coupled() + || pbm[newSlavePatchi].coupled() + ) + ) { // Do not allow coupled faces to be moved to different // coupled patches. @@ -391,8 +399,9 @@ void createFaces << "Found boundary face (in patch " << pp.name() << ") in faceZone " << fZone.name() - << " to convert to baffle patch " - << pbm[newPatchi].name() + << " to convert to baffle patches " + << pbm[newMasterPatchi].name() << "/" + << pbm[newSlavePatchi].name() << endl << " Set internalFacesOnly to true in the" << " createBaffles control dictionary if you" @@ -407,11 +416,14 @@ void createFaces facei, // label of face mesh.faceOwner()[facei], // owner false, // face flip - newPatchi, // patch for face + fZone.flipMap()[zoneFacei] + ? newSlavePatchi + : newMasterPatchi, // patch for face fZone.index(), // zone for face fZone.flipMap()[zoneFacei], // face flip in zone modifiedFace // modify or add ); + nModified++; } }