v0.14.0
test_T3dg_038.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_T3dg_038(const Dg<double, 3, 3> &t3dg_2,
8  const Dg<double, 3, 3> &t3dg_3) {
12 
13  {
14  Dg<double, 3, 3> t3dg_3_1, t3dg_3_2;
15  t3dg_3_1(i, j, k) = t3dg_3(i, j, k);
16  t3dg_3_1(i, j, k) += t3dg_2(i, j, k);
17  for (int ii = 0; ii != 3;++ii)
18  for (int jj = 0; jj != 3;++jj)
19  for (int kk = 0; kk != 3;++kk) {
20  test_for_zero(t3dg_3_1(ii, jj, kk) - t3dg_2(ii, jj, kk) -
21  t3dg_3(ii, jj, kk),
22  "T3(i,j,k)+=T3(i,j,k)(" + to_string(ii) + "," +
23  to_string(jj) + "," + to_string(kk) + ")");
24  }
25 
26  t3dg_3_2(i, j, k) = t3dg_3_1(i, j, k);
27  t3dg_3_2(i, j, k) -= t3dg_3_1(i, j, k);
28  for (int ii = 0; ii != 3;++ii)
29  for (int jj = 0; jj != 3;++jj)
30  for (int kk = 0; kk != 3;++kk) {
31  test_for_zero(t3dg_3_1(ii, jj, kk) - t3dg_2(ii, jj, kk) -
32  t3dg_3(ii, jj, kk),
33  "T3(i,j,k)-=T3(i,j,k)(" + to_string(ii) + "," +
34  to_string(jj) + "," + to_string(kk) + ")");
35  }
36 
37  }
38 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
test_T3dg_038
void test_T3dg_038(const Dg< double, 3, 3 > &t3dg_2, const Dg< double, 3, 3 > &t3dg_3)
Definition: test_T3dg_038.cpp:7
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 >
FTensor::Dg
Definition: Dg_value.hpp:9
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