aboutsummaryrefslogtreecommitdiff
path: root/src/Startup.c
blob: 9a1a8c75d808710d5fdd0d4ef239617112a14838 (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
 /*@@
   @file      Startup.c
   @date      Friday 18th September 1999
   @author    Gabrielle Allen
   @desc 
   Startup routines for IOBasic.
   @enddesc 
 @@*/


#include <stdio.h>
#include <string.h>

#include "cctk.h"

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

CCTK_FILEVERSION(CactusBase_IOBasic_Startup_c)

void IOBasic_Startup (void);

/* prototypes of functions to be registered */
int IOBasic_OutputGH (cGH *GH);
int IOBasic_TriggerOutput (cGH *GH, int);
int IOBasic_TimeForOutput (cGH *GH, int);
int IOBasic_OutputVarAs (cGH *GH, const char *var, const char *alias);
void *IOBasic_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH);
int IOBasic_InitGH (cGH *GH);

int IOBasic_OutputInfoGH (cGH *GH);
int IOBasic_TriggerOutputInfo (cGH *GH, int);
int IOBasic_TimeForInfo (cGH *GH, int);


 /*@@
   @routine    IOBasic_Startup
   @date       Friday 18th September 1999
   @author     Gabrielle Allen
   @desc 
   The startup registration routine for Basic IO.
   Registers the GH extensions needed for IO and
   the registerable routines used for each method of IO.
   IO does not overload any functions.
   @enddesc 
   @calls     
   @calledby   
   @history 
 
   @endhistory 

@@*/
void IOBasic_Startup (void)
{
  int IOMethod;
  int IO_GHExtension;


  if (CCTK_GHExtensionHandle ("IO") < 0)
  {
    CCTK_WARN (1, "Thorn IOUtil was not activated. "
                  "No IOBasic IO methods will be enabled.");
    return;
  }

  IO_GHExtension = CCTK_RegisterGHExtension ("IOBasic");
  CCTK_RegisterGHExtensionSetupGH (IO_GHExtension, IOBasic_SetupGH);
  CCTK_RegisterGHExtensionInitGH (IO_GHExtension, IOBasic_InitGH);

  /* Register the IOBasic routines as output methods  */
  IOMethod = CCTK_RegisterIOMethod ("Scalar");
  CCTK_RegisterIOMethodOutputGH (IOMethod, IOBasic_OutputGH);
  CCTK_RegisterIOMethodOutputVarAs (IOMethod, IOBasic_OutputVarAs);
  CCTK_RegisterIOMethodTimeToOutput (IOMethod, IOBasic_TimeForOutput);
  CCTK_RegisterIOMethodTriggerOutput (IOMethod, IOBasic_TriggerOutput);

  IOMethod = CCTK_RegisterIOMethod ("Info");
  CCTK_RegisterIOMethodOutputGH (IOMethod, IOBasic_OutputInfoGH);
  CCTK_RegisterIOMethodTimeToOutput (IOMethod, IOBasic_TimeForInfo);
  CCTK_RegisterIOMethodTriggerOutput (IOMethod, IOBasic_TriggerOutputInfo);
  
}