v0.14.0
test_T2s_37.cpp
Go to the documentation of this file.
1 #include "../../../src/FTensor.hpp"
2 #include "../test_for_zero.hpp"
3 #include <iostream>
4 using namespace FTensor;
5 using namespace std;
6 
8  const Tensor2<double, 3, 3> &t2_2,
9  const Tensor2_symmetric<double, 3> &t2s_2)
10 {
14 
15  Number<0> N0;
16  Number<1> N1;
17  Number<2> N2;
18 
19  /* Tensor2_symmetric tests */
20 
21  t2_1(i, j) = t2s_2(i, k) * t2_2(k, j);
22  test_for_zero(t2_1(0, 0)
23  - (t2s_2(0, 0) * t2_2(0, 0) + t2s_2(0, 1) * t2_2(1, 0)
24  + t2s_2(0, 2) * t2_2(2, 0)),
25  "T2s(i,k)*T2(k,j)(0,0)");
26  test_for_zero(t2_1(0, 1)
27  - (t2s_2(0, 0) * t2_2(0, 1) + t2s_2(0, 1) * t2_2(1, 1)
28  + t2s_2(0, 2) * t2_2(2, 1)),
29  "T2s(i,k)*T2(k,j)(0,1)");
30  test_for_zero(t2_1(0, 2)
31  - (t2s_2(0, 0) * t2_2(0, 2) + t2s_2(0, 1) * t2_2(1, 2)
32  + t2s_2(0, 2) * t2_2(2, 2)),
33  "T2s(i,k)*T2(k,j)(0,2)");
34  test_for_zero(t2_1(1, 0)
35  - (t2s_2(1, 0) * t2_2(0, 0) + t2s_2(1, 1) * t2_2(1, 0)
36  + t2s_2(1, 2) * t2_2(2, 0)),
37  "T2s(i,k)*T2(k,j)(1,0)");
38  test_for_zero(t2_1(1, 1)
39  - (t2s_2(1, 0) * t2_2(0, 1) + t2s_2(1, 1) * t2_2(1, 1)
40  + t2s_2(1, 2) * t2_2(2, 1)),
41  "T2s(i,k)*T2(k,j)(1,1)");
42  test_for_zero(t2_1(1, 2)
43  - (t2s_2(1, 0) * t2_2(0, 2) + t2s_2(1, 1) * t2_2(1, 2)
44  + t2s_2(1, 2) * t2_2(2, 2)),
45  "T2s(i,k)*T2(k,j)(1,2)");
46  test_for_zero(t2_1(2, 0)
47  - (t2s_2(2, 0) * t2_2(0, 0) + t2s_2(2, 1) * t2_2(1, 0)
48  + t2s_2(2, 2) * t2_2(2, 0)),
49  "T2s(i,k)*T2(k,j)(2,0)");
50  test_for_zero(t2_1(2, 1)
51  - (t2s_2(2, 0) * t2_2(0, 1) + t2s_2(2, 1) * t2_2(1, 1)
52  + t2s_2(2, 2) * t2_2(2, 1)),
53  "T2s(i,k)*T2(k,j)(2,1)");
54  test_for_zero(t2_1(2, 2)
55  - (t2s_2(2, 0) * t2_2(0, 2) + t2s_2(2, 1) * t2_2(1, 2)
56  + t2s_2(2, 2) * t2_2(2, 2)),
57  "T2s(i,k)*T2(k,j)(2,2)");
58  t2_1(i, j) = t2_2(k, j) * t2s_2(i, k);
59  test_for_zero(t2_1(0, 0)
60  - (t2s_2(0, 0) * t2_2(0, 0) + t2s_2(0, 1) * t2_2(1, 0)
61  + t2s_2(0, 2) * t2_2(2, 0)),
62  "T2(k,j)*T2s(i,k)(0,0)");
63  test_for_zero(t2_1(0, 1)
64  - (t2s_2(0, 0) * t2_2(0, 1) + t2s_2(0, 1) * t2_2(1, 1)
65  + t2s_2(0, 2) * t2_2(2, 1)),
66  "T2(k,j)*T2s(i,k)(0,1)");
67  test_for_zero(t2_1(0, 2)
68  - (t2s_2(0, 0) * t2_2(0, 2) + t2s_2(0, 1) * t2_2(1, 2)
69  + t2s_2(0, 2) * t2_2(2, 2)),
70  "T2(k,j)*T2s(i,k)(0,2)");
71  test_for_zero(t2_1(1, 0)
72  - (t2s_2(1, 0) * t2_2(0, 0) + t2s_2(1, 1) * t2_2(1, 0)
73  + t2s_2(1, 2) * t2_2(2, 0)),
74  "T2(k,j)*T2s(i,k)(1,0)");
75  test_for_zero(t2_1(1, 1)
76  - (t2s_2(1, 0) * t2_2(0, 1) + t2s_2(1, 1) * t2_2(1, 1)
77  + t2s_2(1, 2) * t2_2(2, 1)),
78  "T2(k,j)*T2s(i,k)(1,1)");
79  test_for_zero(t2_1(1, 2)
80  - (t2s_2(1, 0) * t2_2(0, 2) + t2s_2(1, 1) * t2_2(1, 2)
81  + t2s_2(1, 2) * t2_2(2, 2)),
82  "T2(k,j)*T2s(i,k)(1,2)");
83  test_for_zero(t2_1(2, 0)
84  - (t2s_2(2, 0) * t2_2(0, 0) + t2s_2(2, 1) * t2_2(1, 0)
85  + t2s_2(2, 2) * t2_2(2, 0)),
86  "T2(k,j)*T2s(i,k)(2,0)");
87  test_for_zero(t2_1(2, 1)
88  - (t2s_2(2, 0) * t2_2(0, 1) + t2s_2(2, 1) * t2_2(1, 1)
89  + t2s_2(2, 2) * t2_2(2, 1)),
90  "T2(k,j)*T2s(i,k)(2,1)");
91  test_for_zero(t2_1(2, 2)
92  - (t2s_2(2, 0) * t2_2(0, 2) + t2s_2(2, 1) * t2_2(1, 2)
93  + t2s_2(2, 2) * t2_2(2, 2)),
94  "T2(k,j)*T2s(i,k)(2,2)");
95 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
FTensor::Tensor2< double, 3, 3 >
FTensor::Number< 0 >
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition: test_for_zero.hpp:7
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
std
Definition: enable_if.hpp:5
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
test_T2s_37
void test_T2s_37(Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2, const Tensor2_symmetric< double, 3 > &t2s_2)
Definition: test_T2s_37.cpp:7
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20