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]
155 <<
"- selecting cells using cellSet " << cellSetName_ <<
endl;
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.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
#define forAll(list, i)
Loop across all elements in list.
void setSelection(const dictionary &dict)
Set the cellSet or points selection.
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 (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
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.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
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 const Enum< selectionModeType > selectionModeTypeNames_
List of selection mode type names.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static unsigned int defaultPrecision()
Return the default precision.
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.
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.
void setCellSet()
Set the cell set based on the user input selection mode.