Commit Graph

27577 Commits

Author SHA1 Message Date
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
f96c5fafb0 Merge branch 'improve-IOobject_PtrList_CompactIOList_List' into 'develop'
general list cleanups

See merge request Development/openfoam!754
2025-08-28 08:44:32 +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
8357b7e28b CONFIG: handle mpirunDebug stdin redirection before execution (#3389)
- previously handled stdin redirection as part of the run command but
  (as Alexey Matveichev noted) this meant the command would actually
  require an `eval` for this to work. Instead redirect before executing
  the run command.

- can always use 'echo -e' (bash builtin) in mpirunDebug

CONFIG: add removal of mpirun.files/ to CleanFunctions

- leave mpirun.log/ files untouched, since they may still be useful
  for later diagnosis
2025-08-19 15:34:27 +02: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
1f5eb55eeb Merge branch 'remove-mixed-precision-particle-streaming_issue3412' into 'develop'
DEFEATURE: remove mixed precision support for streaming particles (#3412)

See merge request Development/openfoam!752
2025-08-19 10:56:45 +00: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
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
24b79d3469 ENH: surfaceHookUp: add maximum-iteration option (fixes #3401) 2025-08-13 16:43:53 +01:00
821cdf6681 ENH: energyTransport: transfer write control from controlDict to function object (#3303) 2025-08-13 16:30:51 +01:00
eaf17337aa ENH: support prefix and log-dir for RunFunctions (#3386)
- these new options permit alternative naming conventions.
  For example,

      runApplication -prefix 0001_ -suffix log blockMesh

      -> 0001_blockMesh.log
2025-08-13 12:39:42 +02: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
233da9adaa TUT: bubbleColumnIATE: correct Crc-coefficient value (fixes #3362) 2025-08-11 21:32:49 +01: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
e4c1a252c6 Merge branch 'GeometricField-tweaks' into 'develop'
preliminary infrastructure for sliced/unified fields

See merge request Development/openfoam!751
2025-07-30 12:13:50 +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
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
6ac50a3307 ENH: Added onStart option to timeControl for function object control
Triggers function object to execute on the first time step.

Example usage:

    minMax1
    {
        type            fieldMinMax;
        libs            (fieldFunctionObjects);
        writeControl    onStart;
        fields          (".*");
    }

Ref: EP2608
2025-07-24 15:09:58 +01:00
0a421c99ab ENH: checkMesh -writeChecks : support multi-region - see EP10:599 2025-07-24 15:09:58 +01:00
20e04a88f7 BUG: cylinderToCell: avoid large-number subtraction (fixes #3378) 2025-07-23 14:17:57 +01:00
9629ae8aa9 ENH: mapDistribute: add separate input and output
To avoid making initial copy of input to output field.
2025-07-17 09:59:46 +01:00
7a8089e076 ENH: extrudeMesh: excess code 2025-07-16 16:48:17 +01:00
4cd1912e4c BUG: AMIInterpolation: keep old geomComm. See #3372
Correcting bug introduced when trying to keep the old communicator.
We do not need local communicator if all ranks of comm have
some faces. Not all ranks of the already local communicator.
2025-07-14 14:43:50 +01:00
9eede215b0 BUG: argList: print excess. Fixes #3384 2025-07-14 14:43:50 +01:00
d37c685523 ENH: holeToFace: corrected documentation 2025-07-14 11:13:00 +01:00
bbef1bc289 ENH: report best dictionary context for failed foamDictionary search (#3379) 2025-07-03 14:35:54 +01:00
615aae61d7 RELEASE: Updated config to v2506 OpenFOAM-v2506 2025-06-27 09:47:59 +01:00