54 const word& zoneTypeName = cellZone::typeName;
56 const label zoneID = zones.findZoneID(
name);
60 <<
"No " << zoneTypeName <<
" named "
61 <<
name <<
"found. Has zones: " << zones.names() <<
endl
65 selected.
cref(zones[zoneID]);
72 const word& zoneTypeName = faceZone::typeName;
74 const label zoneID = zones.findZoneID(
name);
78 <<
"No " << zoneTypeName <<
" named "
79 <<
name <<
"found. Has zones: " << zones.names() <<
endl
83 selected.
cref(zones[zoneID]);
90 const word& zoneTypeName = pointZone::typeName;
92 const label zoneID = zones.findZoneID(
name);
96 <<
"No " << zoneTypeName <<
" named "
97 <<
name <<
"found. Has zones: " << zones.names() <<
endl
101 selected.
cref(zones[zoneID]);
124 if (!
io.isHeaderClass<classType>())
127 <<
"Error reading " << classType::typeName
128 <<
" <" <<
name <<
"> : found "
129 <<
io.headerClassName() <<
nl
142 if (!
io.isHeaderClass<classType>())
145 <<
"Error reading " << classType::typeName
146 <<
" <" <<
name <<
"> : found "
147 <<
io.headerClassName() <<
nl
160 if (!
io.isHeaderClass<classType>())
163 <<
"Error reading " << classType::typeName
164 <<
" <" <<
name <<
"> : found "
165 <<
io.headerClassName() <<
nl
177 <<
"Unexpected sourceType: " << int(setType) <<
nl
178 <<
" for set <" <<
name <<
">" <<
nl
188Foam::word Foam::expressions::fvExprDriver::getHeaderClassName
197 mesh.time().timeName(),
205 <<
"Registry: " <<
mesh.path()
207 <<
" Time: " <<
mesh.time().timeName()
208 <<
" Path: " <<
io.localFilePath(
io.headerClassName())
209 <<
" Class: " <<
io.headerClassName() <<
endl;
211 return io.headerClassName();
224 writeVariableStrings(
os,
"variables");
228 os.writeEntry(
"variableValues", variables_);
231 if (!storedVariables_.empty() || !delayedVariables_.empty())
233 const_cast<fvExprDriver&
>
236 ).updateSpecialVariables(
true);
239 if (!storedVariables_.empty())
241 os.writeEntry(
"storedVariables", storedVariables_);
244 if (!delayedVariables_.empty())
246 List<exprResultDelayed> list(delayedVariables_.size());
248 auto outIter = list.begin();
256 os.writeEntry(
"delayedVariables", list);
259 if (!globalScopes_.empty())
261 os.writeEntry(
"globalScopes", globalScopes_);
282 if (writer_ &&
mesh().time().writeTime())
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
A collection of cell labels.
Ostream & writeVariableStrings(Ostream &os, const word &keyword="") const
Write "variables".
void writeFunctions(Ostream &os) const
Write scalar/vector Function1 entries in dictionary format.
HashTable< exprResult > variables_
The variables table.
virtual void updateSpecialVariables(bool force=false)
Examine current variable values and update stored variables.
virtual bool hasDataToWrite() const
Do we need a data file to be written.
virtual const fvMesh & mesh() const =0
The mesh we are attached to.
void tryWrite() const
Write data if appropriate Should enable exact restarts.
fvExprDriver(enum exprDriver::searchControls search=exprDriver::searchControls::DEFAULT_SEARCH, const dictionary &dict=dictionary::null)
Default construct, and default construct with search preferences.
void createWriterAndRead(const word &name)
Create a writer for this object.
friend class fvExprDriverWriter
Ostream & writeCommon(Ostream &os, bool debug=false) const
Write "variables", "storedVariables", "delayedVariables", "globalScopes" if they are present.
refPtr< labelList > getTopoSetLabels(const word &name, enum topoSetSource::sourceType setType) const
Get the labels associated with the topo set.
Mesh consisting of general polyhedral cells.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
A class for managing references or pointers (no reference counting).
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
bool good() const noexcept
True if pointer/reference is non-null.
void reset(T *p=nullptr) noexcept
Delete managed pointer and set to new given pointer.
static refPtr< T > New(Args &&... args)
Construct refPtr with forwarding arguments.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
sourceType
Enumeration defining the types of sources.
@ POINTSET_SOURCE
Points as set.
@ FACESET_SOURCE
Faces as set.
@ FACEZONE_SOURCE
Faces as zone.
@ POINTZONE_SOURCE
Points as zone.
@ CELLSET_SOURCE
Cells as set.
@ CELLZONE_SOURCE
Cells as zone.
static IOobject findIOobject(const polyMesh &mesh, const word &name, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE, IOobjectOption::registerOption reg=IOobjectOption::LEGACY_REGISTER)
Find IOobject in the polyMesh/sets/ (used as constructor helper).
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define DebugInfo
Report an information message using Foam::Info.
Namespace for handling debugging switches.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.