Commit Graph

24084 Commits

Author SHA1 Message Date
b2feb6a8d8 ENH: avoid redundant IO in readFields function object (fixes #1825)
- read header info once and reuse
- short-circuit logic to avoid unneeded checks
- additional debug information if field cannot be found

STYLE: remove unused old code remnants from #1206
2020-09-03 09:07:31 +02:00
719d3f77be COMP: Intel compiler bug with inheriting constructors (fixes #1821)
- the compiler reports

      Internal error loop: assertion failed:
      find_seq_in_lookup_table: seq_number not found
      (shared/cfe/edgcpfe/il.c, line 4118)

  Seems to be the same as the bug report
  https://community.intel.com/t5/Intel-C-Compiler/Internal-error-loop-assertion-failed-find-seq-in-lookup-table/td-p/1087603

This _should_ be fixed in icc 17.0 update 1, but appears to have
struck here as well.

- workaround: explicitly construct member elements.
2020-09-01 11:49:27 +02:00
8d55c37b2f BUG: missing tab in actuationDiskSource output (fixes #1819) 2020-08-31 15:17:54 +02:00
fa364eda12 BUG: inconsistency between constructor and output (fixes #1816)
- slipped in with changes to csvTableReader (commit 59ed3ba18d) so
  only affects the 2006 version.

- adjust constructor to expect "componentColumns", but also accept
  "valueColumns" as 1912 and earlier-compatibility. This not only
  fixes the reported bug, but also ensure proper compatibility with
  older files.

ENH: use "refColumn" instead of "timeColumn" for csvTableReader

- consistent with the CSV Function1.
  Support 'timeColumn' as 1912 and earlier-compatibility.

TUT: remove unused table-reader entry
2020-08-31 15:17:32 +02:00
a85446cad3 DOC: update BuildIssues for mingw changes 2020-08-12 17:02:53 +02:00
dd1c2edb6b COMP: wmake findObjectDir fails for non-project directories (fixes #1807)
- experienced while reusing src/Pstream/Allwmake-mpi to create
  additional mpi-layers after installation. Since the copied sources
  are not located within the OpenFOAM source-tree (and/or the
  source-tree is non-writable), it should not and does not use the
  central build/WM_OPTIONS directory.

  However, when exploring for the appropriate local Make directory, it
  searched for the current '.' directory instead of checking for the
  resolved directory.

  This fails, since there is no src/Pstream/Make directory.
  Must check for src/Pstream/mpi/Make directory first!

- Adjust wclean to always remove a local build directory
  (Make/WM_OPTIONS) for additional safety.
  After which, attempt to remove central build/WM_OPTIONS version too.
2020-08-12 12:33:34 +02:00
18c68e6b74 ENH: add bin/tools/createMingwRuntime helper
Script to copy/create mingw run-time installation from the Linux
  cross-compilation. Packs everything into a tar or a zip file.

  To accommodate Windows, all .dll files are also placed in the
  platforms bin/ directory where they are easily found via the PATH.

  Futhermore, ThirdParty dll files (including those from mingw itself)
  are also placed in the same directory.

---
Steps
  - bundles common files and directories (bin, etc, META-INFO, ...)

  - copies .exe files from FOAM_APPBIN and .dll files from FOAM_LIBBIN
    to the new target platforms/win64MingwDPInt32Opt/bin.

  - copies mingw sys-root .dll files to the new target
    platforms/win64MingwDPInt32Opt/bin

  - copies other ThirdParty dll files (scotch, fftw, etc) to
    platforms/win64MingwDPInt32Opt/bin

  - copies tutorials (can be deactivated)

---
Note
    Can only be called when the linux64Mingw environment is active.
2020-08-11 16:39:43 +02:00
a6e86caa62 ENH: improvements for FOAM_CONFIG_ETC
- handle relative directory names for FOAM_CONFIG_ETC
2020-08-11 13:16:03 +02:00
6a1efe3b5c ENH: support construct/reset refPtr from autoPtr and unique_ptr (#1775)
- makes it easier to use in combination with various 'New' selectors,
  which mostly return an autoPtr.

ENH: add very simple FFT test

- basic sanity test that the library links properly
2020-08-11 13:15:28 +02:00
e94fdee58d STYLE: add hints about setting GMP/MPFR within etc/config.*sh/CGAL 2020-08-10 14:38:41 +02:00
6e2b7be983 ENH: direct access to wrapped ifstream/ofstream with compression (#1805)
- previously hidden as Detail::[IO]FstreamAllocator, now exposed
  directly as [io]fstreamPointer, which allows reuse for
  std::ifstream, std::ofstream wrapping, without the additional
  ISstream, OSstream layers.

  These stream pointers have some characteristics similar to a
  unique_ptr.

- restrict direct gzstream usage to two files (fstreamPointers.C,
  gzstream.C) which improves localization and makes it simpler to
  enable/disable with the `HAVE_LIBZ` define.

  The HAVE_LIBZ define is currently simply hard-coded in the
  Make/options.

  If compiled WITHOUT libz support:
    - reading gz files : FatalError
    - writing gz files : emit warning and downgrade to uncompressed
    - warn if compression is specified in the case controlDict
      and downgrade to uncompressed

ENH: minor updates to gzstream interface for C++11

- support construct/open with std::string for the file names.

CONFIG: provisioning for have_libz detection as wmake/script
2020-08-10 12:40:08 +02:00
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
583905fdeb 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 17:52:02 +02: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