... | ... | @@ -7,10 +7,10 @@ |
|
|
As part of code evolution, some methods become obsolete or are
|
|
|
superseded by new methods. To assist in code migration we have added
|
|
|
`FOAM_DEPRECATED` macros that are used in some places to emit
|
|
|
compile-time warnings and alert the use about the use of deprecated
|
|
|
compile-time warnings and alert the user about the use of deprecated
|
|
|
methods. The user is advised to heed such warnings since this is good
|
|
|
indication that functionality has changed or that a method may be
|
|
|
slated for removal in a future version. In some rarer circumstances a
|
|
|
slated for removal in a future version. In some rarer circumstances, a
|
|
|
method may be explicitly tagged as `= delete` to prevent the compiler
|
|
|
from using the method at all.
|
|
|
|
... | ... | @@ -18,11 +18,11 @@ from using the method at all. |
|
|
|
|
|
- The linked-list iterator now has a `good()` method for testing its
|
|
|
validity and its rarely used `found()` method has been deprecated
|
|
|
since testing the validity is independent of searching *per se*.
|
|
|
since testing the validity is independent of searching _per se_.
|
|
|
|
|
|
- The `hashedWordList::contains()` method is now tagged as deprecated
|
|
|
(identical to the `found()` method). The `contains()` method is a
|
|
|
remnant from when hashedWordList was generalized from a speciesTable
|
|
|
- The `hashedWordList::contains()` method is now tagged as deprecated.
|
|
|
This method is identical to the `found()` method, with naming that is
|
|
|
holdover from when hashedWordList was generalized from a speciesTable
|
|
|
(2010-10).
|
|
|
|
|
|
- The `Foam::findIndex()` global function is tagged as deprecated. This
|
... | ... | @@ -30,12 +30,11 @@ from using the method at all. |
|
|
on the list containers themselves.
|
|
|
|
|
|
- The face/triangle `normal()` methods are tagged as deprecated.
|
|
|
|
|
|
In v1812, the distinction between areaNormal and unitNormal
|
|
|
was propagated through out the code, but some user code may well
|
|
|
remain that uses the `normal()` method. By providing a compile-time
|
|
|
deprecation message, the user is alerted to possible ambiguities or
|
|
|
optimization potential. In older versions, the `normal()` always meant
|
|
|
remain that uses the `normal()` method. The compile-time
|
|
|
deprecation message alerts the user to possible ambiguities or
|
|
|
optimization potential. In older versions, `normal()` always meant
|
|
|
the area-normal for certain of these primitives and an additional
|
|
|
division by its magnitude would be required to obtain the unit-normal.
|
|
|
Now it is possible to distinguish between both meanings and use
|
... | ... | @@ -44,33 +43,30 @@ from using the method at all. |
|
|
|
|
|
### Removed Methods
|
|
|
|
|
|
- removed deprecated `bitSet::used()` method
|
|
|
|
|
|
The `used()` method was for transitional compatibility with the now
|
|
|
defunct PackedBoolList.
|
|
|
|
|
|
The canonical method name for returning a labelList of *on* bits is
|
|
|
- removed deprecated `bitSet::used()` method, which was for
|
|
|
transitional compatibility with the now defunct PackedBoolList.
|
|
|
The canonical method name for returning a labelList of _on_ bits is
|
|
|
`toc()` or identically `sortedToc()`.
|
|
|
|
|
|
- remove the unused and deprecated `emptyList()` casting function.
|
|
|
- removed the unused and deprecated `emptyList()` casting function.
|
|
|
This function is disllowed by many modern compilers and is no longer
|
|
|
used within OpenFOAM - was deprecated 2018-07.
|
|
|
|
|
|
|
|
|
### Removed Items
|
|
|
|
|
|
- The reader library and configuration files for EnSight have been removed
|
|
|
since the reading of OpenFOAM files has been been supported directly
|
|
|
from within EnSight for several versions already.
|
|
|
- the EnSight reader library and configuration files have been removed.
|
|
|
Directly support for reading OpenFOAM files has been part of EnSight
|
|
|
for several years.
|
|
|
|
|
|
- very old legacy tools (including pre-git packaging tools) have been
|
|
|
removed. Also remove very old deprecated scripts
|
|
|
removed. Also removed very old deprecated scripts
|
|
|
(eg, `foamDebugSwitches`, `foamGraph*`).
|
|
|
|
|
|
- deprecation scripts, such as those suggesting the use of
|
|
|
`postProcess`, have been removed and the information transferred to
|
|
|
wiki content. This reduces installation clutter and enables easier
|
|
|
cross-referencing.
|
|
|
[wiki content](/guides/upgrade/upgrade).
|
|
|
This reduces installation clutter and enables easier cross-referencing.
|
|
|
|
|
|
|
|
|
## Changes in definition
|
... | ... | @@ -78,11 +74,11 @@ from using the method at all. |
|
|
- Previously `mag()` returned a `scalar`, but now it returns the
|
|
|
`magType` of the underlying arithmetic primitive (or respective
|
|
|
pTraits). This change means, for example, that the magnitude of a
|
|
|
`doubleVector` remains `double`, even when using single-precision for
|
|
|
the definition of `scalar`.
|
|
|
`doubleVector` remains `double`, even when `scalar` has been defined
|
|
|
as single-precision.
|
|
|
Adjusted return values of `sumSqr()` accordingly.
|
|
|
|
|
|
- Historically had complex::one defined as `1+1i`. This has been
|
|
|
- Historically complex::one was defined as `1+1i`. This has been
|
|
|
removed and replaced with `pTraits<complex>::one`, which is
|
|
|
defined as `1+0i` for more consistency with the concept of one to
|
|
|
have a real component only.
|
... | ... | @@ -92,23 +88,22 @@ from using the method at all. |
|
|
|
|
|
- `PtrList::set(label)` now returns a const pointer instead of a bool.
|
|
|
This can still be tested as a bool, but also adds the ability
|
|
|
to *peek* at the contents.
|
|
|
to _peek_ at the contents.
|
|
|
|
|
|
|
|
|
## Changes in behaviour
|
|
|
|
|
|
### wordRes
|
|
|
|
|
|
The `wordRes::uniq()` method previously just removed duplicate
|
|
|
literals, but now removes all duplicates. Now uses a linear search
|
|
|
internally instead of the previous wordHashSet implementation, since
|
|
|
lists are normally fairly small and mostly just have unique entries
|
|
|
anyhow. This reduces the overall overhead.
|
|
|
The `wordRes::uniq()` method previously just eliminated duplicate
|
|
|
literals, but now removes all duplicates. A linear search is used
|
|
|
internally instead of the wordHashSet used previously, since the
|
|
|
lists are normally fairly small with predominately unique entries.
|
|
|
|
|
|
|
|
|
## Namespace changes
|
|
|
|
|
|
- Now have `vtk::Tools` as a namespace instead of a class, which
|
|
|
- The `vtk::Tools` are now a namespace instead of a class, which
|
|
|
allows localized extension of functionality.
|
|
|
|
|
|
|
... | ... | @@ -121,9 +116,9 @@ HashTable now supports move insert/set and emplace insertion for |
|
|
improved memory efficiency and to support hash tables of non-copyable
|
|
|
objects (eg, std::unique_ptr).
|
|
|
|
|
|
The reorganization of HashTable internals as further improved
|
|
|
functionality and cleaner future code maintenance. The
|
|
|
HashTable/HashSet *payloads* (a pair of values for HashTable, or a
|
|
|
The reorganization of HashTable internals has further improved
|
|
|
functionality and makes for cleaner future code maintenance. The
|
|
|
HashTable/HashSet _payloads_ (a pair of values for HashTable, or a
|
|
|
single value for HashSet) now have their own output capabilities.
|
|
|
This reduces code clutter and adds intrinsic output handling of
|
|
|
pointers and pointer-like objects (eg, `autoPtr`, `std::unique_ptr`),
|
... | ... | @@ -136,10 +131,8 @@ os << tbl; |
|
|
|
|
|
The HashTable iterators have been moderately revamped:
|
|
|
- a `good()` method as a synonym for `found()` to test validity.
|
|
|
|
|
|
- a `val()` method for symmetry with the `key()` method, and for less
|
|
|
typing than the older `object()` method.
|
|
|
|
|
|
- now also aware of pointer-content payload and can be dereferenced
|
|
|
directly. For example:
|
|
|
```
|
... | ... | @@ -152,8 +145,6 @@ The HashTable iterators have been moderately revamped: |
|
|
iter->write();
|
|
|
}
|
|
|
```
|
|
|
|
|
|
|
|
|
- Added `HashSet::test()` for method name compatibility with `bitSet`
|
|
|
and `boolList`
|
|
|
|
... | ... | @@ -174,32 +165,31 @@ The HashTable iterators have been moderately revamped: |
|
|
SubList<label>(myList, 0); // Unsafe
|
|
|
```
|
|
|
|
|
|
The SubList usage could become unsafe since the pointer from the
|
|
|
labelList::null() would be whatever happened to be in memory
|
|
|
immediately after the NullObject singleton.
|
|
|
The SubList usage could become extremely unsafe since the pointer
|
|
|
obtained from `labelList::null()` is whatever happened to be in memory
|
|
|
addressed immediately after the NullObject singleton.
|
|
|
|
|
|
Expanding the size of the singleton avoids many of these possible
|
|
|
issues. We can now safely use labelList::null() instead of
|
|
|
emptyLabelList for return values. No special treatment required for
|
|
|
lists.
|
|
|
issues. We can now safely use `labelList::null()` instead of
|
|
|
emptyLabelList for return values. No special treatment is required for
|
|
|
lists vs. nullObject lists.
|
|
|
|
|
|
Possible replacements:
|
|
|
```
|
|
|
if (notNull(list) && list.size()) -> if (list.size())
|
|
|
if (isNull(list) || list.empty()) -> if (list.empty())
|
|
|
```
|
|
|
The receiver may still wish to handle differently to distinguish
|
|
|
between a null list and an empty list, but no additional special
|
|
|
The receiver may still wish to have different handling for
|
|
|
a null list vs. an empty list, but no additional special
|
|
|
protection is required when obtaining sizes, traversing, outputting
|
|
|
etc.
|
|
|
|
|
|
|
|
|
## Improvements in complex
|
|
|
|
|
|
- additional construct/assignment methods for complex.
|
|
|
Including add construction from and conversion to std::complex,
|
|
|
which allows easier wrapping of functions.
|
|
|
|
|
|
- additional construct/assignment methods for complex,
|
|
|
including construction from std::complex and conversion to std::complex,
|
|
|
which allows easier wrapping of complex functions.
|
|
|
- add `Foam::sin()`, `Foam::cos()`, ... functions for complex
|
|
|
|
|
|
|
... | ... | @@ -207,8 +197,8 @@ The HashTable iterators have been moderately revamped: |
|
|
|
|
|
- iterators have been added to VectorSpace, which adds support for
|
|
|
various STL operations:
|
|
|
* sorting, filling, find min/max element etc.
|
|
|
* for-range iteration
|
|
|
- sorting, filling, find min/max element etc.
|
|
|
- for-range iteration
|
|
|
|
|
|
|
|
|
## Improvements for input checks
|
... | ... | @@ -262,10 +252,10 @@ For example, |
|
|
|
|
|
## Function Objects
|
|
|
|
|
|
- Inserted a new `timeFunctionObject` virtual class in the inheritance
|
|
|
- A new `timeFunctionObject` virtual class has been inserted in the inheritance
|
|
|
hierarchy. This is simply a `functionObject` with an additional
|
|
|
`Time` reference, which is a combination frequently used by concrete
|
|
|
functionObjects.
|
|
|
`Time` reference, which provides a combination that is frequently used
|
|
|
by concrete functionObjects.
|
|
|
|
|
|
- Remove objects handling is now included in `timeFunctionObject`
|
|
|
and `regionFunctionObject` to make it easier to implement
|
... | ... | @@ -276,7 +266,7 @@ For example, |
|
|
|
|
|
### Output - List
|
|
|
|
|
|
The line-breaks for `UList` output is now compile-time configurable
|
|
|
The line-breaks for `UList` output are now compile-time configurable
|
|
|
via ListPolicy details. The switch between a short list (space separated)
|
|
|
and a long list (newline separated) is now more configurable.
|
|
|
|
... | ... | @@ -296,8 +286,8 @@ Tuple2, for example. |
|
|
|
|
|
### ListOps
|
|
|
|
|
|
Add ListOps find/found accepting a unary predicate, which increases its
|
|
|
variety of use. For example,
|
|
|
Added ListOps find/found methods accepting a unary predicate,
|
|
|
which increases its variety of use. For example,
|
|
|
```
|
|
|
if (ListOps::found(list, matcher))
|
|
|
{
|
... | ... | @@ -331,7 +321,6 @@ if (!findStrings(matcher, list).empty()) |
|
|
- PtrList now has a release() method, for similarity to autoPtr and
|
|
|
unique_ptr and clearer in purpose than using `set(i,nullptr)`.
|
|
|
|
|
|
|
|
|
- support squeezing out (removing) null pointers from a UPtrList, to
|
|
|
remove gaps and compact lists.
|
|
|
|
... | ... | @@ -404,6 +393,7 @@ for (label i : sliceRange(0, 10, 3)) |
|
|
...
|
|
|
}
|
|
|
```
|
|
|
This is equivalent to `for (label i=0; i < 30; i += 3)`
|
|
|
|
|
|
|
|
|
### MinMax
|
... | ... | @@ -418,7 +408,7 @@ required since it avoids looping twice through the data. |
|
|
- Implemented for lists, fields, field-fields, DimensionedField,
|
|
|
GeometricField (parallel reducing, with boundaries).
|
|
|
|
|
|
The `MinMax` container can also function as range predicate for input
|
|
|
The `MinMax` container can also function as a range predicate for input
|
|
|
checking.
|
|
|
|
|
|
|
... | ... | @@ -442,17 +432,17 @@ limits on single or multiple values. Examples, |
|
|
|
|
|
Function calls,
|
|
|
|
|
|
1.
|
|
|
1. For a single value
|
|
|
```
|
|
|
clip(value, limiter)
|
|
|
```
|
|
|
returns a copy after applying lower/upper limit
|
|
|
|
|
|
2.
|
|
|
2. For a multiple values
|
|
|
```
|
|
|
clip(values, limiter)
|
|
|
```
|
|
|
returns a tmp<Field> of clipped values
|
|
|
returns a `tmp<Field>` of clipped values
|
|
|
|
|
|
|
|
|
|
... | ... | @@ -470,11 +460,11 @@ This release has several improvements for dense matrices. |
|
|
- iterators, begin/end, empty() methods for STL behaviour.
|
|
|
|
|
|
- access methods consistent with other OpenFOAM containers:
|
|
|
* data(), cdata(), uniform()
|
|
|
- data(), cdata(), uniform()
|
|
|
|
|
|
- construct/assign moveable
|
|
|
|
|
|
- Can recover matrix storage for re-use elsewhere.
|
|
|
- can recover matrix storage for re-use elsewhere.
|
|
|
For example, to populate values with 2D i-j addressing and later
|
|
|
release it as flat linear storage.
|
|
|
|
... | ... | @@ -484,13 +474,11 @@ This release has several improvements for dense matrices. |
|
|
- support both matrix/column-vector and row-vector/matrix
|
|
|
multiplication. Methods names consistent with lduMatrix:
|
|
|
```
|
|
|
Matrix::Amul -> A*x [matrix][col-vector]
|
|
|
Matrix::Tmul -> x*A [row-vector][matrix]
|
|
|
Matrix::Amul -> A*x [matrix] * [col-vector]
|
|
|
Matrix::Tmul -> x*A [row-vector] * [matrix]
|
|
|
```
|
|
|
|
|
|
- support LLTMatrix, QRMatrix solve of indirect lists
|
|
|
|
|
|
|
|
|
- support solve of indirect lists in LLTMatrix, QRMatrix
|
|
|
|
|
|
|
|
|
[v1906-notes]: https://www.openfoam.com/releases/openfoam-v1906/ |