64 <<
"Could not locate subRegion \""
78 const regIOobject* ptr = this->cfindObject<regIOobject>(fieldName);
82 Log <<
" functionObjects::" <<
type() <<
" " <<
name()
83 <<
" writing field: " << ptr->name() <<
endl;
100 regIOobject* ptr = this->findObject<regIOobject>(fieldName);
123 for (
const word& objName : objNames)
125 regIOobject* ptr = this->findObject<regIOobject>(objName);
127 if (ptr && ptr->ownedByRegistry())
145 subRegistryName_(
dict.getOrDefault<word>(
"subRegion", word::null)),
148 runTime.lookupObject<objectRegistry>
165 subRegistryName_(
dict.getOrDefault<
word>(
"subRegion",
word::null)),
const word & name() const noexcept
Return the object name.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const word & name() const noexcept
Return the name of this functionObject.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Specialization of Foam::functionObject for a region and providing a reference to the region Foam::obj...
const ObjectType & lookupObject(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
const ObjectType * cfindObject(const word &fieldName) const
Return const pointer to the object (eg, a field) in the (sub) objectRegistry.
const objectRegistry & obr_
Reference to the region objectRegistry.
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
void clearObjects(const wordList &objNames)
Clear fields from the (sub) objectRegistry if present.
regionFunctionObject(const regionFunctionObject &)=delete
No copy construct.
virtual bool read(const dictionary &dict)
Read optional controls.
word subRegistryName_
Name for alternative object registry.
const objectRegistry * obrPtr_
Pointer to alternative (eg, sub-region) objectRegistry.
const ObjectType * findObject(const word &fieldName) const
Return const pointer to the object (eg, a field) in the (sub) objectRegistry.
bool writeObject(const word &fieldName)
Write field if present in the (sub) objectRegistry.
bool clearObject(const word &fieldName)
Clear field from the (sub) objectRegistry if present.
Base class for function objects, adding functionality to read/write state information (data required ...
stateFunctionObject(const stateFunctionObject &)=delete
No copy construct.
const Time & time() const
Return time database.
objectRegistry & storedObjects()
Write access to the output objects ("functionObjectObjects") registered on Time.
Registry of regIOobjects.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Mesh consisting of general polyhedral cells.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool ownedByRegistry() const noexcept
Is this object owned by the registry?
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
bool checkOut()
Remove object from registry, and remove all file watches.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
List< word > wordList
List of word.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
constexpr char nl
The newline '\n' character (0x0a).