summaryrefslogtreecommitdiff
path: root/src/main/CactusDefaultEvolve.c
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-05-15 13:36:00 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-05-15 13:36:00 +0000
commita073aba5ae5ea4aacff3de11354563b84256f719 (patch)
tree133f9664a4d5c9d909973041eda77ef5dfc9411d /src/main/CactusDefaultEvolve.c
parent91d4cacaab34a58e774332f2cf9f80b90200a9b0 (diff)
Moved the termination condition check for the main iteration loop
into a separate routine DoneMainLoop(). Now parameter Cactus::cctk_itlast is really steerable. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1667 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/CactusDefaultEvolve.c')
-rw-r--r--src/main/CactusDefaultEvolve.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/main/CactusDefaultEvolve.c b/src/main/CactusDefaultEvolve.c
index c1642da9..26552dc6 100644
--- a/src/main/CactusDefaultEvolve.c
+++ b/src/main/CactusDefaultEvolve.c
@@ -45,7 +45,7 @@ static int cactus_terminate_global = 0;
#define TERMINATION_RAISED_BRDCAST 4
/* Local function prototypes. */
-
+static int DoneMainLoop (CCTK_REAL cctk_time, int iteration);
static int StepGH(cGH *GH);
/* the iteration counter used in the evolution loop */
@@ -99,15 +99,13 @@ int CCTK_MainLoopIndex (void)
@calls
@calledby
@history
-
+ @hdate Fri May 12 2000 @hauthor Thomas Radke
+ @hdesc Moved evolution loop termination check into DoneMainLoop()
@endhistory
@@*/
int CactusDefaultEvolve(tFleshConfig *config)
{
-
- DECLARE_CCTK_PARAMETERS
-
int convergence_level;
#ifdef DEBUG_CCTK
@@ -141,7 +139,7 @@ int CactusDefaultEvolve(tFleshConfig *config)
*/
- while (iteration<cctk_itlast || (cctk_final_time>cctk_initial_time?config->GH[0]->cctk_time<cctk_final_time:0))
+ while (! DoneMainLoop (config->GH[0]->cctk_time, iteration))
{
#ifdef DEBUG_CCTK
@@ -212,6 +210,29 @@ int CactusDefaultEvolve(tFleshConfig *config)
/************************************************************************/
/*@@
+ @routine DoneMainLoop
+ @date Fri May 12 2000
+ @author Thomas Radke
+ @desc
+ Check the termination conditions for the evolution loop
+ @enddesc
+ @calls
+ @calledby
+ @history
+ @endhistory
+
+@@*/
+static int DoneMainLoop (CCTK_REAL cctk_time, int iteration)
+{
+ DECLARE_CCTK_PARAMETERS
+
+ return (! (iteration < cctk_itlast ||
+ (cctk_final_time > cctk_initial_time ?
+ cctk_time < cctk_final_time : 0)));
+}
+
+
+ /*@@
@routine StepGH
@date Fri Aug 14 12:39:49 1998
@author Gerd Lanfermann