Added using std::unique_ptr into the Foam namespace within
in stdFoam.H (and autoPtr.H) to ensure general availability
as Foam::unique_ptr or std::unique_ptr. Change some
old-style handling using demand-driven-data or autoPtr to use
unique_ptr, especially in low-level containers.
Deprecation and Removal
silently deprecate the env() function in favour of hasEnv() for
testing existence of an environment with a non-zero length.
This naming is makes the purpose more explicit, and more similar to
getEnv(), setEnv() naming.
compile-time deprecation warning for objectRegistry methods
lookupObjectPtr() and lookupObjectRefPtr() that were previous
silently deprecated (2018-10) in favour of findObject() and
Remove the Switch asText() method which was replaced by
c_str() and str() several versions ago.
The surfMesh samplers have been removed.
These provided a means of sampling and holding surface values
internally, but are now redundant with the changes in surface sampling
introduced in OpenFOAM-v1906.
Changes in definition
The template parameters for PrimitivePatch have been simplified from
four parameters to two parameters.
Does not appear to affect any normal user coding.
Changes in behaviour
In OpenFOAM, eigenvalues and eigenvectors of a given tensor/tensor2D have been computed by explicit algebraic expressions. However, there has been three issues prior to v2006:
Complex-type eigenvalues and eigenvectors were not allowed from tensor/tensor2D.
The eigendecomposition algorithms for tensor/tensor2D were numerically fragile to a considerable extent.
New eigendecomposition algorithms were provided for symmTensor/symmTensor2D.
The return types of analytical eigendecomposition algorithms were ensured to be mathematically consistent (see 55e7da67):
tensor and tensor2D now return only complex eigenvalues and eigenvectors.
symmTensor and symmTensor2D now return only scalar eigenvalues and eigenvectors.
The fragility of the eigendecomposition algorithms was considerably reduced particularly by improving the numerical stability of polynomial root finding algorithms (see 8ca724ff, 55e7da67).
Header documentation, and test applications carrying out bitwise comparisons with external software were considerably improved to prevent any unannounced changes in input/output behaviour (see 55e7da67, 6a53794e, 66b02ca5, 8ca724ff).
unify use of dictionary method names.
In previous releases introduced various types of dictionary "get"
methods, include getOrDefault. Now complete the transition and use
getOrDefault everywhere that previously had 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).
added single parameter dictionary writeEntry() method.
The dictionary knows its own name (dictName), which can be used when
Extend argList handling to include predicate checks
Further align naming of argList methods with dictionary method names.
Silently deprecate two-parameter get() method in favour of the
more familiar getOrDefault.
Silently deprecate opt() method in favour of get()
stringListOps with whitelist/blacklist matching
stringOps inplaceRemoveSpace() and string replaceAny() methods.
The replaceAny() method takes a search string and a replacement
character. The replacement character can also be a nul char ('\0'),
which simply removes the characters. Some possible uses:
Replace reserved characters
Remove shell meta-characters or reserved filesystem characters
Additional ISstream::getLine() accepting a nullptr.
This passes through to std::istream::ignore to support read
and discarding of lines without buffering their content.
Support default values for format/compress enum lookups.
Avoids situations where the preferred default format is not ASCII.
For example, with the dictionary input:
The typing mistake would previously have caused formatEnum to
default to ASCII. We can now properly control its default
The stream constructors now accept IOstreamOption to conveniently
bundle IO options as a single parameter.
Use IOstreamOption for writeObject() calls.
Both of these changes reduce the number of parameters that are being
passed around and allow future additions into the IOstreamOption
with mininal effort.
The store() method now also registers the object.
Previously the store() method would just set the ownedByRegistry flag
without ensuring that it was available for lookup.
Now ensure that it is indeed also registered first.
Support register/store of tmp<T> items.
The tmp parameter is not cleared, but changed from PTR to CREF
to allow further use.
The implicit registration allows code simplification. Using the
GeometricField::New factory method, for example:
Improve construct from dictionary to handle all valid token types.
Previously just read in a word.
inline and extend clockValue, clockTime
mostly wraps std::chrono so can inline much of it, which is potentially
helpful when used for inner timings.
add elapsedTime() method for direct cast to double and for
naming similarity with wall-clock method.
Potential breaking change (minor):
clockValue construct with a bool parameter is now simply tagged
dispatch (value is ignored) and always queries the current clock
value. This avoids needless branching.
Since this constructor form has primarily been used internally (eg,
clockTime), breakages in user code are not expected.