v0.14.0
Riemann_times_Tensor4.hpp
Go to the documentation of this file.
1 /* This file has the declaration for Riemann*Tensor4 yielding
2  a double. I simplify the expression by removing the identically
3  zero components of Riemann. */
4 
5 #pragma once
6 
7 namespace FTensor
8 {
9  /* A(i,j,k,l)*B(i,j,k,l) */
10 
11  template <class A, class B, char i, char j, char k, char l>
14  {
15  return a(1, 0, 0, 1) * b(1, 0, 0, 1) + a(2, 0, 0, 1) * b(2, 0, 0, 1)
16  + a(0, 1, 0, 1) * b(0, 1, 0, 1) + a(2, 1, 0, 1) * b(2, 1, 0, 1)
17  + a(0, 2, 0, 1) * b(0, 2, 0, 1) + a(1, 2, 0, 1) * b(1, 2, 0, 1)
18  + a(1, 0, 0, 2) * b(1, 0, 0, 2) + a(2, 0, 0, 2) * b(2, 0, 0, 2)
19  + a(0, 1, 0, 2) * b(0, 1, 0, 2) + a(2, 1, 0, 2) * b(2, 1, 0, 2)
20  + a(0, 2, 0, 2) * b(0, 2, 0, 2) + a(1, 2, 0, 2) * b(1, 2, 0, 2)
21  + a(1, 0, 1, 0) * b(1, 0, 1, 0) + a(2, 0, 1, 0) * b(2, 0, 1, 0)
22  + a(0, 1, 1, 0) * b(0, 1, 1, 0) + a(2, 1, 1, 0) * b(2, 1, 1, 0)
23  + a(0, 2, 1, 0) * b(0, 2, 1, 0) + a(1, 2, 1, 0) * b(1, 2, 1, 0)
24  + a(1, 0, 1, 2) * b(1, 0, 1, 2) + a(2, 0, 1, 2) * b(2, 0, 1, 2)
25  + a(0, 1, 1, 2) * b(0, 1, 1, 2) + a(2, 1, 1, 2) * b(2, 1, 1, 2)
26  + a(0, 2, 1, 2) * b(0, 2, 1, 2) + a(1, 2, 1, 2) * b(1, 2, 1, 2)
27  + a(1, 0, 2, 0) * b(1, 0, 2, 0) + a(2, 0, 2, 0) * b(2, 0, 2, 0)
28  + a(0, 1, 2, 0) * b(0, 1, 2, 0) + a(2, 1, 2, 0) * b(2, 1, 2, 0)
29  + a(0, 2, 2, 0) * b(0, 2, 2, 0) + a(1, 2, 2, 0) * b(1, 2, 2, 0)
30  + a(1, 0, 2, 1) * b(1, 0, 2, 1) + a(2, 0, 2, 1) * b(2, 0, 2, 1)
31  + a(0, 1, 2, 1) * b(0, 1, 2, 1) + a(2, 1, 2, 1) * b(2, 1, 2, 1)
32  + a(0, 2, 2, 1) * b(0, 2, 2, 1) + a(1, 2, 2, 1) * b(1, 2, 2, 1);
33 
34  // return a(0,0,0,0)*b(0,0,0,0) + a(1,0,0,0)*b(1,0,0,0) +
35  // a(2,0,0,0)*b(2,0,0,0)
36  // + a(0,1,0,0)*b(0,1,0,0) + a(1,1,0,0)*b(1,1,0,0) +
37  // a(2,1,0,0)*b(2,1,0,0)
38  // + a(0,2,0,0)*b(0,2,0,0) + a(1,2,0,0)*b(1,2,0,0) +
39  // a(2,2,0,0)*b(2,2,0,0)
40  // + a(0,0,0,1)*b(0,0,0,1) + a(1,0,0,1)*b(1,0,0,1) +
41  // a(2,0,0,1)*b(2,0,0,1)
42  // + a(0,1,0,1)*b(0,1,0,1) + a(1,1,0,1)*b(1,1,0,1) +
43  // a(2,1,0,1)*b(2,1,0,1)
44  // + a(0,2,0,1)*b(0,2,0,1) + a(1,2,0,1)*b(1,2,0,1) +
45  // a(2,2,0,1)*b(2,2,0,1)
46  // + a(0,0,0,2)*b(0,0,0,2) + a(1,0,0,2)*b(1,0,0,2) +
47  // a(2,0,0,2)*b(2,0,0,2)
48  // + a(0,1,0,2)*b(0,1,0,2) + a(1,1,0,2)*b(1,1,0,2) +
49  // a(2,1,0,2)*b(2,1,0,2)
50  // + a(0,2,0,2)*b(0,2,0,2) + a(1,2,0,2)*b(1,2,0,2) +
51  // a(2,2,0,2)*b(2,2,0,2)
52  // + a(0,0,1,0)*b(0,0,1,0) + a(1,0,1,0)*b(1,0,1,0) +
53  // a(2,0,1,0)*b(2,0,1,0)
54  // + a(0,1,1,0)*b(0,1,1,0) + a(1,1,1,0)*b(1,1,1,0) +
55  // a(2,1,1,0)*b(2,1,1,0)
56  // + a(0,2,1,0)*b(0,2,1,0) + a(1,2,1,0)*b(1,2,1,0) +
57  // a(2,2,1,0)*b(2,2,1,0)
58  // + a(0,0,1,1)*b(0,0,1,1) + a(1,0,1,1)*b(1,0,1,1) +
59  // a(2,0,1,1)*b(2,0,1,1)
60  // + a(0,1,1,1)*b(0,1,1,1) + a(1,1,1,1)*b(1,1,1,1) +
61  // a(2,1,1,1)*b(2,1,1,1)
62  // + a(0,2,1,1)*b(0,2,1,1) + a(1,2,1,1)*b(1,2,1,1) +
63  // a(2,2,1,1)*b(2,2,1,1)
64  // + a(0,0,1,2)*b(0,0,1,2) + a(1,0,1,2)*b(1,0,1,2) +
65  // a(2,0,1,2)*b(2,0,1,2)
66  // + a(0,1,1,2)*b(0,1,1,2) + a(1,1,1,2)*b(1,1,1,2) +
67  // a(2,1,1,2)*b(2,1,1,2)
68  // + a(0,2,1,2)*b(0,2,1,2) + a(1,2,1,2)*b(1,2,1,2) +
69  // a(2,2,1,2)*b(2,2,1,2)
70  // + a(0,0,2,0)*b(0,0,2,0) + a(1,0,2,0)*b(1,0,2,0) +
71  // a(2,0,2,0)*b(2,0,2,0)
72  // + a(0,1,2,0)*b(0,1,2,0) + a(1,1,2,0)*b(1,1,2,0) +
73  // a(2,1,2,0)*b(2,1,2,0)
74  // + a(0,2,2,0)*b(0,2,2,0) + a(1,2,2,0)*b(1,2,2,0) +
75  // a(2,2,2,0)*b(2,2,2,0)
76  // + a(0,0,2,1)*b(0,0,2,1) + a(1,0,2,1)*b(1,0,2,1) +
77  // a(2,0,2,1)*b(2,0,2,1)
78  // + a(0,1,2,1)*b(0,1,2,1) + a(1,1,2,1)*b(1,1,2,1) +
79  // a(2,1,2,1)*b(2,1,2,1)
80  // + a(0,2,2,1)*b(0,2,2,1) + a(1,2,2,1)*b(1,2,2,1) +
81  // a(2,2,2,1)*b(2,2,2,1)
82  // + a(0,0,2,2)*b(0,0,2,2) + a(1,0,2,2)*b(1,0,2,2) +
83  // a(2,0,2,2)*b(2,0,2,2)
84  // + a(0,1,2,2)*b(0,1,2,2) + a(1,1,2,2)*b(1,1,2,2) +
85  // a(2,1,2,2)*b(2,1,2,2)
86  // + a(0,2,2,2)*b(0,2,2,2) + a(1,2,2,2)*b(1,2,2,2) +
87  // a(2,2,2,2)*b(2,2,2,2);
88  }
89 
90  template <class A, class B, char i, char j, char k, char l>
93 
94  {
95  return operator*(a, b);
96  }
97 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::operator*
promote< T, U >::V operator*(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Ddg_Expr< B, U, Dim, Dim, i, k, j, l > &b)
Definition: Ddg_times_Ddg.hpp:79
FTensor::Tensor4_Expr
Definition: Tensor4_Expr.hpp:25
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Riemann_Expr
Definition: Riemann_Expr.hpp:15