Go to the documentation of this file.
57 faceSet::clearStorage();
126 addressing_(refCast<const faceZoneSet>(
set).addressing()),
127 flipMap_(refCast<const faceZoneSet>(
set).flipMap())
140 for (label facei = 0; facei < maxLen; ++facei)
149 addressing_.setSize(
n);
153 for (label facei = 0; facei < maxLen; ++facei)
157 addressing_[
n] = facei;
176 faceToIndex.insert(addressing_[i], i);
185 const auto iter = faceToIndex.cfind(facei);
189 const label index = *iter;
191 if (zoneSet.
flipMap()[i] != flipMap_[index])
195 newAddressing.
append(facei);
196 newFlipMap.append(flipMap_[index]);
203 <<
"subset : there are " << nConflict
204 <<
" faces with different orientation in faceZonesSets "
208 addressing_.transfer(newAddressing);
209 flipMap_.transfer(newFlipMap);
224 faceToIndex.insert(addressing_[i], i);
233 const auto iter = faceToIndex.cfind(facei);
237 const label index = *iter;
239 if (zoneSet.
flipMap()[i] != flipMap_[index])
246 newAddressing.
append(facei);
254 <<
"addSet : there are " << nConflict
255 <<
" faces with different orientation in faceZonesSets "
259 addressing_.transfer(newAddressing);
260 flipMap_.transfer(newFlipMap);
274 Map<label> faceToIndex(zoneSet.addressing().size());
275 forAll(zoneSet.addressing(), i)
277 faceToIndex.insert(zoneSet.addressing()[i], i);
282 const label facei = addressing_[i];
284 const auto iter = faceToIndex.cfind(facei);
288 const label index = *iter;
290 if (zoneSet.flipMap()[index] != flipMap_[i])
298 newAddressing.append(facei);
299 newFlipMap.append(zoneSet.flipMap()[i]);
306 <<
"subtractSet : there are " << nConflict
307 <<
" faces with different orientation in faceZonesSets "
311 addressing_.transfer(newAddressing);
312 flipMap_.transfer(newFlipMap);
332 <<
" faces that are in the faceZone but not"
333 <<
" in the faceSet or vice versa."
334 <<
" The faceZoneSet should only be manipulated"
335 <<
" using " << setsToFaceZone::typeName
336 <<
" or " << setToFaceZone::typeName <<
endl;
348 const label UNFLIPPED = 1;
349 const label FLIPPED = -1;
360 myZoneFace[bFacei] = FLIPPED;
364 myZoneFace[bFacei] = UNFLIPPED;
384 const label facei = addressing_[i];
387 newAddressing.append(facei);
388 newFlipMap.append(flipMap_[i]);
399 if (neiStat == UNFLIPPED)
402 newAddressing.
append(facei);
403 newFlipMap.append(
true);
405 else if (neiStat == FLIPPED)
407 newAddressing.append(facei);
408 newFlipMap.append(
false);
413 if (myStat == neiStat)
416 newAddressing.append(facei);
417 if (isMasterFace[facei])
419 newFlipMap.append(myStat == FLIPPED);
423 newFlipMap.append(neiStat == UNFLIPPED);
428 newAddressing.append(facei);
429 newFlipMap.append(myStat == FLIPPED);
434 addressing_.transfer(newAddressing);
435 flipMap_.transfer(newFlipMap);
453 word oldTypeName = typeName;
454 const_cast<word&
>(
type()) = faceSet::typeName;
456 const_cast<word&
>(
type()) = oldTypeName;
464 zoneID = faceZones.size();
466 faceZones.setSize(
zoneID+1);
482 faceZones[
zoneID].resetAddressing(addressing_, flipMap_);
486 return ok && faceZones.write(valid);
493 labelList newAddressing(addressing_.size());
494 boolList newFlipMap(flipMap_.size(),
false);
499 label facei = addressing_[i];
503 newAddressing[
n] = newFacei;
504 newFlipMap[
n] = flipMap_[i];
508 newAddressing.setSize(
n);
509 newFlipMap.setSize(
n);
511 addressing_.transfer(newAddressing);
512 flipMap_.transfer(newFlipMap);
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.
const boolList & flipMap() const noexcept
Return face flip map.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static constexpr const zero Zero
Global zero (0)
void updateSet()
Sort addressing and make faceSet part consistent with addressing.
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const boolList & flipMap() const
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
writeOption
Enumeration defining the write options.
static void check(const int retVal, const char *what)
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
UIndirectList< bool > boolUIndList
UIndirectList of bools.
patchWriters resize(patchIds.size())
A subset of mesh faces organised as a primitive patch.
virtual void invert(const label maxLen)
Invert contents.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
virtual bool set(const label id)
Set an index.
The IOstreamOption is a simple container for options an IOstream can normally have.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
Like faceSet but -reads data from faceZone -updates faceZone when writing.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
General set of labels of mesh quantity (points, cells, faces).
faceZoneSet(const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Construct from objectRegistry and name.
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
virtual void sync(const polyMesh &mesh)
Sync faceZoneSet across coupled patches.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write faceZone using stream options.
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
const labelIOList & zoneID
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
const labelList & reverseFaceMap() const
Reverse face map.
virtual void addSet(const topoSet &set)
Add elements present in set.
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
label nInternalFaces() const noexcept
Number of internal faces.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
label nFaces() const noexcept
Number of mesh faces.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
readOption
Enumeration defining the read options.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void clearAddressing()
Clear addressing.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
const labelList & addressing() const noexcept
The addressing used by the zone.
UIndirectList< label > labelUIndList
UIndirectList of labels.
Cell-face mesh analysis engine.