v0.14.0
src
ftensor
tests
conformance
T2s
test_T2s_47.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_T2s_47
(
const
Tensor2_symmetric<double, 3>
&t2s_1,
8
const
Tensor2_symmetric<double, 3>
&t2s_2) {
9
10
Index<'i', 3>
i
;
11
Index<'j', 3>
j
;
12
Index<'k', 3>
k
;
13
Index<'l', 3>
l
;
14
15
Ddg<double, 3, 3>
t4s;
16
t4s(
i
,
j
,
k
,
l
) = t2s_1(
i
,
k
) ^ t2s_2(
j
,
l
);
17
18
for
(
int
ii = 0; ii != 3; ++ii)
19
for
(
int
jj = 0; jj != 3; ++jj)
20
for
(
int
kk = 0; kk != 3; ++kk)
21
for
(
int
ll = 0; ll != 3; ++ll) {
22
23
auto
small_eval = [&](
auto
n1,
auto
n2,
auto
n3,
auto
n4) {
24
return
t2s_1(n1, n3) * t2s_2(n2, n4);
25
};
26
27
const
auto
n1 = ii;
28
const
auto
n2 = jj;
29
const
auto
n3 = kk;
30
const
auto
n4 = ll;
31
32
const
double
t
=
33
small_eval(n1, n2, n3, n4) + small_eval(n2, n1, n3, n4) +
34
small_eval(n1, n2, n4, n3) + small_eval(n2, n1, n4, n3);
35
36
test_for_zero
(t4s(ii, jj, kk, ll) -
t
,
"t2s_1(i, k) ^ t2s_2(j, k)"
);
37
38
}
39
}
FTensor
JSON compatible output.
Definition:
Christof_constructor.hpp:6
FTensor::Tensor2_symmetric
Definition:
Tensor2_symmetric_value.hpp:13
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition:
test_for_zero.hpp:7
t
constexpr double t
plate stiffness
Definition:
plate.cpp:58
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
FTensor::Ddg< double, 3, 3 >
test_T2s_47
void test_T2s_47(const Tensor2_symmetric< double, 3 > &t2s_1, const Tensor2_symmetric< double, 3 > &t2s_2)
Definition:
test_T2s_47.cpp:7
k
FTensor::Index< 'k', 3 > k
Definition:
matrix_function.cpp:20
l
FTensor::Index< 'l', 3 > l
Definition:
matrix_function.cpp:21
Generated by
Doxygen
1.8.17 and hosted at