38 template<>
const char* NamedEnum
59 switch (selectionMode_)
63 dict.
lookup(
"points") >> points_;
68 dict.
lookup(
"cellSet") >> cellSetName_;
73 dict.
lookup(
"cellZone") >> cellSetName_;
83 <<
"Unknown selectionMode " 84 << selectionModeTypeNames_[selectionMode_]
85 <<
". Valid selectionMode types are" << selectionModeTypeNames_
94 switch (selectionMode_)
104 label celli = mesh_.findCell(points_[i]);
107 selectedCells.
insert(celli);
114 <<
"Unable to find owner cell for point " << points_[i]
120 cells_ = selectedCells.
toc();
127 <<
"- selecting cells using cellSet " << cellSetName_ <<
endl;
129 cellSet selectedCells(mesh_, cellSetName_);
130 cells_ = selectedCells.
toc();
137 <<
"- selecting cells using cellZone " << cellSetName_ <<
endl;
139 label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
143 <<
"Cannot find cellZone " << cellSetName_ << endl
144 <<
"Valid cellZones are " << mesh_.cellZones().names()
147 cells_ = mesh_.cellZones()[zoneID];
161 <<
"Unknown selectionMode " 162 << selectionModeTypeNames_[selectionMode_]
163 <<
". Valid selectionMode types are" << selectionModeTypeNames_
172 V_ += mesh_.V()[cells_[i]];
178 <<
" cell(s) with volume " << V_ <<
endl;
187 const word& modelType,
192 option(name, modelType, dict, mesh),
197 selectionModeTypeNames_.read(coeffs_.lookup(
"selectionMode"))
199 cellSetName_(
"none"),
204 setSelection(coeffs_);
223 if (mesh_.changing())
defineTypeNameAndDebug(option, 0)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & indent(Ostream &os)
Indent stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const NamedEnum< selectionModeType, 4 > selectionModeTypeNames_
Word list of selection mode type names.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
bool insert(const Key &key)
Insert a new entry.
Initialise the NamedEnum HashTable from the static list of names.
cellSetOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual ~cellSetOption()
Destructor.
bool read(const char *, int32_t &)
virtual bool isActive()
Is the source active?
selectionModeType
Enumeration for selection mode types.
A class for handling words, derived from string.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
void setCellSet()
Set the cell set based on the user input selection mode.
void setSelection(const dictionary &dict)
Set the cellSet or points selection.
#define WarningInFunction
Report a warning using Foam::Warning.
A collection of cell labels.
Mesh data needed to do the Finite Volume discretisation.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
virtual bool isActive()
Is the source active?
List< Key > toc() const
Return the table of contents.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Finite volume options abstract base class. Provides a base set of controls, e.g.: ...