Silently deprecate string methods startsWith(), endsWith() (added
2016) in favour of starts_with(), ends_with() names. This aligns
with C++20 already and allows these implementations to be removed
in a few years.
Silently deprecate string method removeTrailing() in favour of the
single character variant of removeEnd() to reduce the number of
Removed the const versions of the string methods removeRepeated()
and removeTrailing(), which were never used but could be the
source of confusion with the modifying versions of the same names.
Removed token assignment from a raw word or string pointer.
This was deprecated 2017-11 and now removed.
For this type of content transfer, move assignment should be used
instead of stealing pointers.
Removed pointer-style -> dereferencing for HashTable iterators.
This syntax was added 2019-04, but consistent addressing with
support for wrapped pointer types (eg, autoPtr, std::unique_ptr) has
proven to be less robust than desired.
Remove deprecated HashTable iterator object() method.
Was only used internally and was superseded by the val() method
in an earlier version.
The pre-C++11 Xfer has now been removed.
It was deprecated and slated for removal 2018-03.
Removed the particle PropertyTypes (introduced in 2016 for adios).
Proved to be difficult to use, manage and maintain.
Changes in definition
Replaced previous use of contiguous<T>() as a global function with
is_contiguous<T> as a traits class. For some advanced user code,
this can be a breaking change, but greatly improves the ability to
define general traits and to inherit from them.
Previously something like the following was required:
An future benefit of the new structure is that it provides a static
constexpr value, which allows its use in template expressions.
The change in definition is accompanied by a slight name change from
contiguous to is_contiguous, which should assist in identifying
When defining the contiguous characteristics, the is_contiguous_label
and the is_contiguous_scalar forms may also be relevant.
These are special traits for handling data of homogeneous components
of the respective types.
The keyType type (literal/regex) is now handled as an enum instead
of bool, which makes its somewhat clearer, allows more future
options and provides better alignment with the wordRe class.
Changes in behaviour
The default behaviour is to treat self-assignment as a no-op instead
of a FatalError. In a small minor cases self-assignment could
indicate a programming error, but in other cases it may be entirely
correct. The std::min() function, for example, returns a const
reference, and the following code should behave correctly:
a = std::min(a, b);
support search options on more dictionary methods. For example,
to specify literal matches for sub-dictionary methods:
previously allowed mapped value modification with a const iterator.
However, this can lead to incorrect access patterns.
Now tie the constness of the mapped value to that of the iterator.
set instead of insert a std::initializer_list into HashTable.
This handles duplicate entries by overwriting, which corresponds more
closely to the notion of assignment.
The constructor for Random is now explicit to prevent automatic
construction from a label.
The newly added FatalErrorInLookup, FatalIOErrorInLookup
macros should be used in code New() selectors using a lookup.
See code patterns.
The new InfoErr stream behaves like Info but with output to
stderr instead of stdout.
When retrieving argList options, can now use get<..>() instead of
opt<...>() or the very old optionRead. This improves similarity
with dictionary methods - making it easy to transfer code - and helps
reduce the number of different method names.
The getLine() method now allows an alternative delimiter with the
default be a newline. This makes reading files easier in some
additional xorOp, bitXorOp, xorEqOp, bitXorEqOp reduction operators
and flipBoolOp for negation.
scalarOps with divide-by-zero protection.
Functor versions of floor/ceil/round for scalar.
added cmptMagSqr for scalars, VectorSpace, Fields. This operation
can be useful when constructing matrix norms.
min/max compare/reduction operators for Tuple2 first() that
only compare the first element. This can be useful when building a
temporary aggregate for reduction.
improve syncTools handling of bitSet/PackedList types with
additional support for face sync/swap of boundary values. This
allows use of bitSet instead of boolList in more places
The Foam::name() can now also be used with a pointer to return the
memory address formatted in hexadecimal. This is useful for
obtaining detailed object information.
The tmp and tmpNrc classes now support reset(), move
assignment and allow explicit test as bool (same as valid). This not
only improves similarity to autoPtr, but can also simplify coding.
New generator classes for uniform/gaussian random numbers, which can be
used in combination with std::generate, or as a substitute unary
operator to supply random numbers for std::transform.
The Enum class now has additional methods to make it more dynamic.
The class was originally only used for constant data, but by adding
some elementary methods (empty, clear, append) it is now possible to
use in more situations where a tiny Map/HashTable replacement is
desirable. The new methods can be combined with null-constructed to
have a simple low-weight cache of word/int lookups.
The std::ostream output can be used before other parts of the
OpenFOAM streams have been created.
HashTable and HashSet
HashTable values are now read in-situ to avoid copying.
HashTable uses emplace when generating zero-initialized values for
HashSet (backed by HashTable) use emplace to avoid unneeded argument.
global min(), max(), minMax() functions taking a labelHashSet and an
optional limit. For example,
longer method names for accessing Matrix number of rows/cols.
The names mRows()/nRows() and nCols() are less ambiguous than
m() and n(), which have been know to have swapped naming
For SubList and SubField, support assign from zero.
Support SubField +=, -=, *=, /= operators.
Support construct SubList from UList (as per SubField)
Adjustment for VectorSpace
add data/cdata to VectorSpace for consistency with FixedList etc
additional col/row access methods for Tensor, Tensor2D
additional diagonal access methods for Tensor
support transposed construction of Tensor from a set of vectors
Improved boolList functions for negate() and component() that make
it behave more like the other field types. It also now has a
boolIOField version that allows boolFields to be registered.
Add field operations for complex
zip, unzip. This release has an extensive additional
functionality for handling combining scalar fields into vector or
tensor fields (a zip operation) and for extracting scalar fields
from vector or tensor fields (an unzip operation). The fields may
be plain fields, complex fields or GeometricFields. The unzip
functions have unzipCol, unzipRow and unzipDiag variants.
The new FieldOps namespace contains a variety of methods to
assign field values with unary or binary functions, as well
as different forms for handling ternary conditionals with fields.
A general findMinData/findMaxData algorithm in FieldOps namespace.
The new top-level cloud::nParcels() method permits quick determination
of cloud sizes, even when retrieved from an registry as a simple cloud.