Commit Graph

17013 Commits

Author SHA1 Message Date
750381bd99 ENH: HashTable/HashSet contains(key) method
- functionality provided as 'found(key)' in OpenFOAM naming, since
  there was no stl equivalent at the time. Now support contains(),
  which is the equivalent for C++20 maps/sets.

STYLE: general contains() method for containers

STYLE: treat Enum and Switch similarly as hash-like objects
2023-02-10 17:11:15 +01:00
422654a9ea ENH: added UPstream::waitAnyRequest(UList<UPstream::Request>&)
- waits for completion of any of the listed requests and returns the
  corresponding index into the list.
  This allows, for example, dispatching of data when the receive is
  completed.
2023-02-09 11:11:36 +01:00
add61ca273 ENH: support UOPstream and UIPstream as formatters with an external buffer
- can split serialise/de-serialise and send/recv actions
2023-02-09 10:44:42 +01:00
70d310329c ENH: PstreamBuffers consistency improvements
- make nProcs() independent of internal storage mechanism.
- reset receive positions with finished sends

- use size of received buffers to manage validity instead of
  an separate additional gather operation.
2023-02-08 14:22:29 +01:00
4ec75d538f ENH: clear Map entries, but not Map itself for NBX exchange
- clearing the receive 'slots' is preferrable to clearing out the map
  itself since this can potentially preserve allocated space (eg
  DynamicList entries) between calls.

BUG: remove stray MPI barrier in exchange code
2023-02-08 10:24:58 +01:00
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
068ab8ccc7 ENH: add separate tracking of MPI_Comm_free, MPI_Group_free pending
- permits distinction between communicators/groups that were
  user-created (eg, MPI_Comm_create) versus those queried from MPI.
  Previously simply relied on non-null values, but that is too fragile

ENH: support List<Request> version of UPstream::finishedRequests

- allows more independent algorithms

ENH: added UPstream::probeMessage(...). Blocking or non-blocking
2023-02-07 22:39:00 +01:00
ab4c5f25ac ENH: add PstreamBuffers access routines for friend classes
- allows the possibility of using demand-driven internal buffers
  and/or different storage mechanisms.

  Changes:

    * old: sendBuf_[proci]    -> accessSendBuffer(proci)
    * old: recvBuf_[proci]    -> accessRecvBuffer(proci)
    * old: recvBufPos_[proci] -> accessRecvPosition(proci)

  only affects internals of UIPstreamBase and UOPstreamBase

BUG: reduceOr in PstreamBuffers uses world communicator

- should respect the value of the communicator defined within
  PstreamBuffers
2023-02-07 22:39:00 +01:00
173c9ac163 ENH: reduce storage and startup communication for processorTopology
- previously built the entire adjacency table (full communication!)
  but this is only strictly needed when using 'scheduled' as the
  default communication mode. For blocking/nonBlocking modes this
  information is not necessary at that point.

  The processorTopology::New now generally creates a smaller amount of
  data at startup: the processor->patch mapping and the patchSchedule.

  If the default communication mode is 'scheduled', the behaviour is
  almost identical to previously.

- Use Map<label> for the processor->patch mapping for a smaller memory
  footprint on large (ie, sparsely connected) cases. It also
  simplifies coding and allows recovery of the list of procNeighbours
  on demand.

- Setup the processor initEvaluate/evaluate states with fewer loops
  over the patches.

========
BREAKING: procNeighbours() method changed definition

- this was previously the entire adjacency table, but is now only the
  processor-local neighbours. Now use procAdjacency() to create or
  recover the entire adjacency table.

  The only known use is within Cloud<ParticleType>::move and there it
  was only used to obtain processor-local information.

  Old:
      const labelList& neighbourProcs =
          mesh.globalData().topology().procNeighbours()[Pstream::myProcNo()];

  New:
      const labelList& neighbourProcs =
          mesh.globalData().topology().procNeighbours();

      // If needed, the old definition (with communication!)
      const labelListList& connectivity =
          mesh.globalData().topology().procAdjacency();
2023-02-07 22:39:00 +01:00
3e024d622b STYLE: relocate hashing and IO for std::pair to Pair.H (from Tuple2.H)
- makes it more universally available
2023-02-07 22:39:00 +01:00
e790e1c4ba ENH: wallDistAddressing: wall distance which stores addressing. 2023-02-06 14:38:41 +00:00
7c6232b8b3 BUG: FaceCellWave: support data with transformations. Fixes #2693
transformation support in-place modifies the data (e.g. to
add a transform). This might cause the neighbour side patch
to pick up owner side information.
2023-02-01 16:32:26 +00:00
c0e63a8de7 ENH: MeshObject: specify name (instead of typeName) 2023-02-01 15:32:14 +00:00
8b63f64503 STYLE: use std::ostringstream instead of std::to_string for complex
- std::to_string(double) is locale sensitive.
2023-01-31 15:55:21 +01:00
a6b3a31b28 ENH: add patch expression support for face unit normal (#2691)
- make available as normal()
2023-01-31 13:13:16 +01:00
72bfaa2be9 ENH: Field assign and construct from dictionary with readOption
- This simplifies definition of 'lazier' (READ_IF_PRESENT)
  construction or assignment.

  For construction:
    - For MUST_READ and key not found: FatalIOError.
    - For LAZY_READ and key not found: initialise field with Zero.
    - For NO_READ and key not found: simply size the field.

  For assignment:
    - If len == 0 : a no-op and return True.
    - For NO_READ : a no-op and return False.
    - For MUST_READ and key not found : FatalIOError
2023-01-31 12:45:39 +01:00
bebc6195a8 ENH: IOobjectOption isAnyRead() for checking against NO_READ
- encompasses isReadOptional or isReadRequired check

STYLE: allow LAZY_READ as a shorter synonym for READ_IF_PRESENT

- add helper for downgrading MUST_READ... to LAZY_READ
2023-01-31 12:45:38 +01:00
c8a2d82094 BUG: inconsistent faceArea on processor boundaries (fixes #2683)
- was missing evaluateCoupled on the initial faceAreaNormals field
  (related to #2507)
2023-01-31 12:45:38 +01:00
39cabfca9c ENH: use fvPatchFieldBase::readDict
- replaces getOrDefault/readIfPresent for "patchType"
2023-01-31 12:45:38 +01:00
0190fed56b ENH: support slicing for finiteArea fields 2023-01-31 12:45:38 +01:00
c206b12c80 ENH: patch boundarySlice() for extraction from a flat boundary list
- remove redundant raw patch slice and non-const patchSlice, which
  were only used internally by finiteArea.

STYLE: noexcept on more patch methods
2023-01-31 12:45:38 +01:00
911c28f17d STYLE: use vector::magSqr when checking size 2023-01-31 12:45:34 +01:00
2faf361354 BUG: faMesh geometryOrder=1 blocks in parallel
- with geometryOrder=1, edge normal calculation is done directly from
  the faces, whereas geometryOrder=2 they are calculated based on the
  point normals of each end.

  In both cases, the geometry calculation uses processor communication
  (with corresponding waitRequests etc).

  Since the final correction and the halo face normals also need
  collective communication, these routines must be triggered on all
  processors or they will block. Thus also include edgeAreaNormals()
  triggering in addition to pointAreaNormals() triggering.
2023-01-31 12:36:41 +01:00
312037d4ea ENH: simplify coding logic for calculating Le() vectors.
- handle lower geometryOrder values directly within edgeAreaNormals()
  and reuse the results within Le().

- direct nonBlocking recv/send of edge normals instead using the
  intermediate processorLduInterface buffers
2023-01-31 12:36:41 +01:00
5672bb296f ENH: use cmptMag, cmptMultiply instead of replacing field components 2023-01-31 12:36:41 +01:00
ea2bedf073 ENH: add coupledFaPatch::delta()
- symmetrical evaluation for processor patches, eliminates
  scalar/vector multiply followed by projection.

STYLE: use evaluateCoupled instead of local versions
2023-01-31 12:36:41 +01:00
eb8b51b475 ENH: use back(), pop_back() instead remove()
- adjust looping to resemble LIFO pattern

STYLE: adjust some string includes
2023-01-27 09:50:46 +01:00
7c60c80edd ENH: new/revised emplace_back() [for DynamicList/List/PtrDynList/PtrList]
- returns reference as per C++17 std::vector

STYLE: drop unused, redundant DynamicField remove() method
2023-01-27 09:50:45 +01:00
c1cdacc0b4 COMP: missing default parameters for UIPstream::read
ENH: support UIPstream::read, UOPstream::write with UList, SubList
2023-01-27 09:49:16 +01:00
94a79ef24f STYLE: explicit reference to mesh db for schemes, interfaceTracking etc 2023-01-23 15:05:04 +01:00
0c756cc676 ENH: define linear interpolations for scalar, complex, vector, tensor...
- vector, tensor versions are defined component-wise
  to avoid intermediates.

  The base version uses the form "(1-t)*a + t*b" without any bounds
  checking (ie, will also extrapolate).
2023-01-23 14:55:08 +01:00
ba153df8db ENH: improved handling for clamping
- proper component-wise clamping for MinMax clamp().

- construct clampOp from components

- propagate clamp() method from GeometricField to FieldField and Field

- clamp_min() and clamp_max() for one-sided clamping,
  as explicit alternative to min/max free functions which can
  be less intuitive and often involve additional field copies.

- top-level checks to skip applying invalid min/max ranges
  and bypass the internal checks of MinMax::clamp() etc.
2023-01-23 14:52:29 +01:00
3888bfa17f ENH: UList iterators at offset from begin
- simplifies addressing within sub-ranges.
  Clamps the access range directly
2023-01-23 14:52:29 +01:00
8a70c898ae STYLE: make IOobject time() noexcept. Use explicit REGISTER/NO_REGISTER 2023-01-23 14:52:29 +01:00
1f5a75c3c2 ENH: internal checkTypes method for orientedType
- reuse dimensionSet checking for dimensionedType

STYLE: unfriend some functions for complex
2023-01-23 14:52:29 +01:00
ecaa55295b ENH: add dimensionedLabel typedef
GIT: primitives/compat with compatibility includes
GIT: primitives/traits with pTraits, contiguous, zero, one etc.

COMP: relocate base equal(a,b) definition from scalar.H -> label.H
- make more universally available

STYLE: replace occasional use of notEqual(a,b) with !equal(a,b)
2023-01-23 11:38:54 +01:00
a50d32b587 ENH: define transform(symmTensor, int/float) as no-op
- avoids implicit promotion of label to scalar for no-op,
  or alternatively promotion of symmTensor to tensor for no-op
  (ie, ambiguous).

- fix incorrect transform(.., symmTensor, ...) declarations.
2023-01-23 11:38:54 +01:00
0fa129e83c COMP: add compressed send/recv placeholder (instantiation for integrals) 2023-01-23 10:02:31 +01:00
2641dc4c3a ENH: direct, non-blocking transfer for finiteArea processor patch
STYLE: pTraits::rank instead of std::is_arithmetic to suppress transform

- more consistent with doTransform() coding, potentially useful for
  complex
2023-01-12 21:19:12 +01:00
b15638a2d2 ENH: consistent use of resize_nocopy for processor transfers
STYLE: rename some internal buffers with the data types

  low-level  : byteSendBuf_, byteRecvBuf_
  field level: sendBuf_, recvBuf_
  solve level: scalarSendBuf_, scalarRecvBuf_
2023-01-12 21:19:12 +01:00
bf2f87f7e3 ENH: use isolated request wait in PPCG solver 2023-01-12 21:19:12 +01:00
bf99c104eb ENH: avoid faPatch/fvPatch patchInternalField ambiguity
- with alternative faceCell addressing, use the three-parameter
  version only. This avoids potential future ambiguity with the
  two-parameter version (eg, with a label type)

ENH: add faPatchField patchInternalField() for symmetry with fvPatchField

ENH: direct reference to mesh thisDb instead of inferring

ENH: pointMesh::boundaryMesh() method (eg, similar to fvMesh)
2023-01-12 21:19:12 +01:00
bd0ad07d40 ENH: restrict scope of waitRequests() in LduMatrix update
- Only wait for locally invoked requests.
  Reflects behaviour of lduMatrix update.
2023-01-12 21:19:12 +01:00
568ced68e2 ENH: support independent handling of MPI requests (#2674)
- UPstream::Request wrapping class provides an opaque wrapper for
  vendor MPI_Request values, independent of global lists.

ENH: support for MPI barrier (blocking or non-blocking)
ENH: support for MPI sync-send variants

STYLE: deprecate waitRequests() without a position parameter

- in many cases this can indicate a problem in the program logic since
  normally the startOfRequests should be tracked locally.
2023-01-12 21:19:12 +01:00
2d4ecc4326 GIT: remove unnecessary PatchField Fwd headers
- reduces clutter. In some cases the Fwd typedefs were also incorrect

STYLE: combine Scalar specialisations into corresponding PatchFields.C

- reduces clutter, simplifies future adjustments
2023-01-12 21:19:12 +01:00
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
06f479fbd4 ENH: improve handling of wait/finished requests
- now simply a no-op for out-of-range values (instead of an error),
  which simplifies the calling code.

  Previously
  ==========

      if (request_ >= 0 && request_ < UPstream::nRequests())
      {
          UPstream::waitRequest(request_);
      }

  Updated
  =======

      UPstream::waitRequest(request_);

- when 'recycling' freed request indices, ensure they are actually
  within the currently addressable range

- MPI finalization now checks outstanding requests against
  MPI_REQUEST_NULL to verify that they have been waited or tested on.
  Previously simply checked against freed request indices

ENH: consistent initialisation of send/receive bookkeeping
2023-01-12 21:19:11 +01:00
35c5306544 Merge remote-tracking branch 'origin/master' into develop 2023-01-12 21:18:37 +01:00
166164da93 BUG: vtk::coordSetWriter produces incorrect VTK legacy format (fixes #2678)
- has a special purpose beginPiece() method, but was missing an update
  on the numberOfPoints, numberOfCells values required by the base class.
2023-01-12 17:10:13 +01:00
248e5ff86f ENH: simpler logic for doTransform() check
- test pTraits rank first (compile-time) and then parallel()
2023-01-11 13:16:14 +01:00