34 namespace zoneGenerators
44 template<
class ZoneListType>
45 const typename ZoneListType::zoneType& Foam::zoneGenerators::lookup::lookupZone
47 const ZoneListType& zones,
51 typedef typename ZoneListType::zoneType ZoneType;
53 const ZoneType* zonePtr = zones.lookupPtr(
zoneName_);
55 if (zonePtr ==
nullptr)
58 <<
"Cannot find " << ZoneType::typeName <<
" " <<
zoneName_ <<
nl;
76 <<
" Available " << ZoneType::typeName <<
"s: "
116 const pointZone& pZone = lookupZone(mesh_.pointZones(), zoneName_);
117 moveUpdate_ = moveUpdate_ || pZone.
moveUpdate();
123 const cellZone& cZone = lookupZone(mesh_.cellZones(), zoneName_);
124 moveUpdate_ = moveUpdate_ || cZone.
moveUpdate();
130 const faceZone& fZone = lookupZone(mesh_.faceZones(), zoneName_);
131 moveUpdate_ = moveUpdate_ || fZone.
moveUpdate();
137 if (zoneName_ ==
"all")
140 <<
"zoneType not specified or set to all for zone all"
147 if (mesh_.pointZones().found(zoneName_))
149 zs = mesh_.pointZones()[zoneName_];
154 if (mesh_.cellZones().found(zoneName_))
156 zs = mesh_.cellZones()[zoneName_];
161 if (mesh_.faceZones().found(zoneName_))
163 zs = mesh_.faceZones()[zoneName_];
Macros for easy insertion into run-time selection tables.
const ZoneType * lookupPtr(const word &name) const
Return const reference to ZoneType by name.
bool moveUpdate() const
Flag indicating the zone is updated by the generator.
Named list of cell indices representing a sub-set of the mesh.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Named list of face indices representing a sub-set of the mesh faces.
Named list of point indices representing a sub-set of the mesh faces.
Mesh consisting of general polyhedral cells.
const pointZoneList & pointZones() const
Return point zones.
const cellZoneList & cellZones() const
Return cell zones.
const faceZoneList & faceZones() const
Return face zones.
A class for handling words, derived from string.
Abstract base class for all zoneGenerators, providing runtime selection.
const word zoneName_
Name of the zone (defaults to the name of the generator)
const word & zoneName() const
const dictionary dict_
Dictionary cached for error context.
const polyMesh & mesh_
Reference to the polyMesh.
A zoneGenerator which looks-up and returns a zoneSet containing point, and/or cell and/or faces zones...
virtual zoneSet generate() const
Generate and return the zoneSet.
virtual ~lookup()
Destructor.
lookup(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Zone container returned by zoneGenerator::generate.
const faceZone & fZone() const
Return a reference to the faceZone if allocated.
const cellZone & cZone() const
Return a reference to the cellZone if allocated.
const pointZone & pZone() const
Return a reference to the pointZone if allocated.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
defineTypeNameAndDebug(cylinderHeadPoints, 0)
addToRunTimeSelectionTable(zoneGenerator, cylinderHeadPoints, dictionary)
errorManipArg< error, int > exit(error &err, const int errNo=1)
zoneTypesAll
Enumeration defining the zone types with an option for all the types.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const NamedEnum< zoneTypesAll, 4 > zoneTypesAllNames
Named enumeration defining the zone type names.