Commit Graph

23973 Commits

Author SHA1 Message Date
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
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
6d4928d585 ENH: extend nullptr check for tmp ptr() method (#1775)
- Cannot call ptr_->clone() with a null pointer!
2020-07-16 15:09:57 +02:00
fde93b6603 STYLE: compile-type deprecate empty() method for autoPtr/tmp (#1775)
- autoPtr: less clutter using plain tests with the bool operator

    (!ptr)  vs  (ptr.empty())
    (ptr)   vs  (!ptr.empty())

- tmp: was entirely unused.
2020-07-16 15:09:57 +02:00
35a0fd3e8e ENH: reset tmp via assignment from literal nullptr (#1775)
- previously this was marked as '= delete' for consistency with
  assignment from an empty pointer being a runtime error.
  However, these can be considered semantically different and it makes
  sense to permit this as equivalent to reset(nullptr).

  This change does not break existing code since the operator was
  previously unavailable (deleted).

STYLE: refactor tmp operator=(T*)

- delegate to reset() after initial checks
2020-07-16 15:09:56 +02:00
59bfbb9541 ENH: simpler, more consistent checks for tmp validity (#1775)
- Previously considered to be valid() if it was any reference
  (null or non-null) or a non-null pointer.

  This appears to be a holdover from old code (pre-2015) where
  reinterpret_cast<..>(0) was used instead of the NullObject.

  A reference via a null pointer isn't really possible anywhere. Even
  for things like labelList::null(), they now use the NullObject,
  which has a non-zero memory location.

- now simply check for a non-zero memory address. Regardless of
  pointer or referenced object.
2020-07-16 15:09:56 +02:00
d282d1a285 STYLE: minor code reduction/simplification for tmp (#1775)
- combine reset() methods by adding a default parameter

- improve top-level visibility of empty/valid/get methods for symmetry
  symmetry with autoPtr, future adjustment
2020-07-16 15:09:56 +02:00
12c91b9472 STYLE: check autoPtr as plain bool instead of valid()
- cleaner code, more similarity with unique_ptr

  Now
      if (ptr)
      if (!ptr)

  instead
      if (ptr.valid())
      if (!ptr.valid())
2020-07-16 11:39:24 +02:00
9af3f85cf9 STYLE: simplify short-circuit involving autoPtr (#1775)
- with '&&' conditions, often better to check for non-null autoPtr
  first (it is cheap)

- check as bool instead of valid() method for cleaner code, especially
  when the wrapped item itself has a valid/empty or good.
  Also when handling multiple checks.

  Now
      if (ptr && ptr->valid())
      if (ptr1 || ptr2)

  instead
      if (ptr.valid() && ptr->valid())
      if (ptr1.valid() || ptr2.valid())
2020-07-16 10:17:25 +02:00
3baebcb101 STYLE: replace uses of autoPtr::empty() with bool check (#1775)
- less clutter using plain tests with the bool operator:

      (!ptr)  vs  (ptr.empty())
      (ptr)   vs  (!ptr.empty())
2020-07-16 08:58:22 +02:00
53eda1c4f1 ENH: use boolVector for NURBS3DVolume constraints
- same as FixedList<bool,3> for I/O
2020-07-15 14:34:52 +02:00
5e954d2881 STYLE: use autoPtr instead of tmp for holding sensitivities
- since only pointers are stored, autoPtr is better fit than tmp
2020-07-15 13:41:15 +02:00
e2021550fd Merge branch 'feature-dynamicLibrary' into 'develop'
Feature dynamic library - issue #1737

See merge request Development/openfoam!375
2020-07-14 16:41:39 +01:00
1e7c6ea2f1 ENH: mutable libs() access in Time and other classes (#1737)
- This reflects the pre-existing coding situation where const_cast was
  used throughout to effect the same.

STYLE: fix private/protected access

- CodedField, codedMixedFvPatchField
2020-07-14 11:19:05 +02:00
41d3e6f1d4 ENH: various dlLibraryTable improvements/refinements (#1737)
- libs() singleton method for global library handling

- explicit handling of empty filename for dlLibraryTable open/close.
  Largely worked before, but now be more explicit about its behaviour.

- add (key, dict) constructor and open() methods.
  More similarity to dimensionedType, Enum etc, and there is no
  ambiguity with the templated open().

- construct or open from initializer_list of names

- optional verbosity when opening with auxiliary table,
  avoid duplicate messages or spurious messages for these.

- basename and fullname methods (migrated from dynamicCode).

- centralise low-level load/unload hooks

- adjust close to also dlclose() aliased library names.
2020-07-14 11:19:05 +02:00
950e667259 ENH: snappyHexMesh: optionally remove 'small' regions. Fixes #1772.
This is for a very specific use case where the faceZones are
imprinted after meshing the normal geometry. This sometimes
splits off badly connected bits of the mesh. One way to remove
these is to use e.g. subsetMesh. This embeds the
same functionality inside snappyHexMesh.
2020-07-13 15:29:12 +01:00
331e86cf17 BUG: checkMesh: index into surfaceScalarField. Fixes #1771. 2020-07-13 13:00:13 +01:00
8594fb43c8 ENH: snappyHexMesh: Cleanup of parallel cyclics. See #1731. 2020-07-13 09:45:00 +01:00
6365bab800 ENH: update lemon version and linkage directive (#1768)
- replace `%namespace` directive with simpler `%static` directive.

  We always encapsulate Lemon parser routines in an anonymous
  namespace, so a simpler static linkage directive suffices.

  This reduces the size of the Lemon patch (program and template).
2020-07-10 12:01:58 +02:00
a088bda4d2 ENH: use unique_ptr for memory management of profiling
- makes it easier to distinguish between pointers referring to pool
  data versus pointers actually holding storage, avoids
  manual demand-driven deletion and autoPtr.

ENH: simplify/improve Pstream profiling

- times now double (not scalar) for consistency with what cpuTime
  delivers

- use bool to track suspend state
2020-07-09 16:17:33 +02:00
b64ada3dde BUG: argList: use fileHandler to read decomposeParDict. Fixes #1765 2020-07-09 15:11:39 +01:00
c06c63f49f ENH: snappyHexMesh: handle parallel cyclics. Fixes #1731. 2020-07-08 16:48:14 +01:00
423bbcefa8 Update Build.md 2020-07-03 09:48:50 +01:00
ae76b38270 BUG: TableBase: illegal reference. Fixes #1753 2020-07-01 14:53:26 +01:00
0dc07fb00f CONFIG: reset version 2020-06-30 12:45:36 +01:00
b45f8f6f58 MOD: updated OpenQBMM reference OpenFOAM-v2006 2020-06-29 18:16:22 +01:00
294cfc4a77 REL: Updated completions cache 2020-06-29 17:27:54 +01:00
780c156103 REL: Updated config to v2006 2020-06-29 17:27:54 +01:00
538d749220 REL: Updated headers to version v2006 2020-06-29 17:27:54 +01:00
b244cd1b21 Merge remote-tracking branch 'origin/master' into develop 2020-06-29 11:08:27 +01:00
d1dae159ad BUG: Corrected use of ddtCorr off 2020-06-29 11:07:09 +01:00
b325cb86c0 TUT: added mixerVesselAMI2DRefined to show example of AMI with topology change 2020-06-29 11:07:09 +01:00
2ba6243862 CONFIG: refine handling of git information for debian builds
- When OpenFOAM is under git control and a 'debian/' directory exists,
  this could mean two things:

  1) Additional debian control has been added to OpenFOAM
  2) OpenFOAM has been imported into a debian project

For the case that OpenFOAM has been imported into a debian project,
using the git information would be highly misleading. There will be no
OpenFOAM SHA1 correspondence.

However, if additional debian control has been added to OpenFOAM the
SHA1 will be valid.

The ad hoc solution is to use an additional "openfoam.debian"
directory to flag the addition of debian controls into openfoam.

When a "debian/" directory exists without a "openfoam.debian", assume
that the OpenFOAM has been imported into debian and do not use the SHA1.
2020-06-29 10:33:30 +02:00
5754beeab4 COMP: remove old, unused/unusable lnInclude path (fixes #1752) 2020-06-29 09:32:14 +02:00
d93dd11ae4 ENH: add heatTransferCoeff caseDicts template (#1751) 2020-06-26 14:48:05 +02:00
df7044845e GIT: remove whitespace, backslash escape angle brackets in comments
- fix older '> >' template parameters as '>>'
2020-06-26 12:28:49 +02:00
51dd8f1c63 CONFIG: increment patch level OpenFOAM-v1912.200626 2020-06-26 10:35:55 +02:00
6534245359 BUG: incorrect lookup name in ReynoldsAnalogy (fixes #1751)
- used fluidThermo::typeName instead of fluidThermo::dictName
  within the Cp() method.
2020-06-26 10:32:13 +02:00
b6bf3502a3 BUG: Adding phasePropertyName to basicThermo constructor (fixes #1745) 2020-06-26 10:32:13 +02:00
c49d923392 BUG: Correcting htc definition to avoid negative values 2020-06-26 10:32:13 +02:00
4248fdcd96 BUG: windows IOobject::path() incorrect from absolute (fixes #1738)
- only checked if it started with '/' and not 'd:/' (for example).
2020-06-26 10:32:13 +02:00
1bd5d03ea6 TUT: Adjusting settings for tutorials climbingRod and mixerVessel2D 2020-06-25 11:07:53 -07:00
f0c5f762d6 BUG: Adding phasePropertyName to basicThermo constructor (fixes #1745) 2020-06-25 08:35:21 -07:00
6cf560338e BOT: Added contributors file 2020-06-25 14:57:07 +01:00
f51cac3ad1 ENH: SemiImplicitSource: allow Function1 for Su,Sp. Fixes #1750. 2020-06-25 14:54:46 +01:00