1 #ifndef AMREX_MLMG_2D_K_H_
2 #define AMREX_MLMG_2D_K_H_
3 #include <AMReX_Config.H>
15 for (
int n = 0; n < nc; ++n) {
16 for (
int j = lo.y; j <= hi.y; ++j) {
18 const int joff = 2*(j-jc*2)-1;
20 for (
int i = lo.x; i <= hi.x; ++i) {
22 const int ioff = 2*(i-ic*2)-1;
23 ff(i,j,0,n) = T(0.5625)*cc(ic ,jc ,0,n)
24 + T(0.1875)*cc(ic+ioff,jc ,0,n)
25 + T(0.1875)*cc(ic ,jc+joff,0,n)
26 + T(0.0625)*cc(ic+ioff,jc+joff,0,n);
41 for (
int n = 0; n < nc; ++n) {
42 for (
int j = lo.y; j <= hi.y; ++j) {
45 for (
int i = lo.x; i <= hi.x; ++i) {
47 ff(i,j,0,n) = cc(ic,jc,0,n);
54 template <
int R,
typename T>
62 for (
int n = 0; n < nc; ++n) {
63 for (
int j = lo.y; j <= hi.y; ++j) {
66 for (
int i = lo.x; i <= hi.x; ++i) {
68 if (flag(i,j,0).isCovered()) {
71 ff(i,j,0,n) = cc(ic,jc,0,n);
86 bool i_is_odd = (ic*2 != i);
87 bool j_is_odd = (jc*2 != j);
88 if (i_is_odd && j_is_odd) {
90 fine(i,j,0,n) = T(0.25)*(
crse(ic,jc,0,n) +
crse(ic+1,jc,0,n) +
91 crse(ic,jc+1,0,n) +
crse(ic+1,jc+1,0,n));
92 }
else if (j_is_odd) {
94 fine(i,j,0,n) = T(0.5)*(
crse(ic,jc,0,n) +
crse(ic,jc+1,0,n));
95 }
else if (i_is_odd) {
97 fine(i,j,0,n) = T(0.5)*(
crse(ic,jc,0,n) +
crse(ic+1,jc,0,n));
104 template <
typename T>
111 bool i_injection = (ic*4 == i);
112 bool j_injection = (jc*4 == j);
114 #define I_LO (4*(ic+1)-i)
115 #define J_LO (4*(jc+1)-j)
116 #define I_HI (i-4*ic)
117 #define J_HI (j-4*jc)
119 if (i_injection && j_injection) {
121 }
else if (i_injection) {
124 }
else if (j_injection) {
142 #if (AMREX_SPACEDIM == 2)
144 using namespace TwoD;
#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 const > crse
Definition: AMReX_InterpFaceRegister.cpp:92
static int ff(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:59
Definition: AMReX_MLALap_2D_K.H:5
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlmg_lin_cc_interp_r4(Box const &bx, Array4< T > const &ff, Array4< T const > const &cc, int nc) noexcept
Definition: AMReX_MLMG_2D_K.H:35
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlmg_lin_nd_interp_r4(int i, int j, int, int n, Array4< T > const &fine, Array4< T const > const &crse) noexcept
Definition: AMReX_MLMG_2D_K.H:106
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlmg_lin_nd_interp_r2(int i, int j, int, int n, Array4< T > const &fine, Array4< T const > const &crse) noexcept
Definition: AMReX_MLMG_2D_K.H:81
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlmg_lin_cc_interp_r2(Box const &bx, Array4< T > const &ff, Array4< T const > const &cc, int nc) noexcept
Definition: AMReX_MLMG_2D_K.H:9
Definition: AMReX_Amr.cpp:49
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 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
Definition: AMReX_Array4.H:61