81 const cellZone& fz = cellZones[zoneID];
130 for (label celli = 0; celli < maxLen; ++celli)
139 addressing_.setSize(
n);
142 for (label celli = 0; celli < maxLen; ++celli)
146 addressing_[
n] = celli;
157 DynamicList<label> newAddressing(addressing_.size());
159 const cellZoneSet& zoneSet = refCast<const cellZoneSet>(
set);
161 for (
const label celli : zoneSet.addressing())
165 newAddressing.append(celli);
169 addressing_.transfer(newAddressing);
176 DynamicList<label> newAddressing(addressing_);
178 const cellZoneSet& zoneSet = refCast<const cellZoneSet>(
set);
180 for (
const label celli : zoneSet.addressing())
184 newAddressing.append(celli);
188 addressing_.transfer(newAddressing);
195 DynamicList<label> newAddressing(addressing_.size());
197 const cellZoneSet& zoneSet = refCast<const cellZoneSet>(
set);
199 for (
const label celli : addressing_)
201 if (!zoneSet.found(celli))
204 newAddressing.append(celli);
208 addressing_.transfer(newAddressing);
232 const bool writeOnProc
236 word oldTypeName = typeName;
237 const_cast<word&
>(
type()) = cellSet::typeName;
239 const_cast<word&
>(
type()) = oldTypeName;
247 zoneID = cellZones.
size();
264 cellZones[zoneID] = addressing_;
268 return ok && cellZones.
write(writeOnProc);
275 labelList newAddressing(addressing_.size());
278 for (
const label celli : addressing_)
280 label newCelli = morphMap.reverseCellMap()[celli];
283 newAddressing[
n] = newCelli;
287 newAddressing.resize(
n);
289 addressing_.transfer(newAddressing);
writeOption
Enumeration defining write preferences.
void size(const label n)
Older name for setAddressableSize.
void clearAddressing()
Clear addressing.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
const word & name() const noexcept
Return the object name.
Cell-face mesh analysis engine.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Type & refCast(U &obj)
A dynamic_cast (for references). Generates a FatalError on failed casts and uses the virtual type() m...
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
virtual bool set(const label id)
Set an index.
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Like cellSet but -reads data from cellZone -updates cellZone when writing.
virtual void addSet(const topoSet &set)
Add elements present in set.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write cellZone using stream options.
A simple container for options an IOstream can normally have.
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
Macros for easy insertion into run-time selection tables.
void resize(const label sz)
Resize the hash table for efficiency.
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
A class for handling words, derived from Foam::string.
void updateSet()
Sort addressing and make cellSet part consistent with addressing.
label size() const noexcept
The number of entries in the list.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void invert(const label maxLen)
Invert contents.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
void setSize(const label newLen)
Same as resize()
bool isReadRequired() const noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
General set of labels of mesh quantity (points, cells, faces).
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
label nCells() const noexcept
Number of mesh cells.
A collection of cell labels.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
Mesh consisting of general polyhedral cells.
cellZoneSet(const polyMesh &mesh, const word &name, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE)
Construct from objectRegistry and name.
virtual void sync(const polyMesh &mesh)
Sync cellSet across coupled patches; update cellZone from cellSet.
List< label > labelList
A List of labels.
virtual void check(const label maxSize)
Check limits on addressable range.
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
virtual void sync(const polyMesh &mesh)
Sync cellSet across coupled patches.
void clearStorage()
Clear the table entries and the table itself.
readOption
Enumeration defining read preferences.