v0.14.0
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 
6 namespace FTensor
7 {
8  template <class T>
9  typename promote<T, double>::V
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>
18  typename promote<T, double>::V
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>
27  typename promote<T, double>::V
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 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::d_one_sided
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)
Definition: d_one_sided_Tensor0.hpp:10
FTensor::Number< 0 >
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Tensor0< T * >
Definition: Tensor0.hpp:19
FTensor::promote::V
T1 V
Definition: promote.hpp:17