Commit Graph

27070 Commits

Author SHA1 Message Date
ed39ee6afe Merge branch 'update-pstream' into 'develop'
Pstream improvements for more flexibility. Non-blocking consensus exchange

See merge request Development/openfoam!592
2023-02-09 12:33:58 +00: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
d2ab9e9abf Merge branch 'feature-wallDistAddressing' into 'develop'
ENH: wallDistAddressing: wall distance which stores addressing.

See merge request Development/openfoam!590
2023-02-06 14:39:41 +00:00
e790e1c4ba ENH: wallDistAddressing: wall distance which stores addressing. 2023-02-06 14:38:41 +00:00
cc6ba5c1a0 Merge branch 'fix-ATC-extraConvection' into 'master'
BUG: extraConvection in ATC missing a multiplication with ATClimiter

See merge request Development/openfoam!591
2023-02-03 15:36:17 +00:00
26420a88d7 BUG: extraConvection in ATC missing a multiplication with ATClimiter
In the 'standard' and 'UaGradU' options for the ATC term of the adjoint
equations, there is an option to add 'aritificial dissipation', by
adding and subtracting a multiple of the adjoint convection term with
different discretizations. The implicit part was not multiplied with the
ATClimiter whereas the explicit one was, leading to mismatched
contributions in the areas affected by the ATClimiter, which could
affect the sensitivity derivatives.
2023-02-03 15:35:49 +00:00
ff13cdd39d BUG: ensightWrite not reading "excludeFields" (fixes #2696)
- field blocking/exclusion added in commit d9ab5d54ef,
  but was incorrectly doing a lookup for "blockField" for ensight
  although "excludeFields" was documented (and expected).

  Now corrected to use "excludeFields"
2023-02-02 15:17:24 +01:00
f713f74855 ENH: overPotentialFoam: Make consistent. see #1749.
- createFields extends potentialFoam
- (so registers 'p' field, same as potentialFoam)
- writephi is optional as in potentialFoam
2023-02-02 10:34:47 +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
56bf73d37d Merge branch 'feature-named-MeshObject' into 'develop'
ENH: MeshObject: specify name (instead of typeName)

See merge request Development/openfoam!589
2023-02-01 15:32:14 +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
1471d292bf TUT: add dripping chair test 2023-01-31 15:29:26 +01:00
b93f038ea3 TUT: replace exprFixedValue with uniformFixedValue
- wish to deprecate and remove exprFixedValue in the future since the
  same functionality is possible using patch expressions with a
  uniformFixedValue condition.
2023-01-31 13:45: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
8ee7595a77 ENH: foamToVTK improvements for (-no-internal, -no-boundary)
- skip loading of fields with -no-internal, -no-boundary

- suppress reporting fields with -no-internal, -no-boundary

- cache loaded volume field for reuse with point interpolation.
  Trade off some memory overhead against reading twice.

  NOTE: this issue will not be evident with foamToEnsight since there
  it only handles cell data *or* point data (not both), so a field is
  only ever loaded/processed once.
2023-01-31 12:45:39 +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
988ec18ecc COMP: backslash instead of slash in Make/options 2023-01-30 11:55:35 +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
0339e5ee0d BUG: expression field functionObject 'store' keyword ignored 2023-01-26 21:49:59 +01:00
07c69fdf0d COMP: add static libgcc, libstdc++ linking for mingw (fixes #2680)
- this solves some 'dangling' dependency problems that plagued earlier
  versions (when MS-MPI was not also installed).
2023-01-24 18:21:05 +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