Commit Graph

25381 Commits

Author SHA1 Message Date
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
4fc6ec1d1d ENH: define singleton-style lookups for runTime selection, alias handling
- this makes the lookup and use of tables slightly cleaner and
  provides a hook for update (compat) messages

  The singleton-style method returns the function pointer directly,
  or nullptr on not-found.

  NEW access method (mnemonic: 'ctor' prefix for constructors)

  ```
  auto* ctorPtr = dictionaryConstructorTable(modelType);

  if (!ctorPtr)
  {
      ...
  }

  return autoPtr<myModel>(ctorPtr(dict, ...));
  ```

  OLD method, which also still works, but without any compat handling:

  ```
  auto ctorIter = dictionaryConstructorTablePtr_->cfind(modelType);

  if (!ctorIter.found())
  {
      ...
  }

  return autoPtr<myModel>(ctorIter()(dict, ...));
  ```
2021-11-05 17:21:27 +01:00
Mark Olesen
794e23e083 ENH: add error::master() static for low-level messages
- a Pstream::master with a Pstream::parRun guard in case Pstream has
  not yet been initialised, as will be the case for low-level messages
  during startup.

- propagate relativeName handling into IOstreams
2021-11-05 14:53:55 +01:00
Mark Olesen
0bd113f537 ENH: refactored and simplified runtime declaration macros
- improves future maintenance, avoids code/macro duplication
2021-11-05 14:53:51 +01:00
Mark Olesen
7f8ecd98f5 ENH: rename runTime selection typedefs
- better distinction between content and storage type
  by appending 'Type' to the typedef.

    old: 'Class::abcConstructorTable* tablePtr'
    new: 'Class::abcConstructorTableType* tablePtr'

  Was rarely used in any exposed code.

BREAKING: LESdelta::New with additional table

- parameter change to dictionaryConstructorTableType
  (was dictionaryConstructorTable)
2021-11-05 14:14:20 +01:00
Mark Olesen
3416151dee ENH: improve isolation of basicThermo internals (as private)
- getThermoOrDie: returns constructor pointer, or FatalError.
  Better isolation and avoids additional template/typename previously
  needed with ambiguous method name (lookupThermo).

- makeThermoName: centralize dictionary -> stringified name

- splitThermoName: use stringOps functionality
2021-11-05 14:14:20 +01:00
Mark Olesen
9e56dd4098 Merge branch 'feature-proudman-mean-fields' into 'develop'
ENH: proudmanAcousticPower - extended to operate on mean turbulence fields

See merge request Development/openfoam!485
2021-11-05 13:08:52 +00:00
Andrew Heather
5cba269072 ENH: proudmanAcousticPower - extended to operate on mean turbulence fields
Example using mean turbulence fields (mean fields should be available e.g. from
a fieldAverage function object)

    proudmanAcousticPower1
    {
        // Mandatory entries (unmodifiable)
        type        proudmanAcousticPower;
        libs        (fieldFunctionObjects);

        ...

        // Turbulence field names (if not retrieved from the turb model)
        k           kMean;
        epsilon     epsilonMean;
        omega       none; // omegaMean
    }
2021-11-05 13:06:31 +00:00
Mark Olesen
83fd1c9579 SUBMODULE: update OpenQBMM (selector table modifications) 2021-11-04 21:44:04 +01:00
Mark Olesen
742a2c8a49 BUG: foamPackRelease detects wrong build information
- was taking from the current head instead from specified commit-ish

ENH: add -debian=NUM convenience option to foamPackRelease

STYLE: relocate compile begin/end messages

COMP: suppress more clang warnings (needed for boost)
2021-11-04 19:56:01 +01:00
Mark Olesen
50995706a6 STYLE: remove unused private fields (foamyMesh)
- simplify handling of warnings for surfaceBooleanFeatures
2021-11-04 18:03:34 +01:00
Mark Olesen
c9333a5ac8 ENH: improve flexibility of error, messageStream output
- provide a plain stream() method on messageStream to reduce reliance
  on casting operators and slightly opaque operator()() calls etc

- support alternative stream for messageStream serial output.
  This can be used to support local redirection of output.
  For example,

     refPtr<OFstream> logging;   // or autoPtr, unique_ptr etc

     // Later...
     Info.stream(logging.get())
        << "Detailed output ..." << endl;

  This will use the stdout semantics in the normal case, or allow
  redirection to an output file if a target output stream is defined,
  but still effectively use /dev/null on non-master processes.

  This is mostly the same as this ternary

      (logging ? *logging : Info())

  except that the ternary could be incorrect on sub-processes,
  requires more typing etc.

ENH: use case-relative names of dictionary, IOstream for FatalIOError

- normally yields more easily understandable information
2021-11-03 11:46:13 +01:00
Mark Olesen
1c354ce299 ENH: expose dictionary relativeName() method
STYLE: more consistent noexcept for dictionary and entry
2021-11-03 11:38:39 +01:00
Mark Olesen
b364a9e72c ENH: argList improvements
- argList::envExecutable() static method.
  This is identical to getEnv("FOAM_EXECUTABLE"), where the name of
  the executable has typically been set from the argList construction.

  Provides a singleton access to this value from locations that
  do not have knowledge of the originating command args (argList).
  This is a similar rationale as for the argList::envGlobalPath() static.

- additional argList::envRelativePath() static method.

- make -dry-run handling more central and easier to use by adding into
  argList itself.

STYLE: drop handling of -srcDoc (v1706 option)

- replaced with -doc-source for 1712 and never used much anyhow
2021-11-03 11:38:21 +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
fddf8a8832 ENH: add -help-full option for foamEtcFile 2021-11-02 21:14:41 +01:00
Mark Olesen
2698cab01c ENH: extend use of WM_COMPILER_CONTROL to manage compiler versions
- for compilers such as gcc and clang, may have several different
  variants installed on the computer. Use WM_COMPILER_CONTROL to
  specify the preferred variant.

  Eg,
      WM_COMPILER=Gcc
      WM_COMPILER_CONTROL="version=8"

      will compile with "gcc-8" and "g++-8"

  Good practice would be to tag output directory names with the
  version too. Eg

      WM_COMPILER=Clang110
      WM_COMPILER_CONTROL="version=11.0"

STYLE: modify message for change of gcc -> clang (darwin)
2021-11-02 17:30:06 +01:00
Mark Olesen
3494d662c7 COMP: eliminate some unused variables 2021-11-02 15:47:18 +01:00
Mark Olesen
a6f2aff449 BUG: spurious argument in sutherlandTransport addition (fixes #2256) 2021-11-02 15:47:18 +01:00
Mark Olesen
8746d7e443 Merge branch 'fix-2257-threaded-writing' into 'develop'
BUG: collated: threaded writing accesses out-of-scope. Fixes #2257.

See merge request Development/openfoam!494
2021-11-02 14:26:30 +00:00
Mattijs Janssens
227b3976ba BUG: collated: threaded writing accesses out-of-scope. Fixes #2257. 2021-11-02 14:26:30 +00:00
Mark Olesen
08e66a64e1 CONFIG: increment API level to 2108
- reflects updates for List, globalIndex handling etc
2021-10-29 19:41:27 +02:00
Mark Olesen
08588134fb ENH: report filter settings for distance surface (#1631) 2021-10-29 19:34:54 +02:00
Mark Olesen
0c89154729 ENH: add fallback behaviour for distanceSurface proximity regions (#1631)
- using the proximityRegions filter when there is no enclosing surface
  to segregate domains causes a surface of zero-faces to be created.

  In most cases, this means that a simpler proximityFaces filter would
  have been more appropriate. To increase overall robustness, revert
  to the simpler proximityFaces filter logic when the proximityRegions
  would otherwise result in zero faces (globally seen).
2021-10-29 17:49:50 +02:00
Mark Olesen
048166c3d8 ENH: reduces buffer use / blocking in Ensight output
- reuse single component buffer within an Ensight output method.
  Use direct UPstream read/write to avoid Pstream char buffers

- replace blocking transfer with scheduled for Ensight cloud output
2021-10-29 17:04:52 +02:00
Mark Olesen
33ff3201ea ENH: replace PstreamBuffers with scheduled read/writes for VTK output
- use the new updates to globalIndex to manage the bookkeeping
2021-10-29 17:04:52 +02:00
Mark Olesen
b6539cd02e ENH: additional MPI gather/scatter routines, globalIndex gather methods
- UPstream::mpiGather (MPI_Gather)   - used by Pstream::listGatherValues
- UPstream::mpiScatter (MPI_Scatter) - used by Pstream::listScatterValues

  These are much simpler forms for gather/scatter of fixed-sized
  contiguous types data types (eg, primitives, simple pairs etc).

  In the gather form, creates a list of gathered values on the master
  process. The subranks have a list size of zero.

  Similarly, scatter will distribute a list of values to single values
  on each process.

  Instead of

      labelList sendSizes(Pstream::nProcs());
      sendSizes[Pstream::myProcNo()] = sendData.size();
      Pstream::gatherList(sendSizes);

  Can write

      const labelList sendSizes
      (
          UPstream::listGatherValues<label>(sendData.size())
      );

  // Less code, lower overhead and list can be const.

  For scattering an individual value only,
  instead of

      labelList someValues;
      if (Pstream::master()) someValues = ...;

      Pstream::gatherList(sendSizes);
      const label localValue
      (
          someValues[Pstream::myProcNo()]
      );

  Can write

      labelList someValues;
      if (Pstream::master()) someValues = ...;

      Pstream::gatherList(sendSizes);
      const label localValue
      (
          UPstream::listScatterValues<label>(someValues)
      );

   Can of course also mix listGatherValues to assemble a list on master
   and use Pstream::scatterList to distribute.

ENH: adjusted globalIndex gather methods

- added mpiGather() method [contiguous data only] using MPI_Gatherv

- respect localSize if gathering master data to ensure that a
  request for 0 master elements is properly handled.
2021-10-29 17:04:52 +02:00
Mark Olesen
1f20747b1a ENH: cleanup Pstream internal names, cull unneeded parameters
- Pstreams can be ascii/binary but are always currentVersion

- rename UIPstream externalBuf_ to 'recvBuf_' for similar naming as
  PstreamBuffers and symmetry with UOPstream::sendBuf_

- specific enum size for commsType (for more compact structures in the
  future). Default construct lists items.

BUG: possible incidental indexing in UIPstream::read(char*, std::streamsize)

- raw reading had been split into beginRawRead(), readRaw().
  However, this could change the current input position (due to word
  boundary alignment), even if the expected count is zero. Make a
  no-op for count == 0. This mirrors UOPstream::write behaviour.
2021-10-29 17:04:51 +02:00
Mark Olesen
609fb366e3 ENH: improve flexibilty of globalIndex
- construct or reset from a list of local sizes. It is generally
  easier and safer to assemble sizes and let globalIndex determine the
  corresponding offsets, when working with raw values.

- Can use reset() from sizes or fine-tune offsets with setLocalSize()
  instead of using the potentially more fragile non-const access to
  the offsets.

- add globalIndex const_iterator to iterate across the access ranges.
  This is makes it simpler to use with the List slice() method to
  access or operate on a sub-section of list.

  For example,
      scalarField allValues = ...;
      globalIndex procAccess = ...;

      for (const labelRange& range : procAccess)
      {
          someOutput(allValues.slice(range));
      }
2021-10-29 17:04:51 +02:00
Mark Olesen
b8a4b7e80d ENH: additional 'nocopy' methods for List resize/reserve methods
- the size of a List often requires adjustment prior to an operation,
  but old values (if any) are not of interest and will be overwritten.

  In these cases can use the _nocopy versions to avoid additional memory
  overhead of the intermediate list and the copy/move overhead of
  retaining the old values (that we will subsequently discard anyhow).

  No equivalent for PtrList/UPtrList - this would be too fragile.

- add swap DynamicField with DynamicList

BUG: fixed Dynamic{Field,List} setCapacity corner case

- for the case when the newly requested capacity coincides with the
  current addressable size, the resize of the underlying list would have
  been bypassed - ie, the real capacity was not actually changed.

- remove (unused) PtrDynList setCapacity method as too fragile
2021-10-29 17:04:51 +02:00
Mark Olesen
e2861cc200 ENH: return UList range slice as a SubList
- previously returned the range slice as a UList,
  but this prevents convenient assignment.
  Apply similar handling for Field/SubField

  Allows the following

     labelRange range(...);
     fullList.slice(range) = identity(range.size());

  and

     fullList.slice(range) = UIndirectList<T>(other, addr);

ENH: create SubList from full FixedList (simplifies interface)

- allow default constructed SubList. Use shallowCopy to 'reset' later
2021-10-29 17:04:51 +02:00
Mark Olesen
3781f17eee ENH: add '_bytes()' versions of List data(), cdata()
- simply adds in the reinterpret_cast, which simplifies coding for
  binary data movement.
  Name complements the size_bytes() method for contiguous data

STYLE: container IO.C files into main headers for better visibility

STYLE: include CompactListList.H in polyTopoChange

- avoids future mismatches if the CompactListList template signature
  changes

GIT: relocate CompactListList into CompactLists/ directory
2021-10-29 17:04:51 +02:00
Mark Olesen
3d3d287452 ENH: additional tests in {cell,face}SetOption
- useSubMesh() - name as per fvMeshSubsetProxy.
  Setter methods take a parameter instead of direct access.
2021-10-29 17:04:51 +02:00
Mark Olesen
f5058bca90 ENH: add static set/get dimensionSet::checking() method
- encapsulates toggling

STYLE: noexcept for some Time methods
2021-10-29 17:04:51 +02:00
Mark Olesen
33790ca972 ENH: add stream and dictionary output options for edgeMesh formats 2021-10-29 17:04:51 +02:00
Mark Olesen
120e4a46bc BUG: face flips lost on foamToVTK faceZone output
- previously used an indirect patch to get the sampling locations,
  but this doesn't take account of the face flips. Now use
  the faceZone intrinsic for generating a properly flipped patch
  and provide the sampling locations separately.

STYLE: adjust compatiblity header for surfaceMeshWriter
2021-10-29 17:04:51 +02:00
Mark Olesen
a98d5ebf32 ENH: handle ';' for fluent input (fixes #2249) 2021-10-29 17:04:51 +02:00
Mark Olesen
435be2e5ec CONFIG: improve flexibility of MPI specification
- it is now possible to include the selected mpi version in the
  top-level bashrc or prefs.sh file. For example,

      WM_MPLIB=OPENMPI-4.1.1  or  WM_MPLIB=openmpi-4.1.1

  after evaluation of the config.sh/mpi, this will define

      WM_MPLIB=OPENMPI-4.1.1  and  FOAM_MPI=openmpi-4.1.1

  During the wmake, the mpi-rules will first load the MPI 'family'
  rules (OPENMPI in this example) before trying to load
  version-specific rules if they exist.

  NOTE: the regular user-defined prefs system is unaffected by this
  change. This means it is still possible to use a file such as
  'prefs.openmpi' to define the preferred version instead or as well.
  However, it does mean inconsistent naming can be specified.
  For example, specify WM_MPLIB=OPENMPI-4.1.1 at the top-level but
  actually have FOAM_MPI=openmpi-4.0.6 in the prefs.openmpi file.
  This will make the value of WM_MPLIB misleading.

CONFIG: foamConfigurePaths support for sys-openmpi major version

CONFIG: cleanup any shadow env variables
2021-10-29 17:04:51 +02:00
sergio
36bb99da9b BUG: Condensation mass transfer in interfaceHeatResistance. Fixes #2216 2021-10-28 14:33:05 -07:00
Andrew Heather
7d5dc29e53 Merge branch 'feature-turbulence-model-hierarchy' into 'develop'
ENH: Regroup and unify various virtual functions in laminar/RAS/LES models

See merge request Development/openfoam!487
2021-10-22 16:29:13 +00:00
Kutalmis Bercin
783c2f567f ENH: LESModel: regroup omega/epsilon virtual functions
ENH: LESeddyViscosity: move Ce to LESModel to
enable omega/epsilon virtual hierarchy
2021-10-22 11:40:50 +01:00
Kutalmis Bercin
64fdbf6099 ENH: laminar: regroup k/omega/epsilon/R virtual functions 2021-10-22 11:40:48 +01:00
Kutalmis Bercin
ec62cda73a ENH: RASModel: regroup omega/epsilon virtual functions 2021-10-22 11:40:45 +01:00
Mark Olesen
52be5d0428 TUT: use mergeType points for wedge geometries (#2241) 2021-10-21 15:31:11 +02:00
Mark Olesen
c2697f466d CONFIG: update c++ standard, some compiler rules (partially addresses #2209)
- migrate to c++14 for most compilers *except* gcc.
  There are still many systems in use with gcc-4.8.5, which does not
  support c++14.

- initial rules for nvidia compilers (pgi is will soon be defunct).
  Not fully tested...

CONFIG: provide fallback value for the user directory name

- in containers may have an unset USER env variable.
  Default to 'user' to prevent ugly looking directory names.
2021-10-21 15:31:05 +02:00
Andrew Heather
8eab653117 Merge branch 'feature-decompositionConstraints_cyclicAMI' into 'develop'
ENH: decomposePar: cyclicAMI in constraints. Fixes #2242

See merge request Development/openfoam!491
2021-10-20 15:40:39 +00:00
mattijs
42a9078dad ENH: decomposePar: cyclicAMI in constraints. Fixes #2242 2021-10-20 14:51:38 +01:00
mattijs
b157614e00 ENH: redistributePar: write collated format. #806
- supports redistributePar -decompose -fileHandler collated
- supports redistributePar -reconstruct
- does not support redistributePar with collated in redistribution mode
2021-10-19 12:18:07 +01:00
mattijs
2a2edf5fee ENH: Added contact resistance to multi-world. See #1535.
- added contact resistance to turbulentTemperatureCoupledBaffleMixed
- added basic multi-world to turbulentTemperatureRadCoupledMixed
- added unit-testcase to $FOAM_APP/test/multiWorld
2021-10-18 19:22:23 +01:00