35void Foam::fvMeshSubsetProxy::clearOut()
41 selectedCells_.clearStorage();
47Foam::fvMeshSubsetProxy::fvMeshSubsetProxy(
fvMesh& baseMesh)
59Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
62 const subsetType
type,
63 const word& selectionName,
69 exposedPatchId_(exposedPatchId),
70 type_(selectionName.empty() ? subsetType::NONE :
type),
79 names_.
first() = selectionName;
83 name_ = selectionName;
90Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
93 const wordRes& zoneNames,
99 exposedPatchId_(exposedPatchId),
100 type_(subsetType::ZONES),
109Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
117 subsetter_(baseMesh),
118 exposedPatchId_(exposedPatchId),
119 type_(subsetType::ZONES),
121 names_(std::move(zoneNames)),
132 fvMeshSubsetProxy::clearOut();
134 if (!zoneNames.
empty())
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;
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_);
@ NO_REGISTER
Do not request registration (bool: false).
void resize(const label len)
Adjust allocated size of list.
T & first()
Access first element of the list, position [0].
bool empty() const noexcept
True if List is empty (ie, size() is zero).
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void transfer(bitSet &bitset)
Transfer the contents of the argument list into this list and annul the argument list.
A collection of cell labels.
const fvMesh & baseMesh() const noexcept
The entire base mesh.
const bitSet & selectedCells() const noexcept
The current cell selection, when subsetting is active.
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.
bool correct(bool verbose=false)
Update of mesh subset.
Mesh data needed to do the Finite Volume discretisation.
Database for mesh data, solution data, solver performance and other reduced data.
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.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
messageStream Info
Information stream (stdout output on master, null elsewhere).
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.