51 case topoSetSource::sourceType::CELLZONE_SOURCE:
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]);
69 case topoSetSource::sourceType::FACEZONE_SOURCE:
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]);
87 case topoSetSource::sourceType::POINTZONE_SOURCE:
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]);
120 case topoSetSource::sourceType::CELLSET_SOURCE:
124 if (!
io.isHeaderClass<classType>())
127 <<
"Error reading " << classType::typeName
128 <<
" <" <<
name <<
"> : found " 129 <<
io.headerClassName() <<
nl 138 case topoSetSource::sourceType::FACESET_SOURCE:
142 if (!
io.isHeaderClass<classType>())
145 <<
"Error reading " << classType::typeName
146 <<
" <" <<
name <<
"> : found " 147 <<
io.headerClassName() <<
nl 156 case topoSetSource::sourceType::POINTSET_SOURCE:
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 188 Foam::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_);
273 if (!writer_ && hasDataToWrite())
282 if (writer_ &&
mesh().time().writeTime())
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
refPtr< labelList > getTopoSetLabels(const word &name, enum topoSetSource::sourceType setType) const
Get the labels associated with the topo set.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
virtual const fvMesh & mesh() const =0
The mesh we are attached to.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool good() const noexcept
True if pointer/reference is non-null.
Ignore writing from objectRegistry::writeObject()
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
A class for managing references or pointers (no reference counting)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
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)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
void tryWrite() const
Write data if appropriate Should enable exact restarts.
Registered input/output for an expressions::fvExprDriver.
#define DebugInfo
Report an information message using Foam::Info.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
Ostream & writeCommon(Ostream &os, bool debug=false) const
Write "variables", "storedVariables", "delayedVariables", "globalScopes" if they are present...
A collection of cell labels.
sourceType
Enumeration defining the types of sources.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
void createWriterAndRead(const word &name)
Create a writer for this object.
Mesh consisting of general polyhedral cells.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
forAllConstIters(mixture.phases(), phase)
void reset(T *p=nullptr) noexcept
Delete managed pointer and set to new given pointer.