v0.10.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 ******************************************************************************/
const double T
FTensor::Index< 'i', 3 > i
FTensor::Index< 'k', 3 > k
FTensor::Index< 'l', 3 > l
JSON compatible output.
FTensor::Index< 'j', 3 > j