33 template<>
const char* NamedEnum
52 void Foam::fvCellSet::setCellSet()
56 switch (selectionMode_)
66 label celli = mesh_.findCell(points_[i]);
69 selectedCells.
insert(celli);
76 <<
"Unable to find owner cell for point " << points_[i]
82 cells_ = selectedCells.
toc();
86 case selectionModeType::cellSet:
89 <<
"- selecting cells using cellSet " << cellSetName_ <<
endl;
91 cellSet selectedCells(mesh_, cellSetName_);
92 cells_ = selectedCells.
toc();
96 case selectionModeType::cellZone:
99 <<
"- selecting cells using cellZone " << cellSetName_ <<
endl;
101 label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
105 <<
"Cannot find cellZone " << cellSetName_ << endl
106 <<
"Valid cellZones are " << mesh_.cellZones().names()
109 cells_ = mesh_.cellZones()[zoneID];
113 case selectionModeType::all:
126 V_ += mesh_.V()[cells_[i]];
132 <<
" cell(s) with volume " << V_ <<
endl;
147 selectionMode_(selectionModeType::all),
172 selectionModeTypeNames_.read(dict.
lookup(
"selectionMode"));
174 switch (selectionMode_)
178 dict.
lookup(
"points") >> points_;
181 case selectionModeType::cellSet:
183 dict.
lookup(
"cellSet") >> cellSetName_;
186 case selectionModeType::cellZone:
188 dict.
lookup(
"cellZone") >> cellSetName_;
191 case selectionModeType::all:
198 <<
"Unknown selectionMode " 199 << selectionModeTypeNames_[selectionMode_]
200 <<
". Valid selectionMode types are" << selectionModeTypeNames_
#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.
bool read(const dictionary &dict)
Read coefficients dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
void updateMesh(const mapPolyMesh &)
Update for mesh changes.
bool insert(const Key &key)
Insert a new entry.
Initialise the NamedEnum HashTable from the static list of names.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool read(const char *, int32_t &)
static const word null
An empty word.
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)
#define WarningInFunction
Report a warning using Foam::Warning.
A collection of cell labels.
Mesh data needed to do the Finite Volume discretisation.
selectionModeType
Enumeration for selection mode types.
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.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
static const NamedEnum< selectionModeType, 4 > selectionModeTypeNames_
Word list of selection mode type names.
fvCellSet(const dictionary &dict, const fvMesh &mesh)
Construct from components.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.