mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add support for an output object registry for function objects
This commit is contained in:
@ -67,6 +67,25 @@ void Foam::functionObjectList::createStateDict() const
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::createOutputRegistry() const
|
||||
{
|
||||
objectsRegistryPtr_.reset
|
||||
(
|
||||
new objectRegistry
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"functionObjectObjects",
|
||||
time_.timeName(),
|
||||
time_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::functionObject> Foam::functionObjectList::remove
|
||||
(
|
||||
const word& key,
|
||||
@ -339,6 +358,7 @@ Foam::functionObjectList::functionObjectList
|
||||
time_(runTime),
|
||||
parentDict_(runTime.controlDict()),
|
||||
stateDictPtr_(),
|
||||
objectsRegistryPtr_(),
|
||||
execution_(execution),
|
||||
updated_(false)
|
||||
{}
|
||||
@ -357,6 +377,7 @@ Foam::functionObjectList::functionObjectList
|
||||
time_(runTime),
|
||||
parentDict_(parentDict),
|
||||
stateDictPtr_(),
|
||||
objectsRegistryPtr_(),
|
||||
execution_(execution),
|
||||
updated_(false)
|
||||
{}
|
||||
@ -491,6 +512,28 @@ const Foam::IOdictionary& Foam::functionObjectList::stateDict() const
|
||||
}
|
||||
|
||||
|
||||
Foam::objectRegistry& Foam::functionObjectList::storedObjects()
|
||||
{
|
||||
if (!objectsRegistryPtr_.valid())
|
||||
{
|
||||
createOutputRegistry();
|
||||
}
|
||||
|
||||
return *objectsRegistryPtr_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::objectRegistry& Foam::functionObjectList::storedObjects() const
|
||||
{
|
||||
if (!objectsRegistryPtr_.valid())
|
||||
{
|
||||
createOutputRegistry();
|
||||
}
|
||||
|
||||
return *objectsRegistryPtr_;
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::clear()
|
||||
{
|
||||
PtrList<functionObject>::clear();
|
||||
|
||||
Reference in New Issue
Block a user