aboutsummaryrefslogtreecommitdiff
path: root/schedule.ccl
blob: 3570aff159e16dd7177aec35119858261090ed13 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# Schedule definitions for thorn ADMBase
# $Header$

STORAGE: shift_state dtlapse_state dtshift_state

if (lapse_timelevels == 1)
{
  STORAGE: lapse[1]
}
else if (lapse_timelevels == 2)
{
  STORAGE: lapse[2]
}
else if (lapse_timelevels == 3)
{
  STORAGE: lapse[3]
}

if (! CCTK_Equals(initial_shift, "none"))
{
  if (shift_timelevels == 1)
  {
    STORAGE: shift[1]
  }
  else if (shift_timelevels == 2)
  {
    STORAGE: shift[2]
  }
  else if (shift_timelevels == 3)
  {
    STORAGE: shift[3]
  }
}

if (! CCTK_Equals(initial_dtlapse, "none"))
{
  if (lapse_timelevels == 1)
  {
    STORAGE: dtlapse[1]
  }
  else if (lapse_timelevels == 2)
  {
    STORAGE: dtlapse[2]
  }
  else if (lapse_timelevels == 3)
  {
    STORAGE: dtlapse[3]
  }
}

if (! CCTK_Equals(initial_dtshift, "none"))
{
  if (shift_timelevels == 1)
  {
    STORAGE: dtshift[1]
  }
  else if (shift_timelevels == 2)
  {
    STORAGE: dtshift[2]
  }
  else if (shift_timelevels == 3)
  {
    STORAGE: dtshift[3]
  }
}

if (metric_timelevels == 1)
{
  STORAGE: metric[1], curv[1]
}
else if (metric_timelevels == 2)
{
  STORAGE: metric[2], curv[2]
}
else if (metric_timelevels == 3)
{
  STORAGE: metric[3], curv[3]
}



SCHEDULE ADMBase_ParamCheck at CCTK_PARAMCHECK
{
  LANG: C
  OPTIONS: global
} "Check consistency of parameters"

# Schedule group for setting initial data

SCHEDULE group ADMBase_InitialData at CCTK_INITIAL
{
} "Schedule group for calculating ADM initial data"

SCHEDULE group ADMBase_InitialGauge at CCTK_INITIAL after ADMBase_InitialData
{
} "Schedule group for the ADM initial gauge condition"

SCHEDULE group ADMBase_PostInitial at CCTK_INITIAL after (ADMBase_InitialData ADMBase_InitialGauge)
{
} "Schedule group for modifying the ADM initial data, such as e.g. adding noise"

# Initial data for the spatial slices

if (CCTK_Equals(initial_data, "Cartesian Minkowski"))
{
  SCHEDULE ADMBase_CartesianMinkowski in ADMBase_InitialData
  {
    LANG: C
  } "Set the metric and extrinsic curvature to cartesian minkowski values"
}

# Initial data for the lapse

if (CCTK_Equals(initial_lapse, "one"))
{
  SCHEDULE ADMBase_LapseOne in ADMBase_InitialGauge
  {
    LANG: C
  } "Set the lapse to 1 at all points"
}

# Do we have storage for the shift?
if (! CCTK_Equals(initial_shift, "none")) 
{
  SCHEDULE ADMBase_SetShiftStateOn at CCTK_BASEGRID
  {
    LANG: C
  } "Set the shift_state variable to 1"
}
else
{
  SCHEDULE ADMBase_SetShiftStateOff at CCTK_BASEGRID
  {
    LANG: C
  } "Set the shift_state variable to 0"
}

# Do we have storage for dtlapse?
if (! CCTK_Equals(initial_dtlapse, "none")) 
{
  SCHEDULE ADMBase_SetDtLapseStateOn at CCTK_BASEGRID
  {
    LANG: C
  } "Set the dtlapse_state variable to 1"
}
else
{
  SCHEDULE ADMBase_SetDtLapseStateOff at CCTK_BASEGRID
  {
    LANG: C
  } "Set the dtlapse_state variable to 0"
}

# Do we have storage for dtshift?
if (! CCTK_Equals(initial_dtshift, "none")) 
{
  SCHEDULE ADMBase_SetDtShiftStateOn at CCTK_BASEGRID
  {
    LANG: C
  } "Set the dtshift_state variable to 1"
}
else
{
  SCHEDULE ADMBase_SetDtShiftStateOff at CCTK_BASEGRID
  {
    LANG: C
  } "Set the dtshift_state variable to 0"
}

# Initial data for the shift
if (CCTK_Equals(initial_shift, "zero"))
{
  SCHEDULE ADMBase_ShiftZero in ADMBase_InitialGauge
  {
    LANG: C
  } "Set the shift to 0 at all points"
}

# Initial data for dtlapse
if (CCTK_Equals(initial_dtlapse, "zero"))
{
  SCHEDULE ADMBase_DtLapseZero in ADMBase_InitialGauge
  {
    LANG: C
  } "Set the dtlapse to 0 at all points"
}

# Initial data for dtshift
if (CCTK_Equals(initial_dtshift, "zero"))
{
  SCHEDULE ADMBase_DtShiftZero in ADMBase_InitialGauge
  {
    LANG: C
  } "Set the dtshift to 0 at all points"
}



if (CCTK_Equals(lapse_evolution_method, "static"))
{
  SCHEDULE ADMBase_LapseStatic in CCTK_PRESTEP
  {
    LANG: C
  } "Copy the lapse to the current time level"
}

if (CCTK_Equals(shift_evolution_method, "static"))
{
  SCHEDULE ADMBase_ShiftStatic in CCTK_PRESTEP
  {
    LANG: C
  } "Copy the shift to the current time level"
}

if (CCTK_Equals(evolution_method, "static") || CCTK_Equals(evolution_method, "none"))
{
  SCHEDULE ADMBase_Static in CCTK_PRESTEP
  {
    LANG: C
  } "Copy the metric and extrinsic curvature to the current time level"
}

# FIXME: Remove this when symmetries done better 
schedule Einstein_InitSymBound at CCTK_WRAGH
{
  LANG: C
  OPTIONS: global
} "Set up GF symmetries"

# For Mesh Refinement it is possible (eg Cowling approximation) that ADMBase variables will need synchronization even when not evolved (eg when a new refined grid appears)
if (CCTK_Equals(evolution_method, "static") || CCTK_Equals(evolution_method, "none") || CCTK_Equals(lapse_evolution_method, "static") || CCTK_Equals(shift_evolution_method, "static") || CCTK_Equals(dtlapse_evolution_method, "static") || CCTK_Equals(dtshift_evolution_method, "static") )
{
  SCHEDULE ADMBase_Boundaries IN MoL_PostStep BEFORE ADMBase_SetADMVars
  {
    LANG: C
    OPTIONS: LEVEL
    SYNC: lapse
    SYNC: dtlapse
    SYNC: shift
    SYNC: dtshift
    SYNC: metric
    SYNC: curv
  } "Select ADMBase boundary conditions - may be required for mesh refinement"

  SCHEDULE GROUP ApplyBCs as ADMBase_ApplyBCs IN MoL_PostStep AFTER ADMBase_Boundaries BEFORE ADMBase_SetADMVars
  {
  } "Apply the boundary conditions of ADMBase"

}

# TODO: Rename this group to "ADMBase_HaveBeenSet"?
SCHEDULE GROUP ADMBase_SetADMVars IN MoL_PostStep
{
} "Set the ADM variables before this group, and use them afterwards"

SCHEDULE GROUP ADMBase_SetADMVars IN MoL_PseudoEvolution
{
} "Set the ADM variables before this group, and use them afterwards"