47 const word& faceSetName,
48 const word& cellSetName,
53 faceSetName_(faceSetName),
54 cellSetName_(cellSetName),
66 faceSetName_(dict.
lookup(
"faceSet")),
67 cellSetName_(dict.
lookup(
"cellSet")),
86 if (!isA<faceZoneSet>(
set))
89 <<
"Operation only allowed on a faceZoneSet." <<
endl;
97 Info<<
" Adding all faces from faceSet " << faceSetName_
101 faceSet fSet(mesh_, faceSetName_);
102 cellSet cSet(mesh_, cellSetName_);
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);
169 Info<<
" Removing all faces from faceSet " << faceSetName_
184 newFlipMap.append(fzSet.
flipMap()[i]);
const boolList & flipMap() const
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return name.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
setsToFaceZone(const polyMesh &mesh, const word &faceSetName, const word &cellSetName, const Switch &flip)
Construct from components.
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
virtual ~setsToFaceZone()
Destructor.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
bool found(const Key &) const
Return true if hashedEntry is found in table.
A class for handling words, derived from string.
setAction
Enumeration defining the valid actions.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
void updateSet()
Sort addressing and make faceSet part consistent with addressing.
Like faceSet but -reads data from faceZone -updates faceZone when writing.
General set of labels of mesh quantity (points, cells, faces).
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
A collection of cell labels.
Mesh consisting of general polyhedral cells.
const labelList & addressing() const
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.