v0.14.0
Functions
test_T3ch.cpp File Reference
#include "../../src/FTensor.hpp"
#include "test_for_zero.hpp"
#include <iostream>

Go to the source code of this file.

Functions

void test_T3ch (const int &, Tensor0< double * > &, const Tensor0< double * > &, Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &, Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &, const Tensor2< double, 3, 3 > &, Tensor2_symmetric< double, 3 > &t2s_1, const Tensor2_symmetric< double, 3 > &, const Tensor2_symmetric< double, 3 > &, Dg< double, 3, 3 > &, const Dg< double, 3, 3 > &t3dg_2, const Dg< double, 3, 3 > &, Christof< double, 3, 3 > &t3ch_1, const Christof< double, 3, 3 > &t3ch_2, const Christof< double, 3, 3 > &)
 

Function Documentation

◆ test_T3ch()

void test_T3ch ( const int &  ,
Tensor0< double * > &  ,
const Tensor0< double * > &  ,
Tensor1< double, 3 > &  t1_1,
const Tensor1< double, 3 > &  ,
Tensor2< double, 3, 3 > &  t2_1,
const Tensor2< double, 3, 3 > &  ,
const Tensor2< double, 3, 3 > &  ,
Tensor2_symmetric< double, 3 > &  t2s_1,
const Tensor2_symmetric< double, 3 > &  ,
const Tensor2_symmetric< double, 3 > &  ,
Dg< double, 3, 3 > &  ,
const Dg< double, 3, 3 > &  t3dg_2,
const Dg< double, 3, 3 > &  ,
Christof< double, 3, 3 > &  t3ch_1,
const Christof< double, 3, 3 > &  t3ch_2,
const Christof< double, 3, 3 > &   
)

Definition at line 7 of file test_T3ch.cpp.

18 {
22 
23  Number<0> N0;
24  Number<1> N1;
25  Number<2> N2;
26 
27  /* Tensor3_ch tests */
28 
29  /* Number in one slot */
30 
31  t2s_1(i, j) = t3ch_1(N0, i, j);
32  test_for_zero(t3ch_1(0, 0, 0) - t2s_1(0, 0), "T3ch(N,i,j)(0,0,0)");
33  test_for_zero(t3ch_1(0, 0, 1) - t2s_1(0, 1), "T3ch(N,i,j)(0,0,1)");
34  test_for_zero(t3ch_1(0, 0, 2) - t2s_1(0, 2), "T3ch(N,i,j)(0,0,2)");
35  test_for_zero(t3ch_1(0, 1, 1) - t2s_1(1, 1), "T3ch(N,i,j)(0,1,1)");
36  test_for_zero(t3ch_1(0, 1, 2) - t2s_1(1, 2), "T3ch(N,i,j)(0,1,2)");
37  test_for_zero(t3ch_1(0, 2, 2) - t2s_1(2, 2), "T3ch(N,i,j)(0,2,2)");
38  t2s_1(i, j) = t3ch_1(N1, i, j);
39  test_for_zero(t3ch_1(1, 0, 0) - t2s_1(0, 0), "T3ch(N,i,j)(1,0,0)");
40  test_for_zero(t3ch_1(1, 0, 1) - t2s_1(0, 1), "T3ch(N,i,j)(1,0,1)");
41  test_for_zero(t3ch_1(1, 0, 2) - t2s_1(0, 2), "T3ch(N,i,j)(1,0,2)");
42  test_for_zero(t3ch_1(1, 1, 1) - t2s_1(1, 1), "T3ch(N,i,j)(1,1,1)");
43  test_for_zero(t3ch_1(1, 1, 2) - t2s_1(1, 2), "T3ch(N,i,j)(1,1,2)");
44  test_for_zero(t3ch_1(1, 2, 2) - t2s_1(2, 2), "T3ch(N,i,j)(1,2,2)");
45  t2s_1(i, j) = t3ch_1(N2, i, j);
46  test_for_zero(t3ch_1(2, 0, 0) - t2s_1(0, 0), "T3ch(N,i,j)(2,0,0)");
47  test_for_zero(t3ch_1(2, 0, 1) - t2s_1(0, 1), "T3ch(N,i,j)(2,0,1)");
48  test_for_zero(t3ch_1(2, 0, 2) - t2s_1(0, 2), "T3ch(N,i,j)(2,0,2)");
49  test_for_zero(t3ch_1(2, 1, 1) - t2s_1(1, 1), "T3ch(N,i,j)(2,1,1)");
50  test_for_zero(t3ch_1(2, 1, 2) - t2s_1(1, 2), "T3ch(N,i,j)(2,1,2)");
51  test_for_zero(t3ch_1(2, 2, 2) - t2s_1(2, 2), "T3ch(N,i,j)(2,2,2)");
52 
53  /* Number in two slots */
54 
55  t1_1(i) = t3ch_1(i, N0, N0);
56  test_for_zero(t3ch_1(0, 0, 0) - t1_1(0), "T3ch(i,N,N)(0,0,0)");
57  test_for_zero(t3ch_1(1, 0, 0) - t1_1(1), "T3ch(i,N,N)(1,0,0)");
58  test_for_zero(t3ch_1(2, 0, 0) - t1_1(2), "T3ch(i,N,N)(2,0,0)");
59  t1_1(i) = t3ch_1(i, N0, N1);
60  test_for_zero(t3ch_1(0, 0, 1) - t1_1(0), "T3ch(i,N,N)(0,0,1)");
61  test_for_zero(t3ch_1(1, 0, 1) - t1_1(1), "T3ch(i,N,N)(1,0,1)");
62  test_for_zero(t3ch_1(2, 0, 1) - t1_1(2), "T3ch(i,N,N)(2,0,1)");
63  t1_1(i) = t3ch_1(i, N0, N2);
64  test_for_zero(t3ch_1(0, 0, 2) - t1_1(0), "T3ch(i,N,N)(0,0,2)");
65  test_for_zero(t3ch_1(1, 0, 2) - t1_1(1), "T3ch(i,N,N)(1,0,2)");
66  test_for_zero(t3ch_1(2, 0, 2) - t1_1(2), "T3ch(i,N,N)(2,0,2)");
67  t1_1(i) = t3ch_1(i, N1, N0);
68  test_for_zero(t3ch_1(0, 1, 0) - t1_1(0), "T3ch(i,N,N)(0,1,0)");
69  test_for_zero(t3ch_1(1, 1, 0) - t1_1(1), "T3ch(i,N,N)(1,1,0)");
70  test_for_zero(t3ch_1(2, 1, 0) - t1_1(2), "T3ch(i,N,N)(2,1,0)");
71  t1_1(i) = t3ch_1(i, N1, N1);
72  test_for_zero(t3ch_1(0, 1, 1) - t1_1(0), "T3ch(i,N,N)(0,1,1)");
73  test_for_zero(t3ch_1(1, 1, 1) - t1_1(1), "T3ch(i,N,N)(1,1,1)");
74  test_for_zero(t3ch_1(2, 1, 1) - t1_1(2), "T3ch(i,N,N)(2,1,1)");
75  t1_1(i) = t3ch_1(i, N1, N2);
76  test_for_zero(t3ch_1(0, 1, 2) - t1_1(0), "T3ch(i,N,N)(0,1,2)");
77  test_for_zero(t3ch_1(1, 1, 2) - t1_1(1), "T3ch(i,N,N)(1,1,2)");
78  test_for_zero(t3ch_1(2, 1, 2) - t1_1(2), "T3ch(i,N,N)(2,1,2)");
79  t1_1(i) = t3ch_1(i, N2, N0);
80  test_for_zero(t3ch_1(0, 2, 0) - t1_1(0), "T3ch(i,N,N)(0,2,0)");
81  test_for_zero(t3ch_1(1, 2, 0) - t1_1(1), "T3ch(i,N,N)(1,2,0)");
82  test_for_zero(t3ch_1(2, 2, 0) - t1_1(2), "T3ch(i,N,N)(2,2,0)");
83  t1_1(i) = t3ch_1(i, N2, N1);
84  test_for_zero(t3ch_1(0, 2, 1) - t1_1(0), "T3ch(i,N,N)(0,2,1)");
85  test_for_zero(t3ch_1(1, 2, 1) - t1_1(1), "T3ch(i,N,N)(1,2,1)");
86  test_for_zero(t3ch_1(2, 2, 1) - t1_1(2), "T3ch(i,N,N)(2,2,1)");
87  t1_1(i) = t3ch_1(i, N2, N2);
88  test_for_zero(t3ch_1(0, 2, 2) - t1_1(0), "T3ch(i,N,N)(0,2,2)");
89  test_for_zero(t3ch_1(1, 2, 2) - t1_1(1), "T3ch(i,N,N)(1,2,2)");
90  test_for_zero(t3ch_1(2, 2, 2) - t1_1(2), "T3ch(i,N,N)(2,2,2)");
91 
92  /* Now, test with actual numbers. */
93 
94  t2s_1(i, j) = t3ch_2(0, i, j);
95  test_for_zero(t3ch_2(0, 0, 0) - t2s_1(0, 0), "T3ch(Num,i,j)(0,0,0)");
96  test_for_zero(t3ch_2(0, 0, 1) - t2s_1(0, 1), "T3ch(Num,i,j)(0,0,1)");
97  test_for_zero(t3ch_2(0, 0, 2) - t2s_1(0, 2), "T3ch(Num,i,j)(0,0,2)");
98  test_for_zero(t3ch_2(0, 1, 0) - t2s_1(1, 0), "T3ch(Num,i,j)(0,1,0)");
99  test_for_zero(t3ch_2(0, 1, 1) - t2s_1(1, 1), "T3ch(Num,i,j)(0,1,1)");
100  test_for_zero(t3ch_2(0, 1, 2) - t2s_1(1, 2), "T3ch(Num,i,j)(0,1,2)");
101  test_for_zero(t3ch_2(0, 2, 0) - t2s_1(2, 0), "T3ch(Num,i,j)(0,2,0)");
102  test_for_zero(t3ch_2(0, 2, 1) - t2s_1(2, 1), "T3ch(Num,i,j)(0,2,1)");
103  test_for_zero(t3ch_2(0, 2, 2) - t2s_1(2, 2), "T3ch(Num,i,j)(0,2,2)");
104 
105  t2s_1(i, j) = t3ch_2(1, i, j);
106  test_for_zero(t3ch_2(1, 0, 0) - t2s_1(0, 0), "T3ch(Num,i,j)(1,0,0)");
107  test_for_zero(t3ch_2(1, 0, 1) - t2s_1(0, 1), "T3ch(Num,i,j)(1,0,1)");
108  test_for_zero(t3ch_2(1, 0, 2) - t2s_1(0, 2), "T3ch(Num,i,j)(1,0,2)");
109  test_for_zero(t3ch_2(1, 1, 0) - t2s_1(1, 0), "T3ch(Num,i,j)(1,1,0)");
110  test_for_zero(t3ch_2(1, 1, 1) - t2s_1(1, 1), "T3ch(Num,i,j)(1,1,1)");
111  test_for_zero(t3ch_2(1, 1, 2) - t2s_1(1, 2), "T3ch(Num,i,j)(1,1,2)");
112  test_for_zero(t3ch_2(1, 2, 0) - t2s_1(2, 0), "T3ch(Num,i,j)(1,2,0)");
113  test_for_zero(t3ch_2(1, 2, 1) - t2s_1(2, 1), "T3ch(Num,i,j)(1,2,1)");
114  test_for_zero(t3ch_2(1, 2, 2) - t2s_1(2, 2), "T3ch(Num,i,j)(1,2,2)");
115 
116  t2s_1(i, j) = t3ch_2(2, i, j);
117  test_for_zero(t3ch_2(2, 0, 0) - t2s_1(0, 0), "T3ch(Num,i,j)(2,0,0)");
118  test_for_zero(t3ch_2(2, 0, 1) - t2s_1(0, 1), "T3ch(Num,i,j)(2,0,1)");
119  test_for_zero(t3ch_2(2, 0, 2) - t2s_1(0, 2), "T3ch(Num,i,j)(2,0,2)");
120  test_for_zero(t3ch_2(2, 1, 0) - t2s_1(1, 0), "T3ch(Num,i,j)(2,1,0)");
121  test_for_zero(t3ch_2(2, 1, 1) - t2s_1(1, 1), "T3ch(Num,i,j)(2,1,1)");
122  test_for_zero(t3ch_2(2, 1, 2) - t2s_1(1, 2), "T3ch(Num,i,j)(2,1,2)");
123  test_for_zero(t3ch_2(2, 2, 0) - t2s_1(2, 0), "T3ch(Num,i,j)(2,2,0)");
124  test_for_zero(t3ch_2(2, 2, 1) - t2s_1(2, 1), "T3ch(Num,i,j)(2,2,1)");
125  test_for_zero(t3ch_2(2, 2, 2) - t2s_1(2, 2), "T3ch(Num,i,j)(2,2,2)");
126 
127  t2_1(i, j) = t3ch_2(j, 0, i);
128  test_for_zero(t3ch_2(0, 0, 0) - t2_1(0, 0), "T3ch(j,Num,i)(0,0,0)");
129  test_for_zero(t3ch_2(1, 0, 0) - t2_1(0, 1), "T3ch(j,Num,i)(0,0,1)");
130  test_for_zero(t3ch_2(2, 0, 0) - t2_1(0, 2), "T3ch(j,Num,i)(0,0,2)");
131  test_for_zero(t3ch_2(0, 0, 1) - t2_1(1, 0), "T3ch(j,Num,i)(0,1,0)");
132  test_for_zero(t3ch_2(1, 0, 1) - t2_1(1, 1), "T3ch(j,Num,i)(0,1,1)");
133  test_for_zero(t3ch_2(2, 0, 1) - t2_1(1, 2), "T3ch(j,Num,i)(0,1,2)");
134  test_for_zero(t3ch_2(0, 0, 2) - t2_1(2, 0), "T3ch(j,Num,i)(0,2,0)");
135  test_for_zero(t3ch_2(1, 0, 2) - t2_1(2, 1), "T3ch(j,Num,i)(0,2,1)");
136  test_for_zero(t3ch_2(2, 0, 2) - t2_1(2, 2), "T3ch(j,Num,i)(0,2,2)");
137 
138  t2_1(i, j) = t3ch_2(j, 1, i);
139  test_for_zero(t3ch_2(0, 1, 0) - t2_1(0, 0), "T3ch(j,Num,i)(1,0,0)");
140  test_for_zero(t3ch_2(1, 1, 0) - t2_1(0, 1), "T3ch(j,Num,i)(1,0,1)");
141  test_for_zero(t3ch_2(2, 1, 0) - t2_1(0, 2), "T3ch(j,Num,i)(1,0,2)");
142  test_for_zero(t3ch_2(0, 1, 1) - t2_1(1, 0), "T3ch(j,Num,i)(1,1,0)");
143  test_for_zero(t3ch_2(1, 1, 1) - t2_1(1, 1), "T3ch(j,Num,i)(1,1,1)");
144  test_for_zero(t3ch_2(2, 1, 1) - t2_1(1, 2), "T3ch(j,Num,i)(1,1,2)");
145  test_for_zero(t3ch_2(0, 1, 2) - t2_1(2, 0), "T3ch(j,Num,i)(1,2,0)");
146  test_for_zero(t3ch_2(1, 1, 2) - t2_1(2, 1), "T3ch(j,Num,i)(1,2,1)");
147  test_for_zero(t3ch_2(2, 1, 2) - t2_1(2, 2), "T3ch(j,Num,i)(1,2,2)");
148 
149  t2_1(i, j) = t3ch_2(j, 2, i);
150  test_for_zero(t3ch_2(0, 2, 0) - t2_1(0, 0), "T3ch(j,Num,i)(2,0,0)");
151  test_for_zero(t3ch_2(1, 2, 0) - t2_1(0, 1), "T3ch(j,Num,i)(2,0,1)");
152  test_for_zero(t3ch_2(2, 2, 0) - t2_1(0, 2), "T3ch(j,Num,i)(2,0,2)");
153  test_for_zero(t3ch_2(0, 2, 1) - t2_1(1, 0), "T3ch(j,Num,i)(2,1,0)");
154  test_for_zero(t3ch_2(1, 2, 1) - t2_1(1, 1), "T3ch(j,Num,i)(2,1,1)");
155  test_for_zero(t3ch_2(2, 2, 1) - t2_1(1, 2), "T3ch(j,Num,i)(2,1,2)");
156  test_for_zero(t3ch_2(0, 2, 2) - t2_1(2, 0), "T3ch(j,Num,i)(2,2,0)");
157  test_for_zero(t3ch_2(1, 2, 2) - t2_1(2, 1), "T3ch(j,Num,i)(2,2,1)");
158  test_for_zero(t3ch_2(2, 2, 2) - t2_1(2, 2), "T3ch(j,Num,i)(2,2,2)");
159 
160  t2_1(i, j) = t3ch_2(j, i, 0);
161  test_for_zero(t3ch_2(0, 0, 0) - t2_1(0, 0), "T3ch(j,i,Num)(0,0,0)");
162  test_for_zero(t3ch_2(1, 0, 0) - t2_1(0, 1), "T3ch(j,i,Num)(0,0,1)");
163  test_for_zero(t3ch_2(2, 0, 0) - t2_1(0, 2), "T3ch(j,i,Num)(0,0,2)");
164  test_for_zero(t3ch_2(0, 1, 0) - t2_1(1, 0), "T3ch(j,i,Num)(0,1,0)");
165  test_for_zero(t3ch_2(1, 1, 0) - t2_1(1, 1), "T3ch(j,i,Num)(0,1,1)");
166  test_for_zero(t3ch_2(2, 1, 0) - t2_1(1, 2), "T3ch(j,i,Num)(0,1,2)");
167  test_for_zero(t3ch_2(0, 2, 0) - t2_1(2, 0), "T3ch(j,i,Num)(0,2,0)");
168  test_for_zero(t3ch_2(1, 2, 0) - t2_1(2, 1), "T3ch(j,i,Num)(0,2,1)");
169  test_for_zero(t3ch_2(2, 2, 0) - t2_1(2, 2), "T3ch(j,i,Num)(0,2,2)");
170 
171  t2_1(i, j) = t3ch_2(j, i, 1);
172  test_for_zero(t3ch_2(0, 0, 1) - t2_1(0, 0), "T3ch(j,i,Num)(1,0,0)");
173  test_for_zero(t3ch_2(1, 0, 1) - t2_1(0, 1), "T3ch(j,i,Num)(1,0,1)");
174  test_for_zero(t3ch_2(2, 0, 1) - t2_1(0, 2), "T3ch(j,i,Num)(1,0,2)");
175  test_for_zero(t3ch_2(0, 1, 1) - t2_1(1, 0), "T3ch(j,i,Num)(1,1,0)");
176  test_for_zero(t3ch_2(1, 1, 1) - t2_1(1, 1), "T3ch(j,i,Num)(1,1,1)");
177  test_for_zero(t3ch_2(2, 1, 1) - t2_1(1, 2), "T3ch(j,i,Num)(1,1,2)");
178  test_for_zero(t3ch_2(0, 2, 1) - t2_1(2, 0), "T3ch(j,i,Num)(1,2,0)");
179  test_for_zero(t3ch_2(1, 2, 1) - t2_1(2, 1), "T3ch(j,i,Num)(1,2,1)");
180  test_for_zero(t3ch_2(2, 2, 1) - t2_1(2, 2), "T3ch(j,i,Num)(1,2,2)");
181 
182  t2_1(i, j) = t3ch_2(j, i, 2);
183  test_for_zero(t3ch_2(0, 0, 2) - t2_1(0, 0), "T3ch(j,i,Num)(2,0,0)");
184  test_for_zero(t3ch_2(1, 0, 2) - t2_1(0, 1), "T3ch(j,i,Num)(2,0,1)");
185  test_for_zero(t3ch_2(2, 0, 2) - t2_1(0, 2), "T3ch(j,i,Num)(2,0,2)");
186  test_for_zero(t3ch_2(0, 1, 2) - t2_1(1, 0), "T3ch(j,i,Num)(2,1,0)");
187  test_for_zero(t3ch_2(1, 1, 2) - t2_1(1, 1), "T3ch(j,i,Num)(2,1,1)");
188  test_for_zero(t3ch_2(2, 1, 2) - t2_1(1, 2), "T3ch(j,i,Num)(2,1,2)");
189  test_for_zero(t3ch_2(0, 2, 2) - t2_1(2, 0), "T3ch(j,i,Num)(2,2,0)");
190  test_for_zero(t3ch_2(1, 2, 2) - t2_1(2, 1), "T3ch(j,i,Num)(2,2,1)");
191  test_for_zero(t3ch_2(2, 2, 2) - t2_1(2, 2), "T3ch(j,i,Num)(2,2,2)");
192 
193  /* Assignment to double */
194 
195  t3ch_1(i, j, k) = 10;
196  test_for_zero(t3ch_1(0, 0, 0) - 10, "T3ch=T(0,0,0)");
197  test_for_zero(t3ch_1(0, 0, 1) - 10, "T3ch=T(0,0,1)");
198  test_for_zero(t3ch_1(0, 0, 2) - 10, "T3ch=T(0,0,2)");
199  test_for_zero(t3ch_1(0, 1, 0) - 10, "T3ch=T(0,1,0)");
200  test_for_zero(t3ch_1(0, 1, 1) - 10, "T3ch=T(0,1,1)");
201  test_for_zero(t3ch_1(0, 1, 2) - 10, "T3ch=T(0,1,2)");
202  test_for_zero(t3ch_1(0, 2, 0) - 10, "T3ch=T(0,2,0)");
203  test_for_zero(t3ch_1(0, 2, 1) - 10, "T3ch=T(0,2,1)");
204  test_for_zero(t3ch_1(0, 2, 2) - 10, "T3ch=T(0,2,2)");
205  test_for_zero(t3ch_1(1, 0, 0) - 10, "T3ch=T(1,0,0)");
206  test_for_zero(t3ch_1(1, 0, 1) - 10, "T3ch=T(1,0,1)");
207  test_for_zero(t3ch_1(1, 0, 2) - 10, "T3ch=T(1,0,2)");
208  test_for_zero(t3ch_1(1, 1, 0) - 10, "T3ch=T(1,1,0)");
209  test_for_zero(t3ch_1(1, 1, 1) - 10, "T3ch=T(1,1,1)");
210  test_for_zero(t3ch_1(1, 1, 2) - 10, "T3ch=T(1,1,2)");
211  test_for_zero(t3ch_1(1, 2, 0) - 10, "T3ch=T(1,2,0)");
212  test_for_zero(t3ch_1(1, 2, 1) - 10, "T3ch=T(1,2,1)");
213  test_for_zero(t3ch_1(1, 2, 2) - 10, "T3ch=T(1,2,2)");
214  test_for_zero(t3ch_1(2, 0, 0) - 10, "T3ch=T(2,0,0)");
215  test_for_zero(t3ch_1(2, 0, 1) - 10, "T3ch=T(2,0,1)");
216  test_for_zero(t3ch_1(2, 0, 2) - 10, "T3ch=T(2,0,2)");
217  test_for_zero(t3ch_1(2, 1, 0) - 10, "T3ch=T(2,1,0)");
218  test_for_zero(t3ch_1(2, 1, 1) - 10, "T3ch=T(2,1,1)");
219  test_for_zero(t3ch_1(2, 1, 2) - 10, "T3ch=T(2,1,2)");
220  test_for_zero(t3ch_1(2, 2, 0) - 10, "T3ch=T(2,2,0)");
221  test_for_zero(t3ch_1(2, 2, 1) - 10, "T3ch=T(2,2,1)");
222  test_for_zero(t3ch_1(2, 2, 2) - 10, "T3ch=T(2,2,2)");
223 
224  t3ch_1(i, j, k) = t3dg_2(j, k, i);
225  test_for_zero(t3ch_1(0, 0, 0) - t3dg_2(0, 0, 0),
226  "T3ch(i,j,k)=T3dg(j,k,i)(0,0,0)");
227  test_for_zero(t3ch_1(0, 0, 1) - t3dg_2(0, 1, 0),
228  "T3ch(i,j,k)=T3dg(j,k,i)(0,0,1)");
229  test_for_zero(t3ch_1(0, 0, 2) - t3dg_2(0, 2, 0),
230  "T3ch(i,j,k)=T3dg(j,k,i)(0,0,2)");
231  test_for_zero(t3ch_1(0, 1, 0) - t3dg_2(1, 0, 0),
232  "T3ch(i,j,k)=T3dg(j,k,i)(0,1,0)");
233  test_for_zero(t3ch_1(0, 1, 1) - t3dg_2(1, 1, 0),
234  "T3ch(i,j,k)=T3dg(j,k,i)(0,1,1)");
235  test_for_zero(t3ch_1(0, 1, 2) - t3dg_2(1, 2, 0),
236  "T3ch(i,j,k)=T3dg(j,k,i)(0,1,2)");
237  test_for_zero(t3ch_1(0, 2, 0) - t3dg_2(2, 0, 0),
238  "T3ch(i,j,k)=T3dg(j,k,i)(0,2,0)");
239  test_for_zero(t3ch_1(0, 2, 1) - t3dg_2(2, 1, 0),
240  "T3ch(i,j,k)=T3dg(j,k,i)(0,2,1)");
241  test_for_zero(t3ch_1(0, 2, 2) - t3dg_2(2, 2, 0),
242  "T3ch(i,j,k)=T3dg(j,k,i)(0,2,2)");
243  test_for_zero(t3ch_1(1, 0, 0) - t3dg_2(0, 0, 1),
244  "T3ch(i,j,k)=T3dg(j,k,i)(1,0,0)");
245  test_for_zero(t3ch_1(1, 0, 1) - t3dg_2(0, 1, 1),
246  "T3ch(i,j,k)=T3dg(j,k,i)(1,0,1)");
247  test_for_zero(t3ch_1(1, 0, 2) - t3dg_2(0, 2, 1),
248  "T3ch(i,j,k)=T3dg(j,k,i)(1,0,2)");
249  test_for_zero(t3ch_1(1, 1, 0) - t3dg_2(1, 0, 1),
250  "T3ch(i,j,k)=T3dg(j,k,i)(1,1,0)");
251  test_for_zero(t3ch_1(1, 1, 1) - t3dg_2(1, 1, 1),
252  "T3ch(i,j,k)=T3dg(j,k,i)(1,1,1)");
253  test_for_zero(t3ch_1(1, 1, 2) - t3dg_2(1, 2, 1),
254  "T3ch(i,j,k)=T3dg(j,k,i)(1,1,2)");
255  test_for_zero(t3ch_1(1, 2, 0) - t3dg_2(2, 0, 1),
256  "T3ch(i,j,k)=T3dg(j,k,i)(1,2,0)");
257  test_for_zero(t3ch_1(1, 2, 1) - t3dg_2(2, 1, 1),
258  "T3ch(i,j,k)=T3dg(j,k,i)(1,2,1)");
259  test_for_zero(t3ch_1(1, 2, 2) - t3dg_2(2, 2, 1),
260  "T3ch(i,j,k)=T3dg(j,k,i)(1,2,2)");
261  test_for_zero(t3ch_1(2, 0, 0) - t3dg_2(0, 0, 2),
262  "T3ch(i,j,k)=T3dg(j,k,i)(2,0,0)");
263  test_for_zero(t3ch_1(2, 0, 1) - t3dg_2(0, 1, 2),
264  "T3ch(i,j,k)=T3dg(j,k,i)(2,0,1)");
265  test_for_zero(t3ch_1(2, 0, 2) - t3dg_2(0, 2, 2),
266  "T3ch(i,j,k)=T3dg(j,k,i)(2,0,2)");
267  test_for_zero(t3ch_1(2, 1, 0) - t3dg_2(1, 0, 2),
268  "T3ch(i,j,k)=T3dg(j,k,i)(2,1,0)");
269  test_for_zero(t3ch_1(2, 1, 1) - t3dg_2(1, 1, 2),
270  "T3ch(i,j,k)=T3dg(j,k,i)(2,1,1)");
271  test_for_zero(t3ch_1(2, 1, 2) - t3dg_2(1, 2, 2),
272  "T3ch(i,j,k)=T3dg(j,k,i)(2,1,2)");
273  test_for_zero(t3ch_1(2, 2, 0) - t3dg_2(2, 0, 2),
274  "T3ch(i,j,k)=T3dg(j,k,i)(2,2,0)");
275  test_for_zero(t3ch_1(2, 2, 1) - t3dg_2(2, 1, 2),
276  "T3ch(i,j,k)=T3dg(j,k,i)(2,2,1)");
277  test_for_zero(t3ch_1(2, 2, 2) - t3dg_2(2, 2, 2),
278  "T3ch(i,j,k)=T3dg(j,k,i)(2,2,2)");
279 
280  t3ch_1(i, j, k) = t3ch_2(i, j, k);
281  test_for_zero(t3ch_1(0, 0, 0) - t3ch_2(0, 0, 0),
282  "T3ch(i,j,k)=T3ch(i,j,k)(0,0,0)");
283  test_for_zero(t3ch_1(0, 0, 1) - t3ch_2(0, 0, 1),
284  "T3ch(i,j,k)=T3ch(i,j,k)(0,0,1)");
285  test_for_zero(t3ch_1(0, 0, 2) - t3ch_2(0, 0, 2),
286  "T3ch(i,j,k)=T3ch(i,j,k)(0,0,2)");
287  test_for_zero(t3ch_1(0, 1, 0) - t3ch_2(0, 1, 0),
288  "T3ch(i,j,k)=T3ch(i,j,k)(0,1,0)");
289  test_for_zero(t3ch_1(0, 1, 1) - t3ch_2(0, 1, 1),
290  "T3ch(i,j,k)=T3ch(i,j,k)(0,1,1)");
291  test_for_zero(t3ch_1(0, 1, 2) - t3ch_2(0, 1, 2),
292  "T3ch(i,j,k)=T3ch(i,j,k)(0,1,2)");
293  test_for_zero(t3ch_1(0, 2, 0) - t3ch_2(0, 2, 0),
294  "T3ch(i,j,k)=T3ch(i,j,k)(0,2,0)");
295  test_for_zero(t3ch_1(0, 2, 1) - t3ch_2(0, 2, 1),
296  "T3ch(i,j,k)=T3ch(i,j,k)(0,2,1)");
297  test_for_zero(t3ch_1(0, 2, 2) - t3ch_2(0, 2, 2),
298  "T3ch(i,j,k)=T3ch(i,j,k)(0,2,2)");
299  test_for_zero(t3ch_1(1, 0, 0) - t3ch_2(1, 0, 0),
300  "T3ch(i,j,k)=T3ch(i,j,k)(1,0,0)");
301  test_for_zero(t3ch_1(1, 0, 1) - t3ch_2(1, 0, 1),
302  "T3ch(i,j,k)=T3ch(i,j,k)(1,0,1)");
303  test_for_zero(t3ch_1(1, 0, 2) - t3ch_2(1, 0, 2),
304  "T3ch(i,j,k)=T3ch(i,j,k)(1,0,2)");
305  test_for_zero(t3ch_1(1, 1, 0) - t3ch_2(1, 1, 0),
306  "T3ch(i,j,k)=T3ch(i,j,k)(1,1,0)");
307  test_for_zero(t3ch_1(1, 1, 1) - t3ch_2(1, 1, 1),
308  "T3ch(i,j,k)=T3ch(i,j,k)(1,1,1)");
309  test_for_zero(t3ch_1(1, 1, 2) - t3ch_2(1, 1, 2),
310  "T3ch(i,j,k)=T3ch(i,j,k)(1,1,2)");
311  test_for_zero(t3ch_1(1, 2, 0) - t3ch_2(1, 2, 0),
312  "T3ch(i,j,k)=T3ch(i,j,k)(1,2,0)");
313  test_for_zero(t3ch_1(1, 2, 1) - t3ch_2(1, 2, 1),
314  "T3ch(i,j,k)=T3ch(i,j,k)(1,2,1)");
315  test_for_zero(t3ch_1(1, 2, 2) - t3ch_2(1, 2, 2),
316  "T3ch(i,j,k)=T3ch(i,j,k)(1,2,2)");
317  test_for_zero(t3ch_1(2, 0, 0) - t3ch_2(2, 0, 0),
318  "T3ch(i,j,k)=T3ch(i,j,k)(2,0,0)");
319  test_for_zero(t3ch_1(2, 0, 1) - t3ch_2(2, 0, 1),
320  "T3ch(i,j,k)=T3ch(i,j,k)(2,0,1)");
321  test_for_zero(t3ch_1(2, 0, 2) - t3ch_2(2, 0, 2),
322  "T3ch(i,j,k)=T3ch(i,j,k)(2,0,2)");
323  test_for_zero(t3ch_1(2, 1, 0) - t3ch_2(2, 1, 0),
324  "T3ch(i,j,k)=T3ch(i,j,k)(2,1,0)");
325  test_for_zero(t3ch_1(2, 1, 1) - t3ch_2(2, 1, 1),
326  "T3ch(i,j,k)=T3ch(i,j,k)(2,1,1)");
327  test_for_zero(t3ch_1(2, 1, 2) - t3ch_2(2, 1, 2),
328  "T3ch(i,j,k)=T3ch(i,j,k)(2,1,2)");
329  test_for_zero(t3ch_1(2, 2, 0) - t3ch_2(2, 2, 0),
330  "T3ch(i,j,k)=T3ch(i,j,k)(2,2,0)");
331  test_for_zero(t3ch_1(2, 2, 1) - t3ch_2(2, 2, 1),
332  "T3ch(i,j,k)=T3ch(i,j,k)(2,2,1)");
333  test_for_zero(t3ch_1(2, 2, 2) - t3ch_2(2, 2, 2),
334  "T3ch(i,j,k)=T3ch(i,j,k)(2,2,2)");
335 
336  t1_1(i) = t3ch_1(i, j, j);
337  test_for_zero(t1_1(0)
338  - (t3ch_1(0, 0, 0) + t3ch_1(0, 1, 1) + t3ch_1(0, 2, 2)),
339  "t3ch(i,j,j)(0)");
340  test_for_zero(t1_1(1)
341  - (t3ch_1(1, 0, 0) + t3ch_1(1, 1, 1) + t3ch_1(1, 2, 2)),
342  "t3ch(i,j,j)(1)");
343  test_for_zero(t1_1(2)
344  - (t3ch_1(2, 0, 0) + t3ch_1(2, 1, 1) + t3ch_1(2, 2, 2)),
345  "t3ch(i,j,j)(2)");
346  t1_1(i) = t3ch_1(j, i, j);
347  test_for_zero(t1_1(0)
348  - (t3ch_1(0, 0, 0) + t3ch_1(1, 0, 1) + t3ch_1(2, 0, 2)),
349  "t3ch(j,i,j)(0)");
350  test_for_zero(t1_1(1)
351  - (t3ch_1(0, 1, 0) + t3ch_1(1, 1, 1) + t3ch_1(2, 1, 2)),
352  "t3ch(j,i,j)(1)");
353  test_for_zero(t1_1(2)
354  - (t3ch_1(0, 2, 0) + t3ch_1(1, 2, 1) + t3ch_1(2, 2, 2)),
355  "t3ch(j,i,j)(2)");
356  t1_1(i) = t3ch_1(j, j, i);
357  test_for_zero(t1_1(0)
358  - (t3ch_1(0, 0, 0) + t3ch_1(1, 1, 0) + t3ch_1(2, 2, 0)),
359  "t3ch(j,j,i)(0)");
360  test_for_zero(t1_1(1)
361  - (t3ch_1(0, 0, 1) + t3ch_1(1, 1, 1) + t3ch_1(2, 2, 1)),
362  "t3ch(j,j,i)(1)");
363  test_for_zero(t1_1(2)
364  - (t3ch_1(0, 0, 2) + t3ch_1(1, 1, 2) + t3ch_1(2, 2, 2)),
365  "t3ch(j,j,i)(2)");
366 }
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 >
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20