aboutsummaryrefslogtreecommitdiff
path: root/src/SetTime.c
diff options
context:
space:
mode:
authorhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2003-07-22 07:07:14 +0000
committerhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2003-07-22 07:07:14 +0000
commite3096d84ffb4b909977066f158db78eb45f4a80b (patch)
tree9e41096faa3de1f2af27660866aa5e4eea4cffed /src/SetTime.c
parent06f6fb8bd438528724715988336a8b8ef86192ce (diff)
Add two methods:
RK3. The optimized version of the TVD RK3 solver. Requires no scratch space so is about as efficient as ICN, but third order. Generic method from a parameter table. By specifying the number of intermediate steps and the alpha and beta arrays, create your own method at parameter time. Not well (or at all) documented because it doesn't seem to work correctly at the moment. Some tidying of extraneous code as well. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@29 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/SetTime.c')
-rw-r--r--src/SetTime.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/SetTime.c b/src/SetTime.c
index ba76ffe..5c2a213 100644
--- a/src/SetTime.c
+++ b/src/SetTime.c
@@ -184,6 +184,18 @@ int MoL_ResetTime(CCTK_ARGUMENTS)
cctkGH->cctk_time = (*Original_Time);
}
}
+ else if (CCTK_EQUALS(ODE_Method,"RK3"))
+ {
+ if (*MoL_Intermediate_Step == 2)
+ {
+ cctkGH->cctk_time = (*Original_Time);
+ }
+ else if (*MoL_Intermediate_Step == 1)
+ {
+ cctkGH->cctk_time = (*Original_Time) +
+ 0.5*(*Original_Delta_Time)/cctkGH->cctk_timefac;
+ }
+ }
#ifdef MOLDEBUG
printf("MoL has once more reset t (%d): %f.\n", *MoL_Intermediate_Step, cctkGH->cctk_time);
fflush(stdout);
@@ -250,6 +262,17 @@ int MoL_ResetDeltaTime(CCTK_ARGUMENTS)
cctkGH->cctk_delta_time = 0.5*(*Original_Delta_Time);
}
}
+ else if (CCTK_EQUALS(ODE_Method,"RK3"))
+ {
+ if (*MoL_Intermediate_Step == 2)
+ {
+ cctkGH->cctk_delta_time = 0.25*(*Original_Delta_Time);
+ }
+ else if (*MoL_Intermediate_Step == 1)
+ {
+ cctkGH->cctk_delta_time = 2.0/3.0*(*Original_Delta_Time);
+ }
+ }
#ifdef MOLDEBUG
printf("MoL has once more reset dt (%d): %f.\n",
*MoL_Intermediate_Step,