Commit Graph

24022 Commits

Author SHA1 Message Date
b2bded48c9 STYLE: use Time::printExecutionTime() method
- makes format of ExecutionTime = ... output configurable (#788)
  and reduces code clutter.

STYLE: more consistent line-breaks after "End" tag
2020-08-07 09:24:56 +02:00
1178fc190b CONFIG: add runtime settings for mingw cross-compiled binaries
- WM_ARCH=win64 to indicate the runtime environment

ENH: cross-compile wmake toolchain for the target-side as well
2020-08-06 19:36:19 +02:00
44052de594 TUT: skip some tutorials when dynamicCode is not available
- silence failed restoration of controlDict from controlDict.orig
  (idempotent?)
2020-08-06 19:34:20 +02:00
9ef144118d BUG: directory information spoils "wmake -show-cxx" (fixes #1799)
- the various information queries MUST be executed with
  the '--no-print-directory' or risk polluting values
  in the information queries.

  This is mostly seen with the 'canCompile' test for tutorials running
  in parallel.
2020-08-06 18:30:03 +02:00
67a17f7c78 Merge branch 'functionObject-dispatch' into 'develop'
ENH: finer granularity for handling functionObject failure (#1779)

See merge request Development/openfoam!380
2020-08-06 17:15:09 +01:00
5424c5e5bc ENH: finer granularity for handling functionObject failure (#1779)
- additional "errors" entry with enumerated values
  (default|warn|ignore|strict) for defining warning or error at
  construct or runtime stage

- default : construct = warn, runtime = fatal
- warn    : construct = warn, runtime = warn
- ignore  : construct = silent, runtime = silent
- strict  : construct = fatal, runtime = fatal

The errors control can be added at the top-level and/or for individual
function objects.
2020-08-06 07:45:12 +02:00
f39c1d3c57 Merge branch 'comp-cyclic-dependencies' into 'develop'
remove cyclic dependencies for phase systems

See merge request Development/openfoam!379
2020-08-05 19:02:59 +01:00
a192095ce0 COMP: remove unused variable from phasePressureModel 2020-08-05 18:56:25 +01:00
99e20b3b6f ENH: combine some phaseSystem selectors into regular .C files
- reduces the number of files, eases code refactoring
2020-08-05 18:56:24 +01:00
93ed933770 STYLE: use unitConversion degToRad() from instead of separate value 2020-08-05 18:56:24 +01:00
915c0785ae ENH: avoid phaseSystem cyclic dependencies, reduce number of libraries
Reduce the number of phaseSystems libraries:

- phaseSystems previously had a number of smaller libraries to provide
  interface and model properties, etc. This potential flexibility was
  never actually used anywhere, but causes cyclic dependencies between
  phaseSystem and the models (and turbulence) that causes extreme
  difficulty for mingw linking (issue #1238).

- libincompressibleMultiphaseSystems
  - removed: libmassTransferModels

- libmultiphaseSystem
  - removed: libcompressibleMultiphaseEulerianInterfacialModels

- libreactingMultiphaseSystem
  - removed: libreactingPhaseSystem
  - removed: libreactingEulerianFvPatchFields
  - removed: libreactingEulerianInterfacialCompositionModels
  - removed: libreactingEulerianInterfacialModels
  - removed: libmultiphaseReactingTurbulenceModels

- libreactingTwoPhaseSystem
  - removed: libreactingPhaseSystem
  - removed: libreactingEulerianFvPatchFields
  - removed: libreactingEulerianInterfacialCompositionModels
  - removed: libreactingEulerianInterfacialModels

Avoid duplicate symbol for phaseCompressibleTurbulenceModels

  Common turbulence models are defined in libreactingMultiphaseSystem,
  and libmultiphaseReactingTurbulenceModels is now redundant.

  The libtwoPhaseReactingTurbulenceModels extends the common models
  for reactingTwoPhaseSystem.
2020-08-05 18:56:23 +01:00
03526e2097 ENH: centralize more libraries in src/phaseSystemModels
- prelude to code refactoring

NOTE
    no source code change in this commit, only relocation,
    renaming and adjustment of Make/{files,options}
2020-08-05 18:56:22 +01:00
42ce617b43 ENH: prefer 'model' keyword instead of 'RASModel',... (#149)
- since the context (laminar/RAS/LES) is already given by the
  sub-dictionary, it is redundant to use as prefix as well.

- silently support the longer names as compat methods
2020-08-05 15:29:03 +02:00
7051abc371 TUT: fix run/clean scripts syntax 2020-08-04 15:12:40 +02:00
14c9582458 ENH: provide wordPair typedef in Pair.H, and separate wordPair.H 2020-08-04 12:13:33 +02:00
6b074985ac ENH: improve separation of turbulence models macros (define vs make) 2020-08-03 16:28:21 +02:00
65d9cd503a COMP: stricter inclusion of headers in turbulenceModels
- include fvOptions header, Smagorinsky header
2020-07-31 13:08:33 +02:00
23ea498c08 BUG: inconsistent check in non-const '->' dereference (tmp, refPtr)
- old code just checked for pointer vs non-pointer.
  Should actually treat CREF and REF types differently
  Overseen in commit be058bec7d. Only affects develop branch

ENH: improved naming consistency in tmp, refPtr

- also use long-form to check for pointer type instead of the isTmp()
  method. Makes differences between PTR, CREF, REF easier to spot.

STYLE: typeName() for tmp, refPtr is static
2020-07-30 10:20:07 +02:00
e56e195ab5 ENH: support objectRegistry store of refPtr (as per tmp) 2020-07-30 09:45:55 +02:00
487002d2e2 STYLE: consistent file naming (rigidBodyDynamics,sixDoFRigidBodyMotion) 2020-07-30 09:45:13 +02:00
28eae0573b BUG: The option to cache the limiter field was not working
In fvSolution is possible to cache the limiter. This surface field
is stored in the database to be read later.

The internal tmp management of the field was not working properly.
2020-07-29 11:14:12 -07:00
d073724232 BUG: Limiting min alpha to SMALL to avoid zero transient term of turbulence model
In certain turbulence models such as kEpsilon, kOmegaSST, etc when used
in the multiphase context throw an error in the preconditioner. This
is due to alpha being zero. Fixes #1789.
2020-07-28 12:40:06 -07:00
d3d03de48c DOC: relocate cross-compile (mingw) information to wiki content 2020-07-28 15:48:42 +02:00
74a062d1d5 Merge remote-tracking branch 'origin/master' into develop 2020-07-28 08:42:12 +02:00
65d640e58e BUG: potential memory leaks in HashPtrTable (#1787)
- using HashPtrTable::set() with the same key twice did not guarantee
  proper cleanup of memory since it simply used the underlying
  HashTable::set() without doing anything about the old memory. Now
  check for pre-existing storage and delete it when it does not
  correspond to the newly stored pointer.

  This problem is independent of potential memory slicing previously
  flagged (#1286) and only partially resolved.
2020-07-28 08:40:43 +02:00
fa71840d8b ENH: add get() retrieval of a pointer from PtrLists, HashPtrTable
- naming similarity with autoPtr, unique_ptr and other containers.

  For UPtrList derivatives, this is equivalent to the existing
  operator(). The read-only variant is also equivalent to the
  single-parameter 'set(label)' method.

  With PtrList<T> list(...) :

      const T* ptr = list.get(10);
      if (ptr)
      {
          ptr->method();
      }

  vs.
      if (list.set(10))
      {
          list[10].method();
      }

  For HashPtrTable there is only a read-only variant which is equivalent
  to testing for existence and for value.

  With HashPtrTable<T> hash(...) :

      const T* ptr = list.get("key");
      if (ptr)
      {
          ptr->method();
      }

  vs.
      if (list.found("key"))
      {
          // Fails on null pointer!!
          list["key"].method();
      }

Use of get() is largely a matter of taste or local coding requirements
2020-07-28 08:40:43 +02:00
872c9d370b ENH: support emplace methods and std::unique_ptr for PtrList-derivatives
- emplace methods
  Eg,
      m.internalCoeffs().emplace(patchi, fc.size(), Zero);
  vs.
      m.internalCoeffs().set(patchi, new Field<Type>(fc.size(), Zero));

- handle insert/append of refPtr wherever tmp was already supported

COMP: incorrect variable names in PtrListOpsTemplates.C
2020-07-28 08:40:43 +02:00
4110699d90 ENH: HashTable::emplace_set() method, HashPtrTable support for unique_ptr
- forwarding like the emplace() method, but overwriting existing
  entries as required

- propagate similar changes to HashPtrTable

  For example, with HashPtrTable<labelList> table(...) :

  With 'insert' semantics

      table.emplace("list1", 1000);

  vs
      if (!table.found("list1"))
      {
          table.set("list1", new labelList(1000));
      }
  or
      table.insert("list1", autoPtr<labelList>::New(1000));

  Note that the last example invokes an unnecessary allocation/deletion
  if the insertion is unsuccessful.

  With 'set' semantics:

      table.emplace_set("list1", 15);

  vs
      table.set("list1", new labelList(15));
2020-07-28 08:40:43 +02:00
c77afff48f COMP: fix sloppy (and now ambiguous) use of PtrList::set()
- constructs such as the following will no longer worked, but that is
  also a good thing.

     ptrlist.set(i, scalarField(nFaces, Zero));

  this called set(.., const tmp<scalarField>&), which meant under
  the hood:

     - create local temporary const scalarField&
     - wrap as const tmp&
     - use tmp::ptr(), to clone the const-ref

  This implies an additional allocation (for the const scalarField&)
  which is immediately discarded. Doubtful that compiler optimization
  would do anything.
2020-07-28 08:35:42 +02:00
6461eec886 CONFIG: increment patch level 2020-07-27 10:28:44 +02:00
3455d556c4 BUG: potential memory leaks in HashPtrTable::set (#1787)
- backported fix from develop

COMP: incorrect variable names in PtrListOpsTemplates.C
2020-07-27 10:28:40 +02:00
540589fc22 SUBMODULE: visualization installation prefix on older ubuntu (#1757) 2020-07-27 09:58:24 +02:00
dc52e5ae67 STYLE: use range-for with labelHashSet in MULES 2020-07-27 09:47:33 +02:00
d5884c8d85 STYLE: use HashSet xor instead of two operations (faceZoneSet)
STYLE: use global operator instead of HashSet -= operator
2020-07-27 09:47:33 +02:00
6e75cf2e7d STYLE: unify HashSet list insertion (use iterator pair) 2020-07-27 09:47:33 +02:00
85e74567ff ENH: added subtraction operator for HashSet
- offers similarity with bitSet

STYLE: remove remnant parent::operator= from HashSet

STYLE: code formatting in HashTables
2020-07-27 09:47:33 +02:00
2de4501e47 ENH: add testFunctionObjects library with fakeError function object
The fakeError function object emits FatalError at different stages (or
does nothing), which is useful for testing purposes (issue #1779).

Can request errors from constructor, execute and write methods.
2020-07-24 09:04:07 +02:00
c411c0cc09 SUBMODULE: adios (style), external-solver (bugfix), visualization (style) 2020-07-23 18:12:06 +02:00
e8b06ac222 STYLE: remove incorrect branch condition in setExprFields 2020-07-23 16:52:15 +02:00
181e27a90f ENH: improve abort/exception handling in error class (#1780)
- previously setting FOAM_ABORT would preempt checks for throwing
  exceptions.

  Now check for throwing first, to allow try/catch code to do its job.
  However, ignore exception throwing for abort(). These are used
  infrequently in the code, but indicate that recovery is deemed
  impossible.

STYLE: use unique_ptr for internal stream buffer management
2020-07-22 19:11:57 +02:00
707b29bbbd STYLE: minor doc and formatting changes 2020-07-22 19:11:28 +02:00
bcda061f54 ENH: checkMesh: improved checking on writeFields. Fixes #1786. 2020-07-23 17:26:09 +01:00
d3c76d8ec8 ENH: ListOps: added findIndices with predicate 2020-07-23 17:26:09 +01:00
f1e950ce83 ENH: snappyHexMeshDict: document small region removal. See #1772 2020-07-23 17:26:09 +01:00
45982d97fa BUG: Correct evaluate function for ddt0 in CrankNicolson scheme. Fixes
The function evaluate was returning true every outer loop, triggering
the re-calculation of ddt0 in every outer loop.

The evaluation of the term ddt0 should be performed once per time step.
The corrected function updates the timeIndex of ddt0 to avoid the
re-evaluation of this term in the outer loops.
2020-07-21 16:23:13 -07:00
be058bec7d ENH: support writable reference for tmp (#1775)
- improves flexibility. Can tag a tmp as allowing non-const access to
  the reference and skip additional const_cast in following code. For
  example,

      tmp<volScalarField> tfld(nullptr);
      auto* ptr = getObjectPtr<volScalarField>("field");
      if (ptr)
      {
          tfld.ref(*ptr);
      }
      else
      {
          tfld.reset(volScalarField::New(...));
      }
      auto& fld = tfld.ref();

ENH: renamed tmpNrc to refPtr

- the name 'refPtr' (reference|pointer) should be easier to remember
  than tmpNrc (tmp, but non-ref-counted).

- provide tmpNrc typedef and header for code compatibility

NOTE

- in some places refPtr and tmp can be used instead of a
  std::reference_wrapper for handling external references.

  Unlike std::reference_wrapper, it can be default constructed
  (holding nothing), whereas reference_wrapper may need a dummy
  reference. However, the lifetime extension of references _may_ be
  better with reference_wrapper.
2020-07-21 11:02:20 +02:00
5acb5f3580 STYLE: rename/adjust local pointer naming and handling 2020-07-20 16:59:19 +02:00
dc6c3c8add TUT: Correction for Alltest 2020-07-20 10:19:54 +01:00
065db9a7b8 Merge branch 'enh-memory-cleanup' into 'develop'
autoPtr/tmp cleanup

See merge request Development/openfoam!378
2020-07-17 16:29:16 +01:00
fa86a98482 BUG: Minor correction to lumpedPointState.C for debug build 2020-07-17 14:09:34 +01:00