Commit Graph

25984 Commits

Author SHA1 Message Date
adf95d483c BUG: redistributePar: softlink uniform. Fixes #163 2022-11-24 14:58:07 +00:00
8c02820db6 COMP: EigenMatrix: remove unused iter variable 2022-11-24 13:47:08 +00:00
9d212dfd32 Merge branch 'feature-filtered-mapfile' into 'develop'
Add spatial filtering and ensight support to MappedFile and external file source (#2609)

See merge request Development/openfoam!568
2022-11-24 12:31:08 +00:00
126d831f6e TUT: use filter/mapping with ensight data (#2609) 2022-11-24 13:30:16 +01:00
cb4e026aed ENH: add support for additional filter/mapping (#2609)
- comprises a few different elements:

FilterField (currently packaged in PatchFunction1Types namespace)
~~~~~~~~~~~

  The FilterField helper class provides a multi-sweep median filter
  for a Field of data associated with a geometric point cloud.

  The points can be freestanding or the faceCentres (or points)
  of a meshedSurface, for example.

  Using an initial specified search radius, the nearest point
  neighbours are gathered and addressing/weights are built for them.
  This currently uses an area-weighted, linear RBF interpolator
  with provision for quadratic RBF interpolator etc.

  After the weights and addressing are established,
  the evaluate() method can be called to apply a median filter
  to data fields, with a specified number of sweeps.

boundaryDataSurfaceReader
~~~~~~~~~~~~~~~~~~~~~~~~~

- a surfaceReader (similar to ensightSurfaceReader) when a general
  point data reader is needed.

MappedFile
~~~~~~~~~~
- has been extended to support alternative surface reading formats.
  This allows, for example, sampled ensight data to be reused for
  mapping.  Cavaet: multi-patch entries may still needs some work.

- additional multi-sweep median filtering of the input data.
  This can be used to remove higher spatial frequencies when
  sampling onto a coarse mesh.

smoothSurfaceData
~~~~~~~~~~~~~~~~~
- standalone application for testing of filter radii/sweeps
2022-11-24 13:30:16 +01:00
2984d1e3e7 Merge branch 'feature-updated-core' into 'develop'
Feature updated core

See merge request Development/openfoam!573
2022-11-24 12:21:37 +00:00
98598ba0bb ENH: use simpler constructor forms for treeData types 2022-11-24 12:21:01 +00:00
fc0b980333 BUG: avoid infinite recursion in AABBTree (fixes #2616)
- since bounding boxes overlap, need to verify the splitting actually
  did something. Problem only really evident with higher tree depths.
2022-11-24 12:21:01 +00:00
ffbad65538 ENH: replace triangleFuncs::intersectBb usage with boundBox::intersect 2022-11-24 12:21:01 +00:00
38b663b6a8 ENH: add boundBox/triangle intersection test to boundBox
- replaces edge by edge tests with separating axis tests
2022-11-24 12:21:01 +00:00
ac4f580d09 ENH: cleanup treeData items (#2609)
Changes / Improvements

- more consistent subsetting, interface

  * Extend the use of subset and non-subset collections with uniform
    internal getters to ensure that the subset/non-subset versions
    are robustly handled.

  * operator[](label) and objectIndex(label) for standardized access
    to the underlying item, or the original index, regardless of
    subsetting or not.

  * centres() and centre(label) for representative point cloud
    information.

  * nDim() returns the object dimensionality (0: point, 1: line, etc)
    these can be used to determine how 'fat' each shape may be
    and whether bounds(labelList) may contribute any useful information.

  * bounds(labelList) to return the full bound box required for
    specific items. Eg, the overall bounds for various 3D cells.

- easier construction of non-caching versions. The bounding boxes are
  rarely cached, so simpler constructors without the caching bool
  are provided.

- expose findNearest (bound sphere) method to allow general use
  since this does not actually need a tree.

- static helpers

  The boxes() static methods can be used by callers that need to build
  their own treeBoundBoxList of common shapes (edge, face, cell)
  that are also available as treeData types.

  The bounds() static methods can be used by callers to determine the
  overall bound-box size prior to constructing an indexedOctree
  without writing ad hoc code inplace.

  Not implemented for treeDataPrimitivePatch since similiar
  functionality is available directly from the PrimitivePatch::box()
  method with less typing.

========
BREAKING: cellLabels(), faceLabels(), edgeLabel() access methods

- it was always unsafe to use the treeData xxxLabels() methods without
  subsetting elements. However, since the various classes
  (treeDataCell, treeDataEdge, etc) automatically provided
  an identity lookup, this problem was not apparent.

  Use objectIndex(label) to safely de-reference to the original index
  and operator[](index) to de-reference to the original object.
2022-11-24 12:21:01 +00:00
f638db48c7 ENH: octree findBox, findSphere with external storage of results
- more memory efficient within loops

- octree/boundBox overlaps().
  Like findBox(), findSphere() but early exit if any shapes overlap.

ENH: additional query for nLeafs()
2022-11-24 12:21:01 +00:00
b8d01a88ea ENH: setter/getter for octree permutation tolerance
- make template invariant
2022-11-24 12:21:01 +00:00
3d7dc6a870 ENH: reduce some internal overhead when splitting octree nodes (#2609)
- don't need separate scratch arrays (avoids possible reallocations
  when split is imbalanced)

ENH: upgrade dynamicIndexedOctree to use DynamicList directly

- with C++11 move semantics don't need lists of autoPtr
  for efficient transfers
2022-11-24 12:21:01 +00:00
b129446221 ENH: simplify sub-octant bound-box search
- basic support for splitting into two at a given position and face to keep
2022-11-24 12:21:01 +00:00
fc9311ba0d STYLE: octree pushPoint with local constexpr (more readable code) 2022-11-24 12:21:01 +00:00
3384747f9b ENH: split off template-invariant part of indexedOctree node indexing
- code reduction, reinherit for dynamicIndexedOctree

ENH: additional OBJ writing, statistics
2022-11-24 12:21:01 +00:00
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
1339c3357b ENH: general boundBox/treeBoundBox improvements
- null() static method
  * as const reference to the invertedBox with the appropriate casting.

- boundBox inflate(random)
  * refactored from treeBoundBox::extend, but allows in-place modification

- boundBox::hexFaces() instead of boundBox::faces
  * rarely used, but avoids confusion with treeBoundBox::faces
    and reuses hexCell face definitions without code duplication

- boundBox::hexCorners() for corner points corresponding to a hexCell.
  Can also be accessed from a treeBoundBox without ambiguity with
  points(), which could be hex corners (boundBox) or octant corners
  (treeBoundBox)

- boundBox::add with pairs of points
  * convenient (for example) when adding edges or a 'box' that has
    been extracted from a primitive mesh shape.

- declare boundBox nPoints(), nFaces(), nEdges() as per hexCell

ENH: return invertedBox instead of FatalError for empty trees

- similar to #2612

ENH: cellShape(HEX, ...) + boundBox hexCorners for block meshes

STYLE: cellModel::ref(...) instead of de-reference cellModel::ptr(...)
2022-11-24 12:21:01 +00:00
0ba458fdbc ENH: add primitiveMesh cellBb()
- the boundBox for a given cell, using the cheapest calculation:

  - cellPoints if already available, since this will involve the
    fewest number of min/max comparisions.

  - otherwise walk the cell faces: via the cell box() method
    to avoid creating demand-driven cellPoints etc.
2022-11-24 12:21:01 +00:00
27c2cdc040 ENH: vector mag(), magSqr() methods - complementary to dist(), distSqr()
ENH: use direct access to pointHit as point(), use dist(), distSqr()

- if the pointHit has already been checked for hit(), can/should
  simply use point() noexcept access subsequently to avoid redundant
  checks. Using vector distSqr() methods provides a minor optimization
  (no itermediate temporary), but can also make for clearer code.

ENH: copy construct pointIndexHit with different index

- symmetric with constructing from a pointHit with an index

STYLE: prefer pointHit point() instead of rawPoint()
2022-11-24 12:21:01 +00:00
5ec435aca3 ENH: base classes for wave algorithms (manage non-templated parts)
ENH: use DynamicList instead of List + size for point wave

- consistent with previous updates for the other algorithms

STYLE: unique_ptr instead of raw pointer in wave algorithms
2022-11-24 12:21:01 +00:00
c33167dc0e STYLE: use stack-like naming for ifEntry handling
STYLE: unique_ptr instead of autoPtr for holding std::thread
2022-11-24 12:21:01 +00:00
e4139898d2 ENH: face::connected() method
- return true if two faces share a common vertex.

  Same idea as the existing edge::connected() method
  (previously spelled 'connects()')
2022-11-24 12:21:01 +00:00
d3e285b48b ENH: add FixedList templated get<unsigned>() methods
- provides fast compile-time indexing for FixedList
  (invalid indices trigger a compiler error).

  This enables noexcept access, which can propagate into various
  other uses (eg, triFace, triPoints, ...)

ENH: add triangle edge vectors
2022-11-24 12:21:01 +00:00
c7e6ae30bf ENH: add front(), back() methods to List containers
- traditionally used first(), last() methods,
  but front(), back() are well-known from std::vector etc
  which makes the access more familiar.

- support push_back() method for containers that already had append().
  This increases name familiar and can help when porting between
  different C++ code bases.

- support pop_back() method for List containers.
  This is similar to std::vector
2022-11-24 12:21:01 +00:00
db88265163 ENH: use CircularBuffer instead SLList for FIFO-style handling
- PrimitivePatch localPointOrder
- enrichedPatch
- polyMeshZipUpCells
2022-11-24 12:21:01 +00:00
f3ba6c6da0 ENH: linked-lists accept more familiar STL method names
- ie, front(), back(), push_front(), push_back(), pop_front()

ENH: add CircularBuffer flattening operator() and list() method

- useful if assigning content to a List etc

BUG: CircularBuffer find() did not return logical index
2022-11-24 12:21:01 +00:00
9f9b8fb662 Merge branch 'feature-resolution-index' into 'develop'
ENH: resolutionIndex: new function object to evaluate LES/DES resolution

See merge request Development/openfoam!569
2022-11-23 18:24:06 +00:00
8ba1156a56 ENH: resolutionIndex: new function object to evaluate LES/DES resolution
Grid independency studies and grid adaptation for implicit LES/DES are
nontrivial and intractable due to the inherent coupling between spatial
resolution and subgrid-scale modelling.

To enable assessments for LES/DES resolution, a function object of
single-mesh resolution index with three submodels is introduced.
2022-11-23 13:41:20 +00:00
13606d4e09 ENH: RASModelBaseName: new type name for RANS models 2022-11-23 13:41:20 +00:00
90b61429f6 ENH: multiComponentMixture: fixes #2206
- added bit of tolerance
- write difference
2022-11-23 12:20:04 +00:00
d69ac516e8 ENH: allow configurable field send/receive for surfaceNoise (#2639)
- replaced PstreamBuffers mechanism with globalIndex for both gather
  and scatter operations. Use scheduled communication by default, but
  is selectable.

- reduced communication with ensemble averaging and no-write
2022-11-22 17:07:40 +01:00
9114e01de9 STYLE: align faceZone handling (functionObjects, sampling)
- pattern as per surfaceFieldValue::setFaceZoneFaces()

  1. define faceId, facePatchId assuming an internal face
  2. if actually a boundary face:
     - get facePatchId
     - ignore if emptyPolyPatch or coupledPolyPatch (neighbour side)
     - get patch relative faceId

  This currently seems to be the least amount of code clutter.

ENH: recover some memory my shrinking lists in fluxSummary

BUG: potentially trailing rubbish in the heatExchangerModel lists

- the final resize to length actually used was missing.
  Does not affect any released versions
2022-11-22 13:14:53 +01:00
a8f369fd2b ENH: region support for foamRestoreFields (#2638) 2022-11-22 13:14:53 +01:00
b5e6a42ded Merge branch 'feature-htc-facezone' into 'develop'
ENH: faceZoneReferenceTemperature: new heatTransferCoeff model

See merge request Development/openfoam!561
2022-11-21 15:59:45 +00:00
b18a6675cb STYLE: heatTransferCoeff: minor cleanup of models
TUT: solidQuenching2D: correct libs for reactingEulerHtcModel
2022-11-21 15:58:58 +00:00
354767c694 ENH: faceZoneReferenceTemperature: new heatTransferCoeff model 2022-11-21 15:58:58 +00:00
88e1932145 Merge branch 'feature-mappedPatchBase' into 'develop'
BUG: avoid excessive recalculation of map for moving meshes

See merge request Development/openfoam!572
2022-11-21 13:21:56 +00:00
945405c32d BUG: avoid excessive recalculation of map for moving meshes 2022-11-21 13:17:56 +00:00
013f3cccc4 ENH: improve handling of finiteArea mesh with distributed roots
- in makeFaMesh, the serial fields are now only read on the master
  process and broadcast to the other ranks. The read+distribute is
  almost identical to that used in redistributePar, except that in
  this case entire fields are sent and not a zero-sized subset.

- improved internal faMesh checking for files so that the TryNew
  method works with distributed roots.
2022-11-20 19:59:52 +01:00
21e7ce8f42 STYLE: place HashTable trivial methods in the header (reduce clutter) 2022-11-20 16:55:58 +01:00
94c7e180fb ENH: more fault-tolerance in makeFaMesh decomposition
- if the volume faceProcAddressing is missing, it is not readily
  possible to determine equivalent area procAddressing.

  Instead of throwing an error, be more fault-tolerant by having it
  create with READ_IF_PRESENT and then detect and warn
  if there are problems.
2022-11-19 20:49:12 +01:00
67b58c28c0 ENH: IOobjectList simpler construction of unregistered
- accept IOobjectOption::registerOption with (MUST_READ, NO_WRITE)
  being implicit. Direct handling of IOobjectOption itself, for
  consistency with IOobject.

  The disabling of object registration is currently the only case
  where IOobjectList doesn't use default construction parameters,
  but it was previously a bit awkward to specify.
2022-11-19 20:48:54 +01:00
db57c456f6 ENH: tutorials/Alltest -backup option
- for repeated tests (eg, during bisection) can be used to preserve
  the existing directory as tutorialsTest.bak01,
  tutorialsTest.bak02, ... (max of 10).

- preserve the commit information as tutorialsTest/commit-info
  to help document the current or backup test results.
2022-11-19 13:44:01 +01:00
1b11e4b3ac CONFIG: restrict wmakeLnInclude to header/template files
- source-code (.c, .cpp etc) only adds to clutter in the lnInclude
  directory
2022-11-19 12:41:55 +01:00
5e0a23edd5 STYLE: compacter help information for -debug-switch etc. 2022-11-18 21:24:17 +01:00
d7bf2d400d BUG: string wrapping (eg, argList help) truncates character (#2625)
- had an off-by-one in the accounting for some corner caes,
  partly because the logic was a bit convoluted

ENH: improved string wrapping (#2625)

- reworked logic (like a state machine) to handle backtracking
  with fallback of splitting near punctuation characters.

  Still doesn't compete with nroff or TeX, but does avoid long lines
  and many funny splits.  With this change the help for mapFieldsPar
  now like this:

  =====
      Specify the mapping method
      (direct|mapNearest|cellVolumeWeight|
      correctedCellVolumeWeight)
  =====

  Since the list of options is very long without any spaces, it takes
  '|' as the best split point, which definitely reads better
2022-11-18 21:14:22 +01:00
d9ab5d54ef ENH: ensightWrite, vtkWrite support for excluding fields and patches
- functionality similar to that provided by foamToEnsight, foamToVTK
  which allows blocking out patches (eg, outer walls, inlet/outlet)
  that are not particularly interesting to visualize
2022-11-18 15:28:14 +01:00
ec1d66d640 TUT: keyword updates 2022-11-18 10:31:00 +01:00