v0.14.0
test_T3dg_17.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 
9  const Dg<double, 3, 3> &t3dg_2,
10  const Dg<double, 3, 3> &t3dg_3)
11 {
15 
16  Number<0> N0;
17  Number<1> N1;
18  Number<2> N2;
19 
20  /* Dg tests */
21 
22  t2s_1(i, j) = t3dg_2(i, j, k) * t1_2(k);
23  test_for_zero(t2s_1(0, 0)
24  - (t3dg_2(0, 0, 0) * t1_2(0) + t3dg_2(0, 0, 1) * t1_2(1)
25  + t3dg_2(0, 0, 2) * t1_2(2)),
26  "T3dg(i,j,k)*T1(k)(0,0)");
27  test_for_zero(t2s_1(0, 1)
28  - (t3dg_2(0, 1, 0) * t1_2(0) + t3dg_2(0, 1, 1) * t1_2(1)
29  + t3dg_2(0, 1, 2) * t1_2(2)),
30  "T3dg(i,j,k)*T1(k)(0,1)");
31  test_for_zero(t2s_1(0, 2)
32  - (t3dg_2(0, 2, 0) * t1_2(0) + t3dg_2(0, 2, 1) * t1_2(1)
33  + t3dg_2(0, 2, 2) * t1_2(2)),
34  "T3dg(i,j,k)*T1(k)(0,2)");
35  test_for_zero(t2s_1(1, 0)
36  - (t3dg_2(1, 0, 0) * t1_2(0) + t3dg_2(1, 0, 1) * t1_2(1)
37  + t3dg_2(1, 0, 2) * t1_2(2)),
38  "T3dg(i,j,k)*T1(k)(1,0)");
39  test_for_zero(t2s_1(1, 1)
40  - (t3dg_2(1, 1, 0) * t1_2(0) + t3dg_2(1, 1, 1) * t1_2(1)
41  + t3dg_2(1, 1, 2) * t1_2(2)),
42  "T3dg(i,j,k)*T1(k)(1,1)");
43  test_for_zero(t2s_1(1, 2)
44  - (t3dg_2(1, 2, 0) * t1_2(0) + t3dg_2(1, 2, 1) * t1_2(1)
45  + t3dg_2(1, 2, 2) * t1_2(2)),
46  "T3dg(i,j,k)*T1(k)(1,2)");
47  test_for_zero(t2s_1(2, 0)
48  - (t3dg_2(2, 0, 0) * t1_2(0) + t3dg_2(2, 0, 1) * t1_2(1)
49  + t3dg_2(2, 0, 2) * t1_2(2)),
50  "T3dg(i,j,k)*T1(k)(2,0)");
51  test_for_zero(t2s_1(2, 1)
52  - (t3dg_2(2, 1, 0) * t1_2(0) + t3dg_2(2, 1, 1) * t1_2(1)
53  + t3dg_2(2, 1, 2) * t1_2(2)),
54  "T3dg(i,j,k)*T1(k)(2,1)");
55  test_for_zero(t2s_1(2, 2)
56  - (t3dg_2(2, 2, 0) * t1_2(0) + t3dg_2(2, 2, 1) * t1_2(1)
57  + t3dg_2(2, 2, 2) * t1_2(2)),
58  "T3dg(i,j,k)*T1(k)(2,2)");
59 
60  t2s_1(i, j) = t1_2(k) * t3dg_3(i, j, k);
61  test_for_zero(t2s_1(0, 0)
62  - (t3dg_3(0, 0, 0) * t1_2(0) + t3dg_3(0, 0, 1) * t1_2(1)
63  + t3dg_3(0, 0, 2) * t1_2(2)),
64  "T1(k)*T3dg(i,j,k)(0,0)");
65  test_for_zero(t2s_1(0, 1)
66  - (t3dg_3(0, 1, 0) * t1_2(0) + t3dg_3(0, 1, 1) * t1_2(1)
67  + t3dg_3(0, 1, 2) * t1_2(2)),
68  "T1(k)*T3dg(i,j,k)(0,1)");
69  test_for_zero(t2s_1(0, 2)
70  - (t3dg_3(0, 2, 0) * t1_2(0) + t3dg_3(0, 2, 1) * t1_2(1)
71  + t3dg_3(0, 2, 2) * t1_2(2)),
72  "T1(k)*T3dg(i,j,k)(0,2)");
73  test_for_zero(t2s_1(1, 0)
74  - (t3dg_3(1, 0, 0) * t1_2(0) + t3dg_3(1, 0, 1) * t1_2(1)
75  + t3dg_3(1, 0, 2) * t1_2(2)),
76  "T1(k)*T3dg(i,j,k)(1,0)");
77  test_for_zero(t2s_1(1, 1)
78  - (t3dg_3(1, 1, 0) * t1_2(0) + t3dg_3(1, 1, 1) * t1_2(1)
79  + t3dg_3(1, 1, 2) * t1_2(2)),
80  "T1(k)*T3dg(i,j,k)(1,1)");
81  test_for_zero(t2s_1(1, 2)
82  - (t3dg_3(1, 2, 0) * t1_2(0) + t3dg_3(1, 2, 1) * t1_2(1)
83  + t3dg_3(1, 2, 2) * t1_2(2)),
84  "T1(k)*T3dg(i,j,k)(1,2)");
85  test_for_zero(t2s_1(2, 0)
86  - (t3dg_3(2, 0, 0) * t1_2(0) + t3dg_3(2, 0, 1) * t1_2(1)
87  + t3dg_3(2, 0, 2) * t1_2(2)),
88  "T1(k)*T3dg(i,j,k)(2,0)");
89  test_for_zero(t2s_1(2, 1)
90  - (t3dg_3(2, 1, 0) * t1_2(0) + t3dg_3(2, 1, 1) * t1_2(1)
91  + t3dg_3(2, 1, 2) * t1_2(2)),
92  "T1(k)*T3dg(i,j,k)(2,1)");
93  test_for_zero(t2s_1(2, 2)
94  - (t3dg_3(2, 2, 0) * t1_2(0) + t3dg_3(2, 2, 1) * t1_2(1)
95  + t3dg_3(2, 2, 2) * t1_2(2)),
96  "T1(k)*T3dg(i,j,k)(2,2)");
97 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor1< double, 3 >
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
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 >
FTensor::Dg
Definition: Dg_value.hpp:9
std
Definition: enable_if.hpp:5
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
test_T3dg_17
void test_T3dg_17(const Tensor1< double, 3 > &t1_2, Tensor2_symmetric< double, 3 > &t2s_1, const Dg< double, 3, 3 > &t3dg_2, const Dg< double, 3, 3 > &t3dg_3)
Definition: test_T3dg_17.cpp:7
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20