From ec098f5dadd15c70908dcbd07b484f04f926ebea Mon Sep 17 00:00:00 2001 From: hawke Date: Fri, 28 Jul 2006 09:45:36 +0000 Subject: "Old boundary" interface, as provided by Yosef Zlochower. This sets CCTK_DELTA_TIME in a different way to the standard MoL method inside a bin in MoL_PostStep. I believe this is designed for use with the standard Cactus Radiative boundary condition. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@114 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b --- src/OldBdry.c | 26 ++++++++++++++++++++++++++ src/make.code.defn | 1 + 2 files changed, 27 insertions(+) create mode 100644 src/OldBdry.c (limited to 'src') diff --git a/src/OldBdry.c b/src/OldBdry.c new file mode 100644 index 0000000..f4b5751 --- /dev/null +++ b/src/OldBdry.c @@ -0,0 +1,26 @@ +#include "cctk.h" +#include "cctk_Arguments.h" + +static CCTK_REAL mol_dt; + + +void MoL_OldBdry_SetDt (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + + CCTK_REAL dt; + CCTK_REAL old_time; + + old_time = *Original_Time - *Original_Delta_Time / cctkGH->cctk_timefac; + + mol_dt = cctkGH->cctk_delta_time; + + dt = cctkGH->cctk_time - old_time; + + cctkGH->cctk_delta_time = dt * cctkGH->cctk_timefac; +} + +void MoL_OldBdry_ResetDt (CCTK_ARGUMENTS) +{ + cctkGH->cctk_delta_time = mol_dt; +} diff --git a/src/make.code.defn b/src/make.code.defn index 926dbbb..b2717f9 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -8,6 +8,7 @@ SRCS = ChangeType.c \ ICN.c \ IndexArrays.c \ InitialCopy.c \ + OldBdry.c \ ParamCheck.c \ RK2.c \ RK3.c \ -- cgit v1.2.3