v0.14.0
test_T4_04.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 {
13 
14  {
15  for(int ii = 0; ii < 1; ++ii)
16  {
17  for(int jj = 0; jj < 2; ++jj)
18  {
20  t4(i, j, k, k)(ii, jj)
21  - (t4(ii, jj, 0, 0) + t4(ii, jj, 1, 1) + t4(ii, jj, 2, 2)),
22  "T4(i,j,k,k)(" + std::to_string(ii) + "," + std::to_string(jj)
23  + ")");
24  }
25  for(int kk = 0; kk < 3; ++kk)
26  {
27  test_for_zero(t4(i, j, k, j)(ii, kk)
28  - (t4(ii, 0, kk, 0) + t4(ii, 1, kk, 1)),
29  "T4(i,j,k,j)(" + std::to_string(ii) + ","
30  + std::to_string(kk) + ")");
31  }
32  for(int ll = 0; ll < 3; ++ll)
33  {
34  test_for_zero(t4(i, j, j, l)(ii, ll)
35  - (t4(ii, 0, 0, ll) + t4(ii, 1, 1, ll)),
36  "T4(i,j,j,l)(" + std::to_string(ii) + ","
37  + std::to_string(ll) + ")");
38  }
39  }
40  for(int jj = 0; jj < 2; ++jj)
41  {
42  for(int kk = 0; kk < 3; ++kk)
43  {
44  test_for_zero(t4(i, j, k, i)(jj, kk) - (t4(0, jj, kk, 0)),
45  "T4(i,j,k,i)(" + std::to_string(jj) + ","
46  + std::to_string(kk) + ")");
47  }
48  for(int ll = 0; ll < 3; ++ll)
49  {
50  test_for_zero(t4(i, j, i, l)(jj, ll) - (t4(0, jj, 0, ll)),
51  "T4(i,j,i,l)(" + std::to_string(jj) + ","
52  + std::to_string(ll) + ")");
53  }
54  }
55  for(int kk = 0; kk < 3; ++kk)
56  for(int ll = 0; ll < 3; ++ll)
57  {
58  test_for_zero(t4(i, i, k, l)(kk, ll) - (t4(0, 0, kk, ll)),
59  "T4(i,i,k,l)(" + std::to_string(kk) + ","
60  + std::to_string(ll) + ")");
61  }
62  }
63 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
test_T4_04
void test_T4_04(const Tensor4< double, 1, 2, 3, 4 > &t4)
Definition: test_T4_04.cpp:7
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
Definition: Index.hpp:23
std
Definition: enable_if.hpp:5
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21