Go to the documentation of this file.
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);
179 const faceZoneSet& zoneSet = refCast<const faceZoneSet>(set);
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);
227 const faceZoneSet& zoneSet = refCast<const faceZoneSet>(set);
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);
272 const faceZoneSet& zoneSet = refCast<const faceZoneSet>(set);
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);
338 <<
" faces that are in the faceZone but not"
339 <<
" in the faceSet or vice versa."
340 <<
" The faceZoneSet should only be manipulated"
341 <<
" using " << setsToFaceZone::typeName
342 <<
" or " << setToFaceZone::typeName <<
endl;
354 const label UNFLIPPED = 1;
355 const label FLIPPED = -1;
366 myZoneFace[bFacei] = FLIPPED;
370 myZoneFace[bFacei] = UNFLIPPED;
390 const label facei = addressing_[i];
393 newAddressing.append(facei);
394 newFlipMap.append(flipMap_[i]);
405 if (neiStat == UNFLIPPED)
408 newAddressing.
append(facei);
409 newFlipMap.append(
true);
411 else if (neiStat == FLIPPED)
413 newAddressing.append(facei);
414 newFlipMap.append(
false);
419 if (myStat == neiStat)
422 newAddressing.append(facei);
423 if (isMasterFace[facei])
425 newFlipMap.append(myStat == FLIPPED);
429 newFlipMap.append(neiStat == UNFLIPPED);
434 newAddressing.append(facei);
435 newFlipMap.append(myStat == FLIPPED);
440 addressing_.transfer(newAddressing);
441 flipMap_.transfer(newFlipMap);
461 word oldTypeName = typeName;
462 const_cast<word&
>(
type()) = faceSet::typeName;
464 const_cast<word&
>(
type()) = oldTypeName;
472 zoneID = faceZones.size();
474 faceZones.setSize(
zoneID+1);
490 faceZones[
zoneID].resetAddressing(addressing_, flipMap_);
494 return ok && faceZones.write(valid);
501 labelList newAddressing(addressing_.size());
502 boolList newFlipMap(flipMap_.size(),
false);
507 label facei = addressing_[i];
511 newAddressing[
n] = newFacei;
512 newFlipMap[
n] = flipMap_[i];
516 newAddressing.setSize(
n);
517 newFlipMap.setSize(
n);
519 addressing_.transfer(newAddressing);
520 flipMap_.transfer(newFlipMap);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
label size() const noexcept
The number of elements in table.
const labelList & addressing() const
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write using given format, version and compression.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static constexpr const zero Zero
Global zero.
label nInternalFaces() const
Number of internal faces.
void updateSet()
Sort addressing and make faceSet part consistent with addressing.
label nFaces() const
Number of mesh faces.
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.
const faceZoneMesh & faceZones() const
Return face zone mesh.
writeOption
Enumeration defining the write options.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
UIndirectList< bool > boolUIndList
UIndirectList of bools.
Representation of a major/minor version number.
A subset of mesh faces organised as a primitive patch.
virtual void invert(const label maxLen)
Invert contents.
word name(const complex &c)
Return string representation of complex.
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.
void resize(const label sz)
Resize the hash table for efficiency.
Like faceSet but -reads data from faceZone -updates faceZone when writing.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write faceZone.
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.
streamFormat
Data format (ascii | binary)
label nBoundaryFaces() const
Number of boundary faces (== nFaces - nInternalFaces)
Macros for easy insertion into run-time selection tables.
const labelIOList & zoneID
label findZoneID(const word &zoneName) const
Find zone index given a 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.
void clearStorage()
Clear the table entries and the table itself.
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.
const dimensionedScalar c
Speed of light in a vacuum.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
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.
const boolList & flipMap() const
Return face flip map.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
UIndirectList< label > labelUIndList
UIndirectList of labels.
Cell-face mesh analysis engine.