v0.14.0
Functions
test_T2s_47.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_T2s_47 (const Tensor2_symmetric< double, 3 > &t2s_1, const Tensor2_symmetric< double, 3 > &t2s_2)
 

Function Documentation

◆ test_T2s_47()

void test_T2s_47 ( const Tensor2_symmetric< double, 3 > &  t2s_1,
const Tensor2_symmetric< double, 3 > &  t2s_2 
)

Definition at line 7 of file test_T2s_47.cpp.

8  {
9 
14 
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 }
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 >
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Ddg< double, 3, 3 >
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21