aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-05-01 20:50:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-05-01 20:50:00 +0000
commit11ac382474368f028c892b391975f53a8ac57759 (patch)
tree55827438fa69d0ce9ef5defae73eeecdc545335a /CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
parent0fbb3fc20f36bce10eb1f92921a3f947abef3c99 (diff)
global: Add varying refinement factors
Add support for varying refinement factors. The spatial refinement factors can be different in different directions, can be different from the time refinement factor, and can be different on each level. (However, the underlying spatial transport operators do currently not handle any factors except two.) darcs-hash:20050501205010-891bb-8d3a74abaad55ee6c77ef18d51fca2a2b69740de.gz
Diffstat (limited to 'CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc')
-rw-r--r--CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
index c5e8ec62f..ed01bd34c 100644
--- a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
+++ b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
@@ -261,6 +261,8 @@ namespace CarpetAdaptiveRegrid {
vector<vector<ibbox> > bbss = bbsss.at(0);
vector<vector<ibbox> > local_bbss = local_bbsss.at(0);
+ ivect const reffact = spacereffacts.at(rl+1) / spacereffacts.at(rl);
+
bool did_regrid = false;
//
@@ -458,15 +460,15 @@ namespace CarpetAdaptiveRegrid {
// Correct for the change in level !
CCTK_INT ii = (i + cctkGH->cctk_lbnd[0]
- cctkGH->cctk_nghostzones[0]
- + child_levoff[0]) / reffact -
+ + child_levoff[0]) / reffact[0] -
imin[0];
CCTK_INT jj = (j + cctkGH->cctk_lbnd[1]
- cctkGH->cctk_nghostzones[1]
- + child_levoff[1]) / reffact -
+ + child_levoff[1]) / reffact[1] -
imin[1];
CCTK_INT kk = (k + cctkGH->cctk_lbnd[2]
- cctkGH->cctk_nghostzones[2]
- + child_levoff[1]) / reffact -
+ + child_levoff[1]) / reffact[2] -
imin[2];
// Check that this point actually intersects with
// this box (if this component was actually a
@@ -822,7 +824,7 @@ namespace CarpetAdaptiveRegrid {
rvect hi = int2pos(cctkGH, hh, ihi, reflevel);
rvect str = base_spacing *
ipow((CCTK_REAL)mgfact, basemglevel) /
- ipow(reffact, reflevel);
+ spacereffacts.at(reflevel);
rbbox newbbcoord(lo, hi, str);
if (veryverbose) {
@@ -1057,7 +1059,7 @@ namespace CarpetAdaptiveRegrid {
const ivect global_extent (hh.baseextent.upper() - hh.baseextent.lower());
const rvect scale = rvect(global_extent) / (global_upper - global_lower);
- const int levfac = ipow(hh.reffact, rl);
+ const ivect levfac = hh.reffacts.at(rl);
assert (all (hh.baseextent.stride() % levfac == 0));
const ivect istride = hh.baseextent.stride() / levfac;
@@ -1084,7 +1086,7 @@ namespace CarpetAdaptiveRegrid {
const ivect global_extent (hh.baseextent.upper() - hh.baseextent.lower());
const rvect scale = rvect(global_extent) / (global_upper - global_lower);
- const int levfac = ipow(hh.reffact, rl);
+ const ivect levfac = hh.reffacts.at(rl);
assert (all (hh.baseextent.stride() % levfac == 0));
const ivect istride = hh.baseextent.stride() / levfac;