diff options
author | allen <allen@5633253d-7678-4964-a54d-f87795f8ee59> | 1999-10-31 13:26:59 +0000 |
---|---|---|
committer | allen <allen@5633253d-7678-4964-a54d-f87795f8ee59> | 1999-10-31 13:26:59 +0000 |
commit | 69d85e287d7cd42b998fda5d51af78d0d5b1a2f0 (patch) | |
tree | 6956456582ed6a63d534f3c91d31fff78ebb9039 /src | |
parent | d4bc19f0cb1a24b71a92cef8b03de4020b6e1f5c (diff) |
Improved implementation of dynamic courant condition
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Time/trunk@13 5633253d-7678-4964-a54d-f87795f8ee59
Diffstat (limited to 'src')
-rw-r--r-- | src/Courant.c | 18 |
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; } } |