aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetInterp
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-03-18 15:10:52 -0700
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 16:45:33 +0000
commit0707cfeb82f565afec604f39202dafcbef889db0 (patch)
tree820f1ac0bc04d5f9827e4e00bf1efccb6d76727e /Carpet/CarpetInterp
parent6b2d5314e79a5547f2fdd1dc4898bdeef74da9f2 (diff)
Re-organise time level handling
Store the current Cactus time (and not a fake Carpet time) in the th "time hiearchy". This removes the now redundant "leveltimes" data structure in Carpet. Add past time levels to th, so that it can store the time for past time levels instead of assuming the time step size is constant. This allows changing the time step size during evolution. Share the time hierarchy between all maps, instead of having one time hierarchy per map. Simplify the time level cycling and time stepping code used during evolution. Improve structure of the code that loops over time levels for certain schedule bins. Introduce a new Carpet variable "timelevel", similar to "reflevel". This also makes it possible to avoid time interpolation for the past time levels during regridding. The past time levels of the fine grid then remain aligned (in time) with the past time levels of the coarse grid. This is controlled by a new parameter "time_interpolation_during_regridding", which defaults to "yes" for backwards compatibility. Simplify the three time level initialisation. Instead of initialising all three time levels by taking altogether three time steps (forwards and backwards), initialise only one past time level by taking one time step backwards. The remaining time level is initialised during the first time step of the evolution, which begins by cycling time levels, which drops the non-initialised last time level anyway. Update Carpet and the mode handling correspondingly. Update the CarpetIOHDF5 checkpoint format correspondingly. Update CarpetInterp, CarpetReduce, and CarpetRegrid2 correspondingly. Update CarpetJacobi and CarpetMG correspondingly.
Diffstat (limited to 'Carpet/CarpetInterp')
-rw-r--r--Carpet/CarpetInterp/param.ccl4
-rw-r--r--Carpet/CarpetInterp/src/interp.cc21
2 files changed, 12 insertions, 13 deletions
diff --git a/Carpet/CarpetInterp/param.ccl b/Carpet/CarpetInterp/param.ccl
index 090ef1bcb..f73f4cc61 100644
--- a/Carpet/CarpetInterp/param.ccl
+++ b/Carpet/CarpetInterp/param.ccl
@@ -21,7 +21,3 @@ BOOLEAN tree_search "Use a tree search to find the source processor" STEERABLE=a
BOOLEAN check_tree_search "Cross-check the result of the tree search" STEERABLE=always
{
} "no"
-
-SHARES: Cactus
-
-USES CCTK_REAL cctk_initial_time
diff --git a/Carpet/CarpetInterp/src/interp.cc b/Carpet/CarpetInterp/src/interp.cc
index 936b7d5d6..418408110 100644
--- a/Carpet/CarpetInterp/src/interp.cc
+++ b/Carpet/CarpetInterp/src/interp.cc
@@ -888,9 +888,8 @@ namespace CarpetInterp {
assert (partype == PARAMETER_INTEGER);
prolongation_order_time = *(CCTK_INT const*) parptr;
- current_time =
- (cctkGH->cctk_time - cctk_initial_time) / cctkGH->cctk_delta_time;
- delta_time = cctkGH->cctk_delta_time;
+ current_time = cctkGH->cctk_time;
+ delta_time = cctkGH->cctk_delta_time;
iret = Util_TableGetIntArray (param_table_handle, N_output_arrays,
&time_deriv_order.front(), "time_deriv_order");
@@ -956,8 +955,10 @@ namespace CarpetInterp {
ivect const ipos =
ivect(floor((pos - lower) / (delta * rvect(fact)) + rhalf)) * fact;
- ivect const & stride = hh->baseextent(ml,rl).stride();
- assert (all (ipos % stride == 0));
+ ivect const & istride = hh->baseextent(ml,rl).stride();
+ if (hh->refcent == cell_centered) {
+ assert (all (istride % 2 == 0));
+ }
gh::cregs const & regs = hh->regions.AT(ml).AT(rl);
@@ -1011,14 +1012,16 @@ namespace CarpetInterp {
// Try finer levels first
for (rl = maxrl-1; rl >= minrl; --rl) {
+ ivect const & istride = hh->baseextent(ml,rl).stride();
+ if (hh->refcent == cell_centered) {
+ assert (all (istride % 2 == 0));
+ }
+
ivect const fact =
maxspacereflevelfact / spacereffacts.AT(rl) * ipow(mgfact, ml);
ivect const ipos =
ivect(floor((pos - lower) / (delta * rvect(fact)) + rhalf)) * fact;
- ivect const & stride = hh->baseextent(ml,rl).stride();
- assert (all (ipos % stride == 0));
-
gh::cregs const & regs = hh->superregions.AT(rl);
// Search all superregions linearly. Each superregion
@@ -1415,7 +1418,7 @@ namespace CarpetInterp {
: vector<CCTK_REAL> (num_timelevels_ )
{
for (int tl=0; tl<num_timelevels_; ++tl) {
- at(tl) = vtt.AT(Carpet::map)->time (tl, reflevel, mglevel);
+ at(tl) = tt->get_time (mglevel, reflevel, tl);
}
}