From eab0a7ae7f477cd11cb79e11226fd658311106ff Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 24 Nov 2005 00:10:00 +0000 Subject: CarpetInterp: Take cctk_initial_time into account Take cctk_initial_time into account when calculating the iteration number from cctk_time and cctk_delta_time. darcs-hash:20051124001045-dae7b-ec93e9ca13d700c7aef29d66cb1ffe2e91b8d654.gz --- Carpet/CarpetInterp/param.ccl | 3 +++ Carpet/CarpetInterp/src/interp.cc | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'Carpet/CarpetInterp') diff --git a/Carpet/CarpetInterp/param.ccl b/Carpet/CarpetInterp/param.ccl index e4cb553b9..37f4d791a 100644 --- a/Carpet/CarpetInterp/param.ccl +++ b/Carpet/CarpetInterp/param.ccl @@ -1,2 +1,5 @@ # Parameter definitions for thorn CarpetInterp +SHARES: Cactus + +USES CCTK_REAL cctk_initial_time diff --git a/Carpet/CarpetInterp/src/interp.cc b/Carpet/CarpetInterp/src/interp.cc index 9c9c17157..c5bab62b0 100644 --- a/Carpet/CarpetInterp/src/interp.cc +++ b/Carpet/CarpetInterp/src/interp.cc @@ -7,6 +7,7 @@ #include #include "cctk.h" +#include "cctk_Parameters.h" #include "util_ErrorCodes.h" #include "util_Table.h" @@ -691,6 +692,8 @@ namespace CarpetInterp { vector& operand_indices, vector& time_deriv_order) { + DECLARE_CCTK_PARAMETERS; + // Find source map assert (source_map.size() == N_interp_points); int iret = Util_TableGetIntArray (param_table_handle, N_interp_points, @@ -733,7 +736,8 @@ namespace CarpetInterp { assert (partype == PARAMETER_INTEGER); prolongation_order_time = *(CCTK_INT const*) parptr; - current_time = cctkGH->cctk_time / cctkGH->cctk_delta_time; + current_time = + (cctkGH->cctk_time - cctk_initial_time) / cctkGH->cctk_delta_time; delta_time = cctkGH->cctk_delta_time; iret = Util_TableGetIntArray (param_table_handle, N_output_arrays, -- cgit v1.2.3