NeoN
A framework for CFD software
Loading...
Searching...
No Matches
NeoN::Tensor Class Reference

A class for the representation of a 3x3 tensor. More...

#include <tensor.hpp>

Public Member Functions

KOKKOS_INLINE_FUNCTION Tensor ()
KOKKOS_INLINE_FUNCTION Tensor (const scalar diag)
 Construct scalar-times-identity tensor.
KOKKOS_INLINE_FUNCTION Tensor (scalar t00, scalar t01, scalar t02, scalar t10, scalar t11, scalar t12, scalar t20, scalar t21, scalar t22)
KOKKOS_INLINE_FUNCTION scalar * data ()
KOKKOS_INLINE_FUNCTION const scalar * data () const
constexpr sizeType size () const
KOKKOS_INLINE_FUNCTION scalar & operator() (const sizeType i, const sizeType j)
KOKKOS_INLINE_FUNCTION scalar operator() (const sizeType i, const sizeType j) const
KOKKOS_INLINE_FUNCTION bool operator== (const Tensor &rhs) const
KOKKOS_INLINE_FUNCTION Tensor operator+ (const Tensor &rhs) const
KOKKOS_INLINE_FUNCTION Tensor & operator+= (const Tensor &rhs)
KOKKOS_INLINE_FUNCTION Tensor operator- (const Tensor &rhs) const
KOKKOS_INLINE_FUNCTION Tensor & operator-= (const Tensor &rhs)
KOKKOS_INLINE_FUNCTION Tensor operator* (const scalar s) const
KOKKOS_INLINE_FUNCTION Tensor & operator*= (const scalar s)
KOKKOS_INLINE_FUNCTION scalar trace () const
 Trace: sum of diagonal components.
KOKKOS_INLINE_FUNCTION Tensor T () const
 Transpose.

Detailed Description

A class for the representation of a 3x3 tensor.

Row-major storage: component (i,j) is at data_[3*i+j].

Definition at line 25 of file tensor.hpp.

Constructor & Destructor Documentation

◆ Tensor() [1/3]

KOKKOS_INLINE_FUNCTION NeoN::Tensor::Tensor ( )
inline

Definition at line 30 of file tensor.hpp.

◆ Tensor() [2/3]

KOKKOS_INLINE_FUNCTION NeoN::Tensor::Tensor ( const scalar diag)
inlineexplicit

Construct scalar-times-identity tensor.

Definition at line 40 of file tensor.hpp.

◆ Tensor() [3/3]

KOKKOS_INLINE_FUNCTION NeoN::Tensor::Tensor ( scalar t00,
scalar t01,
scalar t02,
scalar t10,
scalar t11,
scalar t12,
scalar t20,
scalar t21,
scalar t22 )
inline

Definition at line 52 of file tensor.hpp.

Member Function Documentation

◆ data() [1/2]

KOKKOS_INLINE_FUNCTION scalar * NeoN::Tensor::data ( )
inline

Definition at line 75 of file tensor.hpp.

◆ data() [2/2]

KOKKOS_INLINE_FUNCTION const scalar * NeoN::Tensor::data ( ) const
inline

Definition at line 76 of file tensor.hpp.

◆ operator()() [1/2]

KOKKOS_INLINE_FUNCTION scalar & NeoN::Tensor::operator() ( const sizeType i,
const sizeType j )
inline

Definition at line 81 of file tensor.hpp.

◆ operator()() [2/2]

KOKKOS_INLINE_FUNCTION scalar NeoN::Tensor::operator() ( const sizeType i,
const sizeType j ) const
inline

Definition at line 84 of file tensor.hpp.

◆ operator*()

KOKKOS_INLINE_FUNCTION Tensor NeoN::Tensor::operator* ( const scalar s) const
inline

Definition at line 139 of file tensor.hpp.

◆ operator*=()

KOKKOS_INLINE_FUNCTION Tensor & NeoN::Tensor::operator*= ( const scalar s)
inline

Definition at line 150 of file tensor.hpp.

◆ operator+()

KOKKOS_INLINE_FUNCTION Tensor NeoN::Tensor::operator+ ( const Tensor & rhs) const
inline

Definition at line 97 of file tensor.hpp.

◆ operator+=()

KOKKOS_INLINE_FUNCTION Tensor & NeoN::Tensor::operator+= ( const Tensor & rhs)
inline

Definition at line 108 of file tensor.hpp.

◆ operator-()

KOKKOS_INLINE_FUNCTION Tensor NeoN::Tensor::operator- ( const Tensor & rhs) const
inline

Definition at line 118 of file tensor.hpp.

◆ operator-=()

KOKKOS_INLINE_FUNCTION Tensor & NeoN::Tensor::operator-= ( const Tensor & rhs)
inline

Definition at line 129 of file tensor.hpp.

◆ operator==()

KOKKOS_INLINE_FUNCTION bool NeoN::Tensor::operator== ( const Tensor & rhs) const
inline

Definition at line 87 of file tensor.hpp.

◆ size()

sizeType NeoN::Tensor::size ( ) const
inlineconstexpr

Definition at line 78 of file tensor.hpp.

◆ T()

KOKKOS_INLINE_FUNCTION Tensor NeoN::Tensor::T ( ) const
inline

Transpose.

Definition at line 165 of file tensor.hpp.

◆ trace()

KOKKOS_INLINE_FUNCTION scalar NeoN::Tensor::trace ( ) const
inline

Trace: sum of diagonal components.

Definition at line 161 of file tensor.hpp.


The documentation for this class was generated from the following file: