Go to the documentation of this file.
35 Foam::fvMeshSubsetProxy::fvMeshSubsetProxy(
fvMesh& baseMesh)
52 Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
56 const word& selectionName,
62 exposedPatchId_(exposedPatchId),
63 type_(selectionName.empty() ? NONE :
type),
72 names_.first() = selectionName;
74 else if (type_ != NONE)
76 name_ = selectionName;
86 Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
95 exposedPatchId_(exposedPatchId),
108 Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
116 subsetter_(baseMesh),
117 exposedPatchId_(exposedPatchId),
120 names_(std::move(zoneNames)),
137 selectedCells_.clearStorage();
141 const label nCells = baseMesh_.nCells();
149 Info<<
"Subsetting mesh based on cellSet " << name_ <<
endl;
152 cellSet cset(baseMesh_, name_);
154 selectedCells.
resize(nCells);
155 for (
const label idx : cset)
157 selectedCells.
set(idx);
160 else if (type_ == ZONE)
164 Info<<
"Subsetting mesh based on cellZone " << name_ <<
endl;
167 selectedCells.
resize(nCells);
168 selectedCells.
set(baseMesh_.cellZones()[name_]);
170 else if (type_ == ZONES)
174 Info<<
"Subsetting mesh based on cellZones "
178 selectedCells = baseMesh_.cellZones().selection(names_);
182 const bool changed = (selectedCells_ != selectedCells);
185 selectedCells_.
transfer(selectedCells);
187 if (changed || selectedCells_.empty())
189 subsetter_.setCellSubset(selectedCells_, exposedPatchId_);
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)
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void resize(const label nElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
subsetType
Internal bookkeeping for subset type.
bool useSubMesh() const
Check if a sub-mesh is being used.
messageStream Info
Information stream (uses stdout - output is on the master only)
Mesh data needed to do the Finite Volume discretisation.
A collection of cell labels.
readUpdateState
Enumeration defining the state of the mesh after a read update.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
A List of wordRe with additional matching capabilities.
bool correct(bool verbose=false)
Update of mesh subset.
polyMesh::readUpdateState readUpdate()
Read mesh. Correct on topo-change.
void transfer(bitSet &bitset)