summaryrefslogtreecommitdiff
path: root/src/main/CactusDefaultEvolve.c
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-09-19 23:44:34 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-09-19 23:44:34 +0000
commit89482c8cccc7902bbf77d544203093549ef33d4f (patch)
tree4486d548cf91db4a7a44682b3748258c7784376e /src/main/CactusDefaultEvolve.c
parent6219ab351e74eef7c03c7a0221e54582cf47966f (diff)
Use the CCTK_MainLoopIndex ... these will soon be moved to driver overloadable functions
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1829 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/CactusDefaultEvolve.c')
-rw-r--r--src/main/CactusDefaultEvolve.c52
1 files changed, 8 insertions, 44 deletions
diff --git a/src/main/CactusDefaultEvolve.c b/src/main/CactusDefaultEvolve.c
index 908e8a69..167775a5 100644
--- a/src/main/CactusDefaultEvolve.c
+++ b/src/main/CactusDefaultEvolve.c
@@ -23,13 +23,13 @@ CCTK_FILEVERSION(main_CactusDefaultEvolve_c)
/* Define some macros for convenience. */
-#define ForallConvLevels(iteration, conv_level) { \
+#define ForallConvLevels(iteration, conv_level) { \
int factor = 1; \
for(conv_level = 0 ; \
conv_level < config->nGHs; \
conv_level++) \
{ \
- if(iteration%factor == 0) \
+ if(iteration%factor == 0)\
{
#define EndForallConvLevels \
@@ -48,46 +48,6 @@ static int cactus_terminate_global = 0;
static int DoneMainLoop (CCTK_REAL cctk_time, int iteration);
static int StepGH(cGH *GH);
-/* the iteration counter used in the evolution loop */
-static int iteration = 0;
-
-
- /*@@
- @routine CCTK_SetMainLoopIndex
- @date Sep 22 1999
- @author Thomas Radke
- @desc
- Sets the iteration counter variable of the evolution loop.
- This is used for recovery.
- @enddesc
- @calls
- @calledby
-
-@@*/
-int CCTK_SetMainLoopIndex (int main_loop_index)
-{
- iteration = main_loop_index;
- return iteration;
-}
-
-
- /*@@
- @routine CCTK_MainLoopIndex
- @date Sep 22 1999
- @author Thomas Radke
- @desc
- Returns the iteration counter variable of the evolution loop.
- This is used for checkpointing.
- @enddesc
- @calls
- @calledby
-
-@@*/
-int CCTK_MainLoopIndex (void)
-{
- return (iteration);
-}
-
/*@@
@routine CactusDefaultEvolve
@@ -107,6 +67,9 @@ int CCTK_MainLoopIndex (void)
int CactusDefaultEvolve(tFleshConfig *config)
{
int convergence_level;
+ int iteration;
+
+ iteration = CCTK_MainLoopIndex();
#ifdef DEBUG_CCTK
CCTK_PRINTSEPARATOR
@@ -145,17 +108,18 @@ int CactusDefaultEvolve(tFleshConfig *config)
#ifdef DEBUG_CCTK
CCTK_PRINTSEPARATOR
printf("In CactusDefaultEvolve\n----------------------\n");
- printf(" Advancing iteration %d = %d + 1\n",iteration+1,
+ printf(" Advancing iteration %d = %d + 1\n",CCTK_MainLoopIndex+1,
iteration);
CCTK_PRINTSEPARATOR
#endif
iteration++;
+ CCTK_SetMainLoopIndex(iteration);
/* Step each convergence level */
- ForallConvLevels(iteration, convergence_level)
+ ForallConvLevels(CCTK_MainLoopIndex(iteration), convergence_level)
{
StepGH(config->GH[convergence_level]);