50 cellToFaceZone::typeName,
51 "\n Usage: cellToFaceZone <slaveCellSet>\n\n" 52 " Select all outside faces in the cellSet." 53 " Orientated so slave side is in cellSet.\n\n" 59 void Foam::cellToFaceZone::selectFaces
82 for (label facei = 0; facei < nInt; ++facei)
84 const bool ownFound = cSet.found(own[facei]);
85 const bool neiFound = cSet.found(nei[facei]);
87 if (ownFound && !neiFound)
89 selectedFace.
set(facei);
90 doFlip.set(facei, flip_);
92 else if (!ownFound && neiFound)
94 selectedFace.set(facei);
95 doFlip.set(facei, !flip_);
102 for (
const polyPatch& pp :
patches)
106 label facei = pp.start();
109 neiInSet[facei-nInt] = cSet.found(own[facei]);
118 for (
const polyPatch& pp :
patches)
120 label facei = pp.start();
123 const bool ownFound = cSet.found(own[facei]);
124 const bool neiFound = neiInSet[facei-nInt];
126 if (ownFound && !neiFound)
128 selectedFace.set(facei);
129 doFlip.set(facei, flip_);
131 else if (!ownFound && neiFound)
133 selectedFace.set(facei);
134 doFlip.set(facei, !flip_);
146 const polyMesh&
mesh,
152 names_(
one{}, setName),
159 const polyMesh&
mesh,
160 const dictionary&
dict 163 topoSetFaceZoneSource(
mesh),
165 flip_(
dict.getOrDefault(
"flip", false))
168 if (!
dict.readIfPresent(
"sets", names_))
178 const polyMesh&
mesh,
182 topoSetFaceZoneSource(
mesh),
183 names_(one{}, word(checkIs(is))),
196 if (!isA<faceZoneSet>(
set))
199 <<
"Operation only allowed on a faceZoneSet." <<
endl;
204 faceZoneSet& zoneSet = refCast<faceZoneSet>(
set);
212 Info<<
" Adding all faces on outside of cellSet " 214 <<
"; orientation pointing into cellSet" <<
endl;
218 Info<<
" Adding all faces on outside of cellSet " 220 <<
"; orientation pointing away from cellSet" <<
endl;
224 bitSet selectedFace(mesh_.nFaces());
225 bitSet doFlip(mesh_.nFaces());
226 for (
const word& setName : names_)
229 cellSet cSet(mesh_, setName);
231 selectFaces(cSet, selectedFace, doFlip);
235 DynamicList<label> newAddressing(zoneSet.addressing());
236 DynamicList<bool> newFlipMap(zoneSet.flipMap());
238 for (
const label facei : selectedFace)
240 if (!zoneSet.found(facei))
242 newAddressing.append(facei);
243 newFlipMap.append(doFlip[facei]);
247 zoneSet.addressing().transfer(newAddressing);
248 zoneSet.flipMap().transfer(newFlipMap);
255 Info<<
" Removing all faces on outside of cellSet " 260 bitSet selectedFace(mesh_.nFaces());
261 bitSet doFlip(mesh_.nFaces());
262 for (
const word& setName : names_)
265 cellSet cSet(mesh_, setName);
267 selectFaces(cSet, selectedFace, doFlip);
271 DynamicList<label> newAddressing(zoneSet.addressing().size());
272 DynamicList<bool> newFlipMap(zoneSet.flipMap().size());
274 for (
const label facei : selectedFace)
276 newAddressing.append(facei);
277 newFlipMap.append(doFlip[facei]);
279 zoneSet.addressing().transfer(newAddressing);
280 zoneSet.flipMap().transfer(newFlipMap);
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void resize(const label len)
Adjust allocated size of list.
virtual const labelList & faceNeighbour() const
Return face neighbour.
Create a new set and ADD elements to it.
Add elements to current set.
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
label nFaces() const noexcept
Number of mesh faces.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
setAction
Enumeration defining various actions.
virtual const labelList & faceOwner() const
Return face owner.
label nInternalFaces() const noexcept
Number of internal faces.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
const polyMesh & mesh_
Reference to the mesh.
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Subtract elements from current set.
#define WarningInFunction
Report a warning using Foam::Warning.
Class with constructor to add usage string to table.
cellToFaceZone(const polyMesh &mesh, const word &cellSetName, const bool flip)
Construct from components.
const polyBoundaryMesh & patches
messageStream Info
Information stream (stdout output on master, null elsewhere)
The topoSetFaceZoneSource is a intermediate class for handling topoSet sources for selecting face zon...
List< label > labelList
A List of labels.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
List< bool > boolList
A List of bools.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.