summaryrefslogtreecommitdiff
path: root/src/main/Termination.c
blob: be317acf6f548620a58eedd2bf27bcf89ce57745 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
 /*@@
   @file      Termination.c
   @date      Thu March 15 7pm
   @author    Gabrielle Allen
   @desc 
   Termination conditions 
   @enddesc 
   @version $Header$
 @@*/

#include <stdio.h>
#include <stdlib.h>

#include "cctk_Flesh.h"
#include "cctk_Parameter.h"

#include "cctk_Main.h"
#include "cctk_IO.h"

static const char *rcsid="$Header$";

CCTK_FILEVERSION(main_Termination_c)

/********************************************************************
 *********************     Local Data Types   ***********************
 ********************************************************************/

/********************************************************************
 *********************     Local Data   *****************************
 ********************************************************************/

static int termination_reached = 0;

/********************************************************************
 ********************* Local Routine Prototypes *********************
 ********************************************************************/

/********************************************************************
 *********************     External Routines   **********************
 ********************************************************************/

 /*@@
   @routine    CCTK_TerminationReached
   @date       Thu March 15 7pm
   @author     Gabrielle Allen
   @desc 
   Returns true if Cactus will terminate on the next iteration
   @enddesc 
   @calls     
   @calledby   
   @history 
   @hdate @hauthor 
   @hdesc 
   @endhistory 

@@*/
int CCTK_TerminationReached(cGH *GH)
{
  return termination_reached;
}
  
 /*@@
   @routine    CCTK_TerminateNext
   @date       Thu March 15 7pm
   @author     Gabrielle Allen
   @desc 
   Sets termination for next iteration
   @enddesc 
   @calls     
   @calledby   
   @history 
   @hdate @hauthor 
   @hdesc 
   @endhistory 

@@*/
void CCTK_TerminateNext(cGH *GH)
{
  termination_reached = 1;
}
  
/********************************************************************
 *********************     Local Routines   *************************
 ********************************************************************/