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)
- these already existed for a single value, but now handle the full
field. This is more memory-friendly.
fld.clamp_min(lower); OLD: fld = max(fld, lower);
fld.clamp_max(upper); OLD: fld = min(fld, upper);
- central way to calculate reverse sizes for dynamic containers.
For example;
reserve_size<16, 2>(len, cap); // min-size=16, ratio=2
reserve_size<16, 3, 2>(len, cap); // min-size=16, ratio=1.5
replaces this type of code that was used in several places:
max(SizeMin, max(len, label(2*capacity_)));
The caller will have already checked (len < cap) before deciding
to make this call.
ENH: updates for DynamicList/DynamicField handling
- add reserve_exact() method, which is like reserve() but without any
extra sizing heuristics
- add DynamicField 'reuse' constructors, consistent with Field constructors
- sync allocated size before list destruction.
This may help when using aligned allocation strategies.
- provide separate float/double UList interfaces, which improves
flexibility (eg, with SPDP)
- sigFpe::fillNan_if() interface, for filling in when using alternative
memory allocators
- previous code used derived string iterators, but these would
be largely ignored anyhow since the underlying std::sub_match
str() method would just yields a std::string anyhow.
The SubStrings::str(size_t) method wasn't used in any code, so now
just use std::string iterators only.
This change simplfies overall handling, since it removes an unneeded
template dependency.
- easier to create type-specific looping in templated code
STYLE: pass 'direction' and 'label' by value instead of reference
COMP: qualify Foam::min() in dense matrix classes
- compiler versions are now sufficient that only the C++ regex
interface is now being used. Can remove the old POSIX code
accordingly.
This change also removes any dependency on the SubStrings class to
manage the matching results.
ENH: remove OpenFOAM dependencies from MacOS addr2line utility
- The register keyword has been removed from c++17 but old flex
versions (version < 2.6.0) produce code including it, leading to
compilation errors when using clang (despite disabling the diagnostic).
gcc compiles but issues warnings.
- use '#define register' as empty as a workaround
STYLE: mark Pstream::scatterList() as deprecated
- this entry point is not directly used anywhere, only the
scatterList_algorithm backend is actually used.
The scatterList() routine is misnomer since it actually works like a
broadcast that skips overwriting the local rank, but only if used in
combination with the gatherList() manual implementation that uses
the same walk pattern.
- can be used to simplify some logic. For example,
if
(
(tok.read(is) && tok.isWord("FoamFile"))
&& (tok.read(is) && tok.isPunctuation(token::BEGIN_BLOCK))
)
...
vs
if
(
(is.good() && (is >> tok) && tok.isWord("FoamFile")) ...
&& (is.good() && (is >> tok) && tok.isPunctuation(token::BEGIN_BLOCK))
) ...
- compiler cannot decide between std::string and std::string_view
when creating from 'const char*' without also supplying the size,
so also supply a 'const char*' constructor.
ENH: additional string_view handling for ITstream and SubStrings
- the 'move' treatment performs a shallow copy but does not alter
the passed parameter. Identical semantics as per std::span.
ENH: constexpr for basic HashTable constructors
STYLE: 'Foam::zero' instead of 'const Foam::zero' for containers
- this is simply a compiler dispatch flag, so the additional 'const'
qualifier is unnecessary
- simplify and rationalize some of the broadcast methods for more code
reuse.
The bottom level UPstream::broadcast is now always to/from "root=0".
This was previously passed as a default parameter, but never used
anything other than '0' in the code. Fixing it as '0' makes it
consistent with the 'top-down' logical for node-based broadcast.
- now distinguish between basic MPI types and user-defined types.
The new front-facing trait UPstream_basic_dataType unwinds components
and other types, but only for MPI fundamental types
(including any aliases)
- additional helper to combine a test for binary operator validity and
basic data type validity, which better expresses intent:
template<class BinaryOp, class T>
UPstream_data_opType;
- relax bit-wise operators to also accept signed integrals
and 'void' generic