Go to the documentation of this file.
49 { selectionModeType::smPoints,
"points" },
50 { selectionModeType::smCellSet,
"cellSet" },
51 { selectionModeType::smCellZone,
"cellZone" },
52 { selectionModeType::smAll,
"all" },
84 <<
"Unknown selectionMode "
86 <<
". Valid selectionMode types : "
99 for (
const label celli : cells_)
101 sumVol += mesh_.V()[celli];
105 const scalar VOld = V_;
112 if (VName != VOldName)
116 <<
" cell(s) with volume " << V_ <<
endl;
123 switch (selectionMode_)
133 label celli = mesh_.findCell(points_[i]);
136 selectedCells.
insert(celli);
143 <<
"Unable to find owner cell for point " << points_[i]
149 cells_ = selectedCells.sortedToc();
155 <<
"- selecting cells using cellSet " << cellSetName_ <<
endl;
157 cells_ =
cellSet(mesh_, cellSetName_).sortedToc();
163 <<
"- selecting cells using cellZone " << cellSetName_ <<
endl;
165 label
zoneID = mesh_.cellZones().findZoneID(cellSetName_);
169 <<
"Cannot find cellZone " << cellSetName_ <<
endl
170 <<
"Valid cellZones are " << mesh_.cellZones().names()
174 cells_ = mesh_.cellZones()[
zoneID];
187 <<
"Unknown selectionMode "
188 << selectionModeTypeNames_[selectionMode_]
189 <<
". Valid selectionMode types are "
190 << selectionModeTypeNames_
202 const word& modelType,
210 selectionMode_(selectionModeTypeNames_.get(
"selectionMode", coeffs_)),
211 cellSetName_(
"none"),
216 setSelection(coeffs_);
230 if (mesh_.changing())
232 if (mesh_.topoChanging())
238 else if (selectionMode_ == smPoints)
259 if (coeffs_.readIfPresent(
"timeStart", timeStart_))
261 coeffs_.readEntry(
"duration", duration_);
void setVol()
Recalculate the volume.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
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)
cellSetOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
selectionModeType selectionMode_
Cell selection mode.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void setCellSelection()
Set the cell selection based on user input selection mode.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
#define forAll(list, i)
Loop across all elements in list.
void setSelection(const dictionary &dict)
Set cell selection name or points selection from dictionary input.
virtual word timeName() const
Return current time name.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Base abstract class for handling finite volume options (i.e. fvOption).
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool isActive()
Is the source active?
virtual bool read(const dictionary &dict)
Read source dictionary.
selectionModeType
Enumeration for selection mode types.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const labelIOList & zoneID
Mesh data needed to do the Finite Volume discretisation.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
A collection of cell labels.
Ostream & indent(Ostream &os)
Indent stream.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual bool isActive()
Is the source active?
errorManipArg< error, int > exit(error &err, const int errNo=1)
static unsigned int defaultPrecision() noexcept
Return the default precision.
static const Enum< selectionModeType > selectionModeTypeNames_
List of selection mode type names.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
word cellSetName_
Name of set/zone for "cellSet" and "cellZone" selectionMode.
List< point > points_
List of points for "points" selectionMode.
#define WarningInFunction
Report a warning using Foam::Warning.