From d4bc19f0cb1a24b71a92cef8b03de4020b6e1f5c Mon Sep 17 00:00:00 2001 From: allen Date: Wed, 20 Oct 1999 12:35:03 +0000 Subject: Courant condition implemented for timestep, as described in documentation. This hasn't been very well tested yet. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Time/trunk@11 5633253d-7678-4964-a54d-f87795f8ee59 --- src/Courant.c | 14 +------------- src/Simple.c | 11 +++-------- src/make.code.defn | 2 +- 3 files changed, 5 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/Courant.c b/src/Courant.c index 7bac44c..d0c36ef 100644 --- a/src/Courant.c +++ b/src/Courant.c @@ -26,9 +26,6 @@ void Time_Courant(CCTK_CARGUMENTS) int min_handle,ierr; - /* Get the handle for the MINIMUM operation */ - /*$ierr = CCTK_ReductionArrayHandle("minimum");$*/ - /* Calculate the minimum grid spacing */ if (cctk_dim>=1) { @@ -52,15 +49,6 @@ void Time_Courant(CCTK_CARGUMENTS) CCTK_WARN(0,"Time Step not defined for greater than 4 dimensions"); } - /* do the global minimum on local min_spacing to tmp and reassign that - to min_spacing */ - - /*$printf("Courant1: %d \n",min_spacing); - ierr = CCTK_ReduceLocalScalar(GH,-1,min_handle,min_spacing, tmp, CCTK_VAR_REAL); - printf("Courant2: %d \n",min_spacing,tmp); - min_spacing = tmp; - printf("Courant3: %d \n",min_spacing,tmp);$*/ - /* Calculate the courant timestep */ courant_speed = *wave_speed; *courant_dt = courant_fac/courant_speed/sqrt((CCTK_REAL )cctk_dim); @@ -85,7 +73,7 @@ void Time_Courant(CCTK_CARGUMENTS) } else { - cctkGH->cctk_delta_time = dtfac*min_spacing/courant_wave_speed; + cctkGH->cctk_delta_time = dtfac*min_spacing; } } diff --git a/src/Simple.c b/src/Simple.c index ac801e5..e09ad6a 100644 --- a/src/Simple.c +++ b/src/Simple.c @@ -13,8 +13,6 @@ #include "cctk_arguments.h" #include "cctk_parameters.h" -#include "cctk_WarnLevel.h" - void Time_Simple(CCTK_CARGUMENTS) { DECLARE_CCTK_PARAMETERS @@ -23,6 +21,7 @@ void Time_Simple(CCTK_CARGUMENTS) CCTK_REAL min_spacing; char *message; + /* Calculate the minimum grid spacing */ if (cctk_dim>=1) { min_spacing = cctk_delta_space[0]; @@ -42,15 +41,11 @@ void Time_Simple(CCTK_CARGUMENTS) if (cctk_dim>=4) { - CCTK_WARN(0,"Time Step now defined for greater than 4 dimensions"); + CCTK_WARN(0,"Time Step not defined for greater than 4 dimensions"); } + /* Calculate the timestep */ cctkGH->cctk_delta_time = dtfac*min_spacing; - - message = (char *)malloc(1024*sizeof(char)); - sprintf(message,"Time step set to %f",cctkGH->cctk_delta_time); - CCTK_INFO(message); - free(message); } diff --git a/src/make.code.defn b/src/make.code.defn index 8ebd1fb..a37cea0 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -2,7 +2,7 @@ # $Header$ # Source files in this directory -SRCS = Simple.c +SRCS = Simple.c Courant.c # Subdirectories containing source files SUBDIRS = -- cgit v1.2.3