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 1:
return &cell_bilinear_interp;
case 2:
return &quadratic_interp;
case 4:
return &prolongate3d_cc_rf2_o4;
if (indextype == array<int, dim>{0, 0, 0}) {
// Vertex centred
switch (prolongation_order) {
case 1:
return &node_bilinear_interp;
case 5:
return &prolongate3d_vc_rf2_o5;
}
static inline size_t index3(size_t const i, size_t const j, size_t const k,
size_t const padexti, size_t const padextj,
size_t const padextk, size_t const exti,
size_t const extj, size_t const extk) {
#ifdef CARPET_DEBUG
namespace {
inline size_t index3(size_t const i, size_t const j, size_t const k,
size_t const padexti, size_t const padextj,
size_t const padextk, size_t const exti, size_t const extj,
size_t const extk) {
#ifdef CACTUS_DEBUG
T *restrict const dst,
int const *restrict flo, int const *restrict fhi, //dstpadext,
int const *restrict fblo, int const *restrict fbhi, //dstext,
T *restrict const dst, int const *restrict flo,
int const *restrict fhi, // dstpadext,
int const *restrict fblo, int const *restrict fbhi, // dstext,
int const regext[3] = {fbhi[0] - fblo[0] + 1, fbhi[1] - fblo[1] + 1, fbhi[2] - fblo[2] + 1};
//assert(all((regbbox.lower() - srcbbox.lower() + regbbox.stride() / 2) %
int const regext[3] = {fbhi[0] - fblo[0] + 1, fbhi[1] - fblo[1] + 1,
fbhi[2] - fblo[2] + 1};
// assert(all((regbbox.lower() - srcbbox.lower() + regbbox.stride() / 2) %
int const srcoff[3] = {
(2 * fblo[0] - 1 - 4*clo[0] + 1) / 2,
(2 * fblo[1] - 1 - 4*clo[1] + 1) / 2,
(2 * fblo[2] - 1 - 4*clo[2] + 1) / 2};
int const srcoff[3] = {(2 * fblo[0] - 1 - 4 * clo[0] + 1) / 2,
(2 * fblo[1] - 1 - 4 * clo[1] + 1) / 2,
(2 * fblo[2] - 1 - 4 * clo[2] + 1) / 2};
size_t const srcipadext = chi[0] - clo[0] + 1; //srcpadext[0];
size_t const srcjpadext = chi[1] - clo[1] + 1; //srcpadext[1];
size_t const srckpadext = chi[2] - clo[2] + 1; //srcpadext[2];
size_t const srcipadext = chi[0] - clo[0] + 1; // srcpadext[0];
size_t const srcjpadext = chi[1] - clo[1] + 1; // srcpadext[1];
size_t const srckpadext = chi[2] - clo[2] + 1; // srcpadext[2];
void
Prolongate3D_CC_RF2<ORDER>::interp (const FArrayBox& crse,
int crse_comp,
FArrayBox& fine,
int fine_comp,
int ncomp,
const Box& fine_region,
const IntVect& ratio,
const Geometry& crse_geom,
const Geometry& fine_geom,
Vector<BCRec> const& bcr,
int actual_comp,
int actual_state,
RunOn gpu_or_cpu)
{
assert(bcr.size() >= ncomp);
//
// Make box which is intersection of fine_region and domain of fine.
//
Box target_fine_region = fine_region & fine.box();
void Prolongate3D_CC_RF2<ORDER>::interp(
const FArrayBox &crse, int crse_comp, FArrayBox &fine, int fine_comp,
int ncomp, const Box &fine_region, const IntVect &ratio,
const Geometry &crse_geom, const Geometry &fine_geom,
Vector<BCRec> const &bcr, int actual_comp, int actual_state,
RunOn gpu_or_cpu) {
assert(bcr.size() >= ncomp);
//
// Make box which is intersection of fine_region and domain of fine.
//
Box target_fine_region = fine_region & fine.box();
//Box crse_bx(amrex::coarsen(target_fine_region,ratio));
//
// Get coarse and fine edge-centered volume coordinates.
//
// TODO: do not use AMREX macro
/*
Vector<CCTK_REAL> fvc[AMREX_SPACEDIM];
Vector<CCTK_REAL> cvc[AMREX_SPACEDIM];
for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
{
fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir);
crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir);
}
*/
for (int var = 0 ; var < ncomp ; ++var) {
CCTK_REAL* fdat = fine.dataPtr(fine_comp + var);
const CCTK_REAL* cdat = crse.dataPtr(crse_comp + var);
const int* flo = fine.loVect();
const int* fhi = fine.hiVect();
const int* fblo = target_fine_region.loVect();
const int* fbhi = target_fine_region.hiVect();
const int* clo = crse.loVect();
const int* chi = crse.hiVect();
//const int* cblo = crse_bx.loVect();
//const int* cbhi = crse_bx.hiVect();
//Vector<int> bc = GetBCArray(bcr);
//const int* ratioV = ratio.getVect();
// Box crse_bx(amrex::coarsen(target_fine_region,ratio));
CarpetLib::prolongate_3d_cc_rf2<CCTK_REAL, ORDER>(fdat,flo,fhi,
//
// Get coarse and fine edge-centered volume coordinates.
//
// TODO: do not use AMREX macro
/*
Vector<CCTK_REAL> fvc[AMREX_SPACEDIM];
Vector<CCTK_REAL> cvc[AMREX_SPACEDIM];
for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
{
fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir);
crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir);
}
*/
for (int var = 0; var < ncomp; ++var) {
CCTK_REAL *fdat = fine.dataPtr(fine_comp + var);
const CCTK_REAL *cdat = crse.dataPtr(crse_comp + var);
const int *flo = fine.loVect();
const int *fhi = fine.hiVect();
const int *fblo = target_fine_region.loVect();
const int *fbhi = target_fine_region.hiVect();
const int *clo = crse.loVect();
const int *chi = crse.hiVect();
// const int* cblo = crse_bx.loVect();
// const int* cbhi = crse_bx.hiVect();
// Vector<int> bc = GetBCArray(bcr);
// const int* ratioV = ratio.getVect();
CarpetLib::prolongate_3d_cc_rf2<CCTK_REAL, ORDER>(fdat,flo,fhi,
static inline size_t index3(size_t const i, size_t const j, size_t const k,
size_t const padexti, size_t const padextj,
size_t const padextk, size_t const exti,
size_t const extj, size_t const extk) {
#ifdef CARPET_DEBUG
namespace {
inline size_t index3(size_t const i, size_t const j, size_t const k,
size_t const padexti, size_t const padextj,
size_t const padextk, size_t const exti, size_t const extj,
size_t const extk) {
#ifdef CACTUS_DEBUG
//if (any(dstbbox.lower() % dstbbox.stride() != 0))
// CCTK_ERROR("Internal error: destination bbox is not aligned with vertices");
//if (any(regbbox.lower() % regbbox.stride() != 0))
// if (any(dstbbox.lower() % dstbbox.stride() != 0))
// CCTK_ERROR("Internal error: destination bbox is not aligned with
// vertices");
// if (any(regbbox.lower() % regbbox.stride() != 0))
int const regext[3] = {fbhi[0] - fblo[0] + 1, fbhi[1] - fblo[1] + 1, fbhi[2] - fblo[2] + 1};
//assert(all((regbbox.lower() - srcbbox.lower()) % regbbox.stride() == 0));
int const srcoff[3] = {fblo[0] - 2*clo[0], fblo[1] - 2*clo[1], fblo[2] - 2*clo[2]};
//assert(all((regbbox.lower() - dstbbox.lower()) % regbbox.stride() == 0));
int const regext[3] = {fbhi[0] - fblo[0] + 1, fbhi[1] - fblo[1] + 1,
fbhi[2] - fblo[2] + 1};
// assert(all((regbbox.lower() - srcbbox.lower()) % regbbox.stride() == 0));
int const srcoff[3] = {fblo[0] - 2 * clo[0], fblo[1] - 2 * clo[1],
fblo[2] - 2 * clo[2]};
// assert(all((regbbox.lower() - dstbbox.lower()) % regbbox.stride() == 0));
//bvect3 const needoffsetlo = srcoff % reffact2 != 0;
//bvect3 const needoffsethi = (srcoff + regext - 1) % reffact2 != 0;
//int const offsetlo[3] = {0,0,0};
//int const offsethi[3] = {0,0,0};
// bvect3 const needoffsetlo = srcoff % reffact2 != 0;
// bvect3 const needoffsethi = (srcoff + regext - 1) % reffact2 != 0;
// int const offsetlo[3] = {0,0,0};
// int const offsethi[3] = {0,0,0};
size_t const srcipadext = chi[0] - clo[0] + 1; //srcpadext[0];
size_t const srcjpadext = chi[1] - clo[1] + 1; //srcpadext[1];
size_t const srckpadext = chi[2] - clo[2] + 1; //srcpadext[2];
size_t const srcipadext = chi[0] - clo[0] + 1; // srcpadext[0];
size_t const srcjpadext = chi[1] - clo[1] + 1; // srcpadext[1];
size_t const srckpadext = chi[2] - clo[2] + 1; // srcpadext[2];
void
Prolongate3D_VC_RF2<ORDER>::interp (const FArrayBox& crse,
int crse_comp,
FArrayBox& fine,
int fine_comp,
int ncomp,
const Box& fine_region,
const IntVect& ratio,
const Geometry& crse_geom,
const Geometry& fine_geom,
Vector<BCRec> const& bcr,
int actual_comp,
int actual_state,
RunOn gpu_or_cpu)
{
assert(bcr.size() >= ncomp);
//
// Make box which is intersection of fine_region and domain of fine.
//
Box target_fine_region = fine_region & fine.box();
void Prolongate3D_VC_RF2<ORDER>::interp(
const FArrayBox &crse, int crse_comp, FArrayBox &fine, int fine_comp,
int ncomp, const Box &fine_region, const IntVect &ratio,
const Geometry &crse_geom, const Geometry &fine_geom,
Vector<BCRec> const &bcr, int actual_comp, int actual_state,
RunOn gpu_or_cpu) {
assert(bcr.size() >= ncomp);
//
// Make box which is intersection of fine_region and domain of fine.
//
Box target_fine_region = fine_region & fine.box();
//Box crse_bx(amrex::coarsen(target_fine_region,ratio));
//
// Get coarse and fine edge-centered volume coordinates.
//
// TODO: do not use AMREX macro
/*
Vector<CCTK_REAL> fvc[AMREX_SPACEDIM];
Vector<CCTK_REAL> cvc[AMREX_SPACEDIM];
for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
{
fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir);
crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir);
}
*/
for (int var = 0 ; var < ncomp ; ++var) {
CCTK_REAL* fdat = fine.dataPtr(fine_comp + var);
const CCTK_REAL* cdat = crse.dataPtr(crse_comp + var);
const int* flo = fine.loVect();
const int* fhi = fine.hiVect();
const int* fblo = target_fine_region.loVect();
const int* fbhi = target_fine_region.hiVect();
const int* clo = crse.loVect();
const int* chi = crse.hiVect();
//const int* cblo = crse_bx.loVect();
//const int* cbhi = crse_bx.hiVect();
//Vector<int> bc = GetBCArray(bcr);
//const int* ratioV = ratio.getVect();
// Box crse_bx(amrex::coarsen(target_fine_region,ratio));
CarpetLib::prolongate_3d_rf2<CCTK_REAL, ORDER>(fdat,flo,fhi,
//
// Get coarse and fine edge-centered volume coordinates.
//
// TODO: do not use AMREX macro
/*
Vector<CCTK_REAL> fvc[AMREX_SPACEDIM];
Vector<CCTK_REAL> cvc[AMREX_SPACEDIM];
for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
{
fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir);
crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir);
}
*/
for (int var = 0; var < ncomp; ++var) {
CCTK_REAL *fdat = fine.dataPtr(fine_comp + var);
const CCTK_REAL *cdat = crse.dataPtr(crse_comp + var);
const int *flo = fine.loVect();
const int *fhi = fine.hiVect();
const int *fblo = target_fine_region.loVect();
const int *fbhi = target_fine_region.hiVect();
const int *clo = crse.loVect();
const int *chi = crse.hiVect();
// const int* cblo = crse_bx.loVect();
// const int* cbhi = crse_bx.hiVect();
// Vector<int> bc = GetBCArray(bcr);
// const int* ratioV = ratio.getVect();
CarpetLib::prolongate_3d_rf2<CCTK_REAL, ORDER>(fdat,flo,fhi,