Go to the documentation of this file.
47 setsToFaceZone::typeName,
48 "\n Usage: setsToFaceZone <faceSet> <slaveCellSet>\n\n"
49 " Select all faces in the faceSet."
50 " Orientated so slave side is in cellSet.\n\n"
59 const word& faceSetName,
60 const word& cellSetName,
65 faceSetName_(faceSetName),
66 cellSetName_(cellSetName),
78 faceSetName_(
dict.get<
word>(
"faceSet")),
79 cellSetName_(
dict.get<
word>(
"cellSet")),
80 flip_(
dict.lookupOrDefault(
"flip",
false))
91 faceSetName_(checkIs(is)),
92 cellSetName_(checkIs(is)),
105 if (!isA<faceZoneSet>(set))
108 <<
"Operation only allowed on a faceZoneSet." <<
endl;
114 if (action == topoSetSource::ADD || action == topoSetSource::NEW)
120 Info<<
" Adding all faces from faceSet " << faceSetName_
121 <<
"; orientation pointing into cellSet "
122 << cellSetName_ <<
" ..." <<
endl;
126 Info<<
" Adding all faces from faceSet " << faceSetName_
127 <<
"; orientation pointing away from cellSet "
128 << cellSetName_ <<
" ..." <<
endl;
133 faceSet fSet(mesh_, faceSetName_);
134 cellSet cSet(mesh_, cellSetName_);
140 for (
const label facei : fSet)
142 if (!zoneSet.
found(facei))
144 bool flipFace =
false;
146 const label own = mesh_.faceOwner()[facei];
147 const bool ownFound = cSet.
found(own);
149 if (mesh_.isInternalFace(facei))
151 label nei = mesh_.faceNeighbour()[facei];
152 bool neiFound = cSet.
found(nei);
154 if (ownFound && !neiFound)
158 else if (!ownFound && neiFound)
165 <<
"One of owner or neighbour of internal face "
166 << facei <<
" should be in cellSet "
168 <<
" to be able to determine orientation."
170 <<
"Face:" << facei <<
" own:" << own
171 <<
" OwnInCellSet:" << ownFound
173 <<
" NeiInCellSet:" << neiFound
179 flipFace = !ownFound;
185 flipFace = !flipFace;
188 newAddressing.append(facei);
189 newFlipMap.append(flipFace);
197 else if (action == topoSetSource::SUBTRACT)
201 Info<<
" Removing all faces from faceSet " << faceSetName_
216 newAddressing.append(zoneSet.
addressing()[i]);
217 newFlipMap.append(zoneSet.
flipMap()[i]);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
const labelList & addressing() const
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
void updateSet()
Sort addressing and make faceSet part consistent with addressing.
Class with constructor to add usage string to table.
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
const boolList & flipMap() const
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
setsToFaceZone(const polyMesh &mesh, const word &faceSetName, const word &cellSetName, const bool flip)
Construct from components.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
virtual bool found(const label id) const
Has the given index?
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (uses stdout - output is on the master only)
void transfer(List< T > &list)
Like faceSet but -reads data from faceZone -updates faceZone when writing.
General set of labels of mesh quantity (points, cells, faces).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
A collection of cell labels.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.