v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 > Class Template Reference

#include <src/ftensor/src/FTensor/Christof/Christof_value.hpp>

Inheritance diagram for FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >:
[legend]
Collaboration diagram for FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >:
[legend]

Public Member Functions

template<class... U>
 Christof (U... d)
 
 Christof ()
 
Toperator() (const int N1, const int N2, const int N3)
 
T operator() (const int N1, const int N2, const int N3) const
 
template<char i, char j, char k, int Dim0, int Dim12>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim12), Dg_Expr< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim12, Dim0, i, j, k > >::type operator() (const Index< k, Dim0 >, const Index< i, Dim12 >, const Index< j, Dim12 >)
 
template<char i, char j, char k, int Dim0, int Dim12>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim12), Dg_Expr< constChristof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim12, Dim0, i, j, k > >::type operator() (const Index< k, Dim0 >, const Index< i, Dim12 >, const Index< j, Dim12 >) const
 
template<char i, int N1, int N2, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >N1 &&Tensor_Dim12 >N2), Tensor1_Expr< Dg_number_rhs_12< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, N1, N2 >, T, Dim, i > >::type operator() (const Index< i, Dim >, const Number< N1 >, const Number< N2 >)
 
template<char i, int N1, int N2, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >N1 &&Tensor_Dim12 >N2), Tensor1_Expr< Dg_number_12< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, N1, N2 >, T, Dim, i > >::type operator() (const Index< i, Dim >, const Number< N1 >, const Number< N2 >) const
 
template<char i, char j, int Dim0, int Dim12>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim12), Tensor1_Expr< Tensor3_contracted_12< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim12 >, T, Dim0, i > >::type operator() (const Index< i, Dim0 >, const Index< j, Dim12 >, const Index< j, Dim12 >) const
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >=Dim), Tensor1_Expr< Tensor3_contracted_02< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim >, T, Dim, i > >::type operator() (const Index< j, Dim >, const Index< i, Dim >, const Index< j, Dim >) const
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >=Dim), Tensor1_Expr< Tensor3_contracted_01< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim >, T, Dim, i > >::type operator() (const Index< j, Dim >, const Index< j, Dim >, const Index< i, Dim >) const
 
template<char i, char j, int Dim0, int Dim12>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim12), Tensor1_Expr< Tensor3_contracted_12< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim12 >, T, Dim0, i > >::type operator() (const Index< i, Dim0 >, const Index< j, Dim12 >, const Index< j, Dim12 >)
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >=Dim), Tensor1_Expr< Tensor3_contracted_02< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim >, T, Dim, i > >::type operator() (const Index< j, Dim >, const Index< i, Dim >, const Index< j, Dim >)
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >=Dim), Tensor1_Expr< Tensor3_contracted_01< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim >, T, Dim, i > >::type operator() (const Index< j, Dim >, const Index< j, Dim >, const Index< i, Dim >)
 
template<char i, char j, int N, int Dim12>
std::enable_if<(Tensor_Dim0 >N &&Tensor_Dim12 >=Dim12), Tensor2_symmetric_Expr< Christof_number_0< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, N >, T, Dim12, i, j > >::type operator() (const Number< N >, const Index< i, Dim12 >, const Index< j, Dim12 >) const
 
template<char i, char j, int Dim12>
std::enable_if<(Tensor_Dim12 >=Dim12), Tensor2_symmetric_Expr< Christof_numeral_0< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T >, T, Dim12, i, j > >::type operator() (const int N, const Index< i, Dim12 >, const Index< j, Dim12 >) const
 
template<char i, char j, int Dim0, int Dim2>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim2), Tensor2_Expr< Christof_numeral_1< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T >, T, Dim0, Dim2, i, j > >::type operator() (const Index< i, Dim0 >, const int N, const Index< j, Dim2 >) const
 
template<char i, char j, int Dim0, int Dim2>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim2), Tensor2_Expr< Christof_numeral_1< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T >, T, Dim0, Dim2, i, j > >::type operator() (const Index< i, Dim0 >, const Index< j, Dim2 >, const int N) const
 

Private Attributes

T data [Tensor_Dim0][(Tensor_Dim12 *(Tensor_Dim12+1))/2]
 

Detailed Description

template<class T, int Tensor_Dim0, int Tensor_Dim12>
class FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >
Examples
HookeElement.hpp.

Definition at line 9 of file Christof_value.hpp.

Constructor & Destructor Documentation

◆ Christof() [1/2]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<class... U>
FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::Christof ( U...  d)
inline

Definition at line 14 of file Christof_value.hpp.

14 : data{d...}
15 {
16 static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
17 "Incorrect number of Arguments. Constructor should "
18 "initialize the entire Tensor");
19 }
T data[Tensor_Dim0][(Tensor_Dim12 *(Tensor_Dim12+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

◆ Christof() [2/2]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::Christof ( )
inline

Definition at line 21 of file Christof_value.hpp.

21{}

Member Function Documentation

◆ operator()() [1/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, int N1, int N2, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >N1 &&Tensor_Dim12 >N2), Tensor1_Expr< Dg_number_rhs_12< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, N1, N2 >, T, Dim, i > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim >  ,
const Number< N1 ,
const Number< N2  
)
inline

Definition at line 100 of file Christof_value.hpp.

101 {
102 using TensorExpr
103 = Dg_number_rhs_12<Christof<T, Tensor_Dim0, Tensor_Dim12>, T, N1, N2>;
105 }
static Number< 2 > N2
static Number< 1 > N1

◆ operator()() [2/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, int N1, int N2, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >N1 &&Tensor_Dim12 >N2), Tensor1_Expr< Dg_number_12< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, N1, N2 >, T, Dim, i > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim >  ,
const Number< N1 ,
const Number< N2  
) const
inline

Definition at line 113 of file Christof_value.hpp.

114 {
115 using TensorExpr
116 = Dg_number_12<const Christof<T, Tensor_Dim0, Tensor_Dim12>, T, N1, N2>;
117 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
118 }

◆ operator()() [3/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim0, int Dim12>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim12), Tensor1_Expr< Tensor3_contracted_12< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim12 >, T, Dim0, i > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim12 >  ,
const Index< j, Dim12 >   
)
inline

Definition at line 203 of file Christof_value.hpp.

205 {
206 using TensorExpr
207 = Tensor3_contracted_12<Christof<T, Tensor_Dim0, Tensor_Dim12>, T,
208 Dim12>;
209 return Tensor1_Expr<TensorExpr, T, Dim0, i>(TensorExpr(*this));
210 }

◆ operator()() [4/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim0, int Dim12>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim12), Tensor1_Expr< Tensor3_contracted_12< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim12 >, T, Dim0, i > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim12 >  ,
const Index< j, Dim12 >   
) const
inline

Definition at line 133 of file Christof_value.hpp.

135 {
136 using TensorExpr
137 = Tensor3_contracted_12<Christof<T, Tensor_Dim0, Tensor_Dim12>, T,
138 Dim12>;
139 return Tensor1_Expr<TensorExpr, T, Dim0, i>(TensorExpr(*this));
140 }

◆ operator()() [5/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim0, int Dim2>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim2), Tensor2_Expr< Christof_numeral_1< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T >, T, Dim0, Dim2, i, j > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim2 >  ,
const int  N 
) const
inline

Definition at line 319 of file Christof_value.hpp.

320 {
321 using TensorExpr
322 = Christof_numeral_1<Christof<T, Tensor_Dim0, Tensor_Dim12>, T>;
323 return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(
324 TensorExpr(*this, N));
325 }
const int N
Definition: speed_test.cpp:3

◆ operator()() [6/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim0, int Dim2>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim2), Tensor2_Expr< Christof_numeral_1< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T >, T, Dim0, Dim2, i, j > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim0 >  ,
const int  N,
const Index< j, Dim2 >   
) const
inline

Definition at line 306 of file Christof_value.hpp.

307 {
308 using TensorExpr
309 = Christof_numeral_1<Christof<T, Tensor_Dim0, Tensor_Dim12>, T>;
310 return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(
311 TensorExpr(*this, N));
312 }

◆ operator()() [7/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >=Dim), Tensor1_Expr< Tensor3_contracted_02< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim >, T, Dim, i > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< j, Dim >  ,
const Index< i, Dim >  ,
const Index< j, Dim >   
)
inline

Definition at line 218 of file Christof_value.hpp.

219 {
220 using TensorExpr
221 = Tensor3_contracted_02<Christof<T, Tensor_Dim0, Tensor_Dim12>, T, Dim>;
222 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
223 }

◆ operator()() [8/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >=Dim), Tensor1_Expr< Tensor3_contracted_02< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim >, T, Dim, i > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< j, Dim >  ,
const Index< i, Dim >  ,
const Index< j, Dim >   
) const
inline

Definition at line 148 of file Christof_value.hpp.

150 {
151 using TensorExpr
152 = Tensor3_contracted_02<Christof<T, Tensor_Dim0, Tensor_Dim12>, T, Dim>;
153 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
154 }

◆ operator()() [9/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >=Dim), Tensor1_Expr< Tensor3_contracted_01< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim >, T, Dim, i > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< j, Dim >  ,
const Index< j, Dim >  ,
const Index< i, Dim >   
)
inline

Definition at line 243 of file Christof_value.hpp.

244 {
245 using TensorExpr
246 = Tensor3_contracted_01<Christof<T, Tensor_Dim0, Tensor_Dim12>, T, Dim>;
247 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
248 }

◆ operator()() [10/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim0 >=Dim &&Tensor_Dim12 >=Dim), Tensor1_Expr< Tensor3_contracted_01< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim >, T, Dim, i > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< j, Dim >  ,
const Index< j, Dim >  ,
const Index< i, Dim >   
) const
inline

Definition at line 174 of file Christof_value.hpp.

176 {
177 using TensorExpr
178 = Tensor3_contracted_01<Christof<T, Tensor_Dim0, Tensor_Dim12>, T, Dim>;
179 return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
180 }

◆ operator()() [11/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, char k, int Dim0, int Dim12>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim12), Dg_Expr< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim12, Dim0, i, j, k > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< k, Dim0 >  ,
const Index< i, Dim12 >  ,
const Index< j, Dim12 >   
)
inline

Definition at line 69 of file Christof_value.hpp.

71 {
72 return Dg_Expr<Christof<T, Tensor_Dim0, Tensor_Dim12>, T, Dim12, Dim0, i,
73 j, k>(*this);
74 }
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k

◆ operator()() [12/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, char k, int Dim0, int Dim12>
std::enable_if<(Tensor_Dim0 >=Dim0 &&Tensor_Dim12 >=Dim12), Dg_Expr< constChristof< T, Tensor_Dim0, Tensor_Dim12 >, T, Dim12, Dim0, i, j, k > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< k, Dim0 >  ,
const Index< i, Dim12 >  ,
const Index< j, Dim12 >   
) const
inline

Definition at line 80 of file Christof_value.hpp.

82 {
83 return Dg_Expr<const Christof<T, Tensor_Dim0, Tensor_Dim12>, T, Dim12,
84 Dim0, i, j, k>(*this);
85 }

◆ operator()() [13/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim12>
std::enable_if<(Tensor_Dim12 >=Dim12), Tensor2_symmetric_Expr< Christof_numeral_0< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T >, T, Dim12, i, j > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const int  N,
const Index< i, Dim12 >  ,
const Index< j, Dim12 >   
) const
inline

Definition at line 289 of file Christof_value.hpp.

290 {
291 using TensorExpr
292 = Christof_numeral_0<Christof<T, Tensor_Dim0, Tensor_Dim12>, T>;
293 return Tensor2_symmetric_Expr<TensorExpr, T, Dim12, i, j>(
294 TensorExpr(*this, N));
295 }

◆ operator()() [14/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
T & FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const int  N1,
const int  N2,
const int  N3 
)
inline

Definition at line 26 of file Christof_value.hpp.

27 {
28#ifdef FTENSOR_DEBUG
29 if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
30 || N3 >= Tensor_Dim12 || N3 < 0)
31 {
32 std::stringstream s;
33 s << "Bad index in Christof<T," << Tensor_Dim0 << "," << Tensor_Dim12
34 << ">.operator(" << N1 << "," << N2 << "," << N3 << ")"
35 << std::endl;
36 throw std::out_of_range(s.str());
37 }
38#endif
39 return N2 > N3 ? data[N1][N2 + (N3 * (2 * Tensor_Dim12 - N3 - 1)) / 2]
40 : data[N1][N3 + (N2 * (2 * Tensor_Dim12 - N2 - 1)) / 2];
41 }

◆ operator()() [15/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
T FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const int  N1,
const int  N2,
const int  N3 
) const
inline

Definition at line 43 of file Christof_value.hpp.

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

◆ operator()() [16/16]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int N, int Dim12>
std::enable_if<(Tensor_Dim0 >N &&Tensor_Dim12 >=Dim12), Tensor2_symmetric_Expr< Christof_number_0< Christof< T, Tensor_Dim0, Tensor_Dim12 >, T, N >, T, Dim12, i, j > >::type FTensor::Christof< T, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Number< N ,
const Index< i, Dim12 >  ,
const Index< j, Dim12 >   
) const
inline

Definition at line 271 of file Christof_value.hpp.

273 {
274 using TensorExpr
275 = Christof_number_0<Christof<T, Tensor_Dim0, Tensor_Dim12>, T, N>;
276 return Tensor2_symmetric_Expr<TensorExpr, T, Dim12, i, j>(
277 TensorExpr(*this));
278 }

Member Data Documentation

◆ data

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

Definition at line 11 of file Christof_value.hpp.


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