1 #ifndef AMREX_INTERP_FACE_REG_2D_C_H_
2 #define AMREX_INTERP_FACE_REG_2D_C_H_
15 for (
int n = 0; n < ncomp; ++n) {
16 fine(i,j,0,n+scomp) =
crse(ic,jc,0,n);
20 for (
int n = 0; n < ncomp; ++n) {
21 Real dc = Real(0.5) * (
crse(ic,jc+1,0,n) -
crse(ic,jc-1,0,n));
22 Real df = Real(2.0) * (
crse(ic,jc+1,0,n) -
crse(ic,jc ,0,n));
23 Real db = Real(2.0) * (
crse(ic,jc ,0,n) -
crse(ic,jc-1,0,n));
24 Real sy = (df*db >= Real(0.0)) ?
27 if (dc != Real(0.0)) {
32 Real yoff = (
static_cast<Real
>(j - jc*rr[1]) + Real(0.5)) / Real(rr[1]) - Real(0.5);
33 for (
int n = 0; n < ncomp; ++n) {
34 fine(i,j,0,n+scomp) =
crse(ic,jc,0,n) + yoff *
slope(i,j,0,n) * sfy;
39 for (
int n = 0; n < ncomp; ++n) {
40 fine(i,j,0,n+scomp) =
crse(ic,jc,0,n);
44 for (
int n = 0; n < ncomp; ++n) {
45 Real dc = Real(0.5) * (
crse(ic+1,jc,0,n) -
crse(ic-1,jc,0,n));
46 Real df = Real(2.0) * (
crse(ic+1,jc,0,n) -
crse(ic ,jc,0,n));
47 Real db = Real(2.0) * (
crse(ic ,jc,0,n) -
crse(ic-1,jc,0,n));
48 Real sx = (df*db >= Real(0.0)) ?
51 if (dc != Real(0.0)) {
56 Real xoff = (
static_cast<Real
>(i - ic*rr[0]) + Real(0.5)) / Real(rr[0]) - Real(0.5);
57 for (
int n = 0; n < ncomp; ++n) {
58 fine(i,j,0,n+scomp) =
crse(ic,jc,0,n) + xoff *
slope(i,j,0,n) * sfx;
#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
Box domface
Definition: AMReX_InterpFaceRegister.cpp:94
AMREX_GPU_HOST_DEVICE const IntVectND< dim > & smallEnd() const &noexcept
Get the smallend of the BoxND.
Definition: AMReX_Box.H:105
AMREX_GPU_HOST_DEVICE const IntVectND< dim > & bigEnd() const &noexcept
Get the bigend.
Definition: AMReX_Box.H:116
Definition: AMReX_Amr.cpp:49
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 T abs(const GpuComplex< T > &a_z) noexcept
Return the absolute value of a complex number.
Definition: AMReX_GpuComplex.H:356
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
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void interp_face_reg(int i, int j, IntVect const &rr, Array4< Real > const &fine, int scomp, Array4< Real const > const &crse, Array4< Real > const &slope, int ncomp, Box const &domface, int idim)
Definition: AMReX_InterpFaceReg_2D_C.H:7
Definition: AMReX_Array4.H:61