35 void Foam::fvMeshSubsetProxy::clearOut()
38 type_ = subsetType::NONE;
47 Foam::fvMeshSubsetProxy::fvMeshSubsetProxy(
fvMesh& baseMesh)
52 type_(subsetType::NONE),
59 Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
62 const subsetType
type,
63 const word& selectionName,
69 exposedPatchId_(exposedPatchId),
70 type_(selectionName.empty() ? subsetType::NONE :
type),
75 if (type_ == subsetType::ZONES)
79 names_.
first() = selectionName;
81 else if (type_ == subsetType::SET || type_ == subsetType::ZONE)
83 name_ = selectionName;
90 Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
93 const wordRes& zoneNames,
99 exposedPatchId_(exposedPatchId),
100 type_(subsetType::ZONES),
109 Foam::fvMeshSubsetProxy::fvMeshSubsetProxy
117 subsetter_(baseMesh),
118 exposedPatchId_(exposedPatchId),
119 type_(subsetType::ZONES),
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();
154 bitSet selectedCells;
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_);
void resize(const label len)
Adjust allocated size of list.
bool empty() const noexcept
True if List is empty (ie, size() is zero)
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void resetZones(const wordRes &zoneNames)
Define the zones selection, subset the mesh accordingly.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from Foam::string.
A List of wordRe with additional matching capabilities.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil) - psi) *pSat, rhoMin);# 1 "/home/chef2/andy/OpenFOAM/release/v2406/OpenFOAM-v2406/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
polyMesh::readUpdateState readUpdate()
Read mesh. Correct on topo-change.
Mesh data needed to do the Finite Volume discretisation.
bool correct(bool verbose=false)
Update of mesh subset.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void clearStorage()
Clear the list and delete storage.
readUpdateState
Enumeration defining the state of the mesh after a read update.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
Do not request registration (bool: false)
void clear()
Reset subMesh and all maps.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.