Commit Graph

835 Commits

Author SHA1 Message Date
Mark Olesen
5672bb296f ENH: use cmptMag, cmptMultiply instead of replacing field components 2023-01-31 12:36:41 +01:00
mattijs
fa7f0e1b67 ENH: pureZoneMixture: different mixture properties according to cellZone 2022-12-14 15:07:00 +00:00
Mark Olesen
e5006a62d7 ENH: use simpler boundBox handling
- use default initialize boundBox instead of invertedBox
- reset() instead of assigning from invertedBox
- extend (three parameter version) and grow method
- inflate(Random) instead of extend + re-assigning
2022-11-24 12:21:01 +00:00
Mark Olesen
25e874a4f0 ENH: provide MPI native minOp, maxOp reduce multiple values
- consistent with sumOp

ENH: globalIndex with gatherNonLocal tag, and use leading dispatch tags

- useful for gather/write where the master data can be written
 separately.  Leading vs trailing dispatch tags for more similarity to
 other C++ conventions.
2022-11-15 14:00:18 +01:00
Mark Olesen
70208a7399 ENH: use returnReduceAnd(), returnReduceOr() functions
DOC: document which MPI send/recv are associated with commType
2022-11-08 16:48:08 +00:00
Mark Olesen
473e14418a ENH: more consistent use of broadcast, combineReduce etc.
- broadcast           : (replaces scatter)
  - combineReduce       == combineGather + broadcast
  - listCombineReduce   == listCombineGather + broadcast
  - mapCombineReduce    == mapCombineGather + broadcast
  - allGatherList       == gatherList + scatterList

  Before settling on a more consistent naming convention,
  some intermediate namings were used in OpenFOAM-v2206:

    - combineReduce       (2206: combineAllGather)
    - listCombineReduce   (2206: listCombineAllGather)
    - mapCombineReduce    (2206: mapCombineAllGather)
2022-11-08 16:48:08 +00:00
mattijs
5677e10d90 ENH: checkMesh: report overlapping zones. See #2521 2022-10-03 11:41:42 +01:00
Mark Olesen
56e9f7bf4b BUG: blockMesh mergePatchPairs fails with edge-shared points (fixes #2589)
- remedy by performing the attach() action sequentially (as per
  stitchMesh changes). This ensures that the current point addressing
  is always used and avoids references to the already-merged points
  (which is what causes the failure).

ENH: improve handling of empty patch removal

- only remove empty *merged* patches, but leave any other empty
  patches untouched since they may intentional placeholders for other
  parts of a workflow.

- remove any empty point/face zones created for patch merging
2022-09-26 18:03:23 +02:00
Mark Olesen
5130c7bcbc STYLE: use polyPatchList instead of List<polyPatch*> in more places 2022-09-26 18:03:23 +02:00
mattijs
6f764c8d02 ENH: checkMesh: check patches across processors 2022-09-22 09:24:01 +01:00
Mark Olesen
097008544c STYLE: adjust range check in Foam::factorial (FULLDEBUG)
STYLE: consistent use of $(LIB_SRC) in Make/options
2022-09-07 16:25:45 +02:00
Mark Olesen
5218bfd721 Merge remote-tracking branch 'origin/master' into develop 2022-08-19 12:50:50 +02:00
Mark Olesen
b6a6e40c27 BUG: incorrect order for output scaling (transformPoints, ...)
- the output write scaling should be applied *after* undoing the
  effects of the specified rotation centre. Fixes #2566

ENH: update option names for transformPoints and surfaceTransformPoints

- prefer  '-auto-centre' and '-centre', but also accept the previous
  options '-auto-origin' and '-origin' as aliases.

  Changing to '-centre' avoids possible confusion with
  coordinate system origin().
2022-08-18 11:46:08 +02:00
Mark Olesen
d222cb1cee ENH: moveMesh -endTime option to restrict duration of motion testing 2022-07-13 19:09:44 +02:00
Mark Olesen
b4a482751b ENH: simplify tetrahedron and triangle handling
- combine header definitions, more pass-through methods

- face/triFace: support += operator (vertex offset)
2022-07-08 11:13:00 +02:00
Mark Olesen
8e017fa63c STYLE: specify "U[IO]Pstream" instead of "[IO]Pstream" for (read|write)
- consistency. Replace some instances of 'slave' with proc
2022-07-08 11:13:00 +02:00
Mark Olesen
a465e4db85 ENH: support Euler rotation rollPitchYaw/yawPitchRoll ordering
- can be more intuitive to specify for some cases:

      rotation
      {
          type    euler;
          order   rollPitchYaw;
          angles  (0 20 45);
      }

- refactor starcd rotation to reuse Euler ZXY ordering
  (code reduction)

ENH: add -rotate-x, -rotate-y, -rotate-z for transformPoints etc

- easier to specify for simple rotations
2022-06-02 16:47:40 +02:00
Mark Olesen
8081fc7234 ENH: refactor cell selections into cellBitSet
- ensightWrite, vtkWrite, fv::cellSetOption

ENH: additional topoSet "ignore" action

- this no-op can be used to skip an action step, instead of removing
  the entire entry
2022-05-31 13:04:43 +02:00
Mark Olesen
ba10afea77 ENH: add 'filtered' polyMesh regionName() method
- in various situations with mesh regions it is also useful to
  filter out or remove the defaultRegion name (ie, "region0").

  Can now do that conveniently from the polyMesh itself or as a static
  function. Simply use this

      const word& regionDir = polyMesh::regionName(regionName);

  OR  mesh.regionName()

  instead of

      const word& regionDir =
      (
           regionName != polyMesh::defaultRegion
         ? regionName
         : word::null
      );

  Additionally, since the string '/' join operator filters out empty
  strings, the following will work correctly:

      (polyMesh::regionName(regionName)/polyMesh::meshSubDir)

      (mesh.regionName()/polyMesh::meshSubDir)
2022-05-27 14:10:31 +02:00
Mark Olesen
b712e7289e ENH: use typed lookup versions instead of xyz::typeName literals 2022-05-17 17:35:51 +02:00
Mark Olesen
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
Mark Olesen
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
Mark Olesen
a4ef891594 COMP: missing linkage, unneeded linkage
- dynamicMesh, finiteVolume, regionFaModels, thermophysicalProperties
2022-04-29 13:26:36 +02:00
Mark Olesen
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
Mark Olesen
18e0d7e4d6 ENH: bundle broadcasts (#2371)
- additional Pstream::broadcasts() method to serialize/deserialize
  multiple items.

- revoke the broadcast specialisations for std::string and List(s) and
  use a generic broadcasting template. In most cases, the previous
  specialisations would have required two broadcasts:
    (1) for the size
    (2) for the contiguous content.

  Now favour reduced communication over potential local (intermediate)
  storage that would have only benefited a few select cases.

ENH: refine PstreamBuffers access methods

- replace 'bool hasRecvData(label)' with 'label recvDataCount(label)'
  to recover the number of unconsumed receive bytes from specified
  processor.  Can use 'labelList recvDataCounts()' to recover the
  number of unconsumed receive bytes from all processor.

- additional peekRecvData() method (for transcribing contiguous data)

ENH: globalIndex whichProcID - check for isLocal first

- reasonable to assume that local items are searched for more
  frequently, so do preliminary check for isLocal before performing
  a more costly binary search of globalIndex offsets

ENH: masterUncollatedFileOperation - bundled scatter of status
2022-04-29 11:44:28 +02:00
Mark Olesen
d38de84d21 ENH: bundle Pstream:: AllGather methods
- bundles frequently used 'gather/scatter' patterns more consistently.

  - combineAllGather     -> combineGather + broadcast
  - listCombineAllGather -> listCombineGather + broadcast
  - mapCombineAllGather  -> mapCombineGather + broadcast
  - allGatherList        -> gatherList + scatterList
  - reduce               -> gather + broadcast (ie, allreduce)

- The allGatherList currently wraps gatherList/scatterList, but may be
  replaced with a different algorithm in the future.

STYLE: PstreamCombineReduceOps.H is mostly unneeded now
2022-03-31 15:56:04 +02:00
Mark Olesen
24c0b30d48 ENH: mergePoints and patch gatherAndMerge improvements (#2402)
- when writing surface formats (eg, vtk, ensight etc) the sampled
  surfaces merge the faces/points originating from different
  processors into a single surface (ie, patch gatherAndMerge).

  Previous versions of mergePoints simply merged all points possible,
  which proves to be rather slow for larger meshes. This has now been
  modified to only consider boundary points, which reduces the number
  of points to consider. As part of this change, the reference point
  is now always equivalent to the min of the bounding box, which
  reduces the number of search loops. The merged points retain their
  original order.

- inplaceMergePoints version to simplify use and improve code
  robustness and efficiency.

ENH: make PrimitivePatch::boundaryPoints() less costly

- if edge addressing does not already exist, it will now simply walk
  the local face edges directly to define the boundary points.

  This avoids a rather large overhead of the full faceFaces,
  edgeFaces, faceEdges addressing.

  This operation is now more important since it is used in the revised
  patch gatherAndMerge.

ENH: topological merge for mesh-based surfaces in surfaceFieldValue
2022-03-16 13:44:58 +01:00
Mark Olesen
62fc3bbc33 STYLE: broadcast instead of combineScatter/listCombineScatter/mapCombineScatter
- these are the same thing now and 'broadcast' expresses the intention
  more directly/consistently
2022-03-12 21:16:30 +01: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
a6d1f47943 ENH: use globalIndex gather for simpler code and less communication
- checkTools, PatchTools::gatherAndMerge, SprayCloud penetration
2022-03-04 17:49:23 +00: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
mattijs
58f76ccc5f ENH: checkMesh: correct AMI weight directory. See #2356. 2022-02-21 16:14:08 +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
ad6d3a088e ENH: createPatch: update fields. Fixes #1361.
- adds 'patchFields' subdictionary to specify fvPatchFields
  similar to createBaffles
- implements automatic matching across multiple regions
2022-02-09 15:54:24 +00:00
mattijs
f14263e019 ENH: checkMesh: output AMI weights on mapped. Fixes #2356. 2022-02-07 16:21:08 +00:00
Mark Olesen
97f452d53a COMP: isolate include for coordSet writer 2022-01-21 09:19:50 +01:00
Dario Canossi
de90b2b28e BUG: rotateMesh: prevent double rotations (Fixes #2186) 2021-12-09 18:49:02 +00:00
Mark Olesen
ba8d6bddcc ENH: use singleton method for accessing runtime selection
STYLE: use alias to mark partialFaceAreaWeightAMI deprecation after v2012
2021-11-05 17:21:27 +01:00
Mark Olesen
a19f03a5cb STYLE: additional storage checks, noexcept, spelling
- prune unneeded demandDrivenData.H includes
2021-11-03 11:27:56 +01:00
Mark Olesen
851be8ea33 ENH: use consistent naming when toggling exception throwing on/off 2021-11-02 21:14:41 +01:00
Mark Olesen
610711ac47 ENH: inGroups support for mesh zones
- provisions for alternative groupings of zones

- extend indices() for boundary meshes to handle wordRes as well
2021-09-07 16:35:10 +02:00
mattijs
d5fd97d991 ENH: createPatch: check for overlapping patches. Fixes #2193 2021-09-01 08:29:32 +01:00
mattijs
9678b1dc22 ENH: splitMeshRegions: combine cellZones. See #2046
addZones: specifies the name instead of synthesising
2021-08-11 16:14:23 +01:00
mattijs
60aeca32a8 ENH: checkMesh: add stabilisation. Fixes #2171 2021-07-28 17:56:48 +01:00
Mark Olesen
0c15f773e0 STYLE: remove/replace unneeded SortableList 2021-07-15 16:47:27 +02:00
Mark Olesen
620fe96c02 ENH: multi-region support for rotateMesh (#2072) 2021-06-11 17:18:35 +02:00
Mark Olesen
5d9e42cb70 ENH: multi-region support for transformPoints (#2080) 2021-05-30 21:33:20 +02:00
Mark Olesen
2dbabb242b ENH: namedDictionary for managing keyword/dictionary combinations
- reworked from the openfoam.org wordAndDictionary version.

Allows, for example, named entries in topoSet.
2021-05-19 17:13:24 +02:00
Mattijs Janssens
5120c51ba1 ENH: splitMeshRegions: combine cellZones. See #2046 2021-05-17 10:53:40 +00:00