Go to the documentation of this file.
50 setsToFaceZone::typeName,
51 "\n Usage: setsToFaceZone <faceSet> <slaveCellSet>\n\n"
52 " Select all faces in the faceSet."
53 " Orientated so slave side is in cellSet.\n\n"
62 const word& faceSetName,
63 const word& cellSetName,
68 faceSetName_(faceSetName),
69 cellSetName_(cellSetName),
81 faceSetName_(
dict.get<
word>(
"faceSet")),
82 cellSetName_(
dict.get<
word>(
"cellSet")),
83 flip_(
dict.getOrDefault(
"flip",
false))
94 faceSetName_(checkIs(is)),
95 cellSetName_(checkIs(is)),
108 if (!isA<faceZoneSet>(
set))
111 <<
"Operation only allowed on a faceZoneSet." <<
endl;
118 if (action == topoSetSource::ADD || action == topoSetSource::NEW)
124 Info<<
" Adding all faces from faceSet " << faceSetName_
125 <<
"; orientation pointing into cellSet "
126 << cellSetName_ <<
" ..." <<
endl;
130 Info<<
" Adding all faces from faceSet " << faceSetName_
131 <<
"; orientation pointing away from cellSet "
132 << cellSetName_ <<
" ..." <<
endl;
137 faceSet fSet(mesh_, faceSetName_);
138 cellSet cSet(mesh_, cellSetName_);
144 for (
const label facei : fSet)
146 if (!zoneSet.
found(facei))
148 bool flipFace =
false;
150 const label own = mesh_.faceOwner()[facei];
151 const bool ownFound = cSet.
found(own);
153 if (mesh_.isInternalFace(facei))
155 label nei = mesh_.faceNeighbour()[facei];
156 bool neiFound = cSet.
found(nei);
158 if (ownFound && !neiFound)
162 else if (!ownFound && neiFound)
169 <<
"One of owner or neighbour of internal face "
170 << facei <<
" should be in cellSet "
172 <<
" to be able to determine orientation."
174 <<
"Face:" << facei <<
" own:" << own
175 <<
" OwnInCellSet:" << ownFound
177 <<
" NeiInCellSet:" << neiFound
183 flipFace = !ownFound;
189 flipFace = !flipFace;
192 newAddressing.append(facei);
193 newFlipMap.append(flipFace);
201 else if (action == topoSetSource::SUBTRACT)
205 Info<<
" Removing all faces from faceSet " << faceSetName_
220 newAddressing.append(zoneSet.
addressing()[i]);
221 newFlipMap.append(zoneSet.
flipMap()[i]);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
const labelList & addressing() const
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
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.
The topoSetFaceZoneSource is a intermediate class for handling topoSet sources for selecting face zon...
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?
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (stdout output on master, null elsewhere)
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.
A collection of cell labels.
const word & name() const noexcept
Return name.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.