summaryrefslogtreecommitdiff
path: root/src/main/flesh.cc
blob: e3899623e446dfa8c5418c967ba1a6303a896eeb (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
86
87
88
89
90
91
92
93
94
95
96
97
98
 /*@@
   @file      flesh.cc
   @date      Fri Sep 18 14:17:08 1998
   @author    Tom Goodale
   @desc 
   Main program file for cactus.
   @enddesc 
   @version $Header$
 @@*/
#include <stdio.h>

#include "cctk_Flesh.h"
#include "CactusMainFunctions.h"

static const char *rcsid = "$Header$";
CCTK_FILEVERSION(main_flesh_cc);


extern "C" int cctki_onlyprintschedule;
 /*@@
   @routine    main
   @date       Fri Sep 18 14:17:37 1998
   @author     Tom Goodale
   @desc 
   Main program for cactus.  This has to be c++ as on some
   architectures you need the main program in c++ if there's
   going to be any c++ at all in your program.
   
   @enddesc 
   @calls     CCTKi_InitialiseCactus CCTKi_ShutdownCactus
   @calledby   
   @history 
 
   @endhistory 
   @var     argc
   @vdesc   The number of command line arguments
   @vtype   int
   @vio     in
   @vcomment 
 
   @endvar 
   @var     argv
   @vdesc   The command line arguments
   @vtype   char *[]
   @vio     in
   @vcomment 
 
   @endvar 

   @returntype int
   @returndesc
   0 -- success
   @endreturndesc

@@*/
int main(int argc, char **argv)
{
  tFleshConfig ConfigData;



  /* Initialise any cactus specific stuff.
   */
  CCTKi_InitialiseCactus(&argc, &argv, &ConfigData);

  /* Abort if only the schedule tree should be printed.
   */
  if (cctki_onlyprintschedule)
  {
    printf ("--------------------------------------------------------------------------------\n");
    printf ("Stopping now because the option '-S' ('--print-schedule') was given.\n");
    printf ("--------------------------------------------------------------------------------\n");
    printf ("Done.\n");
  }
  else
  {

    /* This is a (c-linkage) routine which has been registered by a thorn.
     */
    CCTK_Initialise(&ConfigData);

    /* This is a (c-linkage) routine which has been registered by a thorn.
     */
    CCTK_Evolve(&ConfigData);

    /* This is a (c-linkage) routine which has been registered by a thorn.
     */
    CCTK_Shutdown(&ConfigData);

    /* Shut down any cactus specific stuff.
     */
    CCTKi_ShutdownCactus(&ConfigData);

  }

  return 0;
}