Commit Graph

27643 Commits

Author SHA1 Message Date
013dbb8248 BUG: Pstream: incorrect indexing. Fixes #3452 2025-10-16 11:52:12 +01:00
e9fcd75ec4 ENH: add default "constant" name for fileOperations::findTimes()
- makes fileHandler calling resemble Time more closely

ENH: provide natural_sort less/greater functions

- more succinct than (compare < 0) or (compare > 0).
  The corresponding wrappers for UList renamed as list_less, etc
  but they were only used in unit tests

ENH: handle (-allRegions | -all-regions, ..) directly when retrieving args

- makes handling independent of aliasing order

STYLE: include <string_view> when including <string>

- the standard does not guarantee which headers (if any) actually
  include string_view
2025-10-12 15:53:26 +02:00
ac34d9fd29 ENH: allow delayed construction of regionFaModel in volume bcs (#3419)
Ideally wish to delay construction of the finite-area mesh until
  updateCoeffs(), when it is actually needed.

  This helps avoid difficult to trace errors and avoids inadvertent
  parallel communication during construction from a dictionary.

  However, lazy evaluation fails at the later stage while attempting
  to load the corresponding initial fields, since the timeIndex has
  already advanced.

  Use the newly introduced regionModels::allowFaModels() switch
  to locally enable or disable lazy evaluation as needed.

  This allows selective disabling (eg, in post-processing utilities)
  where loading the volume field should not activate the associated
  regionFaModel and loading a finite-area mesh too (which may not
  exist or be defined at that point).
2025-10-11 19:51:51 +02:00
14bece937b ENH: added clean up function remove0DirFields (RunFunctions)
- less typing than before and avoids relying on bash-specific behaviour
  (fixes #3448)

ENH: add -region support for cleanFaMesh and cleanPolyMesh

CONFIG: add bash completion help for -area-region

ENH: general improvements for regionProperties

- robustness and failsafe for foamListRegions, regionProperties
- additional global model switches for regionModels
2025-10-10 18:18:31 +02:00
2396828a60 ENH: increase some string_view coverage
- remove some stdFoam::span<char> handling, which was just a stop-gap
  measure
2025-10-10 09:05:23 +02:00
9223d238bd STYLE: surface/volume writing function objects
- further hide implementation (cxx ending)

STYLE: better distinction between code/templates for fileFormats/conversion

- for ensight and vtk, a large part of the code is header only.
  Make this easier to identify
2025-10-10 08:54:03 +02:00
4b92bb6533 ENH: update globalIndex::mpiGather to use MPI intrinsic/user types
- add provisional support for selecting MPI_Gatherv
  when merging fields in the surface writers.
  Uses the 'gatherv' keyword [experimental]

BUG: gatherv/scatterv wrappers used the incorrect data type

- incorrectly checked against UPstream_basic_dataType trait instead of
  UPstream_dataType, which resulted in a count mismatch for
  user-defined types (eg, vector, tensor,...).

  This was not visibly active bug, since previous internal uses of
  gatherv were restricted to primitive types.

COMP: make UPstream dataType traits size(...) constexpr

- allows static asserts and/or compile-time selection
  of code based on size(1)
2025-10-10 08:51:20 +02:00
55c81bce1b ENH: GAMGAgglomeration: increase repeatability. Fixes #3450 2025-10-09 11:55:06 +01:00
1cb0b7b6c9 Merge branch 'extend-field-distributors' into 'develop'
cleanup of decompose/reconstruct/redistribute, adding area-name support

See merge request Development/openfoam!761
2025-10-09 10:29:56 +00:00
7f939f6d2d ENH: increase coverage of bitSet support for field distributors 2025-10-08 21:26:37 +02:00
cbb66f7bc7 ENH: add area-name handling for faMesh decompose/reconstruct (#3419)
- using labelUList addressing

- support direct handling of pointers (as well as autoPtr)
2025-10-08 21:26:30 +02:00
5d7bd9c497 ENH: decompose/reconstruct using labelUList, UPtrList addressing
ENH: reduce some overhead for processorMeshes reconstructPoints
2025-10-08 21:26:22 +02:00
601239f59a Merge branch 'multi-finite-area.base-changes' into 'develop'
base changes to finite-area and faOptions to recognize different area regions.

See merge request Development/openfoam!760
2025-10-08 12:21:17 +01:00
b25147a4f8 ENH: finite-area region support to all faOptions and regionFaModels
- for a non-default mesh region, corresponding files:

     system/finite-area/faOptions.<name>
     system/finite-area/<name>/faSchemes, etc

  if the entries within the faOptions dictionary happen to contain an
  "area" entry and it conflicts with what is expected, it will be
  rejected when creating the list of options, which helps avoid
  unexpected behaviour and simplifies overall handling.
2025-10-08 13:17:40 +02:00
19628b9576 ENH: update faOptions handling to respect finite-area locations
- new locations
    * constant/finite-area/faOptions
    * system/finite-area/faOptions

- legacy locations are still supported
    * constant/faOptions
    * system/faOptions

TUT: update faOptions locations
2025-10-08 13:17:40 +02:00
b913463d95 ENH: correct handling of area-name for faMesh (#3419)
- unlike fvMesh and polyMesh, the faMesh mesh region name is passed
  separately into constructors and functions. Thus need the same for
  faMeshTools and faMeshSubset.

- ensure that an empty area name is treated like
  polyMesh::defaultRegion.
  The faMeshRegistry or other registries cannot have an empty name!
2025-10-08 13:17:40 +02:00
3ae725592d ENH: add area-regions option handling (based partly on regionProperties)
- extend the getAllRegionOptions and getAllFaRegionOptions handling
  to use the supplied string literals as fallback values.

  If regionProperties is missing (or empty) and the -regions/-area-regions
  option is supplied with literal names, these will be used directly
  instead of being used to filter the regionProperties.

STYLE: support both -all-regions and -allRegions
2025-10-08 13:17:39 +02:00
d6081a18f6 ENH: simpler mechanical or thermal use of solidProperties
- in some shell models, only the mechanical properties (rho,E,nu) are
  meaningful or just the basic thermal properties
  (rho,Cp,kappa,emissivity).

  Add a distinction when reading the dictionary entries
  if those properties are mandatory and the thermo properties
  (eg, molWt, Cp, etc) are optional or not.

  This simplifies user input for thermal and vibration shell models.
2025-10-08 13:17:39 +02:00
e46cc77a5b CONFIG: bump patch level to 2507
- changes in stream handling
- imminent API changes for finite-area
2025-10-08 13:11:07 +02:00
5321c92e3d SUBMODULE: update OpenQBMM (some compilation changes) 2025-10-08 13:05:57 +02:00
97cbe9c54e Merge branch 'update-UPstreamRequests-handling' into 'develop'
refine request handling to support MPI idioms

See merge request Development/openfoam!759
2025-10-08 10:49:29 +00:00
06b3e9bd0b ENH: update/refine UPstream request handling
- activeRequest() checks if given request is still active/pending

- finishedRequest() will now always call MPI_Test when running in
  parallel instead of using a fast-path for skipping a null request.
  This allows MPI a chance to progress operations even if that
  particular request is not active.

- sameProcs() is a convenience wrapper for the following:
  * check if indices resolve to the same underlying procs
  * check the communicator procs against a list of procs
  * to compare two lists of procs.

  For example, check if the communicator corresponds to a
  host-local communication:

     if (UPstream::sameProcs(UPstream::commLocalNode(), myComm)) ...

STYLE: UPstream::Request gets an 'active()' method

- more MPI idiomatic than 'good'
2025-10-07 21:04:23 +02:00
a6c924cf8f COMP: minor adjustments for MacOS
- to avoid the many overload warnings on that platform,
  may wish to use

      FOAM_EXTRA_CXXFLAGS="-Wno-overloaded-virtual"

GIT: remove some old compilation stub files
2025-10-07 19:43:07 +02:00
e5848196ef Merge branch 'mixed-precision-streams' into 'develop'
INT: token/stream support for reading/writing int32 and int64

See merge request Development/openfoam!756
2025-10-07 14:51:20 +00:00
aa96119de2 INT: token/stream support for reading/writing int32 and int64
integration-by: Mark Olesen <Mark.Olesen@keysight.com>
2025-10-07 14:50:37 +00:00
11166821f1 REGRESSION: corrected use of inotify 2025-10-06 16:16:26 +01:00
77b2687503 COMP: better constexpr isolation of List<char> specializations
- adjust the if/else-if/else-if cascade to have 'if constexpr (..)'
  first and the *entire* alternate branch within the following 'else'.
  This lets the compiler know that it can safely discarded the other
  parts.

  This change introduces a large amount of indentation change,
  so use `--ignore-space-change` when inspecting.

COMP: reintroduce UList<T>() initialization in List [silence gcc]

COMP: use std::min() instead of direct check [silence gcc]

- gcc complains about possible strict-overflow for this:
  ```
  if (count > len)
  {
      count = len;        // The count truncated by the new length
  }
  ```

  Using `count = std::min(count, len);` avoids these (spurious)
  warnings without adding a "diagnostic ignored" pragma

STYLE: pass std::pair<int,int> by copy [cheaper]

STYLE: make isdigit() and isspace() tests constexpr

- constexpr and C-locale only vs. the std counterparts
2025-10-06 15:54:00 +02:00
52c55543b5 COMP: no-rpath handling not found (darwin) 2025-10-06 15:01:59 +02:00
41231028da Merge branch 'feature-slicing.prerelease' into 'develop'
Adding scratch space for patchField data

See merge request Development/openfoam!757
2025-10-06 12:43:13 +00:00
35615174a3 Adding scratch space for patchField data 2025-10-06 12:43:13 +00:00
b9fecc3898 Merge branch 'time-paths' into 'develop'
Add handling of local/global layout for Time paths

See merge request Development/openfoam!758
2025-10-06 10:26:15 +00:00
c78b510928 ENH: improve search and addressing options for TimePaths
- extend time searching mechanisms to support searching in the case
  global path: times(), findClosestTime(), findInstancePath()

- extend IOobject path() and objectPath() methods with
  IOobjectOption::Layout variants

The changes are needed for addressing a global file structure
in parallel (#3431)
2025-10-05 21:52:51 +02:00
a91587e36a ENH: improve 'fuzzy' matching of time instant
- add '<=' and '>=' operators that include rounding.

  This means that typical code like the following would not have
  considered any rounding:

    instantList times = ...;
    scalar val = ..;

    // No rounding!
    if (times[i].value() <= val) { ... }

    // NEW: with rounding
    if (times[i] <= val) { ... }

    // old equivalent:
    if (times[i].value() <= val || times[i].equal(val)) { ... }

ENH: provide a default stopInstance for fileOperation::findInstance

- makes it more consistent with Time::findInstance and more convenient
  to use

STYLE: minor code style changes to TimePaths etc
2025-10-05 21:52:37 +02:00
9c4d0cdeef BUG: kinematicParcelFoam: correct source-term value (fixes #3446)
- likely results in output changes for denser carrier fluids

Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2025-10-03 15:47:26 +01:00
7a266b566f DOC: functionObjects: overhaul of header documentation 2025-10-02 21:32:26 +01:00
278ad6fb44 Merge branch 'modifiable-memory-streams' into 'develop'
Improve handling and sizing behaviour of memory streams

See merge request Development/openfoam!755
2025-10-01 15:43:01 +01:00
b0d29ba8d6 ENH: add UPstream interface for MPI/IO
- supports writing, but without overlapping (begin/end) semantics.
2025-09-30 10:16:23 +02:00
a42fa7949b ENH: provide Istream::rewind() implementation
- base implementation drops any putback token
2025-09-30 09:32:50 +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
1d1e0c5f13 ENH: make List::resize_copy() a public method
- 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.
2025-09-29 13:18: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
d39b8a5c94 ENH: binField: remove an unused field
- skip the reduce operation for serial mode
- fix typos
2025-09-24 19:34:17 +01:00
b30d42c391 ENH: age: improve field access pattern
- cache the repeated evaluations
2025-09-24 11:55:42 +01:00
f3998b8833 TUT: scalarTransport: reorganise pitzDaily tutorial
- add application missing step to pimpleFoam/RAS/propeller1
2025-09-24 11:55:42 +01:00
1fa20428a8 STYLE: code cleanup for surfaceCourantNumber (#3422)
- simplify some handling. Use reference (not copy) for internalField
2025-09-23 17:02:01 +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
d4019e497d ENH: add/subtract/multiply: validate minimum field count requirement 2025-09-20 18:51:53 +01:00
8be698528a ENH: comfort: improve object performance and readability
- Cache wall patch metadata to avoid repeated computation
- Pre-calculate static dimensioned scalars
- Fix minor typos and enhance code readability
- Improve convergence checking with explicit loop vs max reduction
2025-09-19 20:14:21 +01:00
2d522e921f BUG: FriedrichModel: correct relative-speed calculation (fixes #3436) 2025-09-19 10:55:05 +01:00