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),
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;
116 faceZoneSet& zoneSet = refCast<faceZoneSet>(
set);
122 Info<<
" Adding all faces from face set: " 123 << faceSetName_ <<
"; orientation pointing ";
134 Info<<
" cell set: " << cellSetName_ <<
" ..." <<
endl;
142 DynamicList<label> newAddressing(zoneSet.addressing());
143 DynamicList<bool> newFlipMap(zoneSet.flipMap());
145 for (
const label facei : fSet)
147 if (!zoneSet.found(facei))
149 bool flipFace =
false;
152 const bool ownFound = cSet.
found(own);
157 bool neiFound = cSet.
found(nei);
159 if (ownFound && !neiFound)
163 else if (!ownFound && neiFound)
170 <<
"One of owner or neighbour of internal face " 171 << facei <<
" should be in cellSet " 173 <<
" to be able to determine orientation." 175 <<
"Face:" << facei <<
" own:" << own
176 <<
" OwnInCellSet:" << ownFound
178 <<
" NeiInCellSet:" << neiFound
184 flipFace = !ownFound;
190 flipFace = !flipFace;
193 newAddressing.append(facei);
194 newFlipMap.append(flipFace);
198 zoneSet.addressing().transfer(newAddressing);
199 zoneSet.flipMap().transfer(newFlipMap);
206 Info<<
" Removing all faces from face set: " 207 << faceSetName_ <<
" ..." <<
endl;
211 faceZoneSet loadedSet(
mesh_, faceSetName_);
214 DynamicList<label> newAddressing(zoneSet.addressing().size());
215 DynamicList<bool> newFlipMap(zoneSet.flipMap().size());
217 forAll(zoneSet.addressing(), i)
219 if (!loadedSet.found(zoneSet.addressing()[i]))
221 newAddressing.append(zoneSet.addressing()[i]);
222 newFlipMap.append(zoneSet.flipMap()[i]);
225 zoneSet.addressing().transfer(newAddressing);
226 zoneSet.flipMap().transfer(newFlipMap);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
setsToFaceZone(const polyMesh &mesh, const word &faceSetName, const word &cellSetName, const bool flip)
Construct from components.
bool verbose_
Output verbosity (default: true)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
virtual const labelList & faceNeighbour() const
Return face neighbour.
Create a new set and ADD elements to it.
Add elements to current set.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool found(const T &val, label pos=0) const
Same as contains()
Macros for easy insertion into run-time selection tables.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
#define forAll(list, i)
Loop across all elements in list.
A class for handling words, derived from Foam::string.
setAction
Enumeration defining various actions.
virtual const labelList & faceOwner() const
Return face owner.
const polyMesh & mesh_
Reference to the mesh.
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
Subtract elements from current set.
#define WarningInFunction
Report a warning using Foam::Warning.
Class with constructor to add usage string to table.
messageStream Info
Information stream (stdout output on master, null elsewhere)
The topoSetFaceZoneSource is a intermediate class for handling topoSet sources for selecting face zon...
Mesh consisting of general polyhedral cells.
Do not request registration (bool: false)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)