1 #ifndef AMREX_INTERP_1D_C_H_
2 #define AMREX_INTERP_1D_C_H_
3 #include <AMReX_Config.H>
22 for (
int n = 0; n < ncomp; ++n) {
24 for (
int i = lo.x; i <= hi.x; ++i) {
26 fine(i,0,0,n+fcomp) =
crse(ic,0,0,n+ccomp);
34 const int icomp,
const int ncomp,
IntVect const& ratio) noexcept
39 const Real rx = Real(1.)/Real(ratio[0]);
41 for (
int n = 0; n < ncomp; ++n) {
43 for (
int i = lo.x; i <= hi.x; ++i) {
44 T dx0 = u(i+1,0,0,n+icomp) - u(i,0,0,n+icomp);
45 slope(i,0,0,n) = rx*dx0;
54 const int ccomp,
IntVect const& ratio) noexcept
60 for (
int n = 0; n < ncomp; ++n) {
62 for (
int i = lo.x; i <= hi.x; ++i) {
64 const Real fx = i - ic*ratio[0];
65 fine(i,0,0,n+fcomp) =
crse(ic,0,0,n+ccomp) + fx*
slope(ic,0,0,0);
101 if (i-ii*ratio[0] == 0) {
104 Real
const w =
static_cast<Real
>(i-ii*ratio[0]) * (Real(1.)/Real(ratio[0]));
105 fine(i,0,0,n) = (Real(1.)-w) *
crse(ii,0,0,n) + w *
crse(ii+1,0,0,n);
118 constexpr
Array1D<Real, -2, 2> cL = { -0.01171875_rt, 0.0859375_rt, 0.5_rt, -0.0859375_rt, 0.01171875_rt };
123 Real ftmp = 2.0_rt * ( cL(-2)*
crse(ic-2,0,0,n)
124 + cL(-1)*
crse(ic-1,0,0,n)
125 + cL( 0)*
crse(ic ,0,0,n)
126 + cL( 1)*
crse(ic+1,0,0,n)
127 + cL( 2)*
crse(ic+2,0,0,n) );
129 ftmp = 2.0_rt *
crse(ic,0,0,n) - ftmp;
132 fine(i,0,0,n) = ftmp;
#define AMREX_PRAGMA_SIMD
Definition: AMReX_Extension.H:80
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Array4< Real > fine
Definition: AMReX_InterpFaceRegister.cpp:90
Array4< Real > slope
Definition: AMReX_InterpFaceRegister.cpp:91
Array4< Real const > crse
Definition: AMReX_InterpFaceRegister.cpp:92
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void nodebilin_interp(Box const &bx, Array4< T > const &fine, const int fcomp, const int ncomp, Array4< T const > const &slope, Array4< T const > const &crse, const int ccomp, IntVect const &ratio) noexcept
Definition: AMReX_Interp_1D_C.H:52
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & min(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 ubound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:315
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:308
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void facediv_face_interp(int, int, int, int, int, int, Array4< T const > const &, Array4< T > const &, Array4< const int > const &, IntVect const &) noexcept
Definition: AMReX_Interp_1D_C.H:75
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void facediv_int(int, int, int, int, GpuArray< Array4< T >, AMREX_SPACEDIM > const &, IntVect const &, GpuArray< Real, AMREX_SPACEDIM > const &) noexcept
Definition: AMReX_Interp_1D_C.H:87
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ccquartic_interp(int i, int, int, int n, Array4< Real const > const &crse, Array4< Real > const &fine) noexcept
Definition: AMReX_Interp_1D_C.H:110
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void face_linear_interp_x(int i, int, int, int n, Array4< T > const &fine, Array4< T const > const &crse, IntVect const &ratio) noexcept
Definition: AMReX_Interp_1D_C.H:97
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void pcinterp_interp(Box const &bx, Array4< Real > const &fine, const int fcomp, const int ncomp, Array4< Real const > const &crse, const int ccomp, IntVect const &ratio) noexcept
Definition: AMReX_Interp_1D_C.H:14
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void nodebilin_slopes(Box const &bx, Array4< T > const &slope, Array4< T const > const &u, const int icomp, const int ncomp, IntVect const &ratio) noexcept
Definition: AMReX_Interp_1D_C.H:33
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > coarsen(const BoxND< dim > &b, int ref_ratio) noexcept
Coarsen BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/rati...
Definition: AMReX_Box.H:1304
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition: AMReX.cpp:225
Definition: AMReX_Array.H:161
Definition: AMReX_Array4.H:61
Definition: AMReX_Array.H:34