From adee3e97c377b390fe318d0d8b888b96db8554b3 Mon Sep 17 00:00:00 2001 From: lanfer Date: Wed, 20 Oct 1999 08:42:26 +0000 Subject: the global min operation on min_spacing (commented out for now) git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Time/trunk@10 5633253d-7678-4964-a54d-f87795f8ee59 --- src/Courant.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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=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); -- cgit v1.2.3