diff --git a/CarpetX/param.ccl b/CarpetX/param.ccl index 8addfe4e3..6561e6265 100644 --- a/CarpetX/param.ccl +++ b/CarpetX/param.ccl @@ -426,6 +426,7 @@ KEYWORD prolongation_type "Prolongation type" "hermite" :: "Hermite-interpolate in vertex centred and conserve in cell centred directions" "natural" :: "interpolate in vertex centred and conserve in cell centred directions, using the same order" "poly-cons3lfb" :: "interpolate polynomially in vertex centred directions and conserve with 3rd order accuracy and a linear fallback in cell centred directions" + "amrex-interp" :: "using amrex interpolation operator" } "natural" CCTK_INT prolongation_order "Prolongation order" diff --git a/CarpetX/src/driver.cxx b/CarpetX/src/driver.cxx index 89aea53d1..b84940710 100644 --- a/CarpetX/src/driver.cxx +++ b/CarpetX/src/driver.cxx @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -542,7 +543,7 @@ amrex::Interpolater *get_interpolator(const std::array indextype) { hermite, natural, poly_cons3lfb, - poly_eno3lfb, + amrex_interp, }; static interp_t interp = [&]() { if (CCTK_EQUALS(prolongation_type, "interpolate")) @@ -559,11 +560,33 @@ amrex::Interpolater *get_interpolator(const std::array indextype) { return interp_t::natural; else if (CCTK_EQUALS(prolongation_type, "poly-cons3lfb")) return interp_t::poly_cons3lfb; + else if (CCTK_EQUALS(prolongation_type, "amrex-interp")) + return interp_t::amrex_interp; else assert(0); }(); switch (interp) { + case interp_t::amrex_interp: + + switch ((indextype[0] << 2) | (indextype[1] << 1) | (indextype[2] << 0)) { + case 0b000: + return &amrex::node_bilinear_interp; + break; + case 0b111: + return &amrex::cell_bilinear_interp; + break; + case 0b001: + case 0b010: + case 0b011: + case 0b100: + case 0b101: + case 0b110: + return &amrex::face_linear_interp; + break; + } + break; + case interp_t::interpolate: switch ((indextype[0] << 2) | (indextype[1] << 1) | (indextype[2] << 0)) {