Commit Graph

24634 Commits

Author SHA1 Message Date
2990b14d89 ENH: add more direct methods for getting meshEdge (PrimitivePatch)
- refine definition of patch boundary faces to distinguish between
  boundaryFaces() and uniqBoundaryFaces().

  * boundaryFaces() for edge to face lookup on boundary edges.
  * uniqBoundaryFaces() for accessing quantities such as face areas
    or eroding an outer layer

ENH: LabelledItem container, replaces unused 'Keyed' container

- method names in alignment with objectHit, pointIndexHit etc.
  Top-level name aligns with labelledTri.
2021-05-27 15:42:46 +02:00
aeb9644db4 ENH: use common internal calls for VTK begin/end DataArray
- reduces common boilerplate, ensures that label fields are
  more easily handled.
2021-05-27 15:41:21 +02:00
48c05e5441 ENH: mpirunDebug improvements
- provide '-clean' option for removing old files

- handle out of order '-decomposeParDict' as per RunFunctions

- implicit no-prompt '-yes' with the shortcuts (eg, -log, -xterm)
  and set -local if not already defined

- accept <return> to select defaults
2021-05-27 15:40:55 +02:00
da30533a8f Merge branch 'bugfix-issue-2016-geoVoF-infiniteloop' into 'develop'
BUG: normalResidual has the potential to contain uninitialized values

See merge request Development/openfoam!455
2021-05-27 09:01:13 +00:00
eb8e0aefa5 BUG: normalResidual has the potential to contain uninitilized values 2021-05-27 09:00:46 +00:00
6c3a868fbe Merge branch 'tutorial-compressible' into 'develop'
TUT: compressible: clean up tutorials

See merge request Development/openfoam!459
2021-05-27 09:00:22 +00:00
7ce111809e TUT: compressible: clean up tutorials 2021-05-27 08:59:28 +00:00
f3d715dd13 Merge branch 'feature-spalart-allmaras-model' into 'develop'
ENH: SpalartAllmaras: add estimation functions for k, epsilon and omega

See merge request Development/openfoam!441
2021-05-27 08:59:05 +00:00
42bbd05992 TUT: SpalartAllmaras: add showcase for k/epsilon/omega estimation funcs
TUT: airfoil2D: clean up the tutorial case
2021-05-27 09:04:53 +01:00
c7357bd1c3 ENH: SpalartAllmaras: add estimation functions for k, epsilon and omega
ENH: SpalartAllmaras: reduce peak-memory usage
2021-05-27 09:04:47 +01:00
3273e6c21a BUG: extrudeMesh: copy original patch. See #2103
This is a partial fix for #2103. If there are no points
extruded for a stand-alone mesh (so not adding to mesh)
it should still include the original patch points. Not
doing so would generate illegal faces (also copiedPatchPoints
would not get set).
2021-05-26 14:14:34 +01:00
ab00110b5c Merge branch 'feature-spline-extrudeMesh' into 'develop'
INT: splineEdge: allowing usage in extrudeMesh. See #1983.

See merge request Development/openfoam!453
2021-05-26 12:22:25 +00:00
4a87e2d0b4 INT: splineEdge: allowing usage in extrudeMesh. See #1983. 2021-05-26 12:22:24 +00:00
8be49d8683 Merge branch 'tutorial-heat-transfer' into 'develop'
TUT: heatTransfer: clean up tutorials

See merge request Development/openfoam!458
2021-05-26 11:36:21 +00:00
f62a599eef TUT: heatTransfer: clean up tutorials 2021-05-26 11:35:49 +00:00
ad75af0e50 Merge branch 'feature-localWorld' into 'develop'
Support AMI for multi-world operation

See merge request Development/openfoam!456
2021-05-26 08:27:31 +00:00
f44dbbc200 ENH: Support AMI for multi-world operation. Fixes #2099
Multi-world operation now supports AMI:

    // What to sample:
    sampleMode      nearestPatchFaceAMI;
2021-05-26 08:27:30 +00:00
9a3d27e3df ENH: blockMesh: enable named blocks and mergePatchPairs. Fixes #2088. 2021-05-20 16:13:52 +01:00
f99ba1adbd CONFIG: bump API to 2103
- reflect updated tokenizing of expressions, scotch/paraview version
2021-05-19 18:25:17 +02:00
cb7d8cef78 SUBMODULE: style/code updates for cfmesh, openqbmm, external-solver 2021-05-19 18:16:06 +02:00
b2ab5e8ae9 CONFIG: update scotch (6.1.0), paraview (5.9.1) and petsc (3.15.0) 2021-05-19 18:16:06 +02:00
4028738327 ENH: redistributePar - detect if reconstruct is required (#2092) 2021-05-19 18:16:06 +02:00
0df219d1b3 ENH: expose decomposePar -dry-run options -domains, -method
- can now drop older Test-decomposePar for exploration purposes
  and simply use -dry-run with the -domains and -method options.

- write VTK file instead of volScalarField in combination
  with -dry-run and -cellDist.

  Avoids adding any OpenFOAM fields and is usually faster to load.
  Also easier to rename than a volScalarField would be when exploring
  multiple decompositions.
2021-05-19 18:16:05 +02:00
0ea709e5ee STYLE: minor code reduction in reconstructParMesh 2021-05-19 18:16:05 +02:00
0affbceaca ENH: 'foamToVTK -finite-area' option (compat: -finiteAreaFields)
- aligns with the resulting VTK subdirectory name
2021-05-19 18:16:05 +02:00
edbee86271 Merge branch 'update-tokenizer' into 'develop'
ENH: adjust tokenizing

See merge request Development/openfoam!452
2021-05-19 16:11:50 +00:00
ec81436cce TUT: generalize (parameterize) blockMeshDict for half-cylinder geometries
- profit from some of the recent modifications to parser expansion

TUT: adjust some #eval statements for less clutter
2021-05-19 17:33:25 +02:00
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
c9fda67b5f ENH: refactor function arg splitting -> stringOps::splitFunctionArgs 2021-05-19 16:20:12 +02:00
44a243a94d ENH: improve stream handling of expansions (#2095)
* removed internal upper limit on word/string length for parsed input.

  - Although it has not caused many problems, no reason to retain
    these limits.
  - simplify some of the internal logic for reading string-like items.
  - localize parsers for better separation from the header

  - expose new function seekCommentEnd_Cstyle(), as useful
    handler of C-style comments

* exclude imbalanced closing ')' from word/variable

  - previously included this into the word/variable, but makes more
    sense to leave on the parser for the following token.

    Prevents content like 'vector (10 20 $zmax);' from being parsed
    as '$zmax)' instead of as '$zmax' followed by a ')'.
    No conceivable reason that the former would actually be desirable,
    but can still be obtained with brace notation: Eg, '${zmax)}'

* consistent handling of ${{ ... }} expressions

  - within a dictionary content, the following construct was
    incorrectly processed:

        value ${{2*sqrt(0.5)}};

    Complains about no dictionary/env variable "{2*sqrt(0.5)}"

    Now trap expressions directly and assign their own token type
    while reading. Later expansion can then be properly passed to
    the exprDriver (evalEntry) instead of incorrectly trying
    variable expansion.

    Does not alter the use of expressions embedded within other
    expansions. Eg, "file${{10*2}}"

* improve #eval { ... } brace slurping

  - the initial implementation of this was rudimentary and simply
    grabbed everything until the next '}'.  Now continue to grab
    content until braces are properly balanced

    Eg, the content:   value #eval{${radius}*2};

    would have previously terminated prematurely with "${radius" for
    the expression!

NOTE:
    both the ${{ expr }} parsed input and the #eval { ... } input
    discard C/C++ comments during reading to reduce intermediate
    overhead for content that will be discarded before evaluation
    anyhow.

* tighten recognition of verbatim strings and expressions.

  - parser was previously sloppy and would have accepted content such
    as "# { ..." (for example) as an verbatim string introducer.
    Now only accept parse if there are no intermediate characters
    discarded.
2021-05-18 15:41:26 +02:00
efd1ac4b5f ENH: adjust token in preparation for separate expression tokenization
- minor simplification of #if/#endif handling

ENH: improve input robustness with negative-prefixed expansions (#2095)

- especially in blockMeshDict it is useful to negate an value directly.
  Eg,
  ```
     xmax  100;
     xmin  -$xmax;
  ```
  However, this fails since the dictionary expansion is a two-step
  process of tokenization followed by expansion. After the expansion
  the given input would now be the following:
  ```
     xmax  100;
     xmin  - 100;
  ```
  and retrieving a scalar value for 'xmin' fails.

  Counteract this by being more generous on tokenized input when
  attempting to retrieve a label or scalar value.
  If a '-' is found where a number is expected, use it to negate the
  subsequent value.

  The previous solution was to invoke an 'eval':
  ```
     xmax  100;
     xmin  #eval{-$xmax};
  ```
  which adds additional clutter.
2021-05-18 15:30:00 +02:00
739c1c1d61 Merge branch 'feature-splitMeshRegions-merge' into 'develop'
ENH: splitMeshRegions: combine cellZones. See #2046

See merge request Development/openfoam!448
2021-05-17 10:53:41 +00:00
5120c51ba1 ENH: splitMeshRegions: combine cellZones. See #2046 2021-05-17 10:53:40 +00:00
18c1da05fd Merge branch 'refactor-schemes-handling' into 'develop'
refactor and extend handling of faSchemes/fvSchemes

See merge request Development/openfoam!449
2021-05-14 18:36:38 +00:00
3a1a160cbb ENH: refactor and extend handling of faSchemes/fvSchemes
- use common base for handling scheme lookups.
  Extended to support local injection of schemes into the dictionaries
  during runtime.
2021-05-13 15:27:24 +02:00
91ede9957c STYLE: consistency for usage of GeoMesh
- add const qualifiers on C() methods
2021-05-13 13:07:15 +02:00
662bed74f6 Merge branch 'feature-list-face-updates' into 'develop'
collected changes for Lists, faces and PrimitivePatch

See merge request Development/openfoam!446
2021-05-13 10:53:02 +00:00
5022591c36 ENH: return old file handler on change
- intended for the following type of use:

      auto oldHandler = fileHandler(fileOperation::NewUncollated());

      ... do something that only works with uncollated

      // Restore previous (if any)
      if (oldHandler)
      {
          fileHandler(std::move(oldHandler));
      }

ENH: make fileOperation distributed(bool) mutable

- use is "static-like" and akin to Pstream::parRun(bool),
  thus allow toggling of the switch without a const_cast
2021-05-13 11:39:30 +02:00
2a438385a3 STYLE: make polyMesh constructor explicit
- use polyMesh::defaultRegion instead of fvMesh::defaultRegion and
  others via static inheritance. (92 vs ~25 occurrences)
2021-05-12 11:24:57 +02:00
3bc8ab2839 ENH: improve PrimitivePatch access for edges
- return internalEdges() and boundaryEdges() sub lists directly

- calculate and return boundaryFaces() to identify faces attached to
  boundary edges.

- minor code cleanup, and add PrimitivePatchBase class for
  non-templated code.

STYLE: mark unused parameter in globalMeshData mergePoints
2021-05-12 11:24:57 +02:00
ea2bf72740 ENH: support gather of indirect list via globalIndex 2021-05-12 11:24:57 +02:00
17e6a14773 ENH: improve support for assignment from indirect list
- copy assignment from indirect list to SubList and Field
2021-05-12 11:24:57 +02:00
40567b844a DEFEATURE: remove construct List from two iterators (#2083)
- this constructor was added for similarity with std::vector,
  but continues to cause various annoyances.

  The main problem is that the templated parameter tends to grab
  anything that is not a perfect match for other constructors.

  Typically seen with two integers (in 64-bit mode), but various other
  cases as well.

  If required, the ListOps::create() function provides a lengthier
  alternative but one that can also incorporate transformations.
  Eg,

      pointField pts = ....;

      List<scalar> mags
      (
          List<scalar>::create
          (
              pts.begin(),
              pts.end(),
              [](const vector& v){ return magSqr(v); }
      );
2021-05-12 11:24:57 +02:00
c0138ee8b6 ENH: add forward/reverse circular index/value accessors for indirect lists
- improves interchangeability of List vs IndirectList
2021-05-12 11:24:57 +02:00
8eef91c5e2 ENH: improve edge access for face/triFace
- additional rcEdge(), rcEdges() methods for reverse order walk

- accept generic edge() method as alternative to faceEdge() for
  single edge retrieval.

- edge() method with points -> returns the vector

- reduce the number of operations in edgeDirection methods

DEFEATURE: remove longestEdge global function

- deprecated and replaced by face::longestEdge() method (2017-04)
2021-05-12 11:24:57 +02:00
5eb48c443a ENH: add set/zone support to randomise function object (#2086) 2021-05-12 11:24:52 +02:00
3595e6f93c COMP: specify default format for vtk::polyWriter constructor (internals)
- gcc-4.8.5 does not respect the default parameter,
  thus specify format explicitly
2021-05-12 09:50:23 +02:00
4d14c95567 ENH: change location of static ensight geometry (#2079)
Historically the "geometry" for static meshes was placed under
directly in the EnSight case directory.

Eg,

     ensight/ensight.case
     ensight/geometry
     ensight/data/000001
     ensight/data/000002 ...

This generally works ok, but relocating it to a constant data directory
Eg
     ensight/ensight.case
     ensight/data/constant/geometry
     ensight/data/000001
     ensight/data/000002 ...

Improves handling and avoids potential collisions when adding in
additional mesh regions
2021-05-10 14:34:44 +02:00
0a78e685ee ENH: introduce intermediate vtk::polyWriter class
- reduces code, simplifies creation of new, specialized polyData
  writers.

- new templated vtk::GenericPatchWriter, which adds support for
  writing both uindirectPrimitivePatch + indirectPrimitivePatch types.

- handle geometric fields separately from regular fields with
    * vtk:GenericPatchGeoFieldsWriter
    * vtk:indirectPatchGeoFieldsWriter
    * vtk:uindirectPatchGeoFieldsWriter
2021-05-10 14:34:44 +02:00
492d5cb645 ENH: support 'transform' specification for geometric decomposition
- can be used for block-like meshes that are not aligned with the global
  coordinate directions. Alternatively, for general testing purposes.

  Example,

    method  simple;
    coeffs
    {
        n       ( 2 2 2 );
        transform
        {
            origin  (-0.15 0.15 0);
            e1      (1 1 0);
            e3      (0 0 1);
        }
    }
2021-05-10 14:34:43 +02:00