v0.14.0
test_T2_23.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 
7 void test_T2_23(const Tensor1<double, 3> &t1_2,
8  const Tensor2<double, 3, 3> &t2_2)
9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
18 
19  /* Tensor2*Tensor1 */
21 
22  t1(i) = t2_2(i, j) * t1_2(j);
24  t1(0)
25  - (t2_2(0, 0) * t1_2(0) + t2_2(0, 1) * t1_2(1) + t2_2(0, 2) * t1_2(2)),
26  "T2(i,j)*T1(j)(0)");
28  t1(1)
29  - (t2_2(1, 0) * t1_2(0) + t2_2(1, 1) * t1_2(1) + t2_2(1, 2) * t1_2(2)),
30  "T2(i,j)*T1(j)(1)");
32  t1(2)
33  - (t2_2(2, 0) * t1_2(0) + t2_2(2, 1) * t1_2(1) + t2_2(2, 2) * t1_2(2)),
34  "T2(i,j)*T1(j)(2)");
35 
36  t1(i) = t1_2(j) * t2_2(i, j);
38  t1(0)
39  - (t2_2(0, 0) * t1_2(0) + t2_2(0, 1) * t1_2(1) + t2_2(0, 2) * t1_2(2)),
40  "T1(j)*T2(i,j)(0)");
42  t1(1)
43  - (t2_2(1, 0) * t1_2(0) + t2_2(1, 1) * t1_2(1) + t2_2(1, 2) * t1_2(2)),
44  "T1(j)*T2(i,j)(1)");
46  t1(2)
47  - (t2_2(2, 0) * t1_2(0) + t2_2(2, 1) * t1_2(1) + t2_2(2, 2) * t1_2(2)),
48  "T1(j)*T2(i,j)(2)");
49 
50  t1(j) = t2_2(i, j) * t1_2(i);
52  t1(0)
53  - (t2_2(0, 0) * t1_2(0) + t2_2(1, 0) * t1_2(1) + t2_2(2, 0) * t1_2(2)),
54  "T2(i,j)*T1(i)(0)");
56  t1(1)
57  - (t2_2(0, 1) * t1_2(0) + t2_2(1, 1) * t1_2(1) + t2_2(2, 1) * t1_2(2)),
58  "T2(i,j)*T1(i)(1)");
60  t1(2)
61  - (t2_2(0, 2) * t1_2(0) + t2_2(1, 2) * t1_2(1) + t2_2(2, 2) * t1_2(2)),
62  "T2(i,j)*T1(i)(2)");
63 
64  t1(j) = t1_2(i) * t2_2(i, j);
66  t1(0)
67  - (t2_2(0, 0) * t1_2(0) + t2_2(1, 0) * t1_2(1) + t2_2(2, 0) * t1_2(2)),
68  "T1(i)*T2(i,j)(0)");
70  t1(1)
71  - (t2_2(0, 1) * t1_2(0) + t2_2(1, 1) * t1_2(1) + t2_2(2, 1) * t1_2(2)),
72  "T1(i)*T2(i,j)(1)");
74  t1(2)
75  - (t2_2(0, 2) * t1_2(0) + t2_2(1, 2) * t1_2(1) + t2_2(2, 2) * t1_2(2)),
76  "T1(i)*T2(i,j)(2)");
77 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor1< double, 3 >
FTensor::Tensor2< double, 3, 3 >
test_T2_23
void test_T2_23(const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_23.cpp:7
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