Commit Graph

7814 Commits

Author SHA1 Message Date
b0d29ba8d6 ENH: add UPstream interface for MPI/IO
- supports writing, but without overlapping (begin/end) semantics.
2025-09-30 10:16:23 +02:00
c6fc90b629 ENH: add in-place modification for OCharStream
- 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      |
2025-09-30 09:21:29 +02:00
462d04dcd4 ENH: minor cleanup of memory streams and IOstreamOption
- 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
2025-09-29 13:00:46 +02:00
ac1c41a51b ENH: align zones writing pattern with polyBoundaryMesh, patchField etc.
STYLE: output the zone meta data (names) as an undecorated wordList

ENH: extra safety check in reorderZones to avoid any possible leaking
2025-09-23 12:57:02 +02:00
c378893bcb ENH: simplify direct creation of dictionary primitive entries
- 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
2025-09-23 12:53:30 +02:00
a26f7c243a BUG: ensure check file not written if 'none' option is set 2025-09-04 09:23:33 +01:00
88ff32b713 ENH: MSwindows implementation for memInfo (#3396)
- based on code provided by Daniel Jasinski
2025-09-01 09:34:48 +02:00
4c13fd8658 ENH: provide extended fileOperation::detectProcessorPath()
- returns collated grouping as an output parameter
2025-09-01 09:34:48 +02:00
bd57627955 ENH: extend bitSet functionality
- 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
2025-09-01 09:34:48 +02:00
376674d568 STYLE: remove redundant template parameter for CompactIOField, CompactIOList
- the packed content type can be determined directly from
  List<T>::value_type without need for an additional template parameter.
2025-08-27 12:12:19 +02:00
b2135600a8 ENH: add readContents to CompactIOList, CompactIOField
- 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.
2025-08-27 12:12:19 +02:00
697b8a1436 ENH: improved handling of PtrList copies/cloning
- 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.
2025-08-27 12:12:19 +02:00
3ad17ddf5e ENH: extend UList<bool> specializations to include any(), all(), none()
- simplifies code with boolList vs. bitSet
2025-08-27 11:59:36 +02:00
2446f3f0c7 ENH: handle 'void' type in IOobject::typeHeaderOk
- 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
2025-08-27 11:59:36 +02:00
f3c97d41bd ENH: support wmake -all=FILE option
- allows specialized versions of ./Allwmake in the local directory
2025-08-21 20:36:20 +02:00
9c13057b80 ENH: createPatch: do not remove added patches. Fixes #2726 2025-08-20 15:13:48 +01:00
3a78203863 DEFEATURE: remove mixed precision support for streaming particles (#3412)
- 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.
2025-08-19 10:56:23 +00:00
14b68a7f05 ENH: createPatch: late adding patchfields. Fixes #3410
Thanks to Alexey Matveichev
2025-08-18 13:38:43 +01:00
24b79d3469 ENH: surfaceHookUp: add maximum-iteration option (fixes #3401) 2025-08-13 16:43:53 +01:00
1642841868 ENH: allow modifiable access to IOobject local(), as per instance()
ENH: simplify code by using fieldTypes::is_xxx() tests
2025-08-13 11:57:15 +02:00
891ac808de FIX: robuster blockMesh, face::centre with SP mode (#3411)
- 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.
2025-08-12 09:24:47 +02:00
0483e4826a ENH: cleaner coding for low-level readRawLabel, readRawScalar (#1378)
- 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
2025-08-12 09:24:46 +02:00
6a72b0e607 DEFEATURE: remove OStringStream::count() method (issue #3281)
- 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
2025-08-12 09:24:46 +02:00
53af711c6a ENH: simplify assign zero for Dimensioned and Geometric fields (#3402)
- 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.
2025-07-30 09:29:53 +02:00
a68ed1371f FIX: incorrect DynamicList resizing logic (memory pool)
- 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.
2025-07-28 14:58:08 +02:00
0a421c99ab ENH: checkMesh -writeChecks : support multi-region - see EP10:599 2025-07-24 15:09:58 +01:00
7a8089e076 ENH: extrudeMesh: excess code 2025-07-16 16:48:17 +01:00
bbef1bc289 ENH: report best dictionary context for failed foamDictionary search (#3379) 2025-07-03 14:35:54 +01:00
fabb1c2ce5 RELEASE: Updated headers to v2506 2025-06-27 09:46:28 +01:00
453efa7ca8 COMP: minor changes for gcc-15
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)
2025-06-27 09:42:51 +01:00
4d702d25a6 Merge remote-tracking branch 'origin/master' into develop 2025-06-27 09:41:03 +01:00
2b0e4dc97a ENH: potentialFoam: allow swirl bc. See #3211
Bypasses the constraint override. Contentious -
does field algebra or boundary constraints take
priority.
2025-06-16 17:13:31 +01:00
93f980834b ENH: support patch group selection
- vtkWrite, foamToVTK, surfaceMeshExtract
2025-06-13 10:29:32 +02:00
a860d48637 ENH: make some vectorTensorTransform methods inplace
- 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
2025-06-12 13:13:26 +02:00
9bdb75eeef ENH: add ListOps::equal() function
- 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
2025-06-12 13:13:26 +02:00
164a3e8330 ENH: IOstream::unsetf() now returns old flags (eg, for toggling)
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
2025-06-05 16:06:56 +02:00
9e8e14e448 TUT: minor tutorial cleanup
- 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
2025-06-04 16:39:34 +02:00
d6e6450834 ENH: add missing construct GeometricField from primitive field (tmp)
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
2025-05-28 17:50:55 +02:00
8d9f4c54f3 COMP: suppress false positives from -Wdangling-reference (gcc)
- 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)
2025-05-27 18:25:58 +02:00
82e0d76748 ENH: provide basic hooks for alternative List/Matrix allocators
- include "contiguous.H" in ListPolicy, which makes it available
  whenever UList.H has been included

ENH: return plain List instead of shrinking the DynamicList
2025-05-22 14:41:05 +02:00
4e513cec18 ENH: DimensionedField, GeometricField enhancements and style changes
- 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
2025-05-21 14:19:36 +02:00
ae3adc1007 ENH: add fvPatch::offset() as pass-through to polyPatch::offset()
- 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.
2025-05-21 14:19:36 +02:00
a0bba74950 STYLE: remove old (__cplusplus >= 201703L) checks
- now using c++17 throughout
2025-05-21 14:19:36 +02:00
34143b433a ENH: allow disabling of initial MPI_Comm_dup(MPI_COMM_WORLD,...)
- 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
2025-04-30 12:38:45 +02:00
1d62b6274e COMP: add <numeric> to stdFoam.H
- 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)
2025-04-29 15:42:39 +02:00
5ee8f19bdd ENH: refine handling of DynamicList/DynamicField resizing
- 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
2025-04-29 15:42:39 +02:00
91e7870ee8 ENH: extend patch/boundary methods: faces(), faceOwner()
- similar to polyBoundaryMesh
2025-04-29 15:42:39 +02:00
59f3c55871 STYLE: avoid implicit cast of UList to List 2025-04-09 15:58:30 +02:00
0be19b7fae COMP: namespace qualify min/max functions (#3348)
FIX: missing patch face index writeFields (#3347)
2025-04-09 15:58:30 +02:00
01727c84f1 ENH: use gMinMax() instead of separate gMin(), gMax()
- 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)
2025-04-09 15:58:30 +02:00