v0.13.2
Loading...
Searching...
No Matches
d_one_sided_Tensor0.hpp
Go to the documentation of this file.
1/* Takes a one-sided derivative of a Tensor0 in a particular
2 direction, yielding a typename promote<T,double>::V. */
3
4#pragma once
5
6namespace FTensor
7{
8 template <class T>
10 d_one_sided(const Tensor0<T *> &a, const Number<0> n1, const int &di,
11 const int &dj, const int &dk, const double &dx, const double &dy,
12 const double &dz)
13 {
14 return (a - *(&a - di)) * dx;
15 }
16
17 template <class T>
19 d_one_sided(const Tensor0<T *> &a, const Number<1> n1, const int &di,
20 const int &dj, const int &dk, const double &dx, const double &dy,
21 const double &dz)
22 {
23 return (a - *(&a - dj)) * dy;
24 }
25
26 template <class T>
28 d_one_sided(const Tensor0<T *> &a, const Number<2> n1, const int &di,
29 const int &dj, const int &dk, const double &dx, const double &dy,
30 const double &dz)
31 {
32 return (a - *(&a - dk)) * dz;
33 }
34}
constexpr double a
Tensors class implemented by Walter Landry.
Definition: FTensor.hpp:51
promote< T, double >::V d_one_sided(const Tensor0< T * > &a, const Number< 0 > n1, const int &di, const int &dj, const int &dk, const double &dx, const double &dy, const double &dz)