Commit Graph

177 Commits

Author SHA1 Message Date
Andrew Heather
d3949086ce RELEASE: Updated headers to v2412 2024-12-24 11:17:31 +00:00
mattijs
a9cc444b79 ENH: switch: move to OptimisationSwitches. See #3215 2024-09-18 14:39:17 +01:00
Mark Olesen
d9c73ae489 ENH: improve handling of multi-pass send/recv (#3152)
- the maxCommsSize variable is used to 'chunk' large data transfers
  (eg, with PstreamBuffers) into a multi-pass send/recv sequence.

  The send/recv windows for chunk-wise transfers:

      iter    data window
      ----    -----------
      0       [0, 1*chunk]
      1       [1*chunk, 2*chunk]
      2       [2*chunk, 3*chunk]
      ...

  Since we mostly send/recv in bytes, the current internal limit
  for MPI counts (INT_MAX) can be hit rather quickly.

  The chunking limit should thus also be INT_MAX, but since it is
  rather tedious to specify such large numbers, can instead use

      maxCommsSize = -1

  to specify (INT_MAX-1) as the limit.
  The default value of maxCommsSize = 0 (ie, no chunking).

Note
~~~~
  In previous versions, the number of chunks was determined by the
  sender sizes. This required an additional MPI_Allreduce to establish
  an overall consistent number of chunks to walk. This additional
  overhead each time meant that maxCommsSize was rarely actually
  enabled.

  We can, however, instead rely on the send/recv buffers having been
  consistently sized and simply walk through the local send/recvs until
  no further chunks need to be exchanged. As an additional enhancement,
  the message tags are connected to chunking iteration, which allows
  the setup of all send/recvs without an intermediate Allwait.

ENH: extend UPstream::probeMessage to use int64 instead of int for sizes
2024-05-07 15:33:02 +02:00
Mark Olesen
7f355ba343 STYLE: communication name "buffered" instead of "blocking"
- "buffered" corresponds to MPI_Bsend (buffered send),
  whereas the old name "blocking" is misleading since the
  regular MPI_Send also blocks until completion
  (ie, buffer can be reused).

ENH: IPstream::read() returns std::streamsize instead of label (#3152)

- previously returned a 'label' but std::streamsize is consistent with
  the input parameter and will help with later adjustments.

- use <label> instead of <int> for internal accounting of the message
  size, for consistency with the underyling List<char> buffers used.

- improve handling for corner case of IPstream receive with
  non-blocking, although this combination is not used anywhere
2024-04-29 10:19:40 +02:00
Mark Olesen
ff567dbe71 CONFIG: adjust compile-time value of maxThreadFileBufferSize to 0
- consistent with etc/controlDict default

STYLE: update banner message for collated
2024-02-07 20:20:52 +01:00
Mark Olesen
8818201196 ENH: extend mpiAllGather to include integer and float types
- was previously limited to 'char' whereas gatherv/scatterv
  already supported various integer and float types

STYLE: rebundle allToAll declarations with macros

ENH: provide a version of allToAllConsensus returning the Map

- simplifies use and avoids ambiguities in the send/recv parameters

- the Map version will now also transmit zero value data if they exist
  in the Map. Unlike the List version, zero values are not necessary to
  signal connectivity with a Map.

COMP: forwarding template parameters for NBX routines

ENH: consolidate PstreamBuffers size exchange options

- had a variety of nearly identical backends for all-to-all,
  gather/scatter. Now combined internally with a dispatch enumeration
  which provides better control over which size exchange algorithm
  is used.

DEFEATURE: remove experimental full-NBX PstreamBuffers variant

- no advantages seen compared to the hybrid NBX/PEX approach.
  Removal reduces some code cruft.

DEFEATURE: remove experimental "double non-blocking" NBX version

- the idea was to avoid blocking receives for very large data transfers,
  but that is usually better accomplished with a hybrid NBX/PEX approach
  like PstreamBuffers allows
2023-11-20 09:39:35 +01:00
Mattijs Janssens
d0542c7014 Feature evaluation check 2023-11-16 10:33:32 +00:00
Mark Olesen
360aad19dc DOC: document the NBX and PstreamBuffers parameters 2023-06-22 17:26:35 +02:00
Mark Olesen
f15e58d3d5 ENH: add nbx.tuning to enable/disable initial barrier
- to prevent NBX from intercepting previous messages an initial
  barrier can help with synchronization. (Gregor Weiss)
2023-05-22 17:43:42 +02:00
Mark Olesen
aa002122c2 ENH: simplify handling of pushed/freed requests
- previously had an additional stack for freedRequests_,
  which were used to 'remember' locations into the list of
  outstandingRequests_ that were handled by 'waitRequest()'.

  This was principally done for sanity checks on shutdown,
  but we now just test for any outstanding requests that
  are *not* MPI_REQUEST_NULL instead (much simpler).

  The framework with freedRequests_ also had a provision to 'recycle'
  them by popping from that stack, but this is rather fragile since it
  would only triggered by some collectives
  (MPI_Iallreduce, MPI_Ialltoall, MPI_Igather, MPI_Iscatter)
  with no guarantee that these will all be properly removed again.
  There was also no pruning of extraneous indices.

ENH: consolidate internal reset/push of requests

- replace duplicate code with inline functions
  reset_request(), push_request()

ENH: null out trailing requests

- extra safety (paranoia) for the UPstream::Request versions
  of finishedRequests(), waitAnyRequest()

CONFIG: document nPollProcInterfaces in etc/controlDict

- still experimental, but at least make the keyword known
2023-04-08 18:46:39 +02:00
Mark Olesen
df61104ef5 ENH: add Pstream non-blocking consensus exchange infrastructure
- can be beneficial with increasing number of ranks
2023-02-07 23:02:02 +01:00
Mark Olesen
94a7945be3 ENH: make lduInterfaceField::updatedMatrix mutable
- simplifies code, consistent with other matrix transfer functions.
  Use a setter method.

STYLE: AMIInterpolation::upToDate(bool) setter method

ENH: add guards to avoid float-compressed transfer of integral types

STYLE: drop unused debug member from abstract interface classes
2023-01-12 21:19:12 +01:00
Mark Olesen
0fabbcb404 ENH: direct ensight output of float/double
- since ensight format is always float and also always written
  component-wise, perform the double -> float narrowing when
  extracting the components.  This reduces the amount of data
  transferred between processors.

ENH: avoid vtk/ensight parallel communication of empty messages

- since ensight writes by element type (eg, tet, hex, polyhedral) the
  individual written field sections will tend to be relatively sparse.
  Skip zero-size messages, which should help reduce some of the
  synchronization bottlenecks.

ENH: use 'data chunking' when writing ensight files in parallel

- since ensight fields are written on a per-element basis, the
  corresponding segment can become rather sparsely distributed. With
  'data chunking', we attempt to get as many send/recv messages in
  before flushing the buffer for writing. This should make the
  sequential send/recv less affected by the IO time.

ENH: allow use of an external buffer when writing ensight components

STYLE: remove last vestiges of autoPtr<ensightFile> for output routines
2022-11-15 17:26:09 +01:00
Mark Olesen
500c7047b2 TUT: remove superfluous 'sourceInfo' (topo sets)
- update annotated dicts, remove tabs

- use point1/point2 for cylinder sources
2022-05-27 14:10:31 +02:00
Mark Olesen
c3e14ffdd5 ENH: refactor coordSet writers (#2347)
- the very old 'writer' class was fully stateless and always templated
  on an particular output type.

  This is now replaced with a 'coordSetWriter' with similar concepts
  as previously introduced for surface writers (#1206).

  - writers change from being a generic state-less set of routines to
    more properly conforming to the normal notion of a writer.

  - Parallel data is done *outside* of the writers, since they are used
    in a wide variety of contexts and the caller is currently still in
    a better position for deciding how to combine parallel data.

ENH: update sampleSets to sample on per-field basis (#2347)

- sample/write a field in a single step.

- support for 'sampleOnExecute' to obtain values at execution
  intervals without writing.

- support 'sets' input as a dictionary entry (as well as a list),
  which is similar to the changes for sampled-surface and permits use
  of changeDictionary to modify content.

- globalIndex for gather to reduce parallel communication, less code

- qualify the sampleSet results (properties) with the name of the set.
  The sample results were previously without a qualifier, which meant
  that only the last property value was actually saved (previous ones
  overwritten).

  For example,
  ```
    sample1
    {
        scalar
        {
            average(line,T) 349.96521;
            min(line,T)     349.9544281;
            max(line,T)     350;
            average(cells,T) 349.9854619;
            min(cells,T)    349.6589286;
            max(cells,T)    350.4967271;
            average(line,epsilon) 0.04947733869;
            min(line,epsilon) 0.04449639927;
            max(line,epsilon) 0.06452856475;
        }
        label
        {
            size(line,T)    79;
            size(cells,T)   1720;
            size(line,epsilon) 79;
        }
    }
  ```

ENH: update particleTracks application

- use globalIndex to manage original parcel addressing and
  for gathering. Simplify code by introducing a helper class,
  storing intermediate fields in hash tables instead of
  separate lists.

ADDITIONAL NOTES:

- the regionSizeDistribution largely retains separate writers since
  the utility of placing sum/dev/count for all fields into a single file
  is questionable.

- the streamline writing remains a "soft" upgrade, which means that
  scalar and vector fields are still collected a priori and not
  on-the-fly.  This is due to how the streamline infrastructure is
  currently handled (should be upgraded in the future).
2022-03-10 19:41:22 +01:00
Mark Olesen
666e5f6dc4 GIT: remove stray file, fix server documentation path 2022-03-02 15:12:59 +01:00
Mark Olesen
b874dc74b0 DEFEATURE: remove support for jplot (defunct) 2022-01-20 17:13:28 +01:00
Andrew Heather
f5eace394b DOC: Corrected online doxygen links. Fixes #2326 2022-01-14 14:33:45 +00:00
Andrew Heather
a2014242cf RELEASE: Updated headers for v2112 2021-12-20 14:18:01 +00:00
Mattijs Janssens
227b3976ba BUG: collated: threaded writing accesses out-of-scope. Fixes #2257. 2021-11-02 14:26:30 +00:00
Andrew Heather
e3796745ed CONFIG: Updated headers to v2106
Minor clean-up
2021-06-28 09:14:42 +01:00
Mark Olesen
3a1a160cbb ENH: refactor and extend handling of faSchemes/fvSchemes
- use common base for handling scheme lookups.
  Extended to support local injection of schemes into the dictionaries
  during runtime.
2021-05-13 15:27:24 +02:00
Mark Olesen
b99078768e ENH: downgrade missing default system/decomposeParDict to warning
- if the system/decomposeParDict is missing, skip check for matching
  number of processor dirs. This can make job dispatch easier.
  Does not apply if -decomposeParDict was explicitly specified.

STYLE: adjust naming of host/slaves in argList
2021-03-22 14:45:17 +01:00
Mark Olesen
531e8ab66d CONFIG: relocate messageStream output level control to an InfoSwitch
- location and naming more consistent with other controls

    old: DebugSwitch  'level'
    new: InfoSwitch   'outputLevel'
2021-02-16 14:30:36 +01:00
Mark Olesen
2811c05444 ENH: lazier handling of dynamic libraries
- previously always called dlclose on opened libraries when destroying
  the dlLibraryTable. However, by force closing the libraries the
  situation can arise that the library is missing its own code that it
  needs on unload (#1524). This is also sometimes evident when closing
  VTK libraries for runTimePostProcessing (#354, #1585).

- The new default is to not forcibly dlclose any libraries, unless
  the dlcloseOnTerminate OptimisationSwitch specifies otherwise.

  - The dlLibraryTable::close() method can be used to explicitly close
    all libraries and clear the list.

  - The dlLibraryTable::clear() method now only clears the entries,
    without a dlclose.
2020-12-16 11:25:04 +01:00
Mark Olesen
b1a27d3d00 ENH: rename 'classic' Foam::isoSurface as Foam::isoSurfacePoint
- better distinction between types of algorithms.
  Easier for future deprecation/replacement.
2020-12-08 13:31:22 +01:00
Mark Olesen
12b68e1151 ENH: replace finiteArea timeVaryingUniformFixedValue with Function1 version
- timeVaryingUniformFixedValue -> uniformFixedValue

- allows a variety of functions (eg, coded, expressions, tables, ...)

- more similarity to finiteVolume patch type

STYLE: remove unused timeVarying... from etc/controlDict
2020-09-28 11:08:30 +02:00
Andrew Heather
538d749220 REL: Updated headers to version v2006 2020-06-29 17:27:54 +01:00
mattijs
5bf440956a ENH: timeVaryingMapped: abstract IFstream/regIOobject handling. See #1640.
This change abstracts out the reading of "boundaryData". It should
now support OpenFOAM headers and with that also binary input.
2020-06-11 12:00:51 +01:00
mattijs
7618150ea4 ENH: fileModificationSkew: Changed default. See #1472 2020-06-05 09:06:14 +01:00
Mark Olesen
2a98c4e665 ENH: consistency improvements for surface patch handling (fixes #483)
- remove (unused) Istream constructors, prune some unused methods,
  rationalize write() vs writeDict().
  Deprecate inconsistent construction order.

- handle empty names for ".ftr" surface patches (for plain triSurface
  format) with double-quoted strings for more reliable streaming.
  Written on a single line.

  This is _backward_ compatible, but if users have been parsing these
  files manually, they will need to adjust their code.

Previously:
```
  (
  frt-fairing:001%1
  empty

  windshield:002%2
  empty
  ...
  )
```

Updated (with example handling of empty name):
```
  (
  frt-fairing:001%1 empty

  windshield:002%2 ""
  ...
  )
```
2020-01-16 10:07:26 +01:00
Andrew Heather
ae2ab06312 REL: Release preparations 2019-12-23 09:49:23 +00:00
Mark Olesen
74b12c6afd ENH: improved separation of scanner/parser debug selection
- now use debug 2 for scanner and debug 4 for parser.
  Provided better feedback about what is being parsed (debug mode)

- relocate debug application to applications/tools/foamExprParserInfo
2019-12-19 13:16:26 +01:00
mattijs
76de104daa ENH: fileModificationSkew: add polling. Fixes #1472. 2019-11-27 14:13:01 +00:00
Mark Olesen
eda4cbd55c CONFIG: always allow spaces in fileName for Windows (#1238)
- this cannot be left as a configurable value (on windows), since it
  needs to be enabled even prior to reading the etc/controlDict file,
  in case the OpenFOAM installation path itself contains spaces.
2019-07-09 18:04:23 +02:00
Andrew Heather
be44dcaf1f RELEASE: Version clean-up for release 2019-06-25 11:51:19 +01:00
Mark Olesen
b01611a126 CONFIG: make default for allowSpaceInFileName platform dependent
- enable by default on Windows, disable by default on non-Windows.
2019-06-13 14:01:08 +02:00
Mark Olesen
32916fa845 ENH: dictionary checking methods with predicates on the input values
- can be used to check the validity of input values.

Example:

    dict.getCheck<label>("nIters", greaterOp1<label>(0));
    dict.getCheck<scalar>("relax", scalarMinMax::zero_one());

- use 'get' prefix for more regular dictionary methods.
  Eg, getOrDefault() as alternative to lookupOrDefault()

- additional ops for convenient construction of predicates

ENH: make dictionary writeOptionalEntries integer

- allow triggering of Fatal if default values are used

ENH: additional scalarRange static methods: ge0, gt0, zero_one

- use GREAT instead of VGREAT for internal placeholders

- additional MinMax static methods: gt, le
2019-05-21 19:10:14 +01:00
mattijs
9cd9d879e7 ENH: GAMG: supress debug msg 2019-05-21 09:42:34 +01:00
Mark Olesen
89245fa796 ENH: allow space char in fileName is now configurable (#1008)
- having whitespace in fileName can be somewhat fragile since it means
  that the fileName components do not necessarily correspond to a
  'Foam::word'. But in many cases it will work provided that spaces
  are not present in the final portion of the simulation directory
  itself.

    InfoSwitches
    {
        // Allow space character in fileName (use with caution)
        allowSpaceInFileName    0;
    }

- now use doClean=true as default for fileName::validate(). Was false.

  Unlike fileName::clean() this requires no internal string rewrite
  since the characters are being copied.  Also handle any path
  separator transformations (ie, backslash => forward slash) at the
  same time. This makes it resemble the std::filesystem a bit more.
2019-04-01 16:40:22 +02:00
Mark Olesen
42fbf6d38c ENH: extended runTimePostProcessing (#1206)
- Extended runTimePostProcessing to include access to "live"
  simulation objects such a geometry patches and sampled surfaces
  stored on the "functionObjectObjects" registry.

- Add 'live' runTimePostProcessing of cloud data.
  Extracts position and fields from the cloud via its objectRegistry writer

- For the "live" simulation objects, there are two new volume filters
  that work directly with the OpenFOAM volume fields:
      * iso-surface
      * cutting planes
  Both use the VTK algorithms directly and support multiple values.
  Eg, can make multiple iso-levels or multiple planes parallel to each
  other.

- When VTK has been compiled with MPI-support, parallel rendering will
  be used.

- Additional title text properties (shadow, italic etc)

- Simplified handling of scalar-bar and visibility switches

- Support multiple text positions. Eg, for adding watermark text.
2019-02-13 11:22:46 +01:00
Mark Olesen
9144b122cb GIT: turn off fvsPatchField debug
- seems to have slipped into an earlier commit
2019-02-15 16:36:46 +01:00
mattijs
df35627e69 ENH: controlDict: added entry for clarity. 2019-02-14 12:41:26 +00:00
Mark Olesen
1c85c64984 STYLE: clarify input requirements for extrusion models (#1181)
- changed the sectorCoeffs keyword to 'point' from 'axisPt'
  for more similarity with other dictionaries.
  Continue to accept 'axisPt' for compatibility.
2019-01-24 09:40:12 +01:00
Andrew Heather
9231534efa STYLE: Updating version to v1812 2018-12-19 18:07:52 +00:00
Mark Olesen
f2c78362e7 CONFIG: default to using logical value for cwd()
- this helps for many cases outlined in issue #1007, but can also be
  useful when simply using symlinks for shorter or reorganized
  directory structures.
2018-10-18 08:05:44 +02:00
Mark Olesen
7864672c78 ENH: make cwd() behaviour user-adjustable (issue #1007)
- with the 'cwd' optimization switch it is possible to select the
  preferred behaviour for the cwd() function.

  A value of 0 causes cwd() to return the physical directory,
  which is what getcwd() and `pwd -P` return.
  Until now, this was always the standard behaviour.

  With a value of 1, cwd() instead returns the logical directory,
  which what $PWD contains and `pwd -L` returns.
  If any of the sanity checks fail (eg, PWD points to something other
  than ".", etc), a warning is emitted and the physical cwd() is
  returned instead.

  Apart from the optical difference in the output, this additional
  control helps workaround file systems with whitespace or other
  characters in the directory that normally cause OpenFOAM to balk.
  Using a cleaner symlink elsewhere should skirt this issue.

  Eg,
      cd $HOME
      ln -s "/mounted volume/user/workdir"  workdir
      cd workdir
      # start working with OpenFOAM
2018-10-16 01:30:44 +02:00
Mark Olesen
6697bb4735 ENH: improve, simplify, rationalize coordinate system handling (issue #863)
Previously the coordinate system functionality was split between
coordinateSystem and coordinateRotation. The coordinateRotation stored
the rotation tensor and handled all tensor transformations.

The functionality has now been revised and consolidated into the
coordinateSystem classes. The sole purpose of coordinateRotation
is now just to provide a selectable mechanism of how to define the
rotation tensor (eg, axis-angle, euler angles, local axes) for user
input, but after providing the appropriate rotation tensor it has
no further influence on the transformations.

--

The coordinateSystem class now contains an origin and a base rotation
tensor directly and various transformation methods.

  - The origin represents the "shift" for a local coordinate system.

  - The base rotation tensor represents the "tilt" or orientation
    of the local coordinate system in general (eg, for mapping
    positions), but may require position-dependent tensors when
    transforming vectors and tensors.

For some coordinate systems (currently the cylindrical coordinate system),
the rotation tensor required for rotating a vector or tensor is
position-dependent.

The new coordinateSystem and its derivates (cartesian, cylindrical,
indirect) now provide a uniform() method to define if the rotation
tensor is position dependent/independent.

The coordinateSystem transform and invTransform methods are now
available in two-parameter forms for obtaining position-dependent
rotation tensors. Eg,

      ... = cs.transform(globalPt, someVector);

In some cases it can be useful to use query uniform() to avoid
storage of redundant values.

      if (cs.uniform())
      {
          vector xx = cs.transform(someVector);
      }
      else
      {
          List<vector> xx = cs.transform(manyPoints, someVector);
      }

Support transform/invTransform for common data types:
   (scalar, vector, sphericalTensor, symmTensor, tensor).

====================
  Breaking Changes
====================

- These changes to coordinate systems and rotations may represent
  a breaking change for existing user coding.

- Relocating the rotation tensor into coordinateSystem itself means
  that the coordinate system 'R()' method now returns the rotation
  directly instead of the coordinateRotation. The method name 'R()'
  was chosen for consistency with other low-level entities (eg,
  quaternion).

  The following changes will be needed in coding:

      Old:  tensor rot = cs.R().R();
      New:  tensor rot = cs.R();

      Old:  cs.R().transform(...);
      New:  cs.transform(...);

  Accessing the runTime selectable coordinateRotation
  has moved to the rotation() method:

      Old:  Info<< "Rotation input: " << cs.R() << nl;
      New:  Info<< "Rotation input: " << cs.rotation() << nl;

- Naming consistency changes may also cause code to break.

      Old:  transformVector()
      New:  transformPrincipal()

  The old method name transformTensor() now simply becomes transform().

====================
  New methods
====================

For operations requiring caching of the coordinate rotations, the
'R()' method can be used with multiple input points:

       tensorField rots(cs.R(somePoints));

   and later

       Foam::transformList(rots, someVectors);

The rotation() method can also be used to change the rotation tensor
via a new coordinateRotation definition (issue #879).

The new methods transformPoint/invTransformPoint provide
transformations with an origin offset using Cartesian for both local
and global points. These can be used to determine the local position
based on the origin/rotation without interpreting it as a r-theta-z
value, for example.

================
  Input format
================

- Streamline dictionary input requirements

  * The default type is cartesian.
  * The default rotation type is the commonly used axes rotation
    specification (with e1/e2/3), which is assumed if the 'rotation'
    sub-dictionary does not exist.

    Example,

    Compact specification:

        coordinateSystem
        {
            origin  (0 0 0);
            e2      (0 1 0);
            e3      (0.5 0 0.866025);
        }

    Full specification (also accepts the longer 'coordinateRotation'
    sub-dictionary name):

        coordinateSystem
        {
            type    cartesian;
            origin  (0 0 0);

            rotation
            {
                type    axes;
                e2      (0 1 0);
                e3      (0.5 0 0.866025);
            }
        }

   This simplifies the input for many cases.

- Additional rotation specification 'none' (an identity rotation):

      coordinateSystem
      {
          origin  (0 0 0);
          rotation { type none; }
      }

- Additional rotation specification 'axisAngle', which is similar
  to the -rotate-angle option for transforming points (issue #660).
  For some cases this can be more intuitive.

  For example,

      rotation
      {
          type    axisAngle;
          axis    (0 1 0);
          angle   30;
      }
  vs.
      rotation
      {
          type    axes;
          e2      (0 1 0);
          e3      (0.5 0 0.866025);
      }

- shorter names (or older longer names) for the coordinate rotation
  specification.

     euler         EulerRotation
     starcd        STARCDRotation
     axes          axesRotation

================
  Coding Style
================
- use Foam::coordSystem namespace for categories of coordinate systems
  (cartesian, cylindrical, indirect). This reduces potential name
  clashes and makes a clearer declaration. Eg,

      coordSystem::cartesian csys_;

  The older names (eg, cartesianCS, etc) remain available via typedefs.

- added coordinateRotations namespace for better organization and
  reduce potential name clashes.
2018-10-01 13:54:10 +02:00
Andrew Heather
6e35bcda70 ENH: Updated config for release v1806 2018-06-28 12:56:00 +01:00
Andrew Heather
dad09c5e7d BUG: Correction to commit 8540e6f
- corrected the mass based correction and updated the misleading function
  arguments

- moved the option to the optimisation switches, e.g.:

    OptimisationSwitches
    {
        experimentalDdtCorr 1;
    }

- default remains off/no (0)
2018-06-18 14:13:12 +01:00