v0.14.0
Functions
test_T4ddg_007.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_T4ddg_007 (const Tensor2_symmetric< double, 3 > &t2s_2, const Tensor2_symmetric< double, 3 > &t2s_3)
 

Function Documentation

◆ test_T4ddg_007()

void test_T4ddg_007 ( const Tensor2_symmetric< double, 3 > &  t2s_2,
const Tensor2_symmetric< double, 3 > &  t2s_3 
)

Definition at line 7 of file test_T4ddg_007.cpp.

8  {
15 
16  Ddg<double, 3, 3> t4ddg_3_1;
17  t4ddg_3_1(i, j, k, l) = t2s_2(i, j) * t2s_3(k, l);
18 
19  {
20  Ddg<double, 3, 3> t4ddg_3_2;
21  t4ddg_3_2(i, j, k, l) = t4ddg_3_1(m, n, i, j) * t4ddg_3_1(m, n, k, l);
22  t4ddg_3_2(i, j, k, l) -=
23  (t2s_3(i, j) * t2s_3(k, l)) * (t2s_2(m, n) * t2s_2(m, n));
24  for (int ii = 0; ii != 3; ++ii)
25  for (int jj = 0; jj != 3; ++jj)
26  for (int kk = 0; kk != 3; ++kk)
27  for (int ll = 0; ll != 3; ++ll) {
28  test_for_zero(t4ddg_3_2(ii, jj, kk, ll), "t4ddg_3_2(i, j, k, l)");
29  }
30  }
31 
32  {
33  Ddg<double, 3, 3> t4ddg_3_2;
34  t4ddg_3_2(i, j, k, l) = t4ddg_3_1(i, j, m, n) * t4ddg_3_1(m, n, k, l);
35  t4ddg_3_2(i, j, k, l) -=
36  (t2s_2(i, j) * t2s_3(k, l)) * (t2s_3(m, n) * t2s_2(m, n));
37  for (int ii = 0; ii != 3; ++ii)
38  for (int jj = 0; jj != 3; ++jj)
39  for (int kk = 0; kk != 3; ++kk)
40  for (int ll = 0; ll != 3; ++ll) {
41  test_for_zero(t4ddg_3_2(ii, jj, kk, ll), "t4ddg_3_2(i, j, k, l)");
42  }
43  }
44 
45  {
46  Ddg<double, 3, 3> t4ddg_3_2;
47  t4ddg_3_2(i, j, k, l) = t4ddg_3_1(m, n, i, j) * t4ddg_3_1(k, l, m, n);
48  t4ddg_3_2(i, j, k, l) -=
49  (t2s_3(i, j) * t2s_2(k, l)) * (t2s_2(m, n) * t2s_3(m, n));
50  for (int ii = 0; ii != 3; ++ii)
51  for (int jj = 0; jj != 3; ++jj)
52  for (int kk = 0; kk != 3; ++kk)
53  for (int ll = 0; ll != 3; ++ll) {
54  test_for_zero(t4ddg_3_2(ii, jj, kk, ll), "t4ddg_3_2(i, j, k, l)");
55  }
56  }
57 
58  {
59  Ddg<double, 3, 3> t4ddg_3_2;
60  t4ddg_3_2(i, j, k, l) = t4ddg_3_1(i, j, m, n) * t4ddg_3_1(k, l, m, n);
61  t4ddg_3_2(i, j, k, l) -=
62  (t2s_2(i, j) * t2s_2(k, l)) * (t2s_3(m, n) * t2s_3(m, n));
63  for (int ii = 0; ii != 3; ++ii)
64  for (int jj = 0; jj != 3; ++jj)
65  for (int kk = 0; kk != 3; ++kk)
66  for (int ll = 0; ll != 3; ++ll) {
67  test_for_zero(t4ddg_3_2(ii, jj, kk, ll), "t4ddg_3_2(i, j, k, l)");
68  }
69  }
70 
71  Tensor1<double, 3> t1_1;
72  t1_1(0) = 1;
73  t1_1(1) = 10;
74  t1_1(2) = 100;
75 
76  {
77  Dg<double, 3, 3> t3dg_3_1, t3dg_3_2;
78  t3dg_3_1(i, j, l) = t4ddg_3_1(i, j, k, l) * t1_1(k);
79  t3dg_3_2(i, j, l) = t2s_2(i, j) * (t2s_3(k, l) * t1_1(k));
80 
81  for (int ii = 0; ii != 3; ++ii)
82  for (int jj = 0; jj != 3; ++jj)
83  for (int ll = 0; ll != 3; ++ll) {
84  test_for_zero(t3dg_3_1(ii, jj, ll) - t3dg_3_2(ii, jj, ll),
85  "t4ddg_3_1(i, j, k, l) * t1_1(k)(" + to_string(ii) +
86  "," + to_string(jj) + "," + to_string(ll) + ")");
87  }
88  }
89 
90  {
91  Christof<double, 3, 3> t3ch_3_1, t3ch_3_2;
92  t3ch_3_1(l, j, k) = t4ddg_3_1(i, j, k, l) * t1_1(i);
93  t3ch_3_2(i, j, k) = 0;
94  for (int jj = 0; jj != 3; ++jj)
95  for (int kk = 0; kk != 3; ++kk)
96  for (int ll = kk; ll != 3; ++ll) {
97  auto &v = t3ch_3_2(jj, kk, ll);
98  for (int ii = 0; ii != 3; ++ii) {
99  v += (t2s_2(ii, jj) * t1_1(ii)) * t2s_3(kk, ll);
100  }
101  }
102 
103  for (int jj = 0; jj != 3; ++jj)
104  for (int kk = 0; kk != 3; ++kk)
105  for (int ll = 0; ll != 3; ++ll) {
106  test_for_zero(t3ch_3_1(jj, kk, ll) - t3ch_3_2(jj, kk, ll),
107  "t4ddg_3_1(i, j, k, l) * t1_1(i)(" + to_string(jj) +
108  "," + to_string(kk) + "," + to_string(ll) + ")");
109  }
110 
111  Christof<double, 3, 3> t3ch_3_3;
112  t3ch_3_3(l, i, k) = t4ddg_3_1(i, j, k, l) * t1_1(j);
113  for (int jj = 0; jj != 3; ++jj)
114  for (int kk = 0; kk != 3; ++kk)
115  for (int ll = 0; ll != 3; ++ll) {
116  test_for_zero(t3ch_3_3(jj, kk, ll) - t3ch_3_2(jj, kk, ll),
117  "t4ddg_3_3(i, j, k, l) * t1_1(i)(" + to_string(jj) +
118  "," + to_string(kk) + "," + to_string(ll) + ")");
119  }
120 
121  }
122 
123 
124  {
125  Dg<double, 3, 3> t3ch_3_1, t3ch_3_2;
126  t3ch_3_1(i, j, k) = t4ddg_3_1(i, j, k, l) * t1_1(l);
127  t3ch_3_2(i, j, k) = t4ddg_3_1(i, j, l, k) * t1_1(l);;
128 
129  for (int jj = 0; jj != 3; ++jj)
130  for (int kk = 0; kk != 3; ++kk)
131  for (int ll = 0; ll != 3; ++ll) {
132  test_for_zero(t3ch_3_1(jj, kk, ll) - t3ch_3_2(jj, kk, ll),
133  "t4ddg_3_3(i, j, k, l) * t1_1(i)(" + to_string(jj) +
134  "," + to_string(kk) + "," + to_string(ll) + ")");
135  }
136  }
137 
138 }
FTensor::Christof
Definition: Christof_value.hpp:9
FTensor::Tensor1< double, 3 >
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 >
convert.n
n
Definition: convert.py:82
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
FTensor::Dg
Definition: Dg_value.hpp:9
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Ddg< double, 3, 3 >
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21