- simplifies handling.
* enables unprotecting to avoid accidentally cloning.
* removes the need for dedicated constructor or factory forms.
* simplfies DimensionedField and GeometricField New factory methods
- update objectRegistry management method (internal use)
old: bool cacheTemporaryObject(...)
new: bool is_cacheTemporaryObject(...)
to clarify that it is a query, not a request for caching etc.
- 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);
}
}
- previously introduced `getOrDefault` as a dictionary _get_ method,
now complete the transition and use it everywhere instead of
`lookupOrDefault`. This avoids mixed usage of the two methods that
are identical in behaviour, makes for shorter names, and promotes
the distinction between "lookup" access (ie, return a token stream,
locate and return an entry) and "get" access (ie, the above with
conversion to concrete types such as scalar, label etc).
- more dictionary-like methods, enforce keyType::LITERAL for all
lookups to avoid any spurious keyword matching.
- new readEntry, readIfPresent methods
- The get() method replaces the now deprecate lookup() method.
- Deprecate lookupOrFailsafe()
Failsafe behaviour is now an optional parameter for lookupOrDefault,
which makes it easier to tailor behaviour at runtime.
- output of the names is now always flatted without line-breaks.
Thus,
os << flatOutput(someEnumNames.names()) << nl;
os << someEnumNames << nl;
both generate the same output.
- Constructor now uses C-string (const char*) directly instead of
Foam::word in its initializer_list.
- Remove special enum + initializer_list constructor form since
it can create unbounded lookup indices.
- Removd old hasEnum, hasName forms that were provided during initial
transition from NamedEnum.
- Added static_assert on Enum contents to restrict to enum or
integral values. Should not likely be using this class to enumerate
other things since it internally uses an 'int' for its values.
Changed volumeType accordingly to enumerate on its type (enum),
not the class itself.
- Remove the unused enums() method since it delivers wholly unreliable
results. It is not guaranteed to cover the full enumeration range,
but only the listed names.
- Remove the unused strings() method.
Duplicated functionality of the words(), but was never used.
- Change access of words() method from static to object.
Better code isolation. Permits the constructor to take over
as the single point of failure for bad input.
- Add values() method
- do not expose internal (HashTable) lookup since it makes it more
difficult to enforce constness and the implementation detail should
not be exposed. However leave toc() and sortedToc() for the interface.
STYLE: relocated NamedEnum under primitives (was containers)
- internal typedef as 'value_type' for some consistency with STL conventions
Description
Allows specification of different writing frequency of objects registered
to the database.
It has similar functionality as the main time database through the
\c writeControl setting:
- timeStep
- writeTime
- adjustableRunTime
- runTime
- clockTime
- cpuTime
It also has the ability to write the selected objects that were defined
with the respective write mode for the requested \c writeOption, namely:
- \c autoWrite - objects set to write at output time
- \c noWrite - objects set to not write by default
- \c anyWrite - any option of the previous two
Example of function object specification:
\verbatim
writeObjects1
{
type writeObjects;
libs ("libutilityFunctionObjects.so");
...
objects (obj1 obj2);
writeOption anyWrite;
}
\endverbatim
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2090
Replaced the 'postProcess' argument to the 'write' and 'execute'
functions with the single static member 'postProcess' in the
functionObject base-class.