Commit Graph

16442 Commits

Author SHA1 Message Date
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
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
d3c76d8ec8 ENH: ListOps: added findIndices with predicate 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
fa86a98482 BUG: Minor correction to lumpedPointState.C for debug build 2020-07-17 14:09:34 +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
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
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
9b78472e06 DOC: Updated header doc - see #1756 2020-07-02 09:17:48 +01:00
968ce0290d DOC: Corrected header documentation - see #1756 2020-07-01 14:59:11 +01:00
ae76b38270 BUG: TableBase: illegal reference. Fixes #1753 2020-07-01 14:53:26 +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
5754beeab4 COMP: remove old, unused/unusable lnInclude path (fixes #1752) 2020-06-29 09:32:14 +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
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
f0c5f762d6 BUG: Adding phasePropertyName to basicThermo constructor (fixes #1745) 2020-06-25 08:35:21 -07:00
f51cac3ad1 ENH: SemiImplicitSource: allow Function1 for Su,Sp. Fixes #1750. 2020-06-25 14:54:46 +01:00
7b7142536d DOC: additional documentation in MappedFile 2020-06-25 11:54:38 +02:00
0a7eb6e6dc BUG: bad names if ensight mask contains NO placeholder (fixes #1747)
- affects ensightSurfaceReader only.

  If there are no `*` characters, protect against replacement.
  Otherwise it would attempt to replace a zero-length string with
  a single `0`, which results in prepending the name.

STYLE: ensightSurfaceReader constructor explicit
2020-06-25 11:54:38 +02:00
88dd3a1818 ENH: pimpleControl - added ddtCorr flag 2020-06-24 22:10:20 +01:00
11ed7a0efe ENH: cyclicAMIFvPatch - added hooks to correct delta coeffs and vecs 2020-06-24 22:10:20 +01:00
438f38bb61 ENH: surfaceInterpolation: extended patch override of geometry calculation. 2020-06-24 22:10:20 +01:00
7c1c9fee0c ENH: Updated AMI dependent code 2020-06-24 22:10:20 +01:00
66d270b924 DOC: cyclicAMI - added reference paper to header; function documentation 2020-06-24 22:10:19 +01:00
1e3cd399f2 WIP: dynamicMotionSolverFvMeshAMI - reset Uf 2020-06-24 22:10:19 +01:00