aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Courant.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Courant.c b/src/Courant.c
index d0c36ef..71b62b2 100644
--- a/src/Courant.c
+++ b/src/Courant.c
@@ -50,14 +50,13 @@ void Time_Courant(CCTK_CARGUMENTS)
}
/* Calculate the courant timestep */
- courant_speed = *wave_speed;
- *courant_dt = courant_fac/courant_speed/sqrt((CCTK_REAL )cctk_dim);
-
- /* Output timestep if required */
-
- if (outcourant_every > 0 && cctk_iteration%outcourant_every == 0)
- {
- CCTK_OutputVarAsByMethod(cctkGH,"time::courant_dt","Scalar","courant");
+ if (CCTK_Equals(courant_method,"courant_time"))
+ {
+ *courant_dt = courant_fac*(*courant_time)/sqrt((CCTK_REAL )cctk_dim);
+ }
+ else if (CCTK_Equals(courant_method,"courant"))
+ {
+ *courant_dt = courant_fac/(*courant_wave_speed)/sqrt((CCTK_REAL )cctk_dim);
}
/* Set the Cactus timestep */
@@ -70,10 +69,11 @@ void Time_Courant(CCTK_CARGUMENTS)
sprintf(message,"Time step set to %f",cctkGH->cctk_delta_time);
CCTK_INFO(message);
free(message);
+
}
else
{
- cctkGH->cctk_delta_time = dtfac*min_spacing;
+ cctkGH->cctk_delta_time = dtfac*min_spacing;
}
}