blob: 7fb61368742be69d0ed400766ebd691ef9ec2a77 (
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
99
100
101
102
103
104
105
106
|
/*@@
@file MainUtils.c
@date Sep 22 1999
@author Thomas Radke, Gabrielle Allen
@desc
Utility Flesh routines
@enddesc
@version $Header$
@@*/
#include <string.h>
#include "cctk_Flesh.h"
#include "cctk_Misc.h"
#include "cctk_Schedule.h"
#include "cctk_Parameter.h"
static char *rcsid = "$Header$";
static const char *startuptime = "How do I do this";
CCTK_FILEVERSION(main_MainUtils_c)
/* the iteration counter used in the evolution loop */
static int iteration = 0;
/*@@
@routine CCTK_SetMainLoopIndex
@date Sep 22 1999
@author Thomas Radke
@desc
Sets the iteration counter variable of the evolution loop.
This is used for recovery.
@enddesc
@calls
@calledby
@@*/
int CCTK_SetMainLoopIndex (int main_loop_index)
{
iteration = main_loop_index;
return iteration;
}
/*@@
@routine CCTK_MainLoopIndex
@date Sep 22 1999
@author Thomas Radke
@desc
Returns the iteration counter variable of the evolution loop.
This is used for checkpointing.
@enddesc
@calls
@calledby
@@*/
int CCTK_MainLoopIndex (void)
{
return (iteration);
}
/*@@
@routine CCTK_RunTitle
@date Sun Sep 17 2000
@author Gabrielle Allen
@desc
Returns the simulation description
@enddesc
@calls
@calledby
@@*/
int CCTK_RunTitle(int len, char *title)
{
int retval;
int param_type;
const char *cctk_title;
cctk_title = (*(const char **)
CCTK_ParameterGet("cctk_run_title",
"Cactus",
¶m_type));
if (cctk_title)
{
if (CCTK_Equals(cctk_title,""))
{
strcpy(title,"Cactus Simulation");
}
else
{
strncpy(title,cctk_title,len-1);
}
retval = strlen(title);
retval=retval > len ? 0 : retval;
}
else
{
retval = -1;
}
return retval;
}
|