Commit Graph

25465 Commits

Author SHA1 Message Date
60e07d1f93 ENH: refine mapDistribute methods
- additional distribute/reverseDistribute with specified commsType.
  Improves flexibility.

- distribute with nullValue

- support move construct mapDistribute from mapDistributeBase

- refactor handling of schedules (as whichSchedule method) to
  simplify code.

- renumberMap helper for working with compact sub maps
  and renumberVisit for handling walk-ordered compaction.

COMP: make mapDistributeBase data private

- accessor methods are available - direct access is unnecessary
- mapDistribute : inherit mapDistributeBase constructors

STYLE: use List<labelPair>::null() for schedule placeholders

- clearer that they are doing nothing
2022-05-17 17:35:51 +02:00
ae0ef3efed COMP: make Function1 writeEntries virtual 2022-05-17 17:35:51 +02:00
9e2214131c COMP: Removed unused variable 2022-05-17 16:20:32 +01:00
edb0c5880b ENH: surfaceNoise - added optional areaAveraging for 1/3 octave data 2022-05-17 16:20:32 +01:00
6cafe441f8 ENH: valueAverageBase - added support for averaging label values 2022-05-17 16:20:32 +01:00
5d9456187d ENH: zero tag for constructing various IO types
- for int64 compilations this disambiguates between '0' as int32 (size)
  or as bool 'false' for local processor validity

  Eg,

     IOList list(io, 0);     <- With label-size 64: is this bool or label?
     IOList list(io, Zero);  <- Size = 0 (int32/int64), not a bool
2022-05-12 13:47:03 +02:00
812f4c4f09 BUG: globalIndex fails non-blocking gather of indirect list (fixes #2467)
- for indirect lists we use element-wise output streaming and read
  back as a regular list. This approach cannot however work with
  non-blocking mode - the receive buffers will simply not be filled
  before attempting to read from them.

  For contiguous data, the lowest overhead solution is to locally
  flatten the indirect list and use the regular gather routines
  for non-blocking mode. For non-contiguous data, can continue to
  use the element-wise output, but cannot use non-blocking for it.

STYLE: use non-blocking consistently as default for globalIndex gather(s)

- most of the front-facing code was already using non-blocking,
  but there were a few low-level routines defaulting to scheduled
  (but never relied upon in the code).
2022-05-12 11:29:38 +02:00
809fc70166 BUG: redistributePar: reconstruct mesh 2022-05-11 16:06:52 +01:00
efe057897f ENH: foamToVTK attempt finite-area write if -with-ids is specified
- previously filtered on the existence of area fields, but with
  faMesh::TryNew this is not required anymore.

STYLE: enable -verbose for various parallel utilities (consistency)
2022-05-11 11:34:04 +02:00
9c727abb84 COMP: increment lemon sources, fix stray comment char (wmkdepend)
COMP: compile utilites before solvers

- there are no inter-dependencies,
  so favour getting utilities working first
2022-05-11 09:53:58 +02:00
0ed0856593 COMP: avoid Istream/List operator() ambiguity (gcc-4.8.5)
- introduced UList<bool>::operator()(label) as part of bf0b3d8872
  but with gcc-4.8.5 this participates in operator resolution even
  for non-bool lists!!
  Partial revert until this predicate handling is really required.
2022-05-11 08:57:05 +02:00
dd560a6e3c ENH: reduce allocations/sorting when setting time (#2461)
- use DynamicList instead of List in the cache, which reduces the
  number of allocations occuring each time.

- since the cached times are stored in sorted order, first check if the
  new time is greater than the last list entry. Can then simply append
  without performing a binary search and can obviously also skip any
  subsequent sorting.

STYLE: add noexcept to Instant methods, declare in header (like Tuple2)
2022-05-10 21:16:09 +02:00
525f77f8bb TUT: add constraint types for finiteArea tutorials
STYLE: accept '-proc' as shortcut in restore0Dir function
2022-05-10 21:16:09 +02:00
de59875147 BUG: probes not written to probes/0 output (fixes #2452)
- as part of #2358 the writing was changed to be lazy.
  Which means that files are only created before they are actually
  written, which helps avoid flooding the filesystem if sample-only
  is required and also handles case such as "rho.*" where the sampled
  fields are not known from the objectRegistry at startup.

- now create any new files using the startTime value, which means they
  are easier to find but still retains the lazy construct.

  Don't expect any file collisions with this, but there could be some
  corner cases where the user has edited to remove fields (during
  runtime) and then re-edits to add them back in. In this case the
  file pointers would be closed but reopened later and overwriting
  the old probed values. This could be considered a feature or a bug.

BUG: bad indexing for streamlines (fixes #2454)

- a cut-and-paste error
2022-05-10 21:16:09 +02:00
762c095f4e COMP: WM_SCHEDULER breaks compilation (fixes #2439)
- only wrap compiler calls (not things like flex/bison)
- avoid single quoted '&&' (causes syntax errors)

STYLE: report WM_COMPILE_CONTROL value in top-level Allwmake
2022-05-10 21:15:39 +02:00
ebc634a425 Merge branch 'feature-reorganise' into 'develop'
code style, bug fixes

See merge request Development/openfoam!535
2022-05-10 11:07:46 +00:00
42de624344 ENH: consolidate processorTopology handling for volume and area meshes
- relocate templating to factory method 'New'.
  Adds provisions for more general re-use.

- expose processor topology in globalMesh as topology()

- wrap proc->patch lookup as processorTopology::procPatchLookup method
  (failsafe). May consider using Map<label> for its storage in the
  future.
2022-05-10 10:47:01 +02:00
dea2f23afd COMP: combine uindirectPrimitivePatch.H into indirectPrimitivePatch.H
- similarly combine typedef headers for primitiveFacePatch,
  foamVtkUIndPatchWriter, foamVtkUIndPatchGeoFieldsWriter etc
  (reduce file clutter)
2022-05-10 10:47:01 +02:00
33693f32b6 ENH: wrapped IOField, IOList, IOmapDistributePolyMesh
- Uses a refPtr to reference external content.
  Useful (for example) when writing data without copying.
  Reading into external locations is not implemented
  (no current requirement for that).

    * IOFieldRef -> IOField
    * IOListRef -> IOList
    * IOmapDistributePolyMeshRef -> IOmapDistributePolyMesh

  Eg,

    labelList addressing = ...;

    io.rename("cellProcAddressing");
    IOListRef<label>(io, addressing).write();

  Or,
    primitivePatch patch = ...;
    IOFieldRef<vector>(io, patch.localPoints()).write();
2022-05-10 10:47:01 +02:00
036abb8ecb BUG: bitSet &= operation does not mask out non-overlapping (#2456)
- the values from non-overlapping blocks were simply ignored,
  which meant that ('111111111111' & '111111') would not mask out
  the unset values at all.

- similar oddities in other operations (|=, ^= etc)
  where the original implementation tried hard to avoid touching the
  sizing at all, but now better resolved as follows:

  - '|=' : Set may grow to accommodate new 'on' bits.
  - '^=' : Set may grow to accommodate new 'on' bits.
  - '-=' : Never changes the original set size.
  - '&=' : Never changes the original set size.
           Non-overlapping elements are considered 'off'.

  These definitions are consistent with HashSet behaviour
  and also ensures that (a & b) == (b & a)

ENH: improve short-circuiting within bitSet ops

- in a few places can optimise by checking for none() instead of
  empty() and avoid unnecessary block operations.

ENH: added bitSet::resize_last() method

- as the name says: resizes to the last bit set.
  A friendlier way of writing `resize(find_last()+1)`
2022-05-10 10:47:01 +02:00
a34357b1a6 ENH: additional IndirectList static methods
- uniq() : creates an IndirectList with duplicated entries
  filtered out

- subset() : creates an IndirectList with positions that satisfy
  a condition predicate.

- subset_if() : creates an IndirectList with values that satisfy a
  given predicate.

  An indirect subset will be cheaper than creating a subset copy
  of the original data, and also allows modification.

STYLE: combine UIndirectList.H into UIndirectList.H (reduce file clutter)
2022-05-10 10:47:01 +02:00
7afebef509 ENH: HashTable sorted() method
- the sorted() method fills a UPtrList with sorted entries. In some
  places this can provide a more convenient means of traversing a
  HashTable in consistent order, without the extra step of creating
  a sortedToc(). The sorted() method with a UPtrList will also have
  a lower overhead than creating any sortedToc() or toc() since it is
  list of pointers and not full copies of the keys.

  Instead of this:

      HashTable<someType> table = ...;

      for (const word& key : table.sortedToc())
      {
          Info<< key << " => " << table[key] << nl;
      }

  can write this:

      for (const auto& iter : table.sorted())
      {
          Info<< iter.key() << " => " << iter.val() << nl;
      }

STYLE:

- declare hash entry key 'const' since it is immutable
2022-05-10 10:47:01 +02:00
d68902f4a7 ENH: relocate Foam::sort from PtrListOps to UPtrList.H
- can sort directly without ListOps or other intermediates
  (eg labelList order).

- PtrListOps::less/greater wrappers -> UPtrList::less/greater
2022-05-10 10:04:27 +02:00
cb6f908798 STYLE: IOobject/regIOobject - noexcept methods, isolate local functions
- local writeHeaderEntry helper was not marked as file-scope static.

- use do/while to simplify handling of padding spaces

ENH: IOobject - copy construct, resetting name and local component

- when copying with a new local component, this is simpler than
  constructing from all of the components, which was previously the
  only possibility for setting a new local component.
2022-05-09 14:52:47 +02:00
bf0b3d8872 ENH: relocate sortedOrder from ListOps.H to List.H
- commonly used, only depends on routines defined in UList
  (don't need the rest of ListOps for it).

ENH: implement boolList::operator() const

- allows use as a predicate functor, as per bitSet and labelHashSet

GIT: combine SubList, UList into List directory (intertwined concepts)

STYLE: default initialize DynamicList instead of with size 0
2022-05-09 14:52:47 +02:00
0e01e530a8 ENH: add optional agglomeration coefficent to random decomposition
- specifies the number of consecutive cells to assign to the same
  randomly chosen processor. Can be used to have a less extremely
  random distribution for testing possible breaking points.

Eg,
    method random;

    coeffs
    {
        agglom  4;
    }

- Add finiteArea cellID (actually face ids) / faceLabel and procID
  for foamToVTK with -write-ids. Useful when this type of information
  is needed.
2022-05-09 14:52:47 +02:00
8ee4efc64b ENH: checkMesh: weights on AMI patches. 2022-05-09 13:46:05 +01:00
2ba2814c50 ENH: mpirunDebug: preserve ". Fixes #2459 2022-05-06 18:09:54 +01:00
df63b47fbc BUG: masterCoarsest: do not agglomerate: Fixes #2455.
If the initial mesh does not have enough levels
do not do any agglomeration
2022-05-04 17:57:22 +01:00
d00445ace9 Merge branch 'feature-multiple-outletMappedUniformInlet' into 'develop'
ENH: outletMappedUniformInlet: add multiple fraction, offset and time delays

See merge request Development/openfoam!531
2022-04-29 20:00:22 +00:00
0a6e368289 TUT: airRecirculationRoom: update the tutorial 2022-04-29 19:59:41 +00:00
009f8dd1e8 ENH: outletMappedUniformInlet: add multiple fraction, offset and time delays
- Arbitrary number of outlets can be connected to a single inlet
  - Each inlet can be connected to different and arbitrary
    combination of outlets
- Each outlet-inlet connection has:
  - Optional filtration fraction as a Function1 type
  - Optional offset as a Function1 type (i.e. adding/substracting a substance)
  - Optional time delay (from outlet to inlet) as a Function1 type
- Each inlet has an optional base inlet-field as a PatchFunction1 type
2022-04-29 19:59:41 +00:00
32d3fabcfe ENH: scalarTransport: transfer write control from controlDict to function object 2022-04-29 19:59:41 +00:00
ab976a5ac0 ENH: interpolateXY: enable UList parameters for wider applications 2022-04-29 19:59:41 +00:00
7460fb259b Merge branch 'issues-2022-1.kbc' into 'develop'
BUG: 2022-1: Various bug fixes

See merge request Development/openfoam!530
2022-04-29 19:59:18 +00:00
f5ef5dc371 COMP: snappyLayerDriver: remove 64-bit label ambiguity 2022-04-29 19:55:44 +00:00
2296d91423 BUG: nutUBlendedWallFunction: avoid pressure spikes (fixes #2299) 2022-04-29 19:55:44 +00:00
7552608e08 BUG: linearTsubDiameter: fix the definition of bubble diameter (fixes #2312) 2022-04-29 19:55:44 +00:00
85786c6989 INT: TDACChemistryModel: avoid redundant MPI communications (#2337) 2022-04-29 19:55:44 +00:00
583fc4fb0d ENH: atmPlantCanopyUSource: improve implicit behaviour (fixes #2343) 2022-04-29 19:55:44 +00:00
123fe09fda BUG: activePressureForceBaffleVelocity: fix calculated area (fixes #2360)
This patch provides the correct behavior of
the boundary condition and its opening values.
2022-04-29 19:55:44 +00:00
c323cbd35b TUT: verticalChannel: add limitTemperature to avoid negative temperatures (fixes #2391)
TUT: propeller: remove duplicate log entry (fixes #1967)

TUT: verticalChannelLTS: update input to avoid runtime errors (fixes #2426)

TUT: Keyword updates
2022-04-29 19:55:44 +00:00
f118d9a2a2 BUG: humidityTemperature: fix dropwise condensation expression (fixes #2422) 2022-04-29 19:55:44 +00:00
e28bed59e2 BUG: DEShybrid: store the factor field on the mesh (fixes #2425)
The blendingFactor function object overwrites the DEShybrid:Factor
field internally when blendedSchemeBase debug flag is active.
However, users are allowed to write out the original DEShybrid:Factor
field by executing the writeObjects function object before
any blendingFactor function object execution.
2022-04-29 19:55:44 +00:00
a5f7fb6ad2 BUG: blendingFactor: fix DEShybrid blending-factor inconsistency (fixes #2419) 2022-04-29 19:55:44 +00:00
abc38e1cfc Merge branch 'feature-reorganise' into 'develop'
Code changes and reorganisation preliminary to redistributePar updates (#2436)

See merge request Development/openfoam!533
2022-04-29 19:46:08 +00:00
a4ef891594 COMP: missing linkage, unneeded linkage
- dynamicMesh, finiteVolume, regionFaModels, thermophysicalProperties
2022-04-29 13:26:36 +02:00
cf7dbf4d42 ENH: relocate/refactor fvMeshSubset
- direct construct and reset method for creating a zero-sized (dummy)
  subMesh. Has no exposed faces and no parallel synchronization
  required.

- core mapping (interpolate) functionality with direct handling
  of subsetting in fvMeshSubset (src/finiteVolume).
  Does not use dynamicMesh topology changes

- two-step subsetting as fvMeshSubsetter (src/dynamicMesh).
  Does use dynamicMesh topology changes.
  This is apparently only needed by the subsetMesh application itself.

DEFEATURE: remove deprecated setLargeCellSubset() method

- was deprecated JUL-2018, now removed (see issue #951)
2022-04-29 11:44:29 +02:00
6e21d6f78c ENH: refactor/centralize handling of direct and distributed mappers (#2436)
- added templating level to avoid code duplication and provide future
  extensibility
2022-04-29 11:44:29 +02:00
b68193088c ENH: add GeometricBoundaryField evaluateCoupled method (#2436)
- allows restricted evaluation to specific coupled patch types.
  Code relocated/refactored from redistributePar.

STYLE: ensure use of waitRequests() also corresponds to nonBlocking

ENH: additional copy/move construct GeometricField from DimensionedField

STYLE: processorPointPatch owner()/neighbour() as per processorPolyPatch

STYLE: orientedType with bool cast operator and noexcept
2022-04-29 11:44:29 +02:00