47 const word& faceSetName,
48 const word& cellSetName,
53 faceSetName_(faceSetName),
54 cellSetName_(cellSetName),
62 const dictionary&
dict
68 flip_(
dict.lookupOrDefault(
"flip", false))
86 if (!isA<faceZoneSet>(set))
89 <<
"Operation only allowed on a faceZoneSet." <<
endl;
93 faceZoneSet& fzSet = refCast<faceZoneSet>(set);
97 Info<<
" Adding all faces from faceSet " << faceSetName_
101 faceSet fSet(mesh_, faceSetName_);
102 cellSet cSet(mesh_, cellSetName_);
105 DynamicList<label> newAddressing(fzSet.addressing());
106 DynamicList<bool> newFlipMap(fzSet.flipMap());
110 label facei = iter.key();
112 if (!fzSet.found(facei))
114 bool flipFace =
false;
116 label own = mesh_.faceOwner()[facei];
117 bool ownFound = cSet.found(own);
119 if (mesh_.isInternalFace(facei))
121 label nei = mesh_.faceNeighbour()[facei];
122 bool neiFound = cSet.found(nei);
124 if (ownFound && !neiFound)
128 else if (!ownFound && neiFound)
135 <<
"One of owner or neighbour of internal face "
136 << facei <<
" should be in cellSet "
138 <<
" to be able to determine orientation."
140 <<
"Face:" << facei <<
" own:" << own
141 <<
" OwnInCellSet:" << ownFound
143 <<
" NeiInCellSet:" << neiFound
149 flipFace = !ownFound;
155 flipFace = !flipFace;
158 newAddressing.append(facei);
159 newFlipMap.append(flipFace);
163 fzSet.addressing().transfer(newAddressing);
164 fzSet.flipMap().transfer(newFlipMap);
169 Info<<
" Removing all faces from faceSet " << faceSetName_
173 faceZoneSet loadedSet(mesh_, faceSetName_);
176 DynamicList<label> newAddressing(fzSet.addressing().size());
177 DynamicList<bool> newFlipMap(fzSet.flipMap().size());
179 forAll(fzSet.addressing(), i)
181 if (!loadedSet.found(fzSet.addressing()[i]))
183 newAddressing.append(fzSet.addressing()[i]);
184 newFlipMap.append(fzSet.flipMap()[i]);
187 fzSet.addressing().transfer(newAddressing);
188 fzSet.flipMap().transfer(newFlipMap);
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
virtual ~setsToFaceZone()
Destructor.
setsToFaceZone(const polyMesh &mesh, const word &faceSetName, const word &cellSetName, const Switch &flip)
Construct from components.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
setAction
Enumeration defining the valid actions.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define WarningInFunction
Report a warning using Foam::Warning.
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Ostream & endl(Ostream &os)
Add newline and flush stream.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)