1. 31 Jan, 2019 1 commit
  2. 25 Jan, 2019 1 commit
  3. 09 Jan, 2019 1 commit
  4. 27 Nov, 2018 1 commit
    • Mark Olesen's avatar
      ENH: add non-const field access without triggering update counter (#1081) · 9935c9b7
      Mark Olesen authored
      - can now things like ref(), boundaryFieldRef(), primitiveFieldRef()
        with an optional argument that avoids triggering any update events
      
        Instead of
      
            Field<Type>& iF = const_cast<Field<Type>&>(fld.primitiveField());
      
        can now write
      
            Field<Type>& iF = fld.primitiveFieldRef(false);
      
        or simply
      
            auto& iF = fld.primitiveFieldRef(false);
      9935c9b7
  5. 12 Oct, 2018 1 commit
  6. 09 Oct, 2018 1 commit
  7. 05 Oct, 2018 1 commit
  8. 03 Apr, 2018 1 commit
    • Mark Olesen's avatar
      STYLE: more consistent use of dimensioned Zero · 5632ef2d
      Mark Olesen authored
      - when constructing dimensioned fields that are to be zero-initialized,
        it is preferrable to use a form such as
      
            dimensionedScalar(dims, Zero)
            dimensionedVector(dims, Zero)
      
        rather than
      
            dimensionedScalar("0", dims, 0)
            dimensionedVector("zero", dims, vector::zero)
      
        This reduces clutter and also avoids any suggestion that the name of
        the dimensioned quantity has any influence on the field's name.
      
        An even shorter version is possible. Eg,
      
            dimensionedScalar(dims)
      
        but reduces the clarity of meaning.
      
      - NB: UniformDimensionedField is an exception to these style changes
        since it does use the name of the dimensioned type (instead of the
        regIOobject).
      5632ef2d
  9. 07 Mar, 2018 1 commit
    • Mark Olesen's avatar
      ENH: cleanup tmp class (issue #639) · 96d45486
      Mark Olesen authored
      Improve alignment of its behaviour with std::shared_ptr
      
        - element_type typedef
        - swap, reset methods
      
      * additional reference access methods:
      
      cref()
          returns a const reference, synonymous with operator().
          This provides a more verbose alternative to using the '()' operator
          when that is desired.
      
              Mnemonic: a const form of 'ref()'
      
      constCast()
          returns a non-const reference, regardless if the underlying object
          itself is a managed pointer or a const object.
          This is similar to ref(), but more permissive.
      
              Mnemonic: const_cast<>
      
          Using the constCast() method greatly reduces the amount of typing
          and reading. And since the data type is already defined via the tmp
          template parameter, the type deduction is automatically known.
      
          Previously,
      
              const tmp<volScalarField>& tfld;
      
              const_cast<volScalarField&>(tfld()).rename("name");
              volScalarField& fld = const_cast<volScalarField&>(tfld());
      
          Now,
      
              tfld.constCast().rename("name");
              auto& fld = tfld.constCast();
      
      --
      
      BUG: attempts to move tmp value that may still be shared.
      
      - old code simply checked isTmp() to decide if the contents could be
        transfered. However, this means that the content of a shared tmp
        would be removed, leaving other instances without content.
      
      * movable() method checks that for a non-null temporary that is
        unique (not shared).
      96d45486
  10. 22 Sep, 2017 2 commits
  11. 31 Oct, 2016 1 commit
  12. 30 Apr, 2016 3 commits
    • Henry Weller's avatar
      GeometricField: Renamed internalField() -> primitiveField() and... · fe43b805
      Henry Weller authored
      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.
      fe43b805
    • Henry Weller's avatar
      GeometricField::dimensionedInteralFieldRef() -> GeometricField::ref() · 68fb9a2b
      Henry Weller authored
      In order to simplify expressions involving dimensioned internal field it
      is preferable to use a simpler access convention.  Given that
      GeometricField is derived from DimensionedField it is simply a matter of
      de-referencing this underlying type unlike the boundary field which is
      peripheral information.  For consistency with the new convention in
      "tmp"  "dimensionedInteralFieldRef()" has been renamed "ref()".
      68fb9a2b
    • Henry Weller's avatar
      GeometricField::internalField() -> GeometricField::internalFieldRef() · e1e99674
      Henry Weller authored
      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 a4e2afa4
      e1e99674
  13. 28 Apr, 2016 1 commit
    • Henry Weller's avatar
      GeometricField::GeometricBoundaryField -> GeometricField::Boundary · 75ea7618
      Henry Weller authored
      When the GeometricBoundaryField template class was originally written it
      was a separate class in the Foam namespace rather than a sub-class of
      GeometricField as it is now.  Without loss of clarity and simplifying
      code which access the boundary field of GeometricFields it is better
      that GeometricBoundaryField be renamed Boundary for consistency with the
      new naming convention for the type of the dimensioned internal field:
      Internal, see commit a25a449c
      
      This is a very simple text substitution change which can be applied to
      any code which compiles with the OpenFOAM-dev libraries.
      75ea7618
  14. 27 Apr, 2016 1 commit
    • Henry Weller's avatar
      GeometricField: Rationalized and simplified access to the dimensioned internal field · a25a449c
      Henry Weller authored
      Given that the type of the dimensioned internal field is encapsulated in
      the GeometricField class the name need not include "Field"; the type
      name is "Internal" so
      
      volScalarField::DimensionedInternalField -> volScalarField::Internal
      
      In addition to the ".dimensionedInternalField()" access function the
      simpler "()" de-reference operator is also provided to greatly simplify
      FV equation source term expressions which need not evaluate boundary
      conditions.  To demonstrate this kEpsilon.C has been updated to use
      dimensioned internal field expressions in the k and epsilon equation
      source terms.
      a25a449c
  15. 26 Apr, 2016 2 commits
  16. 25 Apr, 2016 1 commit
    • Henry Weller's avatar
      Completed boundaryField() -> boundaryFieldRef() · a4e2afa4
      Henry Weller authored
      Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1938
      
      Because C++ does not support overloading based on the return-type there
      is a problem defining both const and non-const member functions which
      are resolved based on the const-ness of the object for which they are
      called rather than the intent of the programmer declared via the
      const-ness of the returned type.  The issue for the "boundaryField()"
      member function is that the non-const version increments the
      event-counter and checks the state of the stored old-time fields in case
      the returned value is altered whereas the const version has no
      side-effects and simply returns the reference.  If the the non-const
      function is called within the patch-loop the event-counter may overflow.
      To resolve this it in necessary to avoid calling the non-const form of
      "boundaryField()" if the results is not altered and cache the reference
      outside the patch-loop when mutation of the patch fields is needed.
      
      The most straight forward way of resolving this problem is to name the
      const and non-const forms of the member functions differently e.g. the
      non-const form could be named:
      
          mutableBoundaryField()
          mutBoundaryField()
          nonConstBoundaryField()
          boundaryFieldRef()
      
      Given that in C++ a reference is non-const unless specified as const:
      "T&" vs "const T&" the logical convention would be
      
          boundaryFieldRef()
          boundaryFieldConstRef()
      
      and given that the const form which is more commonly used is it could
      simply be named "boundaryField()" then the logical convention is
      
          GeometricBoundaryField& boundaryFieldRef();
      
          inline const GeometricBoundaryField& boundaryField() const;
      
      This is also consistent with the new "tmp" class for which non-const
      access to the stored object is obtained using the ".ref()" member function.
      
      This new convention for non-const access to the components of
      GeometricField will be applied to "dimensionedInternalField()" and "internalField()" in the
      future, i.e. "dimensionedInternalFieldRef()" and "internalFieldRef()".
      a4e2afa4
  17. 23 Apr, 2016 1 commit
    • Henry Weller's avatar
      GeometricField: New non-const access function boundaryFieldRef() · c25b48a7
      Henry Weller authored
      There is a need to specify const or non-const access to a non-const
      object which is not currently possible with the "boundaryField()" access
      function the const-ness of the return of which is defined by the
      const-ness of the object for which it is called.  For consistency with
      the latest "tmp" storage class in which non-const access is obtained
      with the "ref()" function it is proposed to replace the non-const form
      of "boundaryField()" with "boundaryFieldRef()".
      
      Thanks to Mattijs Janssens for starting the process of migration to
      "boundaryFieldRef()" and providing a patch for the OpenFOAM and
      finiteVolume libraries.
      c25b48a7
  18. 29 Feb, 2016 1 commit
  19. 12 Feb, 2016 1 commit
  20. 10 Jan, 2016 1 commit
  21. 17 Nov, 2015 3 commits
    • mattijs's avatar
      ENH: parallel: overhaul of parallel mapping · 6e28b7fa
      mattijs authored
      - redistributePar to have almost (complete) functionality of decomposePar+reconstructPar
      - low-level distributed Field mapping
      - support for mapping surfaceFields (including flipping faces)
      - support for decomposing/reconstructing refinement data
      6e28b7fa
    • mattijs's avatar
      ENH: parallel: overhaul of parallel mapping · 1fe1f26c
      mattijs authored
      - redistributePar to have almost (complete) functionality of decomposePar+reconstructPar
      - low-level distributed Field mapping
      - support for mapping surfaceFields (including flipping faces)
      - support for decomposing/reconstructing refinement data
      1fe1f26c
    • mattijs's avatar
      ENH: parallel: overhaul of parallel mapping · 2f752590
      mattijs authored
      - redistributePar to have almost (complete) functionality of decomposePar+reconstructPar
      - low-level distributed Field mapping
      - support for mapping surfaceFields (including flipping faces)
      - support for decomposing/reconstructing refinement data
      2f752590
  22. 17 Jul, 2015 1 commit
    • Henry Weller's avatar
      Upgrade Intel C++ compiler to icpc (ICC) 15.0.3 20150407 · e6e7820a
      Henry Weller authored
      This resolves a whole range of issues and work-arounds with earlier
      releases.  This version of icpc is more or less compatible with the
      latest gcc and clang compilers and only required one hack to avoid
      warnings from PackedBoolList.H.
      e6e7820a
  23. 13 Feb, 2015 1 commit
  24. 10 Dec, 2014 1 commit