7 #ifndef SHAPEFACTORS_H_ 8 #define SHAPEFACTORS_H_ 21 template <
int depos_order>
24 template<
typename T >
25 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
37 template<
typename T >
38 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
41 const auto j =
static_cast<int>(xmid + T(0.5));
55 template<
typename T >
56 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
59 const auto j =
static_cast<int>(xmid);
60 const T xint = xmid - T(j);
61 sx[0] = T(1.0) - xint;
75 template<
typename T >
76 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
79 const auto j =
static_cast<int>(xmid + T(0.5));
80 const T xint = xmid - T(j);
81 sx[0] = T(0.5)*(T(0.5) - xint)*(T(0.5) - xint);
82 sx[1] = T(0.75) - xint*xint;
83 sx[2] = T(0.5)*(T(0.5) + xint)*(T(0.5) + xint);
97 template<
typename T >
98 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
101 const auto j =
static_cast<int>(xmid);
102 const T xint = xmid - T(j);
103 sx[0] = (T(1.0))/(T(6.0))*(T(1.0) - xint)*(T(1.0) - xint)*(T(1.0) - xint);
104 sx[1] = (T(2.0))/(T(3.0)) - xint*xint*(T(1.0) - xint/(T(2.0)));
105 sx[2] = (T(2.0))/(T(3.0)) - (T(1.0) - xint)*(T(1.0) - xint)*(T(1.0) - T(0.5)*(T(1.0) - xint));
106 sx[3] = (T(1.0))/(T(6.0))*xint*xint*xint;
117 template <
int depos_order>
120 template<
typename T >
121 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
122 int operator()(T*
const sx,
const T x_old,
const int i_new)
const;
133 template<
typename T >
134 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
135 int operator()(T*
const sx,
const T x_old,
const int i_new)
const 137 const auto i =
static_cast<int>(x_old);
138 const int i_shift =
i - i_new;
139 const T xint = x_old - T(
i);
140 sx[1+i_shift] = T(1.0) - xint;
141 sx[2+i_shift] = xint;
154 template<
typename T >
155 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
156 int operator()(T*
const sx,
const T x_old,
const int i_new)
const 158 const auto i =
static_cast<int>(x_old + T(0.5));
159 const int i_shift =
i - (i_new + 1);
160 const T xint = x_old - T(
i);
161 sx[1+i_shift] = T(0.5)*(T(0.5) - xint)*(T(0.5) - xint);
162 sx[2+i_shift] = T(0.75) - xint*xint;
163 sx[3+i_shift] = T(0.5)*(T(0.5) + xint)*(T(0.5) + xint);
177 template<
typename T >
178 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
179 int operator()(T*
const sx,
const T x_old,
const int i_new)
const 181 const auto i =
static_cast<int>(x_old);
182 const int i_shift =
i - (i_new + 1);
183 const T xint = x_old -
i;
184 sx[1+i_shift] = (T(1.0))/(T(6.0))*(T(1.0) - xint)*(T(1.0) - xint)*(T(1.0) - xint);
185 sx[2+i_shift] = (T(2.0))/(T(3.0)) - xint*xint*(T(1.0) - xint/(T(2.0)));
186 sx[3+i_shift] = (T(2.0))/(T(3.0)) - (T(1.0) - xint)*(T(1.0) - xint)*(T(1.0) - T(0.5)*(T(1.0) - xint));
187 sx[4+i_shift] = (T(1.0))/(T(6.0))*xint*xint*xint;
193 #endif // SHAPEFACTORS_H_ Definition: ShapeFactors.H:118
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int operator()(T *const sx, const T x_old, const int i_new) const
Definition: ShapeFactors.H:156
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int operator()(T *const sx, T xmid) const
Definition: ShapeFactors.H:99
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int operator()(T *const sx, T xmid) const
Definition: ShapeFactors.H:57
Definition: ShapeFactors.H:22
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int operator()(T *const sx, T xmid) const
Definition: ShapeFactors.H:77
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int operator()(T *const, T) const
Definition: ShapeFactors.H:26
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int operator()(T *const sx, T xmid) const
Definition: ShapeFactors.H:39
i
Definition: check_interp_points_and_weights.py:171
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int operator()(T *const sx, const T x_old, const int i_new) const
Definition: ShapeFactors.H:135
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int operator()(T *const sx, const T x_old, const int i_new) const
Definition: ShapeFactors.H:179