diff --git a/applications/utilities/mesh/manipulation/createBaffles/Make/files b/applications/utilities/mesh/manipulation/createBaffles/Make/files index 4d4c0ea538..734f2bce76 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/Make/files +++ b/applications/utilities/mesh/manipulation/createBaffles/Make/files @@ -1,3 +1,7 @@ +faceSelection/faceSelection.C +faceSelection/faceZoneSelection.C +faceSelection/searchableSurfaceSelection.C + createBaffles.C EXE = $(FOAM_APPBIN)/createBaffles diff --git a/applications/utilities/mesh/manipulation/createBaffles/Make/options b/applications/utilities/mesh/manipulation/createBaffles/Make/options index f7e0c60fed..3c8db28129 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/Make/options +++ b/applications/utilities/mesh/manipulation/createBaffles/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -IfaceSelection \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index 6fb57aa027..c2e2a06ebb 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -26,25 +26,26 @@ Description mergeOrSplitBaffles. Note: if any coupled patch face is selected for baffling the opposite - member has to be selected for baffling as well. Note that this - is the same as repatching. This was added only for convenience so - you don't have to filter coupled boundary out of your set. + member has to be selected for baffling as well. + + - if the patch already exists will not override it nor its fields + - if the patch does not exist it will be created together with 'calculated' + patchfields unless the field is mentioned in the patchFields section. \*---------------------------------------------------------------------------*/ -#include "syncTools.H" #include "argList.H" #include "Time.H" -#include "faceSet.H" #include "polyTopoChange.H" #include "polyModifyFace.H" #include "polyAddFace.H" #include "ReadFields.H" #include "volFields.H" #include "surfaceFields.H" -#include "ZoneIDs.H" #include "fvMeshMapper.H" -#include "SetPatchFields.H" +#include "faceSelection.H" + +#include "fvMeshTools.H" using namespace Foam; @@ -107,21 +108,6 @@ void modifyOrAddFace } -label findPatchID(const polyMesh& mesh, const word& name) -{ - const label patchI = mesh.boundaryMesh().findPatchID(name); - - if (patchI == -1) - { - FatalErrorIn("findPatchID(const polyMesh&, const word&)") - << "Cannot find patch " << name << endl - << "Valid patches are " << mesh.boundaryMesh().names() - << exit(FatalError); - } - return patchI; -} - - // Main program: int main(int argc, char *argv[]) @@ -129,102 +115,84 @@ int main(int argc, char *argv[]) argList::addNote ( "Makes internal faces into boundary faces.\n" - "Does not duplicate points, unlike mergeOrSplitBaffles." + "Does not duplicate points." ); #include "addOverwriteOption.H" - #include "addRegionOption.H" - - argList::validArgs.append("faceZone"); - argList::validArgs.append("(masterPatch slavePatch)"); argList::addOption ( - "additionalPatches", - "((master2 slave2) .. (masterN slaveN))" + "dict", + "file", + "specify alternative dictionary for the createBaffles description" ); - argList::addBoolOption - ( - "internalFacesOnly", - "do not convert boundary faces" - ); - argList::addBoolOption - ( - "updateFields", - "update fields to include new patches:" - " NOTE: updated field values may need to be edited" - ); - + #include "addRegionOption.H" #include "setRootCase.H" #include "createTime.H" runTime.functionObjects().off(); #include "createNamedMesh.H" + + const bool overwrite = args.optionFound("overwrite"); + const word oldInstance = mesh.pointsInstance(); - const polyBoundaryMesh& patches = mesh.boundaryMesh(); - const faceZoneMesh& faceZones = mesh.faceZones(); - - // Faces to baffle - faceZoneID zoneID(args.additionalArgs()[0], faceZones); - - Info<< "Converting faces on zone " << zoneID.name() - << " into baffles." << nl << endl; - - if (zoneID.index() == -1) - { - FatalErrorIn(args.executable()) << "Cannot find faceZone " - << zoneID.name() << endl - << "Valid zones are " << faceZones.names() - << exit(FatalError); - } - - const faceZone& fZone = faceZones[zoneID.index()]; - - Info<< "Found " << returnReduce(fZone.size(), sumOp