summaryrefslogtreecommitdiff
path: root/src/main/Termination.c
blob: adb2567a88d95f5a337128ce5c61aa524733497c (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
 /*@@
   @file      Termination.c
   @date      Thu March 15 7pm
   @author    Gabrielle Allen
   @desc
              Termination conditions
   @enddesc
   @version   $Id$
 @@*/

#include "cctk_Flesh.h"
#include "cctk_Termination.h"

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

CCTK_FILEVERSION(main_Termination_c);

/********************************************************************
 *********************     Local Data   *****************************
 ********************************************************************/
static int termination_reached = 0;

/********************************************************************
 *********************     External Routines   **********************
 ********************************************************************/
void CCTK_FCALL CCTK_FNAME (CCTK_TerminateNext) (const cGH **GH);


 /*@@
   @routine    CCTK_TerminationReached
   @date       Thu March 15 7pm
   @author     Gabrielle Allen
   @desc
               Returns true if Cactus will terminate on the next iteration.
   @enddesc
   @var        GH
   @vdesc      pointer to CCTK grid hierarchy
   @vtype      const cGH *
   @vio        in
   @endvar

   @returntype int
   @returndesc
                true (1) or false (0)
   @endreturndesc
@@*/
int CCTK_TerminationReached (const cGH *GH)
{
  GH = GH;

  return (termination_reached);
}


 /*@@
   @routine    CCTK_TerminateNext
   @date       Thu March 15 7pm
   @author     Gabrielle Allen
   @desc
               Sets termination for next iteration.
   @enddesc
   @var        GH
   @vdesc      pointer to CCTK grid hierarchy
   @vtype      const cGH *
   @vio        in
   @endvar
@@*/
void CCTK_TerminateNext (const cGH *GH)
{
  GH = GH;

  termination_reached = 1;
}

void CCTK_FCALL CCTK_FNAME (CCTK_TerminateNext) (const cGH **GH)
{
  CCTK_TerminateNext (*GH);
}