- enables partial overwriting of content
- make default construct zero-sized, add reserve_exact() method
- improve sizing behaviour of OCharStream.
Since char buffers will approach the INT_MAX size more quickly than
other content, adapt the following strategy:
| Capacity range | Strategy |
|--------------------|------------------------------|
| 0 < N <= 0.25) | fast growth (2) |
| 0.25 < N <= 0.5) | slower growth (1.5) |
| 0.5 < N <= 0.75) | very slow growth (1.25) |
| 0.75 < N | already large - use max |
- improves usability of List as a general dynamic container as member
data without inheritance. Provide the same method for DynamicList
to enable more efficient use.
- additional string_view support for charList: useful when being used
as a character buffer
STYLE: improve allocation handling in List
- consolidate routines. Only assign size after allocation to ensure
that states are always consistent.
- make memory streams header-only (simpler)
- add sub-views and direct seek for span streams
New IOobject convenience methods
- IOobject::instanceValue() : return the IOobject instance as a scalar
value (or 0). Effectively the same as instant(io.instance()).value()
but with far less typing.
- IOobject::fileModificationChecking_masterOnly() : combines checks for
time-stamp and inotify variants
STYLE: minor adjustments for Enum
- can now create an empty entry and add/overwrite with tokens afterwards,
or copy/move construct from a list of tokens.
ENH: provided named token setter methods (disambiguates bool/char/label)
COMP: use 'if constexpr' for FlatOutput
DOC: more description for Field
- num_blocks(), test_set() as per boost
- broadcast(), reduceAnd(), reduceOr() to simplify parallel operations
- matrix-like output for PackedList::writeList()
BUG: Pstream::broadcastList() missing resize on sub-ranks
- latent bug since it was unused in any OpenFOAM code
- the snGradTransformDiag() is used in this type of code:
```
if constexpr (!is_rotational_vectorspace_v<Type>)
{
// Rotational-invariant type
return tmp<Field<Type>>::New(this->size(), pTraits<Type>::one);
}
else
{
return pTraits<Type>::one - snGradTransformDiag();
}
```
This implies that a rotational-invariant form should return 0
and not 1 like the pow(..., 0) does.
This is a backstop for any code that may inadvertently hit it,
but also allows the possibility of having integer indicator fields
without upsetting the compiler.
STYLE: doTransform() logic now uses is_rotational_vectorspace
- a special case of fixedValue with a value of zero:
* non-assignable
* no mapping needed
* value internal coeffs are zero
* value boundary coeffs are zero
- align some of the internal handling with each other and with
CompactListList
ENH: add readContentsSize to IOList, IOField etc.
- sometimes just need to know how many elements are stored on disk
without actually caring about the content. In those cases, can
frequently just get that information from the first label token
without needing to read anything else.
- the logic has been revised to allow list copying with nullptr entries.
These previously would have thrown an error.
- remove PtrList trimTrailingNull() method.
It was unused and would result in inconsistent addressing sizes.
FIX: inconsistent sizing used for DynamicList/PtrDynList clearStorage()
- older code did not reset addressable size prior to clearStorage()
or transfer(). Only a latent bug until memory pools are used.
- can be used in most places where checkType=false is used
ENH: add non-const get() method to HashPtrTable
- allows checking and modification (symmetric with PtrList methods)
STYLE: improve annotations in fileOperations headers
- provides some additional safety and precludes any recursive searching
ENH: support local directory handling in regionProperties
- allows alternative locations. Eg, for finite-area (#3419)
- since direct streaming of particles is only ever used internally and
never for disk I/O (which is collated by property), mixed precision
will never occur when constructing a particle from a stream.
Due to padding issues, the previous code would have been faulty anyhow.
Thus remove that code and replace with a simple sanity check.
- appears to hit single precision overflow with clang-15 in
face::center(), cellModel::center() and blockMesh createPoints().
The blockMesh might be particularly sensitive, since the points are
frequently defined in millimeters (scaled later), which results
in large intermediate summations.
Similar to primitiveMesh checks, use double precision for these
calculations.
ENH: support vector += and -= from compatible types
- eg, doubleVector += floatVector is now supported.
This streamlines some coding for mixed precision.
- To avoid lots of boilerplate, do not yet attempt to support general
operations such as `operator+(doubleVector, floatVector)`
until they become necessary.
- since pointConstraint is a tuple of (label, vector) not simply use
readRawLabel, readRawScalar since the tuple will also include
trailing padding and/or padding between its members
FIX: remove flawed handling of non-native precision for directionInfo
- packing of (label, vector) makes handling of non-native content
non-trivial (#3412). Content is only streamed, not written to disk,
so replace with a fatalCheck.
- local templates and 'if constexpr' to simplify logic and reduce
reliance on pre-processor defines.
FIX: readScalarOrDefault used scalarToken() not number() token
- will rarely (or never) be triggered, but was inconsistent
- as seen in #3201, using count() based on the ostringstream tellp
is not reliable since it is not updated with reset or copying.
STYLE: minor changes to string/char/span streams
- update docs to only mention string_view
- use auto return, without extra trailing 'decltype'
ENH: add IOstream size check helper methods
* checkNativeSizes() : test only
* fatalCheckNativeSizes() : an assert with FatalIOError
- find patch by name and return pointer to it. Similar to cfindZone()
ENH: robuster PatchFunction1 handling for uniformFixedValuePointPatchField
COMP: use 'if constexpr' with is_contiguous check
STYLE: consistent patch slicing parameters
- slice UList values, not List values
- base DimensionedField on DynamicField instead of Field to allow
convenient resizing
- initial infrastructure for unified GeometricField handling with
the boundaryEvaluate() method
Co-authored-by: <Mark.Olesen@keysight.com>
- regular or forced assignment from `zero` does not need dimension
checking:
Old: U = dimensionedVector(U.dimensions(), Zero);
New: U = Zero;
this eliminates a fair bit of clutter and simplifies new coding
without losing general dimension checking capabilities.