- 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 |
- 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
- 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
- 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.
- 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
- 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.
- reserve() did not set the addressable size to the current capacity
before resizing, which meant that the delete[] would not have the
true allocated size. Only affects memory-pool usage (#3381), which
is not yet integrated
ENH: remove unused DynamicList '*_unsafe()' methods
- can result in a mismatch between allocated and addressed sizes,
which becomes important for memory-pool usage.
COMP: unresolved pTraits<long int> for reductions on i586 systems
- now always just use int64_t instead of off_t and time_t
for master reductions.
Note that this is not the only place where the off_t definition
causes compilation issues (cf. fileOperation::broadcastCopy)
- avoids intermediate allocation and re-assignment to self (#3374)
BUG: checkMesh (application) with questionable memory handling (#3374)
- move the contents of the new points instead of attempting to transfer
the entire list
COMP: replace mapDistribute specializations with if constexpr handling
- simplify future maintenance
- tests for list equality with different but compatible data types.
Eg, when comparing lists of int32 and int64 values.
STYLE: pass UList instead of List references into ListOps functors
ENH: align MPI_Probe non-blocking handling with header description
- the header states that the commsType is non-blocking or not,
but the implementation actually checked for 'buffered' or not.
STYLE: fix some spacing and some documentation
- use functionObject writeInterval not timeInterval.
No change in behaviour since the missing writeInterval is treated
as '1' anyhow when using 'timeStep' for the writeControl
- consistent use of 'adjustable' vs 'adjustableRunTime'
- prefer '#eval{ vector(...) }' to calling '#eval' multiple times
ENH: improvements for GeometricBoundaryField evaluation
- early termination from evaluate_if() and evaluateCoupled().
- evaluateCoupled() now forwards to evaluate_if() and receives
additional handling for a 'void' parameter type.
BREAKING: extra template parameter for overset correctBoundaryCondition
- the true/false flag as a template parameter instead of as an
argument to use 'if constexpr' code
- the number of false positives has reduced, but in a few remaining
cases, the compiler cannot possibly "know" that the pointer stored
on the registry will outlive the scope of the method (for example)
gcc-13: suppressing these spurious warnings needs to be done at each
caller, which is simply not worth it, since later compiler versions
provide a cleaner solution.
gcc-14: the [[gnu::no_dangling]] attribute on the declaration
lets the compiler know the intent.
- additional FOAM_REAL_GNUC macro (defined in stdFoam.H) to define
the "real" gcc version and ignoring other compilers masquerading
as gcc.
COMP: rename MeshObject code to {cxx,txx}
- avoids issues on case-insensitive filesystems (#3316)
- include "contiguous.H" in ListPolicy, which makes it available
whenever UList.H has been included
ENH: return plain List instead of shrinking the DynamicList
- constCast() convenience methods.
This simplies coding in places, especially in solvers
- inline some methods within headers, for better overview/maintenance
- only set DimensionedField default value on construct if not read
- storeOldTimes() does not require const_cast
- makes fvPatch consistent with faPatch etc and can simplify coding
ENH: handle sizing within extrapolateInternal() patch field methods
- reduces reliance on any sub-components
ENH: extend polyBoundaryMesh patch selectors
- indices_if() method with a predicate, or with a patch-type
behaves similarly to findPatchIDs(), but returns a sorted
labelList instead of a labelHashSet
- nFaces_if() method with a predicate return the number of boundary
faces for patches matching the given predicate.
- can use -mpi-no-comm-dup to suppress the initial communicator
duplication (to avoid potential deadlock with coupled processes).
This is partly related to comments in merge-request !735
ENH: simplify parsing/removal of local -world option
- can extract the world name in a single pass and also makes the
parsing robuster.
ENH: support regular MPI_Comm_split()
- the two-step method of Allgather + Comm_create_group may not be
expected by other applications (issue #3127) and that can lead to
deadlock, so also add in code for the regular MPI_Comm_split.
Does not support re-sorting keys!
FIX: faulty logic for splitting communicators
- only affected more recent develop branch
- useful to have std::reduce(), std::transform_reduce() available in
more places, so treat like <algorithm> and include in "stdFoam.H"
STYLE: add 'stricter' detection markers for cast of SubList to List etc.
STYLE: remove 'const' qualifier from Foam:one/Foam::zero (in Field)
- previously had special resizing treatment for the corner case when
the addressable size and the new capacity are identical. However,
that particular approach (to minimize copying) meant that the exact
deallocation size would likely be incorrect.
Having the correct deallocation size becomes more important with
alternative allocators.
Introduce resize_copy() protected function to limit the number
of elements copied during the resize.
ENH: provide DynamicList/DynamicField constructor with sizing
- allows fine-grained creation of a DynamicList/DynamicField with a
given size/capacity without an initial value.
COMP: typo in code for DynamicList::push_back() with IndirectList
- for reciprocal values, gMinMax() first and then calculate the
reciprocal, which avoids creating temporaries
STYLE: prefer MinMax to separate min/max accounting
COMP: namespace qualify min/max for deltaT, CourantNo, etc (#3348)