diff options
Diffstat (limited to 'src/Courant.c')
-rw-r--r-- | src/Courant.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Courant.c b/src/Courant.c index 82f3557..7bac44c 100644 --- a/src/Courant.c +++ b/src/Courant.c @@ -24,6 +24,11 @@ void Time_Courant(CCTK_CARGUMENTS) char *message; + int min_handle,ierr; + + /* Get the handle for the MINIMUM operation */ + /*$ierr = CCTK_ReductionArrayHandle("minimum");$*/ + /* Calculate the minimum grid spacing */ if (cctk_dim>=1) { @@ -41,12 +46,21 @@ void Time_Courant(CCTK_CARGUMENTS) min_spacing = (min_spacing<cctk_delta_space[2] ? min_spacing : cctk_delta_space[2]); } - + if (cctk_dim>=4) { 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); |