Preview information, subject to change at any time !!!
- Incompatibilities
- Deprecation and Removal
- Changes in definition
- Changes in behaviour
- Tokenization/Parsing Improvements
- New methods
- Other
Incompatibilities
-
fvMeshDistribute
: geometric tolerances have been removed, which means that the constructor now takes a single parameter only. -
protected
UList::size(label)
: renamed tosetAddressableSize(label)
The longer name for this low-level protected method eliminates some ambiguity (eg, withresize
,setSize
) and enables more precise inheritance patterns. The name is consistent with PtrListDetail internals. -
ITstream
: parsing constructor
Elminate mandatory name for parsing versions. This makes it easier to use ITstream, IStringStream, UListStream interchangeable.
Deprecation and Removal
Deprecated classes
-
partialFaceAreaWeightAMI
: functionality replaced by the faceAreaWeightAMI class. -
fieldValueDelta
: equivalent and more flexible functionality offered by themultiFieldValue
function object.
Deprecated Methods
Internal hashing functors have been standardized with method name to reduce clutter and provide better alignment with standard C++ practices.
// Old:
FixedList<label, 3>::Hash<>()
// New:
FixedList<label, 3>::hasher()
// Unchanged:
labelHashSet::hasher()
Existing Hash<>
functor namings are still supported, but deprecated.
Removed Methods
-
The
longestEdge
global function, which was deprecated and replaced by theface::longestEdge()
method (2017-04) has now been removed. -
Removed construct List from two iterators. This constructor was added for similarity with std::vector, but continues to cause various annoyances. If The
ListOps::create()
function provides a lengthier alternative but one that can also incorporate transformations. -
removed
fileName::clean() const
method
Relying on const/non-const to control the behaviour (inplace change or return a copy) is too fragile and the const version was almost never used. Now replace with a two-stage process when needed.// OLD (2012 and earlier) fileName sanitized = constPath.clean(); // NEW (2106) fileName sanitized(constPath); sanitized.clean());
Removed Items
Changes in definition
Changes in behaviour
- construction of
DynamicField
with a size is now consistent withDynamicList
- it now reserves space only and leaves the initial addressable size as zero.
Tokenization/Parsing Improvements
To better harness the OpenFOAM parsing routines, the token handling and ITstream have been extended to include numerous failsafe access methods and direct checking of types.
Direct check of punctuation and word tokens: For example,
if (tok.isWord("uniform")) ..
while (!tok.isPunctuation(token::BEGIN_LIST)) ..
instead of the equivalent lengthier versions:
if (tok.isWord() && tok.wordToken() == "uniform") ..
while (!(tok.isPunctuation() && tok.pToken() == token::BEGIN_LIST)) ..
Failsafe versions for lookahead tokens: Istream peek(), ITstream peek(), peekFirst(), peekLast(). Failsafe traversing: ITstream skip(). This makes it possible to write LALR(1) parsers using OpenFOAM classes.
For example,
ITstream& is = dict.lookup(key);
if (is.peek().isWord())
{
is.skip();
}
New methods
The face
class now has a symmetric hasher that starts with lowest
vertex value and walks in the direction of the next lowest value. This
ensures that the hash code is independent of face orientation and face
rotation.
Other
-
Replaced keyType with wordRe for matching selections
-
noexcept version of size_bytes() for List and other containers. Used when the is_contiguous check has already been done outside the loop. Naming as per std::span.