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

Function Documentation

◆ test_T4ddg_008()

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

Definition at line 7 of file test_T4ddg_008_ddg_times_t4.cpp.

10  {
11 
18 
19  Ddg<double, 3, 3> t4ddg_1;
20  t4ddg_1(i, j, k, l) = t2s_2(i, j) * t2s_3(k, l);
22  t4_1(i, j, k, l) = t2_1(i, j) * t2_2(k, l);
23 
24  {
25 
26  Tensor4<double, 3, 3, 3, 3> t4_2, t4_3, t4_4;
27 
28  t4_2(i, j, k, l) = t4ddg_1(i, j, m, n) * t4_1(m, n, k, l);
29 
30  t4_3(i, j, k, l) = 0;
31  for (int ii = 0; ii != 3; ++ii) {
32  for (int jj = 0; jj != 3; ++jj) {
33  for (int kk = 0; kk != 3; ++kk) {
34  for (int ll = 0; ll != 3; ++ll) {
35  for (int mm = 0; mm != 3; ++mm) {
36  for (int nn = 0; nn != 3; ++nn) {
37  t4_3(ii, jj, kk, ll) +=
38  t4ddg_1(ii, jj, mm, nn) * t4_1(mm, nn, kk, ll);
39  }
40  }
41  }
42  }
43  }
44  }
45 
46  for (int ii = 0; ii != 3; ++ii)
47  for (int jj = 0; jj != 3; ++jj)
48  for (int kk = 0; kk != 3; ++kk)
49  for (int ll = 0; ll != 3; ++ll) {
50  test_for_zero(t4_2(ii, jj, kk, ll) - t4_3(ii, jj, kk, ll),
51  "t4_2(i, j, k, l) = t4ddg_1(i, j, m, n) * "
52  "t4_1(m, n, k, l)");
53  }
54 
55  t4_4(i, j, k, l) = t4_1(m, n, k, l) * t4ddg_1(i, j, m, n);
56 
57 
58  for (int ii = 0; ii != 3; ++ii)
59  for (int jj = 0; jj != 3; ++jj)
60  for (int kk = 0; kk != 3; ++kk)
61  for (int ll = 0; ll != 3; ++ll) {
62  test_for_zero(t4_4(ii, jj, kk, ll) - t4_3(ii, jj, kk, ll),
63  "t4_2(i, j, k, l) = t4ddg_1(i, j, m, n) * "
64  "t4_1(m, n, k, l)");
65  }
66 
67 
68  }
69 
70 }
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition: test_for_zero.hpp:7
FTensor::Tensor4
Definition: Tensor4_value.hpp:18
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
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