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
259
260
261
|
/*@@
@file SetSym.c
@date October 2001
@author Denis Pollney
@desc
Turn off the boundary conditions on the cartoon faces
for grid functions defined by various thorns.
@enddesc
@@*/
#include <stdlib.h>
#include "cGH.h"
#include "CactusBase/CartGrid3D/src/Symmetry.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#define CARTOON_NOSYM -222;
static const char *rcsid = "$Id$";
CCTK_FILEVERSION(BetaThorns_Cartoon2D_SetSym_c);
/* function prototypes */
int ResetSym(cGH* GH, const char* vn);
void Cartoon_SetSym_Einstein(CCTK_ARGUMENTS);
void Cartoon_SetSym_BSSN(CCTK_ARGUMENTS);
void Cartoon_SetSym_WaveToy(CCTK_ARGUMENTS);
/*@@
@routine Cartoon_ResetSym
@date October 2001
@author Denis Pollney
@desc
Applies a ruthless reset of the symmetry flag for the
flat faces (y-direction) of the cartoon plane. The faces
are given the flag CARTOON_NOSYM, which corresponds to
the GFSYM_NOSYM flag in CartGrid3D. The problem with using
CartGrid3D is that it is used to distinguish either a
symmetry BC or radiation BC -- one or the other is always
chosen. So instead, we assign the grid face an otherwise
unrecognised flag which neither the symmetry routines nor
boundary conditions will respond to. Not a complete solution,
but good enough to get Cartoon running with standard
BSSN configurations.
This routine has to be run after SpatialCoordinates.
@enddesc
@@*/
int
ResetSym(cGH* GH, const char* vn)
{
SymmetryGHex *sGHex;
int vi = CCTK_VarIndex(vn);
if (vi < 0)
{
CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
"Couldn't find variable %s in ResetSym\n", vn);
return -1;
}
sGHex = (SymmetryGHex*) GH->extensions[CCTK_GHExtensionHandle("Symmetry")];
/*
* Clobber the previously assigned symmetry flags on the y faces.
*/
sGHex->GFSym[vi][2] = CARTOON_NOSYM;
sGHex->GFSym[vi][3] = CARTOON_NOSYM;
return 0;
}
/*@@
@routine Cartoon_SetSym_Einstein
@date October 2001
@author Denis Pollney
@desc
Resets the symmetries for the Einstein grid functions so
that boundary conditions are not applied to the cartoon
faces.
@enddesc
@@*/
void
Cartoon_SetSym_Einstein(CCTK_ARGUMENTS)
{
DECLARE_CCTK_ARGUMENTS
CCTK_INFO("Resetting cartoon boundary symmetries for Einstein variables");
/* Handle both old and new einstein systems */
if (CCTK_GroupIndex("einstein::metric") > -1)
{
ResetSym(cctkGH, "einstein::gxx");
ResetSym(cctkGH, "einstein::gyy");
ResetSym(cctkGH, "einstein::gzz");
ResetSym(cctkGH, "einstein::gxy");
ResetSym(cctkGH, "einstein::gxz");
ResetSym(cctkGH, "einstein::gyz");
ResetSym(cctkGH, "einstein::kxx");
ResetSym(cctkGH, "einstein::kyy");
ResetSym(cctkGH, "einstein::kzz");
ResetSym(cctkGH, "einstein::kxy");
ResetSym(cctkGH, "einstein::kxz");
ResetSym(cctkGH, "einstein::kyz");
ResetSym(cctkGH, "einstein::alp");
ResetSym(cctkGH, "einstein::betax");
ResetSym(cctkGH, "einstein::betay");
ResetSym(cctkGH, "einstein::betaz");
ResetSym(cctkGH, "einstein::emask");
}
else if (CCTK_GroupIndex("admbase::metric") > -1)
{
ResetSym(cctkGH, "admbase::gxx");
ResetSym(cctkGH, "admbase::gyy");
ResetSym(cctkGH, "admbase::gzz");
ResetSym(cctkGH, "admbase::gxy");
ResetSym(cctkGH, "admbase::gxz");
ResetSym(cctkGH, "admbase::gyz");
ResetSym(cctkGH, "admbase::kxx");
ResetSym(cctkGH, "admbase::kyy");
ResetSym(cctkGH, "admbase::kzz");
ResetSym(cctkGH, "admbase::kxy");
ResetSym(cctkGH, "admbase::kxz");
ResetSym(cctkGH, "admbase::kyz");
ResetSym(cctkGH, "admbase::alp");
ResetSym(cctkGH, "admbase::betax");
ResetSym(cctkGH, "admbase::betay");
ResetSym(cctkGH, "admbase::betaz");
ResetSym(cctkGH, "spacemask::emask");
}
}
/*@@
@routine Cartoon_SetSym_BSSN
@date October 2001
@author Denis Pollney
@desc
Resets the symmetries for the ADM_BSSN grid functions so
that boundary conditions are not applied to the cartoon
faces.
@enddesc
@@*/
void
Cartoon_SetSym_BSSN(CCTK_ARGUMENTS)
{
DECLARE_CCTK_ARGUMENTS
DECLARE_CCTK_PARAMETERS
int ret=0;
/*char* method;*/
char* evolution_system;
char* evolution_method;
evolution_system = CCTK_ParameterValString("evolution_system", "Einstein");
evolution_method = CCTK_ParameterValString("evolution_method", "ADMBase");
if (evolution_system)
{
ret = CCTK_Equals(evolution_system, "adm_bssn");
}
else if (evolution_method)
{
ret = CCTK_Equals(evolution_method, "adm_bssn");
}
if (ret)
{
CCTK_INFO("Resetting cartoon boundary symmetries for ADM_BSSN variables");
ResetSym(cctkGH, "adm_bssn::ADM_BS_dtalp");
ResetSym(cctkGH, "adm_bssn::ADM_BS_phi");
ResetSym(cctkGH, "adm_bssn::ADM_BS_gxx");
ResetSym(cctkGH, "adm_bssn::ADM_BS_gyy");
ResetSym(cctkGH, "adm_bssn::ADM_BS_gzz");
ResetSym(cctkGH, "adm_bssn::ADM_BS_K");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Axx");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Ayy");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Azz");
ResetSym(cctkGH, "adm_bssn::ADM_BS_mask");
ResetSym(cctkGH, "adm_bssn::ADM_BS_gxy");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Axy");
ResetSym(cctkGH, "adm_bssn::ADM_BS_gxz");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Axz");
ResetSym(cctkGH, "adm_bssn::ADM_BS_gyz");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Ayz");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Gx");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Bx");
ResetSym(cctkGH, "adm_bssn::ADM_BS_dirx");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Gy");
ResetSym(cctkGH, "adm_bssn::ADM_BS_By");
ResetSym(cctkGH, "adm_bssn::ADM_BS_diry");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Gz");
ResetSym(cctkGH, "adm_bssn::ADM_BS_Bz");
ResetSym(cctkGH, "adm_bssn::ADM_BS_dirz");
if (CCTK_GroupIndex("einstein::shift") > -1)
{
ResetSym(cctkGH, "einstein::betax");
ResetSym(cctkGH, "einstein::betay");
ResetSym(cctkGH, "einstein::betaz");
}
else if (CCTK_GroupIndex("admbase::shift") > -1)
{
ResetSym(cctkGH, "admbase::betax");
ResetSym(cctkGH, "admbase::betay");
ResetSym(cctkGH, "admbase::betaz");
}
/* stagleap no longer exists in ADM_BSSN
* method = CCTK_ParameterValString("method", "ADM_BSSN");
* if (CCTK_Equals(method, "stagleap"))
* {
* ResetSym(cctkGH, "adm_bssn::ADM_BS_K_stag");
* ResetSym(cctkGH, "adm_bssn::ADM_BS_Axx_stag");
* ResetSym(cctkGH, "adm_bssn::ADM_BS_Ayy_stag");
* ResetSym(cctkGH, "adm_bssn::ADM_BS_Azz_stag");
* ResetSym(cctkGH, "adm_bssn::ADM_BS_Axy_stag");
* ResetSym(cctkGH, "adm_bssn::ADM_BS_Axz_stag");
* ResetSym(cctkGH, "adm_bssn::ADM_BS_Ayz_stag");
* }
* free(method);
*/
}
if (evolution_system)
{
free(evolution_system);
}
if (evolution_method)
{
free(evolution_method);
}
}
/*@@
@routine Cartoon_SetSym_WaveToy
@date Oct 2002
@author David Rideout
@desc
Resets the symmetries for the WaveToy grid function so
that boundary conditions are not applied to the cartoon
faces.
@enddesc
@@*/
void Cartoon_SetSym_WaveToy(CCTK_ARGUMENTS) {
DECLARE_CCTK_ARGUMENTS;
CCTK_INFO("Resetting cartoon boundary symmetry for WaveToy variable");
ResetSym(cctkGH, "wavetoy::phi");
}
|