Skip to content
Snippets Groups Projects
  1. Sep 30, 2021
  2. Mar 29, 2021
  3. Nov 19, 2020
    • Mark OLESEN's avatar
      ENH: Function1 and PatchFunction1 improvements (#1917) · 2f2dcdcf
      Mark OLESEN authored
      - easier support for non-mandatory functions.
      
        In some boundary conditions it can be desirable to support
        additional functions, but not necessarily require them. Make this
        easier to support with a Function1, PatchFunction1 NewIfPresent()
        selector.
      
      - support for compatibility lookups
      
      - harmonize branching logic and error handling between Function1 and
        PatchFunction1.
      
      ENH: refactor a base class for Function1, PatchFunction1
      
      - includes base characteristics, patch or scalar information
      
      ENH: additional creation macros
      
      - makeConcreteFunction1, makeConcretePatchFunction1Type for adding a
        non-templated function into the correct templated selection table.
        makeScalarPatchFunction1 for similarity with makeScalarFunction1
      2f2dcdcf
  4. Jul 01, 2020
  5. May 23, 2020
  6. Oct 31, 2019
  7. Aug 23, 2019
  8. Feb 06, 2019
  9. Dec 11, 2018
    • Mark OLESEN's avatar
      ENH: use Zero when zero-initializing types · 1d85fecf
      Mark OLESEN authored
      - makes the intent clearer and avoids the need for additional
        constructor casting. Eg,
      
            labelList(10, Zero)    vs.  labelList(10, 0)
            scalarField(10, Zero)  vs.  scalarField(10, scalar(0))
            vectorField(10, Zero)  vs.  vectorField(10, vector::zero)
      1d85fecf
  10. Oct 18, 2018
    • Mark OLESEN's avatar
      ENH: cleanup of Enum class · 3b745122
      Mark OLESEN authored
      - more dictionary-like methods, enforce keyType::LITERAL for all
        lookups to avoid any spurious keyword matching.
      
      - new readEntry, readIfPresent methods
      
      - The get() method replaces the now deprecate lookup() method.
      
      - Deprecate lookupOrFailsafe()
        Failsafe behaviour is now an optional parameter for lookupOrDefault,
        which makes it easier to tailor behaviour at runtime.
      
      - output of the names is now always flatted without line-breaks.
        Thus,
      
           os << flatOutput(someEnumNames.names()) << nl;
           os << someEnumNames << nl;
      
        both generate the same output.
      
      - Constructor now uses C-string (const char*) directly instead of
        Foam::word in its initializer_list.
      
      - Remove special enum + initializer_list constructor form since
        it can create unbounded lookup indices.
      
      - Removd old hasEnum, hasName forms that were provided during initial
        transition from NamedEnum.
      
      - Added static_assert on Enum contents to restrict to enum or
        integral values.  Should not likely be using this class to enumerate
        other things since it internally uses an 'int' for its values.
      
        Changed volumeType accordingly to enumerate on its type (enum),
        not the class itself.
      3b745122
  11. Feb 26, 2018
    • Mark OLESEN's avatar
      ENH: cleanup autoPtr class (issue #639) · 660f3e54
      Mark OLESEN authored
      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_();
      660f3e54
  12. Nov 05, 2017
  13. Jul 31, 2017
  14. Jul 07, 2017
  15. May 29, 2017
  16. Nov 28, 2016
  17. Mar 22, 2016
  18. Feb 22, 2016
    • Henry Weller's avatar
      tmp: Updated to store and preserve the const-ness of the reference to a constant object · 15b7e87d
      Henry Weller authored
      This change requires that the de-reference operator '()' returns a
      const-reference to the object stored irrespective of the const-ness of
      object stored and the new member function 'ref()' is provided to return
      an non-const reference to stored object which throws a fatal error if the
      stored object is const.
      
      In order to smooth the transition to this new safer 'tmp' the now
      deprecated and unsafe non-const de-reference operator '()' is still
      provided by default but may be switched-off with the compilation switch
      'CONST_TMP'.
      
      The main OpenFOAM library has already been upgraded and '-DCONST_TMP'
      option specified in the 'options' file to switch to the new 'tmp'
      behavior.  The rest of OpenFOAM-dev will be upgraded over the following
      few weeks.
      
      Henry G. Weller
      CFD Direct
      15b7e87d
  19. Feb 10, 2016
  20. Feb 08, 2016
    • Henry Weller's avatar
      Rename DataEntry -> Function1 · 968c888f
      Henry Weller authored
      Function1 is an abstract base-class of run-time selectable unary
      functions which may be composed of other Function1's allowing the user
      to specify complex functions of a single scalar variable, e.g. time.
      The implementations need not be a simple or continuous functions;
      interpolated tables and polynomials are also supported.  In fact form of
      mapping between a single scalar input and a single primitive type output
      is supportable.
      
      The primary application of Function1 is in time-varying boundary
      conditions, it also used for other functions of time, e.g. injected mass
      is spray simulations but is not limited to functions of time.
      968c888f
  21. Feb 07, 2016
  22. Feb 06, 2016
  23. Jan 10, 2016
  24. Nov 08, 2015
  25. Jul 17, 2015
  26. Apr 30, 2013
  27. Jan 28, 2013
  28. Oct 24, 2012
  29. Jun 22, 2012
  30. May 02, 2012
  31. Apr 17, 2012
  32. Apr 13, 2012
  33. Feb 02, 2012
  34. Nov 22, 2011