Commit Graph

26525 Commits

Author SHA1 Message Date
7cae3b9660 ENH: add HashTable zero-size construct, move construct is noexcept
BUG: HashTable::operator+= self-assignment check was being ignored

STYLE: minor code cleanup for templated Dictionary types
2023-07-27 16:52:03 +02:00
8117cde596 ENH: use emplace_set, emplace_back to simplify code
- eg, for cloud fields, tmp emplace when reading fields etc.
2023-07-27 16:52:03 +02:00
63258d0b33 ENH: refine PtrList emplace method, add emplace for autoPtr/refPtr...
* resize_null() methods for PtrList variants
  - for cases where an existing PtrList needs a specific size and
    but not retain any existing entries.

    Eg,
        ptrs.resize_null(100);

    vs.   ptrs.free();     ptr.resize(100);
    or    ptr.resize(100); ptrs.free();

* remove stored pointer before emplacing PtrList elements
  - may reduce memory peaks

* STYLE: static_cast of (nullptr) instead of reinterpret_cast of (0)

* COMP: implement emplace_set() for PtrDynList
  - previously missing, which meant it would have leaked through to the
    underlying PtrList definition

* emplace methods for autoPtr, refPtr, tmp
  - applies reset() with forwarding arguments.
    For example,

        tmp<GeoField> tfld = ...;

    later...

        tfld.emplace(io, mesh);

    vs.
        tfld.reset(new GeoField(io, mesh));
    or
        tfld.reset(tmp<GeoField>::New(io, mesh));

    The emplace() obviously has reduced typing, but also allows the
    existing stored pointer to be deleted *before* creating its
    replacement (reduces memory peaks).
2023-07-27 16:52:03 +02:00
5e334c0686 ENH: more consistent use of AMIInterpolation distributed() query 2023-07-27 16:52:03 +02:00
32903d337e ENH: add slice/range support to UPstream::waitSomeRequests()
- this simplifies polling receives and allows separation from
  the sends

ENH: add UPstream::removeRequests(pos, len)

- cancel/free of outstanding requests and remove segment from the
  internal list of outstanding requests
2023-07-27 16:52:03 +02:00
f717f79833 ENH: simplify copy/filling of List containers. Make swap noexcept
- internal use of std::fill instead of legacy manual code

- use UList<T>::deepCopy() to reduce code duplication
2023-07-27 16:41:13 +02:00
3430ab3aa8 STYLE: add reset() method for labelRange for symmetry with MinMax 2023-07-26 18:48:45 +02:00
779c3fe11e STYLE: use 'is_sorted()' instead of 'sorted()' for readers, Pair, ...
- avoids naming ambiguity between querying sorted state vs returning a
  sorted list (for example)

ENH: add 'good()' method to a few more classes
2023-07-19 14:10:31 +02:00
8562f4d7a4 STYLE: use UPtrList::test() instead of separate bounds checking 2023-07-19 14:10:31 +02:00
65cddb6120 ENH: specialise bitOr<unsigned char> reduction
STYLE: remove extraneous parRun check before Pstream::combineReduce

- already handled by Pstream::combineReduce itself

STYLE: remove deprecated globalMeshData::ListPlusEqOp

- deprecated/superseded by ListOps::appendEqOp (2020-09)

STYLE: qualify stream format with IOstreamOption (easier to find)
2023-07-19 14:06:23 +02:00
95b820368c Merge branch 'feature-writeLeakFaces' into 'develop'
ENH: snappyHexMesh: write leak-closure faces

See merge request Development/openfoam!615
2023-07-19 11:58:09 +00:00
ab0d4d95ff ENH: snappyHexMesh: write leak-closure faces 2023-07-19 12:55:02 +01:00
a8df552998 ENH: checkMesh: use built-in merging 2023-07-18 12:03:58 +01:00
edb455ca97 TUT: weightedFluxExample: correct plot indices (fixes #2940) 2023-07-13 16:07:49 +01:00
ae6de092d5 ENH: update vscode-settings (fixes #2935) 2023-07-06 16:23:53 +01:00
69dae2e008 ENH: adjust/update debugSurfaceWriter flags
- removed gatherv control.
  The globalIndex information is cached on the merged surface
  and thus not triggered often.

- strip out debug mergeField method which was a precursor to
  what is now within surfaceWriter itself.

- add 'merge' true/false handling to allow testing without
  parallel merging (implies no writing)
2023-07-05 22:08:54 +02:00
63753605a0 STYLE: update surface writers to use UPstream, IOobjectOption naming 2023-07-05 22:03:09 +02:00
7a29eb9b3b STYLE: remove transitional import of std::unique_ptr in Foam namespace 2023-07-05 18:10:15 +02:00
4db98e5de4 COMP: missing compilation of hostUncollated (fixes #2934) 2023-07-05 17:05:44 +02:00
115bbd2699 ENH: reinstate support for cubic Brownian motion (#2922)
- continue to support spherical by default (for compatibility)
  but add the 'spherical' switch to disable that and use a cubic
  distribution instead.

STYLE: reduce number of inline files

  Co-authored-by: Mark Olesen <>
2023-07-05 16:55:58 +02:00
8ee4b52560 ENH: provide MPI native bitOrOp reduce with single/multiple values
- can be used, for example, to track global states:

      // Encode as 0:empty, 1:uniform, 2:nonuniform, 3:mixed
      PackedList<2> uniformity(fields.size());

      forAll(fields, i)
      {
          uniformity.set(i, fields[i].whichUniformity());
      }

      reduce
      (
          uniformity.data(),
          uniformity.size_data(),
          bitOrOp<unsigned>()
      );
2023-07-05 15:14:26 +02:00
f398d7b313 ENH: consolidate PstreamBuffers reduced communication bookkeeping
- can reduce communication by only sending non-zero data (especially
  when using NBX for size exchanges), but proper synchronisation with
  multiply-connected processor/processor patches (eg, processorCyclic)
  may still require speculative sends.

  Can now setup for PstreamBuffers 'registered' sends to avoid
  ad hoc bookkeeping within the caller.
2023-07-05 14:03:54 +02:00
a1e34bb251 ENH: use mapDistribute linear construct order in a few places
- simplifies code by avoiding code duplication:
  * parLagrangianDistributor
  * meshToMesh (processorLOD and AABBTree methods)

BUG: inconsistent mapping when using processorLOD boxes (fixes #2932)

- internally the processorLODs createMap() method used a 'localFirst'
  layout whereas a 'linear' order is what is actually expected for the
  meshToMesh mapping. This will cause of incorrect behaviour
  if using processorLOD instead of AABBTree.
  A dormant bug since processorLOD is not currently selectable.
2023-07-04 20:29:07 +02:00
0d456a4c66 ENH: support alternative construct map layout mapDistributeBase
- when constructing from a sendMap, can now also specify a linear
  receive layout instead of a localFirst layout

  This will make it easier to reduce some code (#2932)

- add missing interface for simple distribute of List/DynamicList
  with a specified commsType. Was previously restricted to
  defaultCommsType only.

ENH: mapDistribute distribute/reverseDistribute with specified commsType

STYLE: prefer UPstream vs Pstream within mapDistribute
2023-07-04 17:29:15 +02:00
728527a345 ENH: use exprValue in exprResult
- replaces previous (similar) union but leverages the type tag for
  handling logic

STYLE: remove unneeded refCount from exprResult

COMP: operator!= as member operator (exprResultDelayed, exprResultStored)

- the operator!= as a free function failed to resolve after removing
  the refCount inheritance
2023-07-04 17:25:26 +02:00
5635e14f81 ENH: add low-level polymorphic/boxed exprValue
- primarily for handling expression results,
  but can also be used as a universal value holder.

  Has some characteristics suitable for type-less IO:
  eg, is_integral(), nComponents()

ENH: add is_pointer() check for expression scanToken
2023-07-04 17:25:26 +02:00
fc2760ab9c ENH: simplify/extend decomposedBlockData retrieve block information
- handle existence/non-existence of a FoamFile header automatically
- support an upper limit when getting the number of blocks and
  use that for a hasBlock(...) method, which will stop reading sooner.
2023-07-04 17:25:25 +02:00
f8987e64ed ENH: add ITstream::emptyStream()
- returns readable reference to an empty ITstream for functions
  needing to return an ITstream reference but which
  don't have anything to return.
2023-07-04 17:25:25 +02:00
a215f94ec4 ENH: expose read option for Time construction
- Time is normally constructed with READ_MODIFIED for its controlDict
  and objectRegistry, but for certain applications (eg, redistributePar)
  it can be useful to construct without file monitoring and specifying
  MUST_READ instead.

  Example,

  Info<< "Create time\n" << Foam::endl;
  Time runTime
  (
      Time::controlDictName,
      args,
      false,   // Disallow functionObjects
      true,    // Allow controlDict "libs"
      IOobjectOption::MUST_READ  // Instead of READ_MODIFIED
  );
2023-07-04 17:25:25 +02:00
d5a0eaeeee STYLE: changes to Time and TimeState
- update TimeState access methods

- use writeTime() instead of old method name outputTime()

- use deltaTValue() instead of deltaT().value()
  to avoids pointless construct of intermediate
2023-07-04 17:25:25 +02:00
7a857b318a DOC: document/warn about GeometricField constructor being always read (#2926)
- no change in behaviour except to emit a warning when called with the
  a non-reading readOption

STYLE: remove redundant size check

- size checking is already done by Field::assign() within the
  DimensionedField::readField
2023-07-04 17:25:22 +02:00
763bf4674d RELEASE: Updated headers to v2306 2023-06-28 16:35:48 +01:00
2d145e070e COMP: chtMultiRegionTwoPhaseEulerFoam: compile local files only 2023-06-28 16:35:47 +01:00
beb0c910a0 REVERT: turbulentTemperatureRadCoupledMixed: remove merge-review updates (!609) 2023-06-28 16:35:47 +01:00
664e8e0060 DOC: Updated contibutor list 2023-06-27 14:28:22 +01:00
7b20e888a8 REGRESSION: inconsistent constructMap order in meshToMesh::calcProcMap
- commit fb69a54bc3 accidentally changed the constructMap compact
  order from linear ordering to local elements first order. Seems to
  interact poorly with other bookkeeping so doing a partial revert,
  but still replacing the old allGatherList with exchangeSizes.

Note:
   the processorLOD method does actually use a constructMap with local
   elements first ordering, so some inconsistency may still exist
   there
2023-06-27 13:20:07 +02:00
c4b4d1e03e BUG: expressions rand() ignores objectRegistry timeIndex (fixes #2923) 2023-06-26 17:49:18 +02:00
4d7c827bd7 ENH: checkMesh: report on processor patch if non-parallel. Fixes #698 2023-06-26 12:14:30 +01:00
d6d319d95a TUT: mixerVessel: update problematic entries 2023-06-26 10:28:58 +01:00
f93b4338d5 ENH: Added new limitTurbulenceViscosity fvOption
Corrects turbulence viscosity field (e.g. nut) within a specified
region by applying a maximum limit, set according to a coefficient
multiplied by the laminar viscosity:

    \nu_{t,max} = c \nu

Corrections applied to:

  nut  | Turbulence vicosity                   [m2/s2]

Usage
    Minimal example by using \c constant/fvOptions:
    \verbatim
    limitTurbulenceViscosity1
    {
        // Mandatory entries (unmodifiable)
        type            limitTurbulenceViscosity;

        // Optional entries (runtime modifiable)
        nut             nut;
        c               1e5;

        // Mandatory/Optional (inherited) entries
        ...
    }
2023-06-26 10:19:22 +01:00
c9645e61a6 ENH: AMI - added option to control area normailisation mode
The optional areaNormalisationMode entry determines how the area normalisation
is performed. Options are:

- `project`: tri face area dotted with patch face normal; same as v2212 (default)
- `mag`: tri face area magnitude (v2206 and earlier)

Example usage:

    AMI1
    {
        type            cyclicAMI;
        ...
        areaNormalisationMode mag;
        //areaNormalisationMode project;
    }
2023-06-26 10:19:22 +01:00
b264d2e913 CONFIG: reinstate FOAM_LD_LIBRARY_PATH adjustments (#2801)
- the special MacOS dlopen handling (commit f584ec97d0)
  did not fully solve the problem with SIP clearing.

  Eg, sourcing the RunFunctions (for runParallel) triggers SIP and
  clears DYLD_LIBRARY_PATH. With the cleared path it finds the dummy
  libraries: the dummy Pstream::init() fails.
2023-06-26 09:47:07 +02:00
c3660b4123 STYLE: AMI - updated output to show AMI patch names
Helps when running/debugging cases with multiple AMI patches

Example:

AMI: Creating AMI for source:AMI1 and target:AMI2
AMI: Patch source faces: 96
AMI: Patch target faces: 96
AMI: Patch source sum(weights) min:1 max:1 average:1
AMI: Patch target sum(weights) min:1 max:1 average:1
2023-06-25 16:49:11 +01:00
642d8a9dfa COMP: guards around #define OMPI_SKIP_MPICXX (avoids compiler warnings) 2023-06-23 16:05:19 +02:00
2afd2320ce ENH: yPlus: support disable of field writing (#2813)
- for simulations where the yPlus is needed for other purposes or
  just for obtaining information on the patches it can be useful
  to disable field writing and save disk space.

  The 'writeFields' flag (as per some other function objects)
  has been added control writing the yPlus volume field.

  If unspecified, the default value is 'true' so that the yPlus
  function object continues to work as before.
  However, this default may change to 'false' in the future to align
  with other function objects.

ENH: wallShearStress: support disable of field writing

- similar to yPlus, the write() method combines writing information
  and writing the fields. The 'writeFields' flag allows some
  separation of that logic.
2023-06-23 16:05:19 +02:00
7edacd3ab0 ENH: yPlus: eliminate field IO control of controlDict (fixes #2813) 2023-06-22 17:34:31 +01:00
6a1e56e6e9 SUBMODULE: updates for OpenQBMM
- https://github.com/OpenQBMM/OpenQBMM/releases/tag/OpenFOAM-v2306
2023-06-22 17:28:08 +02:00
360aad19dc DOC: document the NBX and PstreamBuffers parameters 2023-06-22 17:26:35 +02:00
a3e6af8fcf BUG: processorCyclic: cell->point interpolation. Fixes #2817 2023-06-22 15:10:04 +01:00
183e9511e5 Merge branch 'fix-processorCyclic_reducedSending' into 'develop'
ENH: improve send/recv robustness in the presence of processorCyclic (#2814)

See merge request Development/openfoam!614
2023-06-22 12:19:14 +00:00