Go to the documentation of this file.
43 template<>
const char* NamedEnum
88 <<
"Unknown selectionMode "
99 switch (selectionMode_)
109 label cellI = mesh_.findCell(points_[i]);
112 selectedCells.
insert(cellI);
119 <<
"Unable to find owner cell for point " << points_[i]
125 cells_ = selectedCells.
toc();
132 <<
"- selecting cells using cellSet " << cellSetName_ <<
endl;
134 cellSet selectedCells(mesh_, cellSetName_);
135 cells_ = selectedCells.
toc();
142 <<
"- selecting cells using cellZone " << cellSetName_ <<
endl;
144 label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
148 <<
"Cannot find cellZone " << cellSetName_ <<
endl
149 <<
"Valid cellZones are " << mesh_.cellZones().names()
152 cells_ = mesh_.cellZones()[zoneID];
166 <<
"Unknown selectionMode "
167 << selectionModeTypeNames_[selectionMode_]
168 <<
". Valid selectionMode types are" << selectionModeTypeNames_
177 V_ += mesh_.V()[cells_[i]];
183 <<
" cell(s) with volume " << V_ <<
endl;
192 const word& modelType,
202 selectionModeTypeNames_.read(coeffs_.lookup(
"selectionMode"))
204 cellSetName_(
"none"),
209 setSelection(coeffs_);
228 if (mesh_.changing())
A class for handling words, derived from string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
List< Key > toc() const
Return the table of contents.
#define forAll(list, i)
Loop across all elements in list.
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 *, int32_t &)
virtual ~cellSetOption()
Destructor.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
void setSelection(const dictionary &dict)
Set the cellSet or points selection.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Finite volume options abtract base class. Provides a base set of controls, e.g.
static const NamedEnum< selectionModeType, 4 > selectionModeTypeNames_
Word list of selection mode type names.
virtual bool isActive()
Is the source active?
selectionModeType
Enumeration for selection mode types.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
A list of keyword definitions, which are a keyword followed by any number of values (e....
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 isActive()
Is the source active?
errorManipArg< error, int > exit(error &err, const int errNo=1)
defineTypeNameAndDebug(option, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool insert(const Key &key)
Insert a new entry.
word cellSetName_
Name of cell set for "cellSet" and "cellZone" selectionMode.
List< point > points_
List of points for "points" selectionMode.
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.
void setCellSet()
Set the cell set based on the user input selection mode.
Initialise the NamedEnum HashTable from the static list of names.