51 { selectionModeType::smGeometric,
"geometric" },
52 { selectionModeType::smPoints,
"points" },
53 { selectionModeType::smCellSet,
"cellSet" },
54 { selectionModeType::smCellZone,
"cellZone" },
55 { selectionModeType::smAll,
"all" },
92 <<
"Unknown selectionMode "
94 <<
". Valid selectionMode types : "
107 for (
const label celli : cells_)
109 sumVol += mesh_.V()[celli];
113 const scalar VOld = V_;
120 if (VName != VOldName)
124 <<
" cell(s) with volume " << V_ <<
endl;
131 switch (selectionMode_)
153 for (
const point&
p : points_)
155 const label celli = mesh_.findCell(
p);
157 const bool found = (celli >= 0);
161 selectedCells.
insert(celli);
167 <<
"No owner cell found for point " <<
p <<
endl;
177 <<
"- selecting cells using cellSet " << zoneName_ <<
endl;
185 <<
"- selecting cells using cellZone " << zoneName_ <<
endl;
193 <<
"No matching cellZones: " << zoneName_ <<
nl
204 cells_ = mesh_.cellZones()[
zoneIDs.first()];
208 cells_ = mesh_.cellZones().selection(
zoneIDs).sortedToc();
222 <<
"Unknown selectionMode "
223 << selectionModeTypeNames_[selectionMode_]
224 <<
". Valid selectionMode types are "
225 << selectionModeTypeNames_
232 smAll != selectionMode_
237 <<
"No cells selected!" <<
endl;
247 const word& modelType,
255 selectionMode_(selectionModeTypeNames_.get(
"selectionMode", coeffs_)),
258 geometricSelection_(),
277 if (mesh_.changing())
279 if (mesh_.topoChanging())
287 selectionMode_ == smGeometric
288 || selectionMode_ == smPoints
310 if (coeffs_.readIfPresent(
"timeStart", timeStart_))
312 coeffs_.readEntry(
"duration", duration_);
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
static unsigned int defaultPrecision() noexcept
Return the default precision.
virtual bool read()
Re-read model coefficients if they have changed.
virtual word timeName() const
Return current time name.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
labelList sortedToc() const
The indices of the on bits as a sorted labelList.
static bitSet select(const polyMesh &mesh, const dictionary &dict, const bool verbosity=false)
A collection of cell labels.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Mesh data needed to do the Finite Volume discretisation.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
dictionary geometricSelection_
Dictionary entries for "geometric" (topoSetCellSource) selection.
List< point > points_
List of points for "points" selectionMode.
void setSelection(const dictionary &dict)
Set cell selection name or points selection from dictionary input.
selectionModeType
Enumeration for selection mode types.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual bool isActive()
Is the source active?
wordRe zoneName_
Name of set/zone for "cellSet" and "cellZone" selectionMode.
selectionModeType selectionMode_
Cell selection mode.
static const Enum< selectionModeType > selectionModeTypeNames_
List of selection mode type names.
void setCellSelection()
Set the cell selection based on user input selection mode.
void setVol()
Recalculate the volume.
Base abstract class for handling finite volume options (i.e. fvOption).
dictionary coeffs_
Dictionary containing source coefficients.
virtual bool isActive()
Is the source active?
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelIOList & zoneIDs
#define WarningInFunction
Report a warning using Foam::Warning.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
constexpr char nl
The newline '\n' character (0x0a)