v0.13.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FTensor::Tensor2_symmetric< T, Tensor_Dim > Class Template Reference

#include <src/ftensor/src/FTensor/Tensor2_symmetric/Tensor2_symmetric_value.hpp>

Inheritance diagram for FTensor::Tensor2_symmetric< T, Tensor_Dim >:
[legend]

Public Member Functions

template<class... U>
 Tensor2_symmetric (U... d)
 
 Tensor2_symmetric ()
 
Toperator() (const int N1, const int N2)
 
T operator() (const int N1, const int N2) const
 
template<int N1, int N2>
T operator() (const Number< N1 > &, const Number< N2 >()) const
 
template<int N1, int N2>
Toperator() (const Number< N1 > &, const Number< N2 >())
 
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Tensor_Dim >=Dim0 &&Tensor_Dim >=Dim1), Tensor2_Expr< Tensor2_symmetric< T, Tensor_Dim >, T, Dim0, Dim1, i, j > >::type operator() (const Index< i, Dim0 >, const Index< j, Dim1 >)
 
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Tensor_Dim >=Dim0 &&Tensor_Dim >=Dim1), Tensor2_Expr< constTensor2_symmetric< T, Tensor_Dim >, T, Dim0, Dim1, i, j > >::type operator() (const Index< i, Dim0 >, const Index< j, Dim1 >) const
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor2_symmetric_Expr< Tensor2_symmetric< T, Tensor_Dim >, T, Dim, i, j > >::type operator() (const Index< i, Dim >, const Index< j, Dim >)
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor2_symmetric_Expr< constTensor2_symmetric< T, Tensor_Dim >, T, Dim, i, j > >::type operator() (const Index< i, Dim >, const Index< j, Dim >) const
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >=Dim &&Tensor_Dim >N), Tensor1_Expr< Tensor2_number_rhs_1< Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Index< i, Dim >, const Number< N > &)
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >=Dim &&Tensor_Dim >N), Tensor1_Expr< Tensor2_number_1< constTensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Index< i, Dim >, const Number< N > &) const
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >N &&Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_number_rhs_0< Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Number< N > &, const Index< i, Dim >)
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >N &&Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_number_0< constTensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Number< N > &, const Index< i, Dim >) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_numeral_1< constTensor2_symmetric< T, Tensor_Dim >, T >, T, Dim, i > >::type operator() (const Index< i, Dim >, const int N) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_numeral_0< constTensor2_symmetric< T, Tensor_Dim >, T >, T, Dim, i > >::type operator() (const int N, const Index< i, Dim >) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), T >::type operator() (const Index< i, Dim >, const Index< i, Dim >)
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), T >::type operator() (const Index< i, Dim >, const Index< i, Dim >) const
 

Private Member Functions

template<int N>
T internal_contract (const Number< N > &) const
 
T internal_contract (const Number< 1 > &) const
 

Private Attributes

T data [(Tensor_Dim *(Tensor_Dim+1))/2]
 

Detailed Description

template<class T, int Tensor_Dim>
class FTensor::Tensor2_symmetric< T, Tensor_Dim >
Examples
EshelbianOperators.cpp, HookeElement.hpp, HookeInternalStressElement.hpp, PlasticOps.hpp, PlasticOpsGeneric.hpp, PlasticOpsLargeStrains.hpp, PlasticThermalOps.hpp, Remodeling.cpp, elasticity.cpp, matrix_function.cpp, mortar_contact_thermal.cpp, plate.cpp, and simple_contact_thermal.cpp.

Definition at line 13 of file Tensor2_symmetric_value.hpp.

Constructor & Destructor Documentation

◆ Tensor2_symmetric() [1/2]

template<class T , int Tensor_Dim>
template<class... U>
FTensor::Tensor2_symmetric< T, Tensor_Dim >::Tensor2_symmetric ( U...  d)

Definition at line 18 of file Tensor2_symmetric_value.hpp.

18 : data{d...}
19 {
20 static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
21 "Incorrect number of Arguments. Constructor should "
22 "initialize the entire Tensor");
23 }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]
const double T
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27

◆ Tensor2_symmetric() [2/2]

template<class T , int Tensor_Dim>
FTensor::Tensor2_symmetric< T, Tensor_Dim >::Tensor2_symmetric ( )

Definition at line 25 of file Tensor2_symmetric_value.hpp.

25{}

Member Function Documentation

◆ internal_contract() [1/2]

template<class T , int Tensor_Dim>
T FTensor::Tensor2_symmetric< T, Tensor_Dim >::internal_contract ( const Number< 1 > &  ) const
private

Definition at line 243 of file Tensor2_symmetric_value.hpp.

243{ return data[0]; }

◆ internal_contract() [2/2]

template<class T , int Tensor_Dim>
template<int N>
T FTensor::Tensor2_symmetric< T, Tensor_Dim >::internal_contract ( const Number< N > &  ) const
private

Definition at line 237 of file Tensor2_symmetric_value.hpp.

238 {
239 return data[N - 1 + ((N - 1) * (2 * Tensor_Dim - N)) / 2]
240 + internal_contract(Number<N - 1>());
241 }
T internal_contract(const Number< N > &) const
const int N
Definition: speed_test.cpp:3

◆ operator()() [1/16]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), T >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Index< i, Dim >   
)

Definition at line 224 of file Tensor2_symmetric_value.hpp.

225 {
226 return internal_contract(Number<Dim>());
227 }

◆ operator()() [2/16]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), T >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Index< i, Dim >   
) const

Definition at line 231 of file Tensor2_symmetric_value.hpp.

232 {
233 return internal_contract(Number<Dim>());
234 }

◆ operator()() [3/16]

template<class T , int Tensor_Dim>
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor2_symmetric_Expr< Tensor2_symmetric< T, Tensor_Dim >, T, Dim, i, j > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Index< j, Dim >   
)

Definition at line 119 of file Tensor2_symmetric_value.hpp.

120 {
121 return Tensor2_symmetric_Expr<Tensor2_symmetric<T, Tensor_Dim>, T, Dim,
122 i, j>(*this);
123 }
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j

◆ operator()() [4/16]

template<class T , int Tensor_Dim>
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor2_symmetric_Expr< constTensor2_symmetric< T, Tensor_Dim >, T, Dim, i, j > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Index< j, Dim >   
) const

Definition at line 130 of file Tensor2_symmetric_value.hpp.

131 {
132 return Tensor2_symmetric_Expr<const Tensor2_symmetric<T, Tensor_Dim>, T,
133 Dim, i, j>(*this);
134 }

◆ operator()() [5/16]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_numeral_1< constTensor2_symmetric< T, Tensor_Dim >, T >, T, Dim, i > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const int  N 
) const

Definition at line 198 of file Tensor2_symmetric_value.hpp.

199 {
200 using TensorExpr
201 = Tensor2_numeral_1<const Tensor2_symmetric<T, Tensor_Dim>, T>;
202 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this, N));
203 }

◆ operator()() [6/16]

template<class T , int Tensor_Dim>
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >=Dim &&Tensor_Dim >N), Tensor1_Expr< Tensor2_number_rhs_1< Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Number< N > &   
)

Definition at line 148 of file Tensor2_symmetric_value.hpp.

149 {
150 using TensorExpr
151 = Tensor2_number_rhs_1<Tensor2_symmetric<T, Tensor_Dim>, T, N>;
153 }

◆ operator()() [7/16]

template<class T , int Tensor_Dim>
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >=Dim &&Tensor_Dim >N), Tensor1_Expr< Tensor2_number_1< constTensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Number< N > &   
) const

Definition at line 160 of file Tensor2_symmetric_value.hpp.

161 {
162 using TensorExpr
163 = Tensor2_number_1<const Tensor2_symmetric<T, Tensor_Dim>, T, N>;
164 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
165 }

◆ operator()() [8/16]

template<class T , int Tensor_Dim>
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Tensor_Dim >=Dim0 &&Tensor_Dim >=Dim1), Tensor2_Expr< Tensor2_symmetric< T, Tensor_Dim >, T, Dim0, Dim1, i, j > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >   
)

Definition at line 96 of file Tensor2_symmetric_value.hpp.

97 {
98 return Tensor2_Expr<Tensor2_symmetric<T, Tensor_Dim>, T, Dim0, Dim1, i,
99 j>(*this);
100 }

◆ operator()() [9/16]

template<class T , int Tensor_Dim>
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Tensor_Dim >=Dim0 &&Tensor_Dim >=Dim1), Tensor2_Expr< constTensor2_symmetric< T, Tensor_Dim >, T, Dim0, Dim1, i, j > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >   
) const

Definition at line 106 of file Tensor2_symmetric_value.hpp.

107 {
108 return Tensor2_Expr<const Tensor2_symmetric<T, Tensor_Dim>, T, Dim0,
109 Dim1, i, j>(*this);
110 }

◆ operator()() [10/16]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_numeral_0< constTensor2_symmetric< T, Tensor_Dim >, T >, T, Dim, i > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const int  N,
const Index< i, Dim >   
) const

Definition at line 210 of file Tensor2_symmetric_value.hpp.

211 {
212 using TensorExpr
213 = Tensor2_numeral_0<const Tensor2_symmetric<T, Tensor_Dim>, T>;
214 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this, N));
215 }

◆ operator()() [11/16]

template<class T , int Tensor_Dim>
T & FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const int  N1,
const int  N2 
)

Definition at line 30 of file Tensor2_symmetric_value.hpp.

31 {
32#ifdef FTENSOR_DEBUG
33 if(N1 >= Tensor_Dim || N1 < 0 || N2 >= Tensor_Dim || N2 < 0)
34 {
35 std::stringstream s;
36 s << "Bad index in Tensor2_symmetric<T," << Tensor_Dim
37 << ">.operator(" << N1 << "," << N2 << ")" << std::endl;
38 throw std::out_of_range(s.str());
39 }
40#endif
41 return N1 > N2 ? data[N1 + (N2 * (2 * Tensor_Dim - N2 - 1)) / 2]
42 : data[N2 + (N1 * (2 * Tensor_Dim - N1 - 1)) / 2];
43 }
static Number< 2 > N2
static Number< 1 > N1

◆ operator()() [12/16]

template<class T , int Tensor_Dim>
T FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const int  N1,
const int  N2 
) const

Definition at line 45 of file Tensor2_symmetric_value.hpp.

46 {
47#ifdef FTENSOR_DEBUG
48 if(N1 >= Tensor_Dim || N1 < 0 || N2 >= Tensor_Dim || N2 < 0)
49 {
50 std::stringstream s;
51 s << "Bad index in Tensor2_symmetric<T," << Tensor_Dim
52 << ">.operator(" << N1 << "," << N2 << ") const" << std::endl;
53 throw std::out_of_range(s.str());
54 }
55#endif
56 return N1 > N2 ? data[N1 + (N2 * (2 * Tensor_Dim - N2 - 1)) / 2]
57 : data[N2 + (N1 * (2 * Tensor_Dim - N1 - 1)) / 2];
58 }

◆ operator()() [13/16]

template<class T , int Tensor_Dim>
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >N &&Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_number_rhs_0< Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Number< N > &  ,
const Index< i, Dim >   
)

Definition at line 172 of file Tensor2_symmetric_value.hpp.

173 {
174 using TensorExpr
175 = Tensor2_number_rhs_0<Tensor2_symmetric<T, Tensor_Dim>, T, N>;
177 }

◆ operator()() [14/16]

template<class T , int Tensor_Dim>
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >N &&Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_number_0< constTensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Number< N > &  ,
const Index< i, Dim >   
) const

Definition at line 184 of file Tensor2_symmetric_value.hpp.

185 {
186 using TensorExpr
187 = Tensor2_number_0<const Tensor2_symmetric<T, Tensor_Dim>, T, N>;
188 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
189 }

◆ operator()() [15/16]

template<class T , int Tensor_Dim>
template<int N1, int N2>
T & FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Number< N1 > &  ,
const Number< N2 () 
)

Definition at line 73 of file Tensor2_symmetric_value.hpp.

73 {
74
75 static_assert(N1 < Tensor_Dim, "Bad index");
76 static_assert(N2 < Tensor_Dim, "Bad index");
77
78 if constexpr (N1 > N2)
79 return data[N1 + (N2 * (2 * Tensor_Dim - N2 - 1)) / 2];
80 else
81 return data[N2 + (N1 * (2 * Tensor_Dim - N1 - 1)) / 2];
82 }

◆ operator()() [16/16]

template<class T , int Tensor_Dim>
template<int N1, int N2>
T FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Number< N1 > &  ,
const Number< N2 () 
) const

Definition at line 61 of file Tensor2_symmetric_value.hpp.

61 {
62
63 static_assert(N1 < Tensor_Dim, "Bad index");
64 static_assert(N2 < Tensor_Dim, "Bad index");
65
66 if constexpr (N1 > N2)
67 return data[N1 + (N2 * (2 * Tensor_Dim - N2 - 1)) / 2];
68 else
69 return data[N2 + (N1 * (2 * Tensor_Dim - N1 - 1)) / 2];
70 }

Member Data Documentation

◆ data

template<class T , int Tensor_Dim>
T FTensor::Tensor2_symmetric< T, Tensor_Dim >::data[(Tensor_Dim *(Tensor_Dim+1))/2]
private

Definition at line 15 of file Tensor2_symmetric_value.hpp.


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