v0.14.0
dTensor2_symmetric.hpp
Go to the documentation of this file.
1 /* Takes a derivative of a Tensor2_symmetric, yielding a Dg. */
2 
3 #pragma once
4 
5 namespace FTensor
6 {
7  template <class T, int Dim01, int Dim2, char i, char j, char k>
9  {
13 
14  public:
15  typename promote<T, double>::V
16  operator()(const int N1, const int N2, const int N3) const
17  {
18  return (*(a.ptr(N1, N2) + d_ijk(N3)) - *(a.ptr(N1, N2) - d_ijk(N3)))
19  * d_xyz(N3) * 0.5;
20  }
22  const Tensor1<int, Dim2> &D_ijk,
23  const Tensor1<double, Dim2> &D_xyz)
24  : a(A), d_ijk(D_ijk), d_xyz(D_xyz)
25  {}
26  };
27 
28  template <class T, int Dim01, int Dim2, char i, char j, char k>
29  const Dg_Expr<const dTensor2_symmetric<T, Dim01, Dim2, i, j, k>,
30  typename promote<T, double>::V, Dim01, Dim2, i, j, k>
32  const Index<j, Dim01> index2, const Index<k, Dim2> index3,
33  const Tensor1<int, Dim2> &d_ijk, const Tensor1<double, Dim2> &d_xyz)
34  {
37  j, k>(TensorExpr(a, d_ijk, d_xyz));
38  }
39 }
FTensor::dTensor2_symmetric::d_ijk
const Tensor1< int, Dim2 > & d_ijk
Definition: dTensor2_symmetric.hpp:11
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor1< int, Dim2 >
FTensor::dTensor2_symmetric::d_xyz
const Tensor1< double, Dim2 > & d_xyz
Definition: dTensor2_symmetric.hpp:12
FTensor::d
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::dTensor2_symmetric::a
const Tensor2_symmetric< T *, Dim01 > & a
Definition: dTensor2_symmetric.hpp:10
FTensor::Tensor2_symmetric< T *, Dim01 >
FTensor::dTensor2_symmetric
Definition: dTensor2_symmetric.hpp:8
FTensor::dTensor2_symmetric::dTensor2_symmetric
dTensor2_symmetric(const Tensor2_symmetric< T *, Dim01 > &A, const Tensor1< int, Dim2 > &D_ijk, const Tensor1< double, Dim2 > &D_xyz)
Definition: dTensor2_symmetric.hpp:21
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::dTensor2_symmetric::operator()
promote< T, double >::V operator()(const int N1, const int N2, const int N3) const
Definition: dTensor2_symmetric.hpp:16
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index
Definition: Index.hpp:23
FTensor::Dg_Expr
Definition: Dg_Expr.hpp:25
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20