92 const faceZone& fz = faceZones[zoneID];
130 addressing_(refCast<const faceZoneSet>(
set).
addressing()),
131 flipMap_(refCast<const faceZoneSet>(
set).
flipMap())
150 for (
label facei = 0; facei < maxLen; facei++)
163 for (
label facei = 0; facei < maxLen; facei++)
167 addressing_[
n] = facei;
186 faceToIndex.insert(addressing_[i], i);
189 const faceZoneSet& fSet = refCast<const faceZoneSet>(
set);
197 if (iter != faceToIndex.
end())
199 label index = iter();
201 if (fSet.
flipMap()[i] != flipMap_[index])
205 newAddressing.append(facei);
206 newFlipMap.append(flipMap_[index]);
213 <<
"subset : there are " << nConflict
214 <<
" faces with different orientation in faceZonesSets " 215 <<
name() <<
" and " <<
set.name() <<
endl;
218 addressing_.
transfer(newAddressing);
234 faceToIndex.insert(addressing_[i], i);
237 const faceZoneSet& fSet = refCast<const faceZoneSet>(
set);
245 if (iter != faceToIndex.
end())
247 label index = iter();
249 if (fSet.
flipMap()[i] != flipMap_[index])
256 newAddressing.
append(facei);
264 <<
"addSet : there are " << nConflict
265 <<
" faces with different orientation in faceZonesSets " 266 <<
name() <<
" and " <<
set.name() <<
endl;
269 addressing_.
transfer(newAddressing);
282 const faceZoneSet& fSet = refCast<const faceZoneSet>(
set);
285 forAll(fSet.addressing(), i)
287 faceToIndex.insert(fSet.addressing()[i], i);
292 label facei = addressing_[i];
296 if (iter != faceToIndex.
end())
298 label index = iter();
300 if (fSet.flipMap()[index] != flipMap_[i])
308 newAddressing.append(facei);
309 newFlipMap.append(fSet.flipMap()[i]);
316 <<
"deleteSet : there are " << nConflict
317 <<
" faces with different orientation in faceZonesSets " 318 <<
name() <<
" and " <<
set.name() <<
endl;
321 addressing_.
transfer(newAddressing);
348 <<
" faces that are in the faceZone but not" 349 <<
" in the faceSet or vice versa." 350 <<
" The faceZoneSet should only be manipulated" 351 <<
" using " << setsToFaceZone::typeName
352 <<
" or " << setToFaceZone::typeName <<
endl;
364 const label UNFLIPPED = 1;
365 const label FLIPPED = -1;
376 myZoneFace[bFacei] = FLIPPED;
380 myZoneFace[bFacei] = UNFLIPPED;
400 label facei = addressing_[i];
403 newAddressing.
append(facei);
404 newFlipMap.append(flipMap_[i]);
415 if (neiStat == UNFLIPPED)
418 newAddressing.
append(facei);
419 newFlipMap.append(
true);
421 else if (neiStat == FLIPPED)
423 newAddressing.append(facei);
424 newFlipMap.append(
false);
429 if (myStat == neiStat)
432 newAddressing.append(facei);
433 if (isMasterFace[facei])
435 newFlipMap.append(myStat == FLIPPED);
439 newFlipMap.append(neiStat == UNFLIPPED);
444 newAddressing.append(facei);
445 newFlipMap.append(myStat == FLIPPED);
450 addressing_.
transfer(newAddressing);
471 word oldTypeName = typeName;
472 const_cast<word&
>(
type()) = faceSet::typeName;
474 const_cast<word&
>(
type()) = oldTypeName;
482 zoneID = faceZones.
size();
500 faceZones[zoneID].resetAddressing(addressing_, flipMap_);
504 return ok && faceZones.
write(valid);
517 label facei = addressing_[i];
521 newAddressing[
n] = newFacei;
522 newFlipMap[
n] = flipMap_[i];
527 newFlipMap.setSize(n);
529 addressing_.
transfer(newAddressing);
const boolList & flipMap() const
faceZoneSet(const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Construct from objectRegistry and name.
#define forAll(list, i)
Loop across all elements in list.
writeOption
Enumeration defining the write options.
void clearAddressing()
Clear addressing.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
bool set(const label) const
Is element set.
const faceZoneMesh & faceZones() const
Return face zone mesh.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
label nInternalFaces() const
Cell-face mesh analysis engine.
virtual void invert(const label maxLen)
Invert contents. (insert all members 0..maxLen-1 which were not in.
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write faceZone.
readOption
Enumeration defining the read options.
bool insert(const label &key)
Insert a new entry.
virtual void deleteSet(const topoSet &set)
Delete elements present in set.
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
void check(const label maxLabel)
Check validity of contents.
label size() const
Return number of elements in table.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
virtual ~faceZoneSet()
Destructor.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write using given format, version and compression.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
label findZoneID(const word &zoneName) const
Find zone index given a name.
bool found(const label &) const
Return true if hashedEntry is found in table.
A class for handling words, derived from string.
label size() const
Return the number of elements in the list.
void append(const T &)
Append an element at the end of the list.
streamFormat
Enumeration for the format of data in the stream.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
compressionType
Enumeration for the format of data in the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
faceSet(const IOobject &obj)
Construct from IOobject.
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
defineTypeNameAndDebug(combustionModel, 0)
virtual void sync(const polyMesh &mesh)
Sync faceZoneSet across coupled patches.
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).
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual void addSet(const topoSet &set)
Add elements present in set.
A List with indirect addressing.
void resize(const label newSize)
Resize the hash table for efficiency.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Mesh consisting of general polyhedral cells.
A subset of mesh faces organised as a primitive patch.
virtual bool write(const bool valid=true) const
Write using setting from DB.
const labelList & addressing() const
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
const labelList & reverseFaceMap() const
Reverse face map.
void clearStorage()
Clear the table entries and the table itself.