v0.14.0
Loading...
Searching...
No Matches
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
5namespace FTensor
6{
7 template <class T, int Dim01, int Dim2, char i, char j, char k>
9 {
13
14 public:
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}
constexpr double a
dTensor2_symmetric(const Tensor2_symmetric< T *, Dim01 > &A, const Tensor1< int, Dim2 > &D_ijk, const Tensor1< double, Dim2 > &D_xyz)
const Tensor1< double, Dim2 > & d_xyz
const Tensor2_symmetric< T *, Dim01 > & a
const Tensor1< int, Dim2 > & d_ijk
promote< T, double >::V operator()(const int N1, const int N2, const int N3) const
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
Tensors class implemented by Walter Landry.
Definition FTensor.hpp:51
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