Commit Graph

18052 Commits

Author SHA1 Message Date
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
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
f7fd9f8186 ENH: FA film models - added zonal Cf specification for Darcy model
Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2025-09-12 14:36:25 +01:00
1e715d3847 STYLE: coneNozzleInjection: use Umag instead of UMag for consistency (fixes #1168) 2025-09-11 09:35:02 +01:00
ec2b71f324 BUG: Lee: fix the sign for the solid-to-liquid mass transfer model (fixes #3429) 2025-09-08 13:21:32 +01:00
52f2c42e54 BUG: InjectionModelList: avoid an FPE instance while using spray cloud (fixes #3413) 2025-09-08 11:19:51 +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
7fa861f09b ENH: extend faPatchField, fvPatchField to support non-allocating snGrad()
Co-authored-by: <Mark.Olesen@keysight.com>
2025-08-28 14:18:25 +00:00
202b448b8f ENH: enforce snGradTransformDiag() as zero for rotational-invariant
- 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
2025-08-28 14:18:25 +00:00
4cc8423c94 ENH: support zeroValue boundary condition
- 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
2025-08-28 14:18:25 +00: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
a85b0f0736 STYLE: replace UList<char> specializations with 'if constexpr' handling 2025-08-27 11:59:36 +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
8aa69ad976 BUG: shm: filter out duplicates. Fixes #3333
Problem was duplicates in list of patches to
add buffer layers to
2025-08-21 17:42:35 +01:00
9c13057b80 ENH: createPatch: do not remove added patches. Fixes #2726 2025-08-20 15:13:48 +01:00
828693bc90 ENH: explicitly handle empty name lookup (objectRegistry, IOobjectList)
- provides some additional safety and precludes any recursive searching

ENH: support local directory handling in regionProperties

- allows alternative locations. Eg, for finite-area (#3419)
2025-08-19 14:42:01 +02: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
45f34f558b BUG: snappyHexMesh: parallel consistency. Fixes #2320
non-adapt patches using zero values were only seen if on
same processor
2025-08-17 08:58:41 +01:00
f000a8e43d BUG: missed removal of pointMesh/boundaryProcAddressing (fixes #3412) 2025-08-14 10:56:18 +02:00
821cdf6681 ENH: energyTransport: transfer write control from controlDict to function object (#3303) 2025-08-13 16:30:51 +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
fe7006acd7 ENH: support mixed-precision reading for pointConstraintList (#3405)
- 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.
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
fcc8e62e47 ENH: add cfindPatch() method to boundary meshes
- 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
2025-08-12 09:24:46 +02:00
631b6e5111 ENH: add convenience fieldTypes tests for volume/area etc fields 2025-08-12 09:24:46 +02:00
83107a192c COMP: add forward declaration for UPstream::File
BUG: typo in UPstream::Window::put() code
2025-08-12 09:24:46 +02:00
954a54ea73 BUG: heatTransferCoeff: correct the radiation-contribution sign (fixes #3325) 2025-08-08 15:35:00 +01:00
9cbf544ecd ENH: AMIInterpolation: make matching more robust 2025-08-06 11:11:37 +01:00
1bcad518c6 ENH: pointConstraint: work in binary mode 2025-07-31 14:53:21 +01:00
a32493778a ENH: surfaceSlip: allow use on stand-alone pointPatches. Fixes #3404 2025-07-31 11:39:06 +01:00
c108153d06 ENH: DimensionedField/GeometricField provision for additional storage
- 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>
2025-07-30 09:43:57 +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