v0.14.0
FTensor.hpp
Go to the documentation of this file.
1 /** \file FTensor.hpp
2 * \brief Tensors class implemented by Walter Landry.
3 * \ingroup ftensor
4 
5 *
6 * The main repository is available under link
7 <https://bitbucket.org/wlandry/ftensor>.
8 * For more details look at reference \cite landry2003implementing.
9 * See link <http://www.wlandry.net/Presentations/FTensor.pdf>.
10 *
11 * Note this implementation is modified for proposes of MoFEM.
12 *
13 */
14 
15 /* Include file for the Fast Tensor classes (FTensor). Everything is
16  in namespace FTensor. */
17 
18 #pragma once
19 
20 #include <cmath>
21 #include <complex>
22 #include <type_traits>
23 #include <array>
24 
25 #ifdef FTENSOR_DEBUG
26 #include <iostream>
27 #include <sstream>
28 #include <stdexcept>
29 #endif
30 #include "FTensor/Layout.hpp"
31 
32 #ifdef WITH_ADOL_C
33 #include <adolc/adolc.h>
34 #include <adolc/adtl.h>
35 #endif
36 
37 /**
38  * \brief Tensors class implemented by Walter Landry.
39  * \ingroup ftensor
40 
41 
42  * The main repository is available under link
43  <https://bitbucket.org/wlandry/ftensor>.
44  * For more details look at reference \cite landry2003implementing.
45  * See link <http://www.wlandry.net/Presentations/FTensor.pdf>.
46  *
47  * Note this implementation is modified for proposes of MoFEM.
48 
49  */
50 namespace FTensor
51 {
52  template <class T> class Tensor0;
53 
54  template <class T, const int I> class PackPtr
55  {};
56 
57  template <class T, int Dim> class Tensor1;
58  template <class A, class T, int Dim, char i> class Tensor1_Expr;
59 
60  template <class T, int Dim1, int Dim2>
61  class Tensor2;
62  template <class A, class T, int Dim1, int Dim2, char i, char j>
63  class Tensor2_Expr;
64  template <class A, class T, int N> class Tensor2_number_rhs_0;
65  template <class A, class T, int N> class Tensor2_number_rhs_1;
66 
67  template <class T, int Dim> class Tensor2_symmetric;
68  template <class A, class T, int Dim, char i, char j>
70 
71  template <class T, int Dim> class Tensor2_antisymmetric;
72  template <class A, class T, int Dim, char i, char j>
74 
75  template <class T, int Dim0, int Dim1, int Dim2> class Tensor3;
76  template <class A, class T, int Dim0, int Dim1, int Dim2, char i, char j,
77  char k>
78  class Tensor3_Expr;
79  template <class A, class T, int N> class Tensor3_number_rhs_0;
80  template <class A, class T, int N> class Tensor3_number_rhs_2;
81  template <class A, class T, int N> class Tensor3_number_rhs_2;
82  template <class A, class T, int N1, int N2> class Tensor3_number_rhs_01;
83  template <class A, class T, int N1, int N2> class Tensor3_number_rhs_02;
84  template <class A, class T, int N1, int N2> class Tensor3_number_rhs_12;
85 
86  template <class T, int Dim01, int Dim2> class Dg;
87  template <class A, class T, int Dim01, int Dim2, char i, char j, char k>
88  class Dg_Expr;
89  template <class A, class T, int N> class Dg_number_rhs_0;
90  template <class A, class T, int N> class Dg_number_rhs_2;
91  template <class A, class T, int N1, int N2> class Dg_number_rhs_01;
92  template <class A, class T, int N1, int N2> class Dg_number_rhs_12;
93 
94  template <class T, int Dim0, int Dim12> class Christof;
95  template <class A, class T, int Dim0, int Dim12, char i, char j, char k>
97 
98  template <class T, int Dim0, int Dim12> class Tensor3_antisymmetric;
99  template <class A, class T, int Dim0, int Dim12, char i, char j, char k>
101 
102  template <class T, int Dim0, int Dim1, int Dim2, int Dim3> class Tensor4;
103  template <class A, class T, int Dim0, int Dim1, int Dim2, int Dim3, char i,
104  char j, char k, char l>
105  class Tensor4_Expr;
106 
107  template <class T, int Dim> class Riemann;
108  template <class A, class T, int Dim, char i, char j, char k, char l>
109  class Riemann_Expr;
110 
111  template <class T, int Dim01, int Dim23> class Ddg;
112  template <class A, class T, int Dim01, int Dim23, char i, char j, char k,
113  char l>
114  class Ddg_Expr;
115  template <class A, class T, int N0, int N1> class Ddg_number_rhs_01;
116  template <class A, class T, int N0> class Ddg_number_rhs_0;
117 
118 }
119 
120 #include "FTensor/Index.hpp"
121 #include "FTensor/Number.hpp"
122 #include "FTensor/promote.hpp"
123 
124 #include "FTensor/Levi_Civita.hpp"
125 #include "FTensor/cross.hpp"
127 
128 #include "FTensor/Christof.hpp"
129 #include "FTensor/Ddg.hpp"
130 #include "FTensor/Dg.hpp"
131 #include "FTensor/Riemann.hpp"
132 #include "FTensor/Tensor0.hpp"
133 #include "FTensor/Tensor1.hpp"
134 #include "FTensor/Tensor2.hpp"
137 #include "FTensor/Tensor3.hpp"
140 #include "FTensor/Tensor4.hpp"
142 
143 /***************************************************************************/ /**
144 * \defgroup ftensor Tensor template library
145 * \brief Efficient Template Tensor library
146 ******************************************************************************/
FTensor::Christof
Definition: Christof_value.hpp:9
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
Kronecker_Delta.hpp
cross.hpp
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
Tensor3.hpp
FTensor::Tensor2_antisymmetric_Expr
Definition: Tensor2_antisymmetric_Expr.hpp:9
FTensor::Tensor2_symmetric_Expr
Definition: Tensor2_symmetric_Expr.hpp:36
FTensor::Tensor2_number_rhs_1
Definition: Tensor2_number.hpp:29
FTensor::Tensor3_number_rhs_02
Definition: Tensor3_number.hpp:76
Tensor1.hpp
FTensor::Tensor2_Expr
Definition: Tensor2_Expr.hpp:26
Tensor4_contracted.hpp
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
Riemann.hpp
FTensor::Tensor3_antisymmetric_Expr
Definition: Tensor3_antisymmetric_Expr.hpp:18
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
FTensor::Ddg_Expr
Definition: Ddg_Expr.hpp:28
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
FTensor::Tensor3_number_rhs_0
Definition: Tensor3_number.hpp:20
Tensor3_antisymmetric.hpp
Tensor4.hpp
Tensor2_antisymmetric.hpp
FTensor::Tensor4_Expr
Definition: Tensor4_Expr.hpp:25
Number.hpp
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
FTensor::Tensor3_number_rhs_01
Definition: Tensor3_number.hpp:62
FTensor::Tensor1_Expr
Definition: Tensor1_Expr.hpp:27
FTensor::Tensor3_antisymmetric
Definition: Tensor3_antisymmetric_value.hpp:8
FTensor::Tensor3_number_rhs_12
Definition: Tensor3_number.hpp:90
Christof.hpp
FTensor::Riemann_Expr
Definition: Riemann_Expr.hpp:15
Ddg.hpp
FTensor::Dg_number_rhs_2
Definition: Dg_number.hpp:34
Dg.hpp
FTensor::Tensor2_antisymmetric
Definition: Tensor2_antisymmetric_value.hpp:9
FTensor::Riemann
Definition: Riemann.hpp:10
Index.hpp
FTensor::PackPtr
Definition: FTensor.hpp:54
FTensor::Tensor3_Expr
Definition: Tensor3_Expr.hpp:24
Layout.hpp
Tensor2_symmetric.hpp
FTensor::Tensor4
Definition: Tensor4_value.hpp:18
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
Tensor0.hpp
FTensor::Ddg_number_rhs_01
Definition: Ddg_number.hpp:23
FTensor::Dg
Definition: Dg_value.hpp:9
FTensor::Dg_Expr
Definition: Dg_Expr.hpp:25
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Ddg
Definition: Ddg_value.hpp:7
Levi_Civita.hpp
FTensor::Dg_number_rhs_01
Definition: Dg_number.hpp:62
FTensor::Christof_Expr
Definition: FTensor.hpp:96
FTensor::Tensor2_number_rhs_0
Definition: Tensor2_number.hpp:26
Tensor2.hpp
FTensor::Dg_number_rhs_12
Definition: Dg_number.hpp:48
promote.hpp
FTensor::Tensor3_number_rhs_2
Definition: Tensor3_number.hpp:48
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
FTensor::Dg_number_rhs_0
Definition: Dg_number.hpp:20
Tensor3_contracted.hpp
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
FTensor::Ddg_number_rhs_0
Definition: Ddg_number.hpp:40