Commit Graph

25975 Commits

Author SHA1 Message Date
3a6e427409 ENH: simplify dictionary search for value/refValue in BCs
- in expressions BCs in particular, there is various logic handling
  for if value/refValue/refGradient etc are found or not.

  Handle the lookups as findEntry and branch to use Field assign
  or other handling, depending on its existence.

STYLE: use wordList instead of wordRes for copy/filter dictionary
2022-10-04 15:51:26 +02:00
ea51c2c0e4 STYLE: return orientedType, Switch directly instead of const reference
- noexcept on some Time methods

ENH: pass through is_oriented() method for clearer coding

- use logical and/or/xor instead of bitwise versions (clearer intent)
2022-10-04 15:51:26 +02:00
867b5e9060 Merge branch 'feature-noise-writeFile' into 'develop'
ENH: noiseModels - replaced graph usage by writeFile

See merge request Development/openfoam!562
2022-10-04 13:50:32 +00:00
7c2311aae6 ENH: noiseModels - replaced graph usage by writeFile
Header information now includes, e.g.

    f [Hz] vs P(f) [Pa]
    Lower frequency: 2.500000e+01
    Upper frequency: 5.000000e+03
    Window model: Hanning
    Window number: 2
    Window samples: 512
    Window overlap %: 5.000000e+01
    dBRef       : 2.000000e-05
    Area average: false
    Area sum    : 6.475194e-04
    Number of faces: 473

Note: output files now have .dat extension
2022-10-04 13:10:39 +00:00
f87f0040b8 ENH: writeFile - add newFile function
ENH: writeFile - renamed createFile functions
     to newFileAtTime and newFileAtStartTime
2022-10-04 13:10:39 +00:00
c59b6db3c4 ENH: viewFactorsGen: re-enable 2D. See #2560
This reverts the v2206 behaviour so does not include
the edge-integration (2LI) optimisation - it uses
the exact same code as v2206.
2022-10-03 16:54:58 +01:00
5677e10d90 ENH: checkMesh: report overlapping zones. See #2521 2022-10-03 11:41:42 +01:00
38d68824b3 ENH: uniformInterpolatedDisplacement: Delay evaluation. Fixes #2605
If a `value` field is present use it and don't look for time
directories since this messes up the construct-from-dictionary
2022-10-03 10:31:40 +01:00
8283599c31 ENH: meshQualityDict: disable minEdgeLength by default (fixes #2599) 2022-09-29 14:16:44 +01:00
f276366a05 ENH: snappyHexMesh: add mesh-quality control for edge lengths 2022-09-28 08:57:43 +01:00
a7ef33da6b ENH: add finite-area support to setFields (#2591)
- for example,

    defaultFieldValues
    (
        areaScalarFieldValue h 0.00014
    );

    regions
    (
        clipPlaneToFace
        {
            point  (0 0 0);
            normal (1 0 0);

            fieldValues
            (
                areaScalarFieldValue h 0.00015
            );
        }
    );

ENH: additional clipPlaneTo{Cell,Face,Point} topo sets

- less cumbersome than defining a semi-infinite bounding box
2022-09-26 18:03:23 +02:00
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
9fa37ba068 ENH: add static centre(), {area,unit}Normal() methods to triangle
- commonly used calculations

ENH: add faPatch::patchRawSlice method

- slices using the nEdges() instead of the virtual size(),
  which provides similar functionality as finite-volume has with
  its distinction between polyPatch vs fvPatch patchSlice

- use patchInternal for obtaining faPatch, fvPatch information
2022-09-26 18:03:23 +02:00
5130c7bcbc STYLE: use polyPatchList instead of List<polyPatch*> in more places 2022-09-26 18:03:23 +02:00
3c7088b6c0 STYLE: provide GeometricField internalFieldRef()
- similar to boundaryFieldRef(), primitiveFieldRef() for providing
  write access. Complimentary naming to internalField(). Identical to
  ref() but more explicitly named, and less likely to be confused with
  a tmp::ref(), for example.

- prefer .primitiveFieldRef() over .ref().field()

- mark some access methods noexcept
2022-09-26 09:53:22 +02:00
4710528448 ENH: reduce allocations/overhead when reading PtrList
- replace SLList with direct handling (like a hand-rolled DynamicList)

ENH: support PtrList transfer for polyMesh::addZones
2022-09-26 09:52:59 +02:00
cbace69896 ENH: more consistent naming of MPI reductions
- combineReduce     (older: combineAllGather)
- listCombineReduce (older: listCombineAllGather)
- mapCombineReduce  (older: mapCombineAllGather)
2022-09-23 19:19:03 +02:00
39fc7cc957 GIT: missing tutorial files 2022-09-23 12:35:07 +02:00
dc28dbc3ad TUT: add multi-patch versions using regionFaModels 2022-09-22 17:24:21 +02:00
b1a8bb1b12 STYLE: remove old/fragile volSurfaceMapping mappings 2022-09-22 17:18:20 +02:00
a00997f32f ENH: extend regionFaModels to handle multiple volume patches 2022-09-22 16:09:14 +02:00
0302ba4418 ENH: construct fa::options from fvMesh instead of fvPatch
- these were previously constructing from an fvPatch (for simpler
  integration with regionFaModel) but this unnecessarily restricts
  the finiteArea to a single volume patch.

- adjusted derived faOptions to support multiple patches
2022-09-22 16:09:14 +02:00
fe7dd51258 BUG: incorrect local face addressing for fa::faceSetOption subset
- list of faces() was using mesh-faces, not area-faces

ENH: provision for patch and faceSet selection in fa::faceSetOption

- adjust most of the faOptions to respect subset of faces

ENH: support Function1 for externalHeatFluxSource

BUG: incorrect handling of fixedPower (externalHeatFluxSource)

- used local areas instead of global total area
2022-09-22 16:09:14 +02:00
c59dc00623 STYLE: update code style for regionFaModels, optionsList 2022-09-22 16:09:14 +02:00
a8057c4bc6 ENH: avoid undefined method in temperatureCoupledBase
- old constructor interface allowed arbitrary strings to specify the
  method enumeration. If actually used at runtime, they could/would
  raise a FatalError (unknown enumeration).
  Define a simpler default constructor instead.
2022-09-22 16:09:14 +02:00
1695f2f5b9 TUT: use simpler faMeshDefinition 2022-09-22 16:09:14 +02:00
84db37f62f ENH: improved bookkeeping for finite-area to volume mesh correspondence
- whichPolyPatches() = the polyPatches related to the areaMesh.

  This helps when pre-calculating (and caching) any patch-specific
  content.

- whichPatchFaces() = the poly-patch/patch-face for each of the faceLabels.

  This allows more convenient lookups and, since the list is cached on
  the area mesh, reduces the number of calls to whichPatch() etc.

- whichFace() = the area-face corresponding to the given mesh-face

ENH: more flexible/consistent volume->area mapper functions
2022-09-22 16:09:14 +02:00
e8863cd091 ENH: extend polyBoundaryMesh patch/face query
- whichPatchFace() returns the (patchi, patchFacei) tuple,
  whichPatch() simply wraps whichPatchFace()

- groupNames() : similar to zones

ENH: simplify calls to faPatch/fvPatch patchField, lookupPatchField

- make second (ununsed) template parameter optional.
  Was previously needed for old compilers (2008 and earlier).
2022-09-22 16:09:14 +02:00
4393ffa8dc ENH: template invariant base classes for {fa,fae,fv,fvs,point}PatchField
- simplifies construction/inheritance

ENH: add {fa,fv}PatchField::zeroGradientType() static

- can be used to avoid literal "zeroGradient" in places

STYLE: adjust naming of pointPatch runtime selection table

- simply use 'patch' as per fa/fv fields

STYLE: add zero-size guard to patch constraintType(const word&)
2022-09-22 16:09:14 +02:00
88f5be479e ENH: support assign or construct Field from primitiveEntry
For example, instead of

   if (dict.found("value"))
   {
       fvScalarField::operator=
       (
           Field<scalar>("value", dict, p.size())
       );
   }

can use more precise specifications, and also eliminate searching
the dictionary multiple times:

   const auto* eptr = dict.findEntry("value", keyType::LITERAL);

   //or:  dict.findCompat("value", {{"oldName" ... }}, keyType::LITERAL);

   if (eptr)
   {
       fvScalarField::assign(*eptr, p.size());
   }

STYLE: combine declaration of FieldBase into Field.H
2022-09-22 16:09:14 +02:00
88061f3b28 ENH: improved argList handling of libs, functionObjects
- include -no-libs option by default, similar to '-lib',
  which makes it available to all solvers/utilities.
  Add argList allowLibs() method to query it.

- relocate with/no functionObjects logic from Time to argList
  itself as argList allowFunctionObjects()

- add libs/functionObjects override handling to decomposePar etc

ENH: report the stream relativeName for IOerrors (see c9333a5ac8)
2022-09-22 16:08:52 +02:00
c031f7d00a ENH: improve autoPtr/refPtr/tmp consistency (#2571)
- disallow inadvertant casting and hidden copy constructions etc
2022-09-22 11:50:51 +02:00
052d8b13e3 ENH: support tuple (pair) indexing into FieldField
- can use a (patchi, elemi) pair to access an element of a FieldField
2022-09-22 11:50:51 +02:00
a0282c7e41 ENH: prefer PtrList set/get/test instead of PtrList::operator() access
- clearer coding intent. Mark operator() as 'deprecated'

- add bounds checking to get(label) and set(label) methods.

  This gives failsafe behaviour for get() that is symmetric with
  HashPtrTable, autoPtr etc and aligns the set(label) methods
  for UPtrList, PtrList and PtrDynList.

- use top-level PtrList::clone() instead of cloning individual elements

ENH: support HashPtrTable set with refPtr/tmp (flexibility)
2022-09-22 11:50:51 +02:00
b9ca63b118 ENH: use pointer checks for dynamicCast, refCast
- avoids try/catch exception handling

STYLE: prefer refCast (shorter) to dynamicCast where possible
2022-09-22 11:50:51 +02:00
512f558549 COMP: native MPI reduce not triggered (fixes #2569)
- define returnReduce *after* defining all specializations for reduce
  so that the compiler does not take the generic templated reduce.

ENH: add UPstream::reduceAnd, UPstream::reduceOr

- direct wrapper of MPI_LAND, MPI_LOR intrinsics

ENH: provide special purpose returnReduce for logical operations

- returnReduceAnd(bool), returnReduceOr(bool) as a inline wrappers
  for returnReduce with andOp<bool>(), orOp<bool>() operators,
  respectively.

  These forms are more succinct and force casting of the parameter
  into a bool. Using MPI bool operations allows vendor/hardware MPI
  optimisations.

  * Test for existence on any rank:

      1.  if (returnReduceOr(list.size()) { ... }
      1b. if (returnReduceOr(!list.empty()) { ... }

      2.  if (returnReduce(bool(list.size(), orOp<bool>())) { ... }
      3.  if (returnReduce(list.size(), sumOp<label>()) != 0) { ... }
      3b. if (returnReduce(list.size(), sumOp<label>()) > 0) { ... }

  * Test for non-existence on all ranks:

      1.  if (returnReduceAnd(list.empty()) { ... }
      1b. if (!returnReduceOr(list.size()) { ... }

      2.  if (returnReduce(list.empty(), andOp<bool>())) { ... }
      3.  if (returnReduce(list.size(), sumOp<label>()) == 0) { ... }

  Notes:
      Form 1. succinct
      Form 2. may require explicit bool() for correct dispatch
      Form 3. more expensive sumOp<label> just for testing size!
      There are also some places using maxOp<label> instead of sumOp<label>
2022-09-22 11:50:51 +02:00
968c1db1af ENH: use combined &=, |=, ^= forms for bitAndEqOp, bitOrEqOp, bitXorEqOp
- these also work for bitSet, HashSet with slightly lower overhead

ENH: locate FOAM_NODISCARD attribute macro in stdFoam.H
2022-09-22 11:50:50 +02:00
47e172e6ef ENH: add internal parRun guards to some UPstream methods
- simplifies coding
  * finishedRequest(), waitRequest(), waitRequests() with parRun guards
  * nRequests() is noexcept

- more consistent use of UPstream::defaultCommsType in branching
2022-09-22 11:50:50 +02:00
716d330547 COMP: link finiteArea whenever regionFaModel is used 2022-09-22 11:50:50 +02:00
6f764c8d02 ENH: checkMesh: check patches across processors 2022-09-22 09:24:01 +01:00
1a15bd08f7 BUG: viewFactor: incorrect number of unknowns. Fixes #2585 2022-09-20 11:34:27 +01:00
afffec446a DOC: snappyHexMeshDict: more comment 2022-09-14 13:38:41 +01:00
51dbc84ddb ENH: coded bc: evaluate if no 'value' supplied. Fixes #2561 2022-09-14 13:37:01 +01:00
a964c364b6 ENH: viewFactorsGen: stabilise calculation. Fixes #2583 2022-09-14 13:26:05 +01:00
ff4c776b8b BUG: tetDecomposer: illegal tet face. Fixes #2580 2022-09-12 16:35:30 +01:00
f9b85dbfbb BUG: bad detection of Ensight binary/ascii (fixes #2579)
- related to #2535
2022-09-09 11:55:33 +02:00
c841aaed83 ENH: use atomic move in wmkdepend
- avoids truncated files if dependency generation is interrupted
2022-09-09 11:55:33 +02:00
793f4e3a37 CONFIG: add support for WM_COMPILE_OPTION='Dbg'
- uses '-g -DFULLDEBUG' (like Debug), but with -O3 (like Opt).

  This adds in debug symbols and FULLDEBUG code segments (good for
  code development) but retains -O3 optimizations and code paths and
  avoids the much slower -O0 associated with 'Debug'.

- add in central wmake/General/common/{c,c++}XXX tuning,
  which helps reduce the number of nearly identical files

ENH: add support for wmake -debug-Og
2022-09-09 11:55:33 +02:00
0ed79f3bc1 COMP: pass phase-change YInf by reference not by copy
- copying was inadvertently added by 85a2ae6eaa
2022-09-09 11:55:33 +02:00
c624590e26 ENH: stricter handling of missing timeActivatedFileUpdate files (#2573)
- previously threw FatalError, which downgrades to a Warning only when
  loading the functionObject. Now throw a FatalIOError so that missing
  control files are treated as a critical error.
2022-09-07 16:25:45 +02:00