mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
INT: objectRegistry: optionally caching temporary objects (#2723)
- functionality introduced by openfoam.org to support selective
caching of temporary fields. The purpose is two-fold: to enable
diagnostics and to allow more places to use unregistered fields by
default.
For example to cache the grad(k) field in
cacheTemporaryObjects
(
grad(k)
);
If the name of a field which in never constructed is added to the
cacheTemporaryObjects list a waning message is generated which
includes a useful list of ALL the temporary fields constructed
during the time step
Multiple regions are also supported by specifying individual region
names in a cacheTemporaryObjects dictionary.
cacheTemporaryObjects
{
porous
(
porosityBlockage:UNbr
);
}
functions
{
writePorousObjects
{
type writeObjects;
libs (utilityFunctionObjects);
region porous;
writeControl writeTime;
writeOption anyWrite;
objects (porosityBlockage:UNbr);
}
}
This commit is contained in:
@ -219,9 +219,22 @@ bool Foam::functionObjects::writeObjects::write()
|
||||
}
|
||||
else
|
||||
{
|
||||
Log << " writing object " << obj.name() << endl;
|
||||
// TBD:
|
||||
// If the object is a temporary field expression wrap with tmp<...>
|
||||
|
||||
obj.write();
|
||||
// if (obj.db().cacheTemporaryObject(objName))
|
||||
// {
|
||||
// obj.IOobject::rename("tmp<" + objName + ">");
|
||||
//
|
||||
// Log << " writing object " << obj.name() << endl;
|
||||
// obj.write();
|
||||
// obj.IOobject::rename(objName);
|
||||
// }
|
||||
// else
|
||||
{
|
||||
Log << " writing object " << obj.name() << endl;
|
||||
obj.write();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user