diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index bd88570d94..ece5f4dde6 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -48,157 +48,6 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void createBaffles -( - const polyMesh& mesh, - const label faceI, - const label oldPatchI, - const labelList& newPatches, - PackedBoolList& doneFace, - polyTopoChange& meshMod -) -{ - const polyBoundaryMesh& patches = mesh.boundaryMesh(); - const faceZoneMesh& faceZones = mesh.faceZones(); - - const face& f = mesh.faces()[faceI]; - label zoneID = faceZones.whichZone(faceI); - bool zoneFlip = false; - if (zoneID >= 0) - { - const faceZone& fZone = faceZones[zoneID]; - zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)]; - } - label nei = -1; - if (oldPatchI == -1) - { - nei = mesh.faceNeighbour()[faceI]; - } - - - face revFace(f.reverseFace()); - - forAll(newPatches, i) - { - if (oldPatchI == -1) - { - // Internal face - if (doneFace.set(faceI)) - { - // First usage of face. Modify. - meshMod.setAction - ( - polyModifyFace - ( - f, // modified face - faceI, // label of face - mesh.faceOwner()[faceI], // owner - -1, // neighbour - false, // face flip - newPatches[i], // patch for face - false, // remove from zone - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - else - { - // Second or more usage of face. Add. - meshMod.setAction - ( - polyAddFace - ( - f, // modified face - mesh.faceOwner()[faceI], // owner - -1, // neighbour - -1, // master point - -1, // master edge - faceI, // master face - false, // face flip - newPatches[i], // patch for face - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - - meshMod.setAction - ( - polyAddFace - ( - revFace, // modified face - nei, // owner - -1, // neighbour - -1, // masterPointID - -1, // masterEdgeID - faceI, // masterFaceID, - true, // face flip - newPatches[i], // patch for face - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - else if - ( - patches[oldPatchI].coupled() - && patches[newPatches[i]].coupled() - ) - { - // Do not allow coupled patches to be moved to different coupled - // patches. - //WarningIn("createBaffles()") - // << "Not moving face from coupled patch " - // << patches[oldPatchI].name() - // << " to another coupled patch " << patches[newPatches[i]] - // << endl; - } - else - { - if (doneFace.set(faceI)) - { - meshMod.setAction - ( - polyModifyFace - ( - f, // modified face - faceI, // label of face - mesh.faceOwner()[faceI], // owner - -1, // neighbour - false, // face flip - newPatches[i], // patch for face - false, // remove from zone - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - else - { - meshMod.setAction - ( - polyAddFace - ( - f, // modified face - mesh.faceOwner()[faceI], // owner - -1, // neighbour - -1, // master point - -1, // master edge - faceI, // master face - false, // face flip - newPatches[i], // patch for face - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - } - } -} - - - // Main program: int main(int argc, char *argv[]) @@ -215,15 +64,16 @@ int main(int argc, char *argv[]) const word oldInstance = mesh.pointsInstance(); const polyBoundaryMesh& patches = mesh.boundaryMesh(); + const faceZoneMesh& faceZones = mesh.faceZones(); // Faces to baffle word setName(args.additionalArgs()[0]); - Pout<< "Reading faceSet from " << setName << nl << endl; + Info<< "Reading faceSet from " << setName << nl << endl; faceSet facesToSplit(mesh, setName); // Make sure set is synchronised across couples facesToSplit.sync(mesh); - Pout<< "Read " << facesToSplit.size() << " faces from " << setName - << nl << endl; + Info<< "Read " << returnReduce(facesToSplit.size(), sumOp