v0.14.0
test_T3dg_20.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  const Dg<double, 3, 3> &t3dg_3)
10 {
15 
16  Number<0> N0;
17  Number<1> N1;
18  Number<2> N2;
19 
20  /* Dg tests */
21 
22  t3dg_1(i, j, k) = t3dg_2(i, j, l) * t2_2(l, k);
23  test_for_zero(t3dg_1(0, 0, 0)
24  - (t3dg_2(0, 0, 0) * t2_2(0, 0)
25  + t3dg_2(0, 0, 1) * t2_2(1, 0)
26  + t3dg_2(0, 0, 2) * t2_2(2, 0)),
27  "T3dg(i,j,l)*T2(l,k)(0,0,0)");
28  test_for_zero(t3dg_1(0, 0, 1)
29  - (t3dg_2(0, 0, 0) * t2_2(0, 1)
30  + t3dg_2(0, 0, 1) * t2_2(1, 1)
31  + t3dg_2(0, 0, 2) * t2_2(2, 1)),
32  "T3dg(i,j,l)*T2(l,k)(0,0,1)");
33  test_for_zero(t3dg_1(0, 0, 2)
34  - (t3dg_2(0, 0, 0) * t2_2(0, 2)
35  + t3dg_2(0, 0, 1) * t2_2(1, 2)
36  + t3dg_2(0, 0, 2) * t2_2(2, 2)),
37  "T3dg(i,j,l)*T2(l,k)(0,0,2)");
38  test_for_zero(t3dg_1(0, 1, 0)
39  - (t3dg_2(0, 1, 0) * t2_2(0, 0)
40  + t3dg_2(0, 1, 1) * t2_2(1, 0)
41  + t3dg_2(0, 1, 2) * t2_2(2, 0)),
42  "T3dg(i,j,l)*T2(l,k)(0,1,0)");
43  test_for_zero(t3dg_1(0, 1, 1)
44  - (t3dg_2(0, 1, 0) * t2_2(0, 1)
45  + t3dg_2(0, 1, 1) * t2_2(1, 1)
46  + t3dg_2(0, 1, 2) * t2_2(2, 1)),
47  "T3dg(i,j,l)*T2(l,k)(0,1,1)");
48  test_for_zero(t3dg_1(0, 1, 2)
49  - (t3dg_2(0, 1, 0) * t2_2(0, 2)
50  + t3dg_2(0, 1, 1) * t2_2(1, 2)
51  + t3dg_2(0, 1, 2) * t2_2(2, 2)),
52  "T3dg(i,j,l)*T2(l,k)(0,1,2)");
53  test_for_zero(t3dg_1(0, 2, 0)
54  - (t3dg_2(0, 2, 0) * t2_2(0, 0)
55  + t3dg_2(0, 2, 1) * t2_2(1, 0)
56  + t3dg_2(0, 2, 2) * t2_2(2, 0)),
57  "T3dg(i,j,l)*T2(l,k)(0,2,0)");
58  test_for_zero(t3dg_1(0, 2, 1)
59  - (t3dg_2(0, 2, 0) * t2_2(0, 1)
60  + t3dg_2(0, 2, 1) * t2_2(1, 1)
61  + t3dg_2(0, 2, 2) * t2_2(2, 1)),
62  "T3dg(i,j,l)*T2(l,k)(0,2,1)");
63  test_for_zero(t3dg_1(0, 2, 2)
64  - (t3dg_2(0, 2, 0) * t2_2(0, 2)
65  + t3dg_2(0, 2, 1) * t2_2(1, 2)
66  + t3dg_2(0, 2, 2) * t2_2(2, 2)),
67  "T3dg(i,j,l)*T2(l,k)(0,2,2)");
68  test_for_zero(t3dg_1(1, 0, 0)
69  - (t3dg_2(1, 0, 0) * t2_2(0, 0)
70  + t3dg_2(1, 0, 1) * t2_2(1, 0)
71  + t3dg_2(1, 0, 2) * t2_2(2, 0)),
72  "T3dg(i,j,l)*T2(l,k)(1,0,0)");
73  test_for_zero(t3dg_1(1, 0, 1)
74  - (t3dg_2(1, 0, 0) * t2_2(0, 1)
75  + t3dg_2(1, 0, 1) * t2_2(1, 1)
76  + t3dg_2(1, 0, 2) * t2_2(2, 1)),
77  "T3dg(i,j,l)*T2(l,k)(1,0,1)");
78  test_for_zero(t3dg_1(1, 0, 2)
79  - (t3dg_2(1, 0, 0) * t2_2(0, 2)
80  + t3dg_2(1, 0, 1) * t2_2(1, 2)
81  + t3dg_2(1, 0, 2) * t2_2(2, 2)),
82  "T3dg(i,j,l)*T2(l,k)(1,0,2)");
83  test_for_zero(t3dg_1(1, 1, 0)
84  - (t3dg_2(1, 1, 0) * t2_2(0, 0)
85  + t3dg_2(1, 1, 1) * t2_2(1, 0)
86  + t3dg_2(1, 1, 2) * t2_2(2, 0)),
87  "T3dg(i,j,l)*T2(l,k)(1,1,0)");
88  test_for_zero(t3dg_1(1, 1, 1)
89  - (t3dg_2(1, 1, 0) * t2_2(0, 1)
90  + t3dg_2(1, 1, 1) * t2_2(1, 1)
91  + t3dg_2(1, 1, 2) * t2_2(2, 1)),
92  "T3dg(i,j,l)*T2(l,k)(1,1,1)");
93  test_for_zero(t3dg_1(1, 1, 2)
94  - (t3dg_2(1, 1, 0) * t2_2(0, 2)
95  + t3dg_2(1, 1, 1) * t2_2(1, 2)
96  + t3dg_2(1, 1, 2) * t2_2(2, 2)),
97  "T3dg(i,j,l)*T2(l,k)(1,1,2)");
98  test_for_zero(t3dg_1(1, 2, 0)
99  - (t3dg_2(1, 2, 0) * t2_2(0, 0)
100  + t3dg_2(1, 2, 1) * t2_2(1, 0)
101  + t3dg_2(1, 2, 2) * t2_2(2, 0)),
102  "T3dg(i,j,l)*T2(l,k)(1,2,0)");
103  test_for_zero(t3dg_1(1, 2, 1)
104  - (t3dg_2(1, 2, 0) * t2_2(0, 1)
105  + t3dg_2(1, 2, 1) * t2_2(1, 1)
106  + t3dg_2(1, 2, 2) * t2_2(2, 1)),
107  "T3dg(i,j,l)*T2(l,k)(1,2,1)");
108  test_for_zero(t3dg_1(1, 2, 2)
109  - (t3dg_2(1, 2, 0) * t2_2(0, 2)
110  + t3dg_2(1, 2, 1) * t2_2(1, 2)
111  + t3dg_2(1, 2, 2) * t2_2(2, 2)),
112  "T3dg(i,j,l)*T2(l,k)(1,2,2)");
113  test_for_zero(t3dg_1(2, 0, 0)
114  - (t3dg_2(2, 0, 0) * t2_2(0, 0)
115  + t3dg_2(2, 0, 1) * t2_2(1, 0)
116  + t3dg_2(2, 0, 2) * t2_2(2, 0)),
117  "T3dg(i,j,l)*T2(l,k)(2,0,0)");
118  test_for_zero(t3dg_1(2, 0, 1)
119  - (t3dg_2(2, 0, 0) * t2_2(0, 1)
120  + t3dg_2(2, 0, 1) * t2_2(1, 1)
121  + t3dg_2(2, 0, 2) * t2_2(2, 1)),
122  "T3dg(i,j,l)*T2(l,k)(2,0,1)");
123  test_for_zero(t3dg_1(2, 0, 2)
124  - (t3dg_2(2, 0, 0) * t2_2(0, 2)
125  + t3dg_2(2, 0, 1) * t2_2(1, 2)
126  + t3dg_2(2, 0, 2) * t2_2(2, 2)),
127  "T3dg(i,j,l)*T2(l,k)(2,0,2)");
128  test_for_zero(t3dg_1(2, 1, 0)
129  - (t3dg_2(2, 1, 0) * t2_2(0, 0)
130  + t3dg_2(2, 1, 1) * t2_2(1, 0)
131  + t3dg_2(2, 1, 2) * t2_2(2, 0)),
132  "T3dg(i,j,l)*T2(l,k)(2,1,0)");
133  test_for_zero(t3dg_1(2, 1, 1)
134  - (t3dg_2(2, 1, 0) * t2_2(0, 1)
135  + t3dg_2(2, 1, 1) * t2_2(1, 1)
136  + t3dg_2(2, 1, 2) * t2_2(2, 1)),
137  "T3dg(i,j,l)*T2(l,k)(2,1,1)");
138  test_for_zero(t3dg_1(2, 1, 2)
139  - (t3dg_2(2, 1, 0) * t2_2(0, 2)
140  + t3dg_2(2, 1, 1) * t2_2(1, 2)
141  + t3dg_2(2, 1, 2) * t2_2(2, 2)),
142  "T3dg(i,j,l)*T2(l,k)(2,1,2)");
143  test_for_zero(t3dg_1(2, 2, 0)
144  - (t3dg_2(2, 2, 0) * t2_2(0, 0)
145  + t3dg_2(2, 2, 1) * t2_2(1, 0)
146  + t3dg_2(2, 2, 2) * t2_2(2, 0)),
147  "T3dg(i,j,l)*T2(l,k)(2,2,0)");
148  test_for_zero(t3dg_1(2, 2, 1)
149  - (t3dg_2(2, 2, 0) * t2_2(0, 1)
150  + t3dg_2(2, 2, 1) * t2_2(1, 1)
151  + t3dg_2(2, 2, 2) * t2_2(2, 1)),
152  "T3dg(i,j,l)*T2(l,k)(2,2,1)");
153  test_for_zero(t3dg_1(2, 2, 2)
154  - (t3dg_2(2, 2, 0) * t2_2(0, 2)
155  + t3dg_2(2, 2, 1) * t2_2(1, 2)
156  + t3dg_2(2, 2, 2) * t2_2(2, 2)),
157  "T3dg(i,j,l)*T2(l,k)(2,2,2)");
158 
159  t3dg_1(i, j, k) = t2_2(l, k) * t3dg_3(i, j, l);
160  test_for_zero(t3dg_1(0, 0, 0)
161  - (t3dg_3(0, 0, 0) * t2_2(0, 0)
162  + t3dg_3(0, 0, 1) * t2_2(1, 0)
163  + t3dg_3(0, 0, 2) * t2_2(2, 0)),
164  "T2(l,k)*T3dg(i,j,l)(0,0,0)");
165  test_for_zero(t3dg_1(0, 0, 1)
166  - (t3dg_3(0, 0, 0) * t2_2(0, 1)
167  + t3dg_3(0, 0, 1) * t2_2(1, 1)
168  + t3dg_3(0, 0, 2) * t2_2(2, 1)),
169  "T2(l,k)*T3dg(i,j,l)(0,0,1)");
170  test_for_zero(t3dg_1(0, 0, 2)
171  - (t3dg_3(0, 0, 0) * t2_2(0, 2)
172  + t3dg_3(0, 0, 1) * t2_2(1, 2)
173  + t3dg_3(0, 0, 2) * t2_2(2, 2)),
174  "T2(l,k)*T3dg(i,j,l)(0,0,2)");
175  test_for_zero(t3dg_1(0, 1, 0)
176  - (t3dg_3(0, 1, 0) * t2_2(0, 0)
177  + t3dg_3(0, 1, 1) * t2_2(1, 0)
178  + t3dg_3(0, 1, 2) * t2_2(2, 0)),
179  "T2(l,k)*T3dg(i,j,l)(0,1,0)");
180  test_for_zero(t3dg_1(0, 1, 1)
181  - (t3dg_3(0, 1, 0) * t2_2(0, 1)
182  + t3dg_3(0, 1, 1) * t2_2(1, 1)
183  + t3dg_3(0, 1, 2) * t2_2(2, 1)),
184  "T2(l,k)*T3dg(i,j,l)(0,1,1)");
185  test_for_zero(t3dg_1(0, 1, 2)
186  - (t3dg_3(0, 1, 0) * t2_2(0, 2)
187  + t3dg_3(0, 1, 1) * t2_2(1, 2)
188  + t3dg_3(0, 1, 2) * t2_2(2, 2)),
189  "T2(l,k)*T3dg(i,j,l)(0,1,2)");
190  test_for_zero(t3dg_1(0, 2, 0)
191  - (t3dg_3(0, 2, 0) * t2_2(0, 0)
192  + t3dg_3(0, 2, 1) * t2_2(1, 0)
193  + t3dg_3(0, 2, 2) * t2_2(2, 0)),
194  "T2(l,k)*T3dg(i,j,l)(0,2,0)");
195  test_for_zero(t3dg_1(0, 2, 1)
196  - (t3dg_3(0, 2, 0) * t2_2(0, 1)
197  + t3dg_3(0, 2, 1) * t2_2(1, 1)
198  + t3dg_3(0, 2, 2) * t2_2(2, 1)),
199  "T2(l,k)*T3dg(i,j,l)(0,2,1)");
200  test_for_zero(t3dg_1(0, 2, 2)
201  - (t3dg_3(0, 2, 0) * t2_2(0, 2)
202  + t3dg_3(0, 2, 1) * t2_2(1, 2)
203  + t3dg_3(0, 2, 2) * t2_2(2, 2)),
204  "T2(l,k)*T3dg(i,j,l)(0,2,2)");
205  test_for_zero(t3dg_1(1, 0, 0)
206  - (t3dg_3(1, 0, 0) * t2_2(0, 0)
207  + t3dg_3(1, 0, 1) * t2_2(1, 0)
208  + t3dg_3(1, 0, 2) * t2_2(2, 0)),
209  "T2(l,k)*T3dg(i,j,l)(1,0,0)");
210  test_for_zero(t3dg_1(1, 0, 1)
211  - (t3dg_3(1, 0, 0) * t2_2(0, 1)
212  + t3dg_3(1, 0, 1) * t2_2(1, 1)
213  + t3dg_3(1, 0, 2) * t2_2(2, 1)),
214  "T2(l,k)*T3dg(i,j,l)(1,0,1)");
215  test_for_zero(t3dg_1(1, 0, 2)
216  - (t3dg_3(1, 0, 0) * t2_2(0, 2)
217  + t3dg_3(1, 0, 1) * t2_2(1, 2)
218  + t3dg_3(1, 0, 2) * t2_2(2, 2)),
219  "T2(l,k)*T3dg(i,j,l)(1,0,2)");
220  test_for_zero(t3dg_1(1, 1, 0)
221  - (t3dg_3(1, 1, 0) * t2_2(0, 0)
222  + t3dg_3(1, 1, 1) * t2_2(1, 0)
223  + t3dg_3(1, 1, 2) * t2_2(2, 0)),
224  "T2(l,k)*T3dg(i,j,l)(1,1,0)");
225  test_for_zero(t3dg_1(1, 1, 1)
226  - (t3dg_3(1, 1, 0) * t2_2(0, 1)
227  + t3dg_3(1, 1, 1) * t2_2(1, 1)
228  + t3dg_3(1, 1, 2) * t2_2(2, 1)),
229  "T2(l,k)*T3dg(i,j,l)(1,1,1)");
230  test_for_zero(t3dg_1(1, 1, 2)
231  - (t3dg_3(1, 1, 0) * t2_2(0, 2)
232  + t3dg_3(1, 1, 1) * t2_2(1, 2)
233  + t3dg_3(1, 1, 2) * t2_2(2, 2)),
234  "T2(l,k)*T3dg(i,j,l)(1,1,2)");
235  test_for_zero(t3dg_1(1, 2, 0)
236  - (t3dg_3(1, 2, 0) * t2_2(0, 0)
237  + t3dg_3(1, 2, 1) * t2_2(1, 0)
238  + t3dg_3(1, 2, 2) * t2_2(2, 0)),
239  "T2(l,k)*T3dg(i,j,l)(1,2,0)");
240  test_for_zero(t3dg_1(1, 2, 1)
241  - (t3dg_3(1, 2, 0) * t2_2(0, 1)
242  + t3dg_3(1, 2, 1) * t2_2(1, 1)
243  + t3dg_3(1, 2, 2) * t2_2(2, 1)),
244  "T2(l,k)*T3dg(i,j,l)(1,2,1)");
245  test_for_zero(t3dg_1(1, 2, 2)
246  - (t3dg_3(1, 2, 0) * t2_2(0, 2)
247  + t3dg_3(1, 2, 1) * t2_2(1, 2)
248  + t3dg_3(1, 2, 2) * t2_2(2, 2)),
249  "T2(l,k)*T3dg(i,j,l)(1,2,2)");
250  test_for_zero(t3dg_1(2, 0, 0)
251  - (t3dg_3(2, 0, 0) * t2_2(0, 0)
252  + t3dg_3(2, 0, 1) * t2_2(1, 0)
253  + t3dg_3(2, 0, 2) * t2_2(2, 0)),
254  "T2(l,k)*T3dg(i,j,l)(2,0,0)");
255  test_for_zero(t3dg_1(2, 0, 1)
256  - (t3dg_3(2, 0, 0) * t2_2(0, 1)
257  + t3dg_3(2, 0, 1) * t2_2(1, 1)
258  + t3dg_3(2, 0, 2) * t2_2(2, 1)),
259  "T2(l,k)*T3dg(i,j,l)(2,0,1)");
260  test_for_zero(t3dg_1(2, 0, 2)
261  - (t3dg_3(2, 0, 0) * t2_2(0, 2)
262  + t3dg_3(2, 0, 1) * t2_2(1, 2)
263  + t3dg_3(2, 0, 2) * t2_2(2, 2)),
264  "T2(l,k)*T3dg(i,j,l)(2,0,2)");
265  test_for_zero(t3dg_1(2, 1, 0)
266  - (t3dg_3(2, 1, 0) * t2_2(0, 0)
267  + t3dg_3(2, 1, 1) * t2_2(1, 0)
268  + t3dg_3(2, 1, 2) * t2_2(2, 0)),
269  "T2(l,k)*T3dg(i,j,l)(2,1,0)");
270  test_for_zero(t3dg_1(2, 1, 1)
271  - (t3dg_3(2, 1, 0) * t2_2(0, 1)
272  + t3dg_3(2, 1, 1) * t2_2(1, 1)
273  + t3dg_3(2, 1, 2) * t2_2(2, 1)),
274  "T2(l,k)*T3dg(i,j,l)(2,1,1)");
275  test_for_zero(t3dg_1(2, 1, 2)
276  - (t3dg_3(2, 1, 0) * t2_2(0, 2)
277  + t3dg_3(2, 1, 1) * t2_2(1, 2)
278  + t3dg_3(2, 1, 2) * t2_2(2, 2)),
279  "T2(l,k)*T3dg(i,j,l)(2,1,2)");
280  test_for_zero(t3dg_1(2, 2, 0)
281  - (t3dg_3(2, 2, 0) * t2_2(0, 0)
282  + t3dg_3(2, 2, 1) * t2_2(1, 0)
283  + t3dg_3(2, 2, 2) * t2_2(2, 0)),
284  "T2(l,k)*T3dg(i,j,l)(2,2,0)");
285  test_for_zero(t3dg_1(2, 2, 1)
286  - (t3dg_3(2, 2, 0) * t2_2(0, 1)
287  + t3dg_3(2, 2, 1) * t2_2(1, 1)
288  + t3dg_3(2, 2, 2) * t2_2(2, 1)),
289  "T2(l,k)*T3dg(i,j,l)(2,2,1)");
290  test_for_zero(t3dg_1(2, 2, 2)
291  - (t3dg_3(2, 2, 0) * t2_2(0, 2)
292  + t3dg_3(2, 2, 1) * t2_2(1, 2)
293  + t3dg_3(2, 2, 2) * t2_2(2, 2)),
294  "T2(l,k)*T3dg(i,j,l)(2,2,2)");
295 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
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
test_T3dg_20
void test_T3dg_20(const Tensor2< double, 3, 3 > &t2_2, Dg< double, 3, 3 > &t3dg_1, const Dg< double, 3, 3 > &t3dg_2, const Dg< double, 3, 3 > &t3dg_3)
Definition: test_T3dg_20.cpp:7
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21