1. 18 Feb, 2020 1 commit
    • Kutalmis Bercin's avatar
      ENH: improve funcs and opers in Tensor types · 66b02ca5
      Kutalmis Bercin authored
        - ensures each Tensor-container operates for the following base types:
          - floatScalar
          - doubleScalar
          - complex
      
        - adds/improves test applications for each container and base type:
          - constructors
          - member functions
          - global functions
          - global operators
      
        - misc:
          - silently removes `invariantIII()` for `tensor2D` and `symmTensor2D`
            since the 3rd invariant does not exist for 2x2 matrices
          - fixes `invariantII()` algorithm for `tensor2D` and `symmTensor2D`
          - adds `Cmpt` multiplication to `Vector2D` and `Vector`
          - adds missing access funcs for symmetric containers
          - improves func/header documentations
      66b02ca5
  2. 30 Jan, 2020 1 commit
  3. 28 Jan, 2020 1 commit
  4. 19 Nov, 2019 1 commit
  5. 15 Nov, 2019 1 commit
  6. 31 Oct, 2019 1 commit
  7. 10 Oct, 2019 1 commit
  8. 29 Jul, 2019 1 commit
    • Mark Olesen's avatar
      ENH: additional contiguous traits (#1378) · 1d79c045
      Mark Olesen authored
      - change contiguous from a series of global functions to separate
        templated traits classes:
      
          - is_contiguous
          - is_contiguous_label
          - is_contiguous_scalar
      
        The static constexpr 'value' and a constexpr conversion operator
        allow use in template expressions.  The change also makes it much
        easier to define general traits and to inherit from them.
      
        The is_contiguous_label and is_contiguous_scalar are special traits
        for handling data of homogeneous components of the respective types.
      1d79c045
  9. 04 Apr, 2019 1 commit
    • Mark Olesen's avatar
      ENH: add iterators to VectorSpace (#1265) · 1c4e32fb
      Mark Olesen authored
      - this adds support for various STL operations including
      
          * sorting, filling, find min/max element etc.
          * for-range iteration
      
      STYLE: use constexpr for VectorSpace rank
      1c4e32fb
  10. 06 Feb, 2019 1 commit
  11. 01 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: improve, simplify, rationalize coordinate system handling (issue #863) · 6697bb47
      Mark Olesen authored
      Previously the coordinate system functionality was split between
      coordinateSystem and coordinateRotation. The coordinateRotation stored
      the rotation tensor and handled all tensor transformations.
      
      The functionality has now been revised and consolidated into the
      coordinateSystem classes. The sole purpose of coordinateRotation
      is now just to provide a selectable mechanism of how to define the
      rotation tensor (eg, axis-angle, euler angles, local axes) for user
      input, but after providing the appropriate rotation tensor it has
      no further influence on the transformations.
      
      --
      
      The coordinateSystem class now contains an origin and a base rotation
      tensor directly and various transformation methods.
      
        - The origin represents the "shift" for a local coordinate system.
      
        - The base rotation tensor represents the "tilt" or orientation
          of the local coordinate system in general (eg, for mapping
          positions), but may require position-dependent tensors when
          transforming vectors and tensors.
      
      For some coordinate systems (currently the cylindrical coordinate system),
      the rotation tensor required for rotating a vector or tensor is
      position-dependent.
      
      The new coordinateSystem and its derivates (cartesian, cylindrical,
      indirect) now provide a uniform() method to define if the rotation
      tensor is position dependent/independent.
      
      The coordinateSystem transform and invTransform methods are now
      available in two-parameter forms for obtaining position-dependent
      rotation tensors. Eg,
      
            ... = cs.transform(globalPt, someVector);
      
      In some cases it can be useful to use query uniform() to avoid
      storage of redundant values.
      
            if (cs.uniform())
            {
                vector xx = cs.transform(someVector);
            }
            else
            {
                List<vector> xx = cs.transform(manyPoints, someVector);
            }
      
      Support transform/invTransform for common data types:
         (scalar, vector, sphericalTensor, symmTensor, tensor).
      
      ====================
        Breaking Changes
      ====================
      
      - These changes to coordinate systems and rotations may represent
        a breaking change for existing user coding.
      
      - Relocating the rotation tensor into coordinateSystem itself means
        that the coordinate system 'R()' method now returns the rotation
        directly instead of the coordinateRotation. The method name 'R()'
        was chosen for consistency with other low-level entities (eg,
        quaternion).
      
        The following changes will be needed in coding:
      
            Old:  tensor rot = cs.R().R();
            New:  tensor rot = cs.R();
      
            Old:  cs.R().transform(...);
            New:  cs.transform(...);
      
        Accessing the runTime selectable coordinateRotation
        has moved to the rotation() method:
      
            Old:  Info<< "Rotation input: " << cs.R() << nl;
            New:  Info<< "Rotation input: " << cs.rotation() << nl;
      
      - Naming consistency changes may also cause code to break.
      
            Old:  transformVector()
            New:  transformPrincipal()
      
        The old method name transformTensor() now simply becomes transform().
      
      ====================
        New methods
      ====================
      
      For operations requiring caching of the coordinate rotations, the
      'R()' method can be used with multiple input points:
      
             tensorField rots(cs.R(somePoints));
      
         and later
      
             Foam::transformList(rots, someVectors);
      
      The rotation() method can also be used to change the rotation tensor
      via a new coordinateRotation definition (issue #879).
      
      The new methods transformPoint/invTransformPoint provide
      transformations with an origin offset using Cartesian for both local
      and global points. These can be used to determine the local position
      based on the origin/rotation without interpreting it as a r-theta-z
      value, for example.
      
      ================
        Input format
      ================
      
      - Streamline dictionary input requirements
      
        * The default type is cartesian.
        * The default rotation type is the commonly used axes rotation
          specification (with e1/e2/3), which is assumed if the 'rotation'
          sub-dictionary does not exist.
      
          Example,
      
          Compact specification:
      
              coordinateSystem
              {
                  origin  (0 0 0);
                  e2      (0 1 0);
                  e3      (0.5 0 0.866025);
              }
      
          Full specification (also accepts the longer 'coordinateRotation'
          sub-dictionary name):
      
              coordinateSystem
              {
                  type    cartesian;
                  origin  (0 0 0);
      
                  rotation
                  {
                      type    axes;
                      e2      (0 1 0);
                      e3      (0.5 0 0.866025);
                  }
              }
      
         This simplifies the input for many cases.
      
      - Additional rotation specification 'none' (an identity rotation):
      
            coordinateSystem
            {
                origin  (0 0 0);
                rotation { type none; }
            }
      
      - Additional rotation specification 'axisAngle', which is similar
        to the -rotate-angle option for transforming points (issue #660).
        For some cases this can be more intuitive.
      
        For example,
      
            rotation
            {
                type    axisAngle;
                axis    (0 1 0);
                angle   30;
            }
        vs.
            rotation
            {
                type    axes;
                e2      (0 1 0);
                e3      (0.5 0 0.866025);
            }
      
      - shorter names (or older longer names) for the coordinate rotation
        specification.
      
           euler         EulerRotation
           starcd        STARCDRotation
           axes          axesRotation
      
      ================
        Coding Style
      ================
      - use Foam::coordSystem namespace for categories of coordinate systems
        (cartesian, cylindrical, indirect). This reduces potential name
        clashes and makes a clearer declaration. Eg,
      
            coordSystem::cartesian csys_;
      
        The older names (eg, cartesianCS, etc) remain available via typedefs.
      
      - added coordinateRotations namespace for better organization and
        reduce potential name clashes.
      6697bb47
  12. 28 Sep, 2018 1 commit
    • Mark Olesen's avatar
      ENH: add column access and other methods for Tensor · 4a61042f
      Mark Olesen authored
      - Can now retrieve or set a column/row of a tensor.
        Either compile-time or run-time checks.
      
        Get
           t.col<1>();   t.col(1);
           t.row<1>();   t.row(1);
      
        Set
           t.col<1>(vec);   t.col(1,vec);
           t.row<1>(vec);   t.row(1,vec);
      
        The templated versions are compile-time checked
      
           t.col<3>();
           t.col<3>(vec);
      
        The parameter versions are run-time checked
      
           t.col(3);
           t.col(3,vec);
      
      ENH: provide named access to tensor/tensor inner product as inner()
      4a61042f
  13. 17 Jun, 2016 1 commit
  14. 17 Apr, 2016 1 commit
  15. 22 Mar, 2016 2 commits
  16. 12 Mar, 2016 1 commit
    • Henry Weller's avatar
      MatrixSpace: 2D (i-j) specialization of VectorSpace · c14ee0ad
      Henry Weller authored
      Provides '(i, j)' element access and general forms of inner and outer
      products, transpose etc. for square and rectangular VectorSpaces.
      
      VectorSpaces default to be column-vectors as before whereas row-vectors
      may be represented as 1xn MatrixSpaces.  In the future it may be
      preferable to create a specializations of VectorSpace for column- and
      maybe row-vectors but it would add complexity to MatrixSpace to handle
      all the type combinations.
      
      Tensor is now a 3x3 specialization of MatrixSpace.
      
      Sub-block const and non-const access is provided via the
      '.block<SubTensor, RowStart, ColStart>()' member functions.  Consistent
      sub-block access is also provide for VectorSpace so that columns of
      MatrixSpaces may be accessed and substituted.
      
      These new classes will be used to create a more extensive set of
      primitive vector and tensor types over the next few weeks.
      
      Henry G. Weller
      CFD Direct
      c14ee0ad
  17. 09 Mar, 2016 1 commit
  18. 08 Mar, 2016 1 commit
  19. 07 Mar, 2016 1 commit
  20. 06 Mar, 2016 1 commit
  21. 10 Jan, 2016 1 commit
  22. 18 Jul, 2013 1 commit
  23. 21 Feb, 2013 2 commits
  24. 24 Dec, 2012 1 commit
  25. 17 Dec, 2012 1 commit
  26. 11 Dec, 2012 1 commit
  27. 28 Dec, 2011 1 commit
  28. 14 Aug, 2011 1 commit
  29. 19 Jan, 2011 1 commit
  30. 14 Jan, 2011 1 commit
  31. 07 Jan, 2011 1 commit
  32. 05 Jan, 2011 2 commits
  33. 19 Aug, 2010 1 commit
  34. 28 Jul, 2010 1 commit
  35. 29 Mar, 2010 1 commit
  36. 23 Jan, 2009 1 commit
  37. 31 Dec, 2008 1 commit