Commit Graph

16 Commits

Author SHA1 Message Date
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
8b569b16d1 STYLE: logical ops return bool (issue #1043)
- these currently only with bool parameters, but the return value should
  nonetheless always be a bool value:

      andOp(), orOp(), lessOp(), lessEqOp(), greaterOp(), greaterEqOp()

- renamed the unused eqEqOp() to equalOp() for naming consistency with
  the equal() global function.

ENH: equalOp() specialization for scalars

- function object version of the equal() function.
  The default constructor uses the same tolerance (VSMALL),
  but can also supply an alternative tolerance on construction.
2018-10-17 07:59:26 +02:00
mattijs
3b6027d1be ENH: test: make test apps compile. Fixes #876. 2018-06-14 15:14:14 +01:00
Mark Olesen
dd8341f659 ENH: make format of ExecutionTime = ... output configurable (issue #788)
- controlled by the the 'printExecutionFormat' InfoSwitch in
  etc/controlDict

      // Style for "ExecutionTime = " output
      // - 0 = seconds (with trailing 's')
      // - 1 = day-hh:mm:ss

   ExecutionTime = 112135.2 s  ClockTime = 113017 s

   ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37

- Callable via the new Time::printExecutionTime() method,
  which also helps to reduce clutter in the applications.
  Eg,

     runTime.printExecutionTime(Info);

  vs

     Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
         << "  ClockTime = " << runTime.elapsedClockTime() << " s"
         << nl << endl;

--

ENH: return elapsedClockTime() and clockTimeIncrement as double

- previously returned as time_t, which is less portable.
2018-04-27 15:00:34 +02:00
Mark Olesen
660f3e5492 ENH: cleanup autoPtr class (issue #639)
Improve alignment of its behaviour with std::unique_ptr

  - element_type typedef
  - release() method - identical to ptr() method
  - get() method to get the pointer without checking and without releasing it.
  - operator*() for dereferencing

Method name changes

  - renamed rawPtr() to get()
  - renamed rawRef() to ref(), removed unused const version.

Removed methods/operators

  - assignment from a raw pointer was deleted (was rarely used).
    Can be convenient, but uncontrolled and potentially unsafe.
    Do allow assignment from a literal nullptr though, since this
    can never leak (and also corresponds to the unique_ptr API).

Additional methods

  - clone() method: forwards to the clone() method of the underlying
    data object with argument forwarding.

  - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)

STYLE: avoid implicit conversion from autoPtr to object type in many places

- existing implementation has the following:

     operator const T&() const { return operator*(); }

  which means that the following code works:

       autoPtr<mapPolyMesh> map = ...;
       updateMesh(*map);    // OK: explicit dereferencing
       updateMesh(map());   // OK: explicit dereferencing
       updateMesh(map);     // OK: implicit dereferencing

  for clarity it may preferable to avoid the implicit dereferencing

- prefer operator* to operator() when deferenced a return value
  so it is clearer that a pointer is involve and not a function call
  etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
2018-02-26 12:00:00 +01:00
Mark Olesen
03b287ed24 COMP: adjust tests to compile with current code base 2018-02-20 17:24:08 +01:00
Mark Olesen
f2ba618c19 STYLE: consistency in using argList::addArgument, argList::addOption 2017-11-22 12:54:28 +01:00
Mark Olesen
95e7faf309 STYLE: use the more succinct forms for argList (issue #307)
* args[int]   vs  args.args()[int]
  * args[word]  vs  args.options()[word]
  etc.
2016-11-20 13:06:57 +01:00
Henry Weller
3c053c2fe6 GeometricField: Renamed internalField() -> primitiveField() and dimensionedInternalField() -> internalField()
These new names are more consistent and logical because:

primitiveField():
primitiveFieldRef():
    Provides low-level access to the Field<Type> (primitive field)
    without dimension or mesh-consistency checking.  This should only be
    used in the low-level functions where dimensional consistency is
    ensured by careful programming and computational efficiency is
    paramount.

internalField():
internalFieldRef():
    Provides access to the DimensionedField<Type, GeoMesh> of values on
    the internal mesh-type for which the GeometricField is defined and
    supports dimension and checking and mesh-consistency checking.
2016-04-30 21:40:09 +01:00
Henry Weller
5df2b96489 GeometricField::internalField() -> GeometricField::internalFieldRef()
Non-const access to the internal field now obtained from a specifically
named access function consistent with the new names for non-canst access
to the boundary field boundaryFieldRef() and dimensioned internal field
dimensionedInternalFieldRef().

See also commit 22f4ad32b1
2016-04-30 14:25:21 +01:00
Henry Weller
e2ef006b91 applications: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 17:53:31 +00:00
Henry
c778346c96 Formatting: Rationalized the indentation of #include 2015-02-10 20:35:50 +00:00
mattijs
80ef6e2392 ENH: hexRef8: test more 2013-12-20 16:01:18 +00:00
mattijs
1186a190aa ENH: Test-hexref8: added pointFields 2013-12-20 13:20:50 +00:00
mattijs
a009a149b4 ENH: hexRef8: new testcase for refinement and unrefinement 2013-09-19 14:48:39 +01:00