v0.14.0
Functions
test_T2s_38.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_T2s_38 (Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2, const Tensor2_symmetric< double, 3 > &t2s_2)
 

Function Documentation

◆ test_T2s_38()

void test_T2s_38 ( Tensor2< double, 3, 3 > &  t2_1,
const Tensor2< double, 3, 3 > &  t2_2,
const Tensor2_symmetric< double, 3 > &  t2s_2 
)

Definition at line 7 of file test_T2s_38.cpp.

10 {
14 
15  Number<0> N0;
16  Number<1> N1;
17  Number<2> N2;
18 
19  /* Tensor2_symmetric tests */
20 
21  t2_1(i, j) = t2s_2(i, k) * t2_2(j, k);
22  test_for_zero(t2_1(0, 0)
23  - (t2s_2(0, 0) * t2_2(0, 0) + t2s_2(0, 1) * t2_2(0, 1)
24  + t2s_2(0, 2) * t2_2(0, 2)),
25  "T2s(i,k)*T2(j,k)(0,0)");
26  test_for_zero(t2_1(0, 1)
27  - (t2s_2(0, 0) * t2_2(1, 0) + t2s_2(0, 1) * t2_2(1, 1)
28  + t2s_2(0, 2) * t2_2(1, 2)),
29  "T2s(i,k)*T2(j,k)(0,1)");
30  test_for_zero(t2_1(0, 2)
31  - (t2s_2(0, 0) * t2_2(2, 0) + t2s_2(0, 1) * t2_2(2, 1)
32  + t2s_2(0, 2) * t2_2(2, 2)),
33  "T2s(i,k)*T2(j,k)(0,2)");
34  test_for_zero(t2_1(1, 0)
35  - (t2s_2(1, 0) * t2_2(0, 0) + t2s_2(1, 1) * t2_2(0, 1)
36  + t2s_2(1, 2) * t2_2(0, 2)),
37  "T2s(i,k)*T2(j,k)(1,0)");
38  test_for_zero(t2_1(1, 1)
39  - (t2s_2(1, 0) * t2_2(1, 0) + t2s_2(1, 1) * t2_2(1, 1)
40  + t2s_2(1, 2) * t2_2(1, 2)),
41  "T2s(i,k)*T2(j,k)(1,1)");
42  test_for_zero(t2_1(1, 2)
43  - (t2s_2(1, 0) * t2_2(2, 0) + t2s_2(1, 1) * t2_2(2, 1)
44  + t2s_2(1, 2) * t2_2(2, 2)),
45  "T2s(i,k)*T2(j,k)(1,2)");
46  test_for_zero(t2_1(2, 0)
47  - (t2s_2(2, 0) * t2_2(0, 0) + t2s_2(2, 1) * t2_2(0, 1)
48  + t2s_2(2, 2) * t2_2(0, 2)),
49  "T2s(i,k)*T2(j,k)(2,0)");
50  test_for_zero(t2_1(2, 1)
51  - (t2s_2(2, 0) * t2_2(1, 0) + t2s_2(2, 1) * t2_2(1, 1)
52  + t2s_2(2, 2) * t2_2(1, 2)),
53  "T2s(i,k)*T2(j,k)(2,1)");
54  test_for_zero(t2_1(2, 2)
55  - (t2s_2(2, 0) * t2_2(2, 0) + t2s_2(2, 1) * t2_2(2, 1)
56  + t2s_2(2, 2) * t2_2(2, 2)),
57  "T2s(i,k)*T2(j,k)(2,2)");
58  t2_1(i, j) = t2_2(j, k) * t2s_2(i, k);
59  test_for_zero(t2_1(0, 0)
60  - (t2s_2(0, 0) * t2_2(0, 0) + t2s_2(0, 1) * t2_2(0, 1)
61  + t2s_2(0, 2) * t2_2(0, 2)),
62  "T2(j,k)*T2s(i,k)(0,0)");
63  test_for_zero(t2_1(0, 1)
64  - (t2s_2(0, 0) * t2_2(1, 0) + t2s_2(0, 1) * t2_2(1, 1)
65  + t2s_2(0, 2) * t2_2(1, 2)),
66  "T2(j,k)*T2s(i,k)(0,1)");
67  test_for_zero(t2_1(0, 2)
68  - (t2s_2(0, 0) * t2_2(2, 0) + t2s_2(0, 1) * t2_2(2, 1)
69  + t2s_2(0, 2) * t2_2(2, 2)),
70  "T2(j,k)*T2s(i,k)(0,2)");
71  test_for_zero(t2_1(1, 0)
72  - (t2s_2(1, 0) * t2_2(0, 0) + t2s_2(1, 1) * t2_2(0, 1)
73  + t2s_2(1, 2) * t2_2(0, 2)),
74  "T2(j,k)*T2s(i,k)(1,0)");
75  test_for_zero(t2_1(1, 1)
76  - (t2s_2(1, 0) * t2_2(1, 0) + t2s_2(1, 1) * t2_2(1, 1)
77  + t2s_2(1, 2) * t2_2(1, 2)),
78  "T2(j,k)*T2s(i,k)(1,1)");
79  test_for_zero(t2_1(1, 2)
80  - (t2s_2(1, 0) * t2_2(2, 0) + t2s_2(1, 1) * t2_2(2, 1)
81  + t2s_2(1, 2) * t2_2(2, 2)),
82  "T2(j,k)*T2s(i,k)(1,2)");
83  test_for_zero(t2_1(2, 0)
84  - (t2s_2(2, 0) * t2_2(0, 0) + t2s_2(2, 1) * t2_2(0, 1)
85  + t2s_2(2, 2) * t2_2(0, 2)),
86  "T2(j,k)*T2s(i,k)(2,0)");
87  test_for_zero(t2_1(2, 1)
88  - (t2s_2(2, 0) * t2_2(1, 0) + t2s_2(2, 1) * t2_2(1, 1)
89  + t2s_2(2, 2) * t2_2(1, 2)),
90  "T2(j,k)*T2s(i,k)(2,1)");
91  test_for_zero(t2_1(2, 2)
92  - (t2s_2(2, 0) * t2_2(2, 0) + t2s_2(2, 1) * t2_2(2, 1)
93  + t2s_2(2, 2) * t2_2(2, 2)),
94  "T2(j,k)*T2s(i,k)(2,2)");
95 }
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