33 template<>
const char* NamedEnum
52 void Foam::fvCellSet::setCells()
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 void Foam::fvCellSet::setV()
133 V_ += mesh_.V()[cells_[i]];
139 <<
" cell(s) with volume " << V_ <<
endl;
154 selectionMode_(selectionModeType::all),
204 selectionModeTypeNames_.read(dict.
lookup(
"selectionMode"));
206 switch (selectionMode_)
210 dict.
lookup(
"points") >> points_;
213 case selectionModeType::cellSet:
215 dict.
lookup(
"cellSet") >> cellSetName_;
218 case selectionModeType::cellZone:
220 dict.
lookup(
"cellZone") >> cellSetName_;
223 case selectionModeType::all:
230 <<
"Unknown selectionMode " 231 << selectionModeTypeNames_[selectionMode_]
232 <<
". Valid selectionMode types are" << selectionModeTypeNames_
#define forAll(list, i)
Loop across all elements in list.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
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.
void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
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.
void movePoints()
Update for mesh motion.
void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
bool read(const char *, int32_t &)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
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.
Class containing mesh-to-mesh mapping information.
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.