aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/Interpolate_K.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Utils/Interpolate_K.H')
-rw-r--r--Source/Utils/Interpolate_K.H7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/Utils/Interpolate_K.H b/Source/Utils/Interpolate_K.H
index 9c8e0a2b4..f452f1acf 100644
--- a/Source/Utils/Interpolate_K.H
+++ b/Source/Utils/Interpolate_K.H
@@ -18,11 +18,16 @@ void interp (int j, int k, int l,
Real const wx = static_cast<Real>(type[0]) * static_cast<amrex::Real>(j-jg*r_ratio) * rr;
Real const owx = 1.0_rt-wx;
+#if (AMREX_SPACEDIM >= 2)
int const kg = amrex::coarsen(k,r_ratio);
Real const wy = static_cast<Real>(type[1]) * static_cast<amrex::Real>(k-kg*r_ratio) * rr;
Real const owy = 1.0_rt-wy;
+#endif
-#if (AMREX_SPACEDIM == 2)
+#if (AMREX_SPACEDIM == 1)
+ fine(j,k,l) = owx * crse(jg ,0,0)
+ + wx * crse(jg+1,0,0);
+#elif (AMREX_SPACEDIM == 2)
fine(j,k,l) = owx * owy * crse(jg ,kg ,0)
+ owx * wy * crse(jg ,kg+1,0)
+ wx * owy * crse(jg+1,kg ,0)