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 "
205 <<
name() <<
" and " << set.name() <<
endl;
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 "
256 <<
name() <<
" and " << set.name() <<
endl;
259 addressing_.transfer(newAddressing);
260 flipMap_.transfer(newFlipMap);
272 const faceZoneSet& zoneSet = refCast<const faceZoneSet>(set);
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);
306 <<
"subtractSet : there are " << nConflict
307 <<
" faces with different orientation in faceZonesSets "
308 <<
name() <<
" and " << set.name() <<
endl;
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"
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);
405 else if (neiStat == FLIPPED)
407 newAddressing.
append(facei);
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;
456 const_cast<word&
>(
type()) = oldTypeName;
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];
511 addressing_.transfer(newAddressing);
512 flipMap_.transfer(newFlipMap);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
label maxSize() const
The max row length used.
void invert()
Return the matrix inverse into itself if no elem is equal to zero.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
virtual bool resize()
Resize the ODE solver.
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
const word & name() const noexcept
Return the object name.
writeOption
Enumeration defining the write options.
readOption
Enumeration defining the read options.
The IOstreamOption is a simple container for options an IOstream can normally have.
void setSize(const label n)
Alias for resize()
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void clearStorage()
Clear the list and delete storage.
const T * set(const label i) const
void setSize(const label newLen)
Same as resize()
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of elements in the list.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
void clearAddressing()
Clear addressing.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
Like faceSet but -reads data from faceZone -updates faceZone when writing.
const boolList & flipMap() const noexcept
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write faceZone using stream options.
const labelList & addressing() const noexcept
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 updateSet()
Sort addressing and make faceSet part consistent with addressing.
A subset of mesh faces organised as a primitive patch.
const boolList & flipMap() const noexcept
Return face flip map.
void sync()
Do all: synchronise all IOFields and objectRegistry.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & reverseFaceMap() const
Reverse face map.
void updateMesh()
Update for new mesh topology.
Mesh consisting of general polyhedral cells.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
Cell-face mesh analysis engine.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
label nInternalFaces() const noexcept
Number of internal faces.
label nFaces() const noexcept
Number of mesh faces.
void writeDebug() const
Debug write.
virtual bool write(const bool valid=true) const
Write using setting from DB.
General set of labels of mesh quantity (points, cells, faces).
virtual void check(const label maxSize)
Check limits on addressable range.
bool set() const
Are all the vector set.
A class for handling words, derived from Foam::string.
const labelList & addressing() const noexcept
The addressing used by the zone.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
const labelIOList & zoneID
#define WarningInFunction
Report a warning using Foam::Warning.
To & refCast(From &r)
Reference type cast template function.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
UIndirectList< bool > boolUIndList
UIndirectList of bools.
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
UIndirectList< label > labelUIndList
UIndirectList of labels.
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.