summaryrefslogtreecommitdiff
path: root/src/main/CactusDefaultEvolve.c
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-09-22 15:50:36 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-09-22 15:50:36 +0000
commit64428040b9961f29d7c6feb31f25c412327458ac (patch)
treef98abf2e22d6c0d2169ef2ab1e12ea3decba8dbc /src/main/CactusDefaultEvolve.c
parent46277f4b3dfe8365bd3eab7121281c1ad128ce24 (diff)
Added CCTK_MainLoopIndex() and CCTK_SetMainLoopIndex() to control
the iteration counter in the evolution loop. This is used for checkpointing & recovery. git-svn-id: http://svn.cactuscode.org/flesh/trunk@982 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/CactusDefaultEvolve.c')
-rw-r--r--src/main/CactusDefaultEvolve.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/main/CactusDefaultEvolve.c b/src/main/CactusDefaultEvolve.c
index b454a195..bfb44047 100644
--- a/src/main/CactusDefaultEvolve.c
+++ b/src/main/CactusDefaultEvolve.c
@@ -50,6 +50,46 @@ static int cactus_terminate_global = 0;
int CCTK_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;
+}
+
+
+ /*@@
+ @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
@date Thu Oct 8 17:30:15 1998
@@ -69,11 +109,8 @@ int CactusDefaultEvolve(tFleshConfig *config)
DECLARE_CCTK_PARAMETERS
- int iteration;
int convergence_level;
- iteration = 0;
-
#ifdef DEBUG_CCTK
CCTK_PRINTSEPARATOR
printf("In CactusDefaultEvolve\n----------------------\n");