v0.16.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
FTensor::SymmLTensor< T, Dim > Class Template Reference

Mapping from symmetric tensor indices to packed storage index. More...

#include "src/ftensor/src/FTensor/SymmLTensor.hpp"

Collaboration diagram for FTensor::SymmLTensor< T, Dim >:
[legend]

Public Types

using value_type = typename promote< T, double >::V
 

Public Member Functions

constexpr value_type operator() (const int N0, const int N1, const int N2) const
 
template<char i, char j, char k, int Dim01, int Dim2>
std::enable_if<(Dim01==Dim &&Dim2==size_symm), Dg_Expr< SymmLTensor< T, Dim >, value_type, Dim01, Dim2, i, j, k > >::type operator() (const Index< i, Dim01 > &, const Index< j, Dim01 > &, const Index< k, Dim2 > &) const
 

Static Public Attributes

static constexpr int size_symm = (Dim * (Dim + 1)) / 2
 

Detailed Description

template<class T = int, int Dim = 3>
class FTensor::SymmLTensor< T, Dim >

Mapping from symmetric tensor indices to packed storage index.

Template Parameters
T
Dim
Examples
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 16 of file SymmLTensor.hpp.

Member Typedef Documentation

◆ value_type

template<class T = int, int Dim = 3>
using FTensor::SymmLTensor< T, Dim >::value_type = typename promote<T, double>::V

Definition at line 18 of file SymmLTensor.hpp.

Member Function Documentation

◆ operator()() [1/2]

template<class T = int, int Dim = 3>
template<char i, char j, char k, int Dim01, int Dim2>
std::enable_if<(Dim01==Dim &&Dim2==size_symm), Dg_Expr< SymmLTensor< T, Dim >, value_type, Dim01, Dim2, i, j, k > >::type FTensor::SymmLTensor< T, Dim >::operator() ( const Index< i, Dim01 > &  ,
const Index< j, Dim01 > &  ,
const Index< k, Dim2 > &   
) const
inline

Definition at line 33 of file SymmLTensor.hpp.

34 {
35 return Dg_Expr<SymmLTensor<T, Dim>, value_type, Dim01, Dim2, i, j, k>(
36 *this);
37 };
typename promote< T, double >::V value_type
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k

◆ operator()() [2/2]

template<class T = int, int Dim = 3>
constexpr value_type FTensor::SymmLTensor< T, Dim >::operator() ( const int  N0,
const int  N1,
const int  N2 
) const
inlineconstexpr

Definition at line 21 of file SymmLTensor.hpp.

22 {
23 const auto hi = N0 > N1 ? N0 : N1;
24 const auto lo = N0 > N1 ? N1 : N0;
25 const auto packed = hi + (lo * (2 * Dim - lo - 1)) / 2;
26 return N2 == packed ? value_type(1) : value_type(0);
27 }

Member Data Documentation

◆ size_symm

template<class T = int, int Dim = 3>
constexpr int FTensor::SymmLTensor< T, Dim >::size_symm = (Dim * (Dim + 1)) / 2
staticconstexpr

Definition at line 19 of file SymmLTensor.hpp.


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