v0.14.0
test_T3dg_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 
8  const Dg<double, 3, 3> &t3dg_2)
9 {
13 
14  Number<0> N0;
15  Number<1> N1;
16  Number<2> N2;
17 
18  /* Dg tests */
19 
20  t1_1(i) = t3dg_2(i, j, k) * t2_2(k, j);
22  t1_1(0)
23  - (t3dg_2(0, 0, 0) * t2_2(0, 0) + t3dg_2(0, 0, 1) * t2_2(1, 0)
24  + t3dg_2(0, 0, 2) * t2_2(2, 0) + t3dg_2(0, 1, 0) * t2_2(0, 1)
25  + t3dg_2(0, 1, 1) * t2_2(1, 1) + t3dg_2(0, 1, 2) * t2_2(2, 1)
26  + t3dg_2(0, 2, 0) * t2_2(0, 2) + t3dg_2(0, 2, 1) * t2_2(1, 2)
27  + t3dg_2(0, 2, 2) * t2_2(2, 2)),
28  "T3dg(i,j,k)*T2(k,j)(0)");
30  t1_1(1)
31  - (t3dg_2(1, 0, 0) * t2_2(0, 0) + t3dg_2(1, 0, 1) * t2_2(1, 0)
32  + t3dg_2(1, 0, 2) * t2_2(2, 0) + t3dg_2(1, 1, 0) * t2_2(0, 1)
33  + t3dg_2(1, 1, 1) * t2_2(1, 1) + t3dg_2(1, 1, 2) * t2_2(2, 1)
34  + t3dg_2(1, 2, 0) * t2_2(0, 2) + t3dg_2(1, 2, 1) * t2_2(1, 2)
35  + t3dg_2(1, 2, 2) * t2_2(2, 2)),
36  "T3dg(i,j,k)*T2(k,j)(1)");
38  t1_1(2)
39  - (t3dg_2(2, 0, 0) * t2_2(0, 0) + t3dg_2(2, 0, 1) * t2_2(1, 0)
40  + t3dg_2(2, 0, 2) * t2_2(2, 0) + t3dg_2(2, 1, 0) * t2_2(0, 1)
41  + t3dg_2(2, 1, 1) * t2_2(1, 1) + t3dg_2(2, 1, 2) * t2_2(2, 1)
42  + t3dg_2(2, 2, 0) * t2_2(0, 2) + t3dg_2(2, 2, 1) * t2_2(1, 2)
43  + t3dg_2(2, 2, 2) * t2_2(2, 2)),
44  "T3dg(i,j,k)*T2(k,j)(2)");
45 
46  t1_1(i) = t2_2(k, j) * t3dg_2(i, j, k);
48  t1_1(0)
49  - (t3dg_2(0, 0, 0) * t2_2(0, 0) + t3dg_2(0, 0, 1) * t2_2(1, 0)
50  + t3dg_2(0, 0, 2) * t2_2(2, 0) + t3dg_2(0, 1, 0) * t2_2(0, 1)
51  + t3dg_2(0, 1, 1) * t2_2(1, 1) + t3dg_2(0, 1, 2) * t2_2(2, 1)
52  + t3dg_2(0, 2, 0) * t2_2(0, 2) + t3dg_2(0, 2, 1) * t2_2(1, 2)
53  + t3dg_2(0, 2, 2) * t2_2(2, 2)),
54  "T2(k,j)*T3dg(i,j,k)(0)");
56  t1_1(1)
57  - (t3dg_2(1, 0, 0) * t2_2(0, 0) + t3dg_2(1, 0, 1) * t2_2(1, 0)
58  + t3dg_2(1, 0, 2) * t2_2(2, 0) + t3dg_2(1, 1, 0) * t2_2(0, 1)
59  + t3dg_2(1, 1, 1) * t2_2(1, 1) + t3dg_2(1, 1, 2) * t2_2(2, 1)
60  + t3dg_2(1, 2, 0) * t2_2(0, 2) + t3dg_2(1, 2, 1) * t2_2(1, 2)
61  + t3dg_2(1, 2, 2) * t2_2(2, 2)),
62  "T2(k,j)*T3dg(i,j,k)(1)");
64  t1_1(2)
65  - (t3dg_2(2, 0, 0) * t2_2(0, 0) + t3dg_2(2, 0, 1) * t2_2(1, 0)
66  + t3dg_2(2, 0, 2) * t2_2(2, 0) + t3dg_2(2, 1, 0) * t2_2(0, 1)
67  + t3dg_2(2, 1, 1) * t2_2(1, 1) + t3dg_2(2, 1, 2) * t2_2(2, 1)
68  + t3dg_2(2, 2, 0) * t2_2(0, 2) + t3dg_2(2, 2, 1) * t2_2(1, 2)
69  + t3dg_2(2, 2, 2) * t2_2(2, 2)),
70  "T2(k,j)*T3dg(i,j,k)(2)");
71 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor1< double, 3 >
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 >
FTensor::Dg
Definition: Dg_value.hpp:9
std
Definition: enable_if.hpp:5
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
test_T3dg_23
void test_T3dg_23(Tensor1< double, 3 > &t1_1, const Tensor2< double, 3, 3 > &t2_2, const Dg< double, 3, 3 > &t3dg_2)
Definition: test_T3dg_23.cpp:7