Commit Graph

25295 Commits

Author SHA1 Message Date
Mark Olesen
1348cd7e7b ENH: use broadcasting Pstreams for one-to-all sends 2022-03-04 17:49:23 +00:00
Mark Olesen
d37cb64efe ENH: broadcast for Foam::scatter() instead of manual tree communication
- use MPI_Bcast intrinsic instead of manual tree to reduce the overall
  number of messages.

  Old behaviour can be re-enabled with

      `#define Foam_Pstream_scatter_nobroadcast`
2022-03-04 17:49:23 +00:00
Mark Olesen
8478595a15 ENH: new broadcast version of Pstreams (#2371)
- The idea of broadcast streams is to replace multiple master to
  subProcs communications with a single MPI_Bcast.

    if (Pstream::master())
    {
        OPBstream toAll(Pstream::masterNo());
        toAll << data;
    }
    else
    {
        IPBstream fromMaster(Pstream::masterNo());
        fromMaster >> data;
    }

    // vs.
    if (Pstream::master())
    {
        for (const int proci : Pstream::subProcs())
        {
            OPstream os(Pstream::commsTypes::scheduled, proci);
            os << data;
        }
    }
    else
    {
        IPstream is(Pstream::commsTypes::scheduled, Pstream::masterNo());
        is >> data;
    }

  Can simply use UPstream::broadcast() directly for contiguous data
  with known lengths.

Based on ideas from T.Aoyagi(RIST), A.Azami(RIST)
2022-03-04 17:49:23 +00:00
Mark Olesen
a9cdaa1bae ENH: additional exchangeSizes, PstreamBuffers methods (#2371)
- allows restriction of exchange sizes to specified send/recv procs

Based on code supplied by T.Aoyagi(RIST), A.Azami(RIST)
2022-03-04 17:49:23 +00:00
Mark Olesen
b0ef650a12 ENH: Pstream specialization for float/scalar, FixedList (#2351)
- native MPI min/max/sum reductions for float/double
  irrespective of WM_PRECISION_OPTION

- native MPI min/max/sum reductions for (u)int32_t/(u)int64_t types,
  irrespective of WM_LABEL_SIZE

- replace rarely used vector2D sum reduction with FixedList as a
  indicator of its intent and also generalizes to different lengths.

  OLD:
      vector2D values;  values.x() = ...;  values.y() = ...;
      reduce(values, sumOp<vector2D>());

  NEW:
      FixedList<scalar,2> values;  values[0] = ...;  values[1] = ...;
      reduce(values, sumOp<scalar>());

- allow returnReduce() to use native reductions. Previous code (with
  linear/tree selector) would have bypassed them inadvertently.

ENH: added support for MPI broadcast (for a memory span)

ENH: select communication schedule as a static method

- UPstream::whichCommunication(comm) to select linear/tree
  communication instead of ternary or
  if (Pstream::nProcs() < Pstream::nProcsSimpleSum) ...

STYLE: align nProcsSimpleSum static value with etc/controlDict override
2022-03-04 17:49:23 +00:00
Mark Olesen
b95b24e4e7 ENH: improved isolation of MPI access in Pstreams
- refactor as an MPI-independent base class.

  Add bufferIPC{send,recv} private methods for construct/destruct.
  Eliminates code duplication from two constructor forms and reduces
  additional constructor definitions in dummy library.

- add PstreamBuffers access methods, refactor common finish sends
  code, tweak member packing

ENH: resize_nocopy for processorLduInterface buffers

- content is immediately overwritten

STYLE: cull unneeded includes in processorFa*

- handled by processorLduInterface
2022-03-04 17:49:23 +00:00
sergio
1bbe558dc5 ENH: Changing checkImplicit function to account for implicit patches 2022-03-04 09:29:35 -08:00
sergio
b94ffe93f1 ENH: Adding lower and upper bounds to nonUniformTable index 2022-03-03 09:17:57 -08:00
mattijs
3c2db201b7 BUG: createPatch: make tutorial run parallel. See #2386 2022-03-02 14:49:50 +00:00
Mark Olesen
eb676f08a1 BUG: access of non-const tmp value in surface writers
- was inadvertently introduced with the previous commit.
  Affected non-parallel use of the surface writers.
2022-03-02 15:12:59 +01:00
Mark Olesen
666e5f6dc4 GIT: remove stray file, fix server documentation path 2022-03-02 15:12:59 +01:00
mattijs
a74b9ca763 ENH: createPatch: handle multiple regions. Fixes #2386
Also #1361.
2022-03-02 13:14:30 +00:00
Mark Olesen
1a55829ef9 ENH: add fieldLevel handling for surface writers (#2382)
- this can be used to apply a uniform field level to remove from
  a sampled field. For example,

      fieldLevel
      {
          "p.*"   1e5;        // Absolute -> gauge [Pa]
          T       273.15;     // [K] -> [C]
          U       #eval{ 10/sqrt(3) };  // Uniform mag(U)=10
      }

  After the fieldLevel has been removed, any fieldScale is applied.
  For example

      fieldScale
      {
          "p.*"   0.01;       // [Pa] -> [mbar]
      }

  The fieldLevel for vector and tensor fields may still need some
  further refinement.
2022-02-28 19:08:39 +01:00
Mark Olesen
cb10045094 ENH: add createNamedPolyMeshes.H file 2022-02-28 19:03:40 +01:00
Mark Olesen
02f57f8a36 ENH: use '<constant>' and '<system>' tags when creating relative names
- symmetric with expand()
2022-02-28 09:31:59 +01:00
Mark Olesen
fc43ed9d68 GIT: adjust for rebase edit of feature-runTimeControl-recycle 2022-02-28 09:22:06 +01:00
Mark Olesen
3c1da487f2 Merge branch 'feature-runTimeControl-recycle' into 'develop'
ENH: runTimeControl - enable resetting the trigger to an earlier instant

See merge request Development/openfoam!523
2022-02-25 16:18:01 +00:00
Andrew Heather
3d134167dd ENH: Refactored valueAverage FO and average runTimeCondition 2022-02-25 16:08:47 +01:00
Andrew Heather
bb04f5759d ENH: runTimeControl - enable resetting the trigger to an earlier instant
The runTimeControl function object can activate further function objects using
triggers. Previously the trigger index could only advance; this change set
allows users to set smaller values to enable function object recycling, e.g.

Repeat for N cycles:
1. average the pressure at a point in space
2. when the average stabilises, run for a further 100 iterations
3. set a new patch inlet velocity
  - back to (1)

- Removes old default behaviour that only permitted an increase in the
  trigger level. This type of 'ratcheting' mechanism (if required) is
  now the responsibility of the derived function object.
2022-02-25 15:39:26 +01:00
Andrew Heather
53c2eae543 ENH: runTimeControl - added 'none' condition as a no-op 2022-02-25 15:39:22 +01:00
Andrew Heather
fcb328332b Merge branch 'feature-clipped-AMIMethod' into 'develop'
ENH: cyclicAMI: extend faceAreaWeight to filter. See #2378

See merge request Development/openfoam!527
2022-02-24 11:56:53 +00:00
Mattijs Janssens
f46c398372 ENH: cyclicAMI: extend faceAreaWeight to filter. See #2378 2022-02-24 11:56:52 +00:00
mattijs
ff8518a89a ENH: snappyHexMesh: express small regions. Fixes #2379
Extend selection of small cells to use absolute cell count
2022-02-24 09:44:53 +00:00
Mark Olesen
5386dd56db ENH: avoid read/write of empty slots for globalIndex gather 2022-02-21 19:53:21 +01:00
Mark Olesen
59dbee741f STYLE: use globalIndex localSize(), totalSize() in more places
- more explicit meaning than offset(), size() - respectively.
2022-02-21 19:53:21 +01:00
Mark Olesen
055a7b29e0 ENH: ensure indices are properly reset in SortList
- use more ListOps functions, add uniqueSort() method
2022-02-21 19:53:21 +01:00
Mark Olesen
711e1142ed BUG: FixedList/Pair writeEntry not re-readable (fixes #2351)
- notably affects writing continuous data in binary. If generating a
  compound token (eg, List<label>), need to add in the size prefix
  otherwise it cannot actually be parsed properly as a List.

BUG: bad fallthrough for compound reading (FixedList)

- the branch was likely never reached, but would have attempted to
  read twice due to a bad fall-through condition.
2022-02-21 19:53:21 +01:00
Mark Olesen
2a25b356b9 ENH: use GeometricField type aliases in sampling and expressions 2022-02-21 19:53:21 +01:00
Mark Olesen
a67f6bf7ae ENH: direct support of wordRes::filter in stringListOps 2022-02-21 19:53:21 +01:00
Mark Olesen
42f426f6c4 ENH: relocate graph writers to meshTools (not reqd by core OpenFOAM lib)
GIT: relocate globalIndex (is independent of mesh)

STYLE: include label/scalar Fwd in contiguous.H

STYLE: unneed commSchedule include in GeometricField
2022-02-21 19:53:21 +01:00
mattijs
58f76ccc5f ENH: checkMesh: correct AMI weight directory. See #2356. 2022-02-21 16:14:08 +00:00
Mark Olesen
ad6f17652b BUG: uninitialized file pointer in thermoCoupleProbes (fixes #2365)
- as a side-effect of changes to probes, the file pointers are not
  automatically creating when reading the dictionary but delayed
  until prepare(WRITE_ACTION) is called.
  This nuance was missed in thermoCoupleProbes.
2022-02-17 12:44:56 +01:00
mattijs
eb2b9b2823 ENH: createPatch: sample dictionary. See #1361. 2022-02-17 10:34:13 +00:00
mattijs
d5644058b2 ENH: checkMesh: output AMI weights on mapped. Fixes #2356.
Also output target weights
2022-02-17 09:31:20 +00:00
mattijs
504f5a8a14 BUG: decomposeParDict: operate with masterUncollated. Fixes #2368. 2022-02-16 09:59:03 +00:00
mattijs
8e552bd2b4 ENH: snappyHexMesh: parallel consistency. Fixes #2331.
Coupled boundary faces should behave as internal faces
2022-02-14 16:02:19 +00:00
mattijs
bdb9a54bed BUG: cyclicAMI: optional settings not written. Fixes #2363 2022-02-11 18:38:49 +00:00
Mark Olesen
24bee96db2 ENH: avoid unnecessary disk access in writeDictionary (#2362)
- added in special handling for monitoring controlDict.

  Since controlDict is an unwatchedIOdictionary (not IOdictionary) and
  not registered either, the usual objectRegistry caching is not
  available. Instead, access directly from Time.

  Left the balance of the file handling largely intact (for handling
  unregistered dictionaries) but could potentially revisit in the
  future and attempt master-only file access if required. However,
  most other IOdictionary types will be registered, otherwise the
  READ_IF_MODIFIED mechanism would not really work properly.
2022-02-11 17:52:34 +01:00
Mark Olesen
cbc86d6a88 DEFEATURE: remove deprecated/obsolete sample/store onto surfMesh
- was a stop-gap measure until field/registry storage on
  polySurface was introduced (FEB-2019)
2022-02-10 19:42:06 +01:00
Mark Olesen
1be63cd378 ENH: update coding for VTK fileFormats, make open() virtual
- add writer support for VERTICES

- updated use of globalIndex

ENH: add base vtk writer for points/verts/lines

STYLE: noexcept, explicit constructors etc
2022-02-10 19:28:51 +01:00
Mark Olesen
295822daa6 ENH: cleanup/reorganize surfaceWriter and fileFormats
- remove unused surfaceWriter constructors, noexcept on methods

- relocate/rename writerCaching from surfMesh -> fileFormats

- changed from surfaceWriters::writerCaching to
  ensightOutput::writerCaching to permit reuse elsewhere

- relocate static output helpers to ensightCase

- refactor NAS coordinate writing
2022-02-10 19:28:51 +01:00
Mark Olesen
731e276e21 ENH: extend command-line options for particleTracks
- can specify format, stride without modifying a dictionary
  (increases flexibility, eases testing)
2022-02-10 19:28:51 +01:00
Mark Olesen
df18b8bb3c DEFEATURE: remove alpha-field support (partly broken) from gltf output
- when used with *any* alphaField and normalised (the usual case)
  would largely give a 0-1 corresponding to the min/max of the first
  component, but could also yield negative values.

- if the alpha field corresponds identically to colour field, it is
  readily possible to combine as into RGBA sequences. However, if the
  fields are different it potentially means referencing an opacity
  field that has not yet been sampled.  This impedes using the format
  for a streaming sampler without additional overhead and/or rewriting
  the alpha channel later.
2022-02-10 19:28:51 +01:00
Mark Olesen
2a61606251 ENH: improve gltf handling
- scene

  - write with fileName, additional getMesh accessor

  - addColourToMesh accepts an alpha field size 1 as a constant
    alpha value

  - sceneWriter wrapper

ENH: improve gltf handling of colour and alpha specification

- accept plain input directly.
  Eg,
      colour  (1 0 1);
  vs
      colour      uniform;
      colourValue (1 0 1);

- use field magnitude for colouring of non-scalar fields.

  Eg, having three different colour maps for a vector field simply
  does not help much with visualisation.
2022-02-10 19:28:51 +01:00
Mark Olesen
06ade9515e GIT: relocate coordSet from fileFormats to meshTools
- meshTools is the first layer in which coordSet is actually needed

STYLE: rename writer implementations in advance of upcoming changes (#2347)

- simplifies tracing of code changes (git blame)
2022-02-10 19:28:51 +01:00
Mark Olesen
0511aebd86 ENH: add probes sampleOnExecute option (#2358)
- supports sampling/probing of values to obtain min/max/average/size
  at execution intervals without writing any output or generating
  output directories.

- 'verbose' option for additional output
2022-02-10 19:28:51 +01:00
Andrew Heather
e147ac52e9 ENH: probes and patchProbes - added caching of results (#2358)
- min, max, average and sample size results now stored in
  functionObjectProperties similar to sampledSets, e.g. for field p

  - min(p)
  - max(p)
  - average(p)
  - size(p)
2022-02-10 19:28:50 +01:00
Mark Olesen
e806d18612 ENH: consolidate allow/deny wordRes filtering
- wrap as wordRes::filter functor

- support allow/deny when loading cloud fields to a registry
2022-02-10 19:28:50 +01:00
Mark Olesen
fb4fe06306 ENH: simplify component handling
- raw writer, components functionObject
2022-02-10 19:28:50 +01:00
Mark Olesen
7db2a29413 ENH: type aliases for common GeometricField forms (#2348)
ENH: provide fieldTypes::surface names (as per fieldTypes::volume)

ENH: reduce number of files for surface fields

- combine face and point field declarations/definitions,
  simplify typeName definitions
2022-02-10 19:28:50 +01:00