35void Foam::fvMeshSubsetProxy::clearOut()
63 const word& selectionName,
69 exposedPatchId_(exposedPatchId),
79 names_.
first() = selectionName;
83 name_ = selectionName;
99 exposedPatchId_(exposedPatchId),
117 subsetter_(baseMesh),
118 exposedPatchId_(exposedPatchId),
121 names_(std::move(zoneNames)),
132 fvMeshSubsetProxy::clearOut();
134 if (!zoneNames.
empty())
136 type_ = subsetType::ZONES;
145 if (type_ == subsetType::NONE)
148 selectedCells_.clearStorage();
152 const label nCells = baseMesh_.nCells();
156 if (type_ == subsetType::SET)
160 Info<<
"Subsetting mesh based on cellSet " << name_ <<
endl;
163 cellSet cset(baseMesh_, name_);
165 selectedCells.
resize(nCells);
166 for (
const label idx : cset)
168 selectedCells.
set(idx);
171 else if (type_ == subsetType::ZONE)
175 Info<<
"Subsetting mesh based on cellZone " << name_ <<
endl;
178 selectedCells.
resize(nCells);
179 selectedCells.
set(baseMesh_.cellZones()[name_]);
181 else if (type_ == subsetType::ZONES)
185 Info<<
"Subsetting mesh based on cellZones "
189 selectedCells = baseMesh_.cellZones().selection(names_);
193 const bool changed = (selectedCells_ != selectedCells);
196 selectedCells_.
transfer(selectedCells);
198 if (changed || selectedCells_.empty())
200 subsetter_.reset(selectedCells_, exposedPatchId_);
void resize(const label len)
Adjust allocated size of list.
void clear()
Clear the list, i.e. set size to zero.
void resize(const label numElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
void clearStorage()
Clear the list and delete storage.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
T & first()
Return the first element of the list.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
void transfer(bitSet &bitset)
A collection of cell labels.
Simple proxy for holding a mesh, or mesh-subset. The subMeshes are currently limited to cellSet or ce...
void resetZones(const wordRes &zoneNames)
Define the zones selection, subset the mesh accordingly.
polyMesh::readUpdateState readUpdate()
Read mesh. Correct on topo-change.
subsetType
Internal bookkeeping for subset type.
@ ZONES
Subset with multiple cellZones.
@ ZONE
Subset with a cellZone.
@ SET
Subset with a cellSet.
void clear()
Reset subMesh and all maps.
Mesh data needed to do the Finite Volume discretisation.
readUpdateState
Enumeration defining the state of the mesh after a read update.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
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.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.