v0.14.0
test_T4_008.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 
7 void test_T4_008() {
8 
13 
15 
16  for (int ii = 0; ii != 3;++ii)
17  for (int jj = 0; jj != 3;++jj)
18  for (int kk = 0; kk != 3;++kk)
19  for (int ll = 0; ll != 3;++ll)
20  t_4(ii, jj, kk, ll) = 1 + ii + 10 * jj + 100 * kk + 1000 * ll;
21 
24  for (int ii = 0; ii != 3;++ii)
25  for (int jj = ii; jj != 3;++jj) {
26  ts_2(ii, jj) = 1 + ii + 10 * jj;
27  t_2(ii, jj) = 1 + ii + 10 * jj;
28  t_2(jj, ii) = 1 + ii + 10 * jj;
29  }
30 
32  t_2_2(k, l) = t_4(i, j, k, l) * ts_2(i, j);
33  t_2_2(k, l) -= t_4(i, j, k, l) * t_2(i, j);
34  for (int ii = 0; ii != 3; ++ii)
35  for (int jj = 0; jj != 3; ++jj) {
36  test_for_zero(t_2_2(ii, jj), "T4(i,j,k,l)*Ts2(i,j)(" + to_string(ii) +
37  "," + to_string(jj) + ")");
38  }
39 
40 
41 }
test_T4_008
void test_T4_008()
Definition: test_T4_008.cpp:7
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
FTensor::Tensor2< double, 3, 3 >
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 >
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