-
Notifications
You must be signed in to change notification settings - Fork 7
/
global.structs.h
276 lines (207 loc) · 6.15 KB
/
global.structs.h
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// structure definitions
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// none of below blink integers should be nearly as large as 32-bit signed integer can handle
struct blink {
int num; // must stay int since used as argument to MPI functions that assume int -- so this limits number of elements one can pass.
struct blink * np;
// only used by cpu=0
int cpu; // which cpu
int i,j,k,col; // starting values for cpu=0
int ri,rj,rk,rcol; // reference values for first cpu in sequence of nodes for a single buffer
int end;
};
// structure declarations
// if add something, then should set it in (at least) set_grid.c
// gcon put below gcov,gcovpert,alphalapse since gcon not as often needed
// store betasqoalphasq to avoid need of gcon in most calculations
#define interiorofgeompart1a \
int i,j,k,p;
#if(WHICHEOM==WITHGDET)
#define interiorofgeompart1b \
FTYPE gdet;
#else
#define interiorofgeompart1b \
FTYPE gdet; \
FTYPE eomfunc[NPR];
#endif
// FTYPE gcov[SYMMATRIXNDIM]; \
#define interiorofgeompart1c \
FTYPE gcov[SYMMATRIXNDIM]; \
FTYPE gcovpert[NDIM]; \
FTYPE alphalapse; \
FTYPE betasqoalphasq; \
FTYPE beta[NDIM];
#if(WHICHEOM==WITHGDET)
// must always create eomfunc[NPR],ieomfuncnosing[NPR] even if(WHICHEOM!=WITHGDET) since code refers to these arrays[pl] in general
#define interiorofgeompart2 \
FTYPE igdetnosing;
#else
#define interiorofgeompart2 \
FTYPE igdetnosing; \
FTYPE ieomfuncnosing[NPR];
#endif
// FTYPE gcon[SYMMATRIXNDIM];
#if(GDETVOLDIFF)
#define interiorofgeompart3 \
FTYPE gdetvol;
#else
#define interiorofgeompart3
#endif
#define interiorofgeompart4 \
FTYPE gcon[SYMMATRIXNDIM];
// done with parts of structure
#define interiorofgeom \
interiorofgeompart1a \
interiorofgeompart1b \
interiorofgeompart1c \
interiorofgeompart2 \
interiorofgeompart3 \
interiorofgeompart4
#define interiorofgdetgeom \
interiorofgeompart1b \
interiorofgeompart2
// stored global geometry used most of the time when previously would call get_geometry()
struct of_compgeom {
interiorofgeom
};
#if(GETGEOMUSEPOINTER==0)
//typedef struct of_geom struct of_compgeom;
// force to be the same
#define of_geom of_compgeom
struct of_allgeom {
interiorofgeom
// extra in "allgeom"
FTYPE X[NDIM];
FTYPE V[NDIM];
FTYPE dxdxp[NDIM][NDIM];
};
#else
struct of_geom {
// dummy space for gset() version
FTYPE gengcov[SYMMATRIXNDIM];
FTYPE gengcovpert[NDIM];
FTYPE alphalapse;
FTYPE betasqoalphasq;
FTYPE beta[NDIM];
FTYPE gengcon[SYMMATRIXNDIM];
// bit faster since not all values always used
FTYPE *gcov;
FTYPE *gcon;
FTYPE *gcovpert;
FTYPE gdet,igdetnosing;
#if(GDETVOLDIFF)
FTYPE gdetvol;
#endif
#if(WHICHEOM!=WITHGDET)
FTYPE eomfunc[NPR],ieomfuncnosing[NPR];
#endif
int i,j,k,p;
};
struct of_allgeom {
#if(GETGEOMUSEPOINTER==0)
FTYPE gcov[SYMMATRIXNDIM];
FTYPE gcovpert[NDIM];
FTYPE alphalapse;
FTYPE betasqoalphasq;
FTYPE beta[NDIM];
FTYPE gcon[SYMMATRIXNDIM];
#else
// dummy space for gset() version
FTYPE gengcon[SYMMATRIXNDIM];
FTYPE gengcov[SYMMATRIXNDIM];
FTYPE gengcovpert[NDIM];
// bit faster since not all values always used
FTYPE *gcov;
FTYPE *gcovpert;
FTYPE alphalapse;
FTYPE betasqoalphasq;
FTYPE beta[NDIM];
FTYPE *gcon;
#endif
FTYPE gdet,igdetnosing;
#if(GDETVOLDIFF)
FTYPE gdetvol;
#endif
#if(WHICHEOM!=WITHGDET)
FTYPE eomfunc[NPR],ieomfuncnosing[NPR];
#endif
int i,j,k,p;
// extra in "allgeom"
FTYPE X[NDIM];
FTYPE V[NDIM];
FTYPE dxdxp[NDIM][NDIM];
};
#endif
#if(NEWMETRICSTORAGE)
// stored global geometry used most of the time when previously would call get_geometry()
struct of_gdetgeom {
interiorofgdetgeom
};
#else
#define of_gdetgeom of_compgeom
#endif
//////////////////////
//
// state structure
//
//////////////////////
struct of_state {
FTYPE ucon[NDIM];
FTYPE ucov[NDIM];
FTYPE bcon[NDIM];
FTYPE bcov[NDIM];
FTYPE pressure; // aux thermodynamical quantity
FTYPE bsq; // b^2 that is often used
FTYPE entropy; //aux thermodynamical quantity
FTYPE ifremoverestplus1ud0elseud0; // 1+u_t
// OPTMARK: If don't use bcon,bcov, store Bcon/u^t and Bcov/u^t so avoid catastrophic cancellation but still avoid divisions.
FTYPE others[NUMOTHERSTATERESULTS];
#if(MERGEDC2EA2CMETHOD)
// for merged method and stored by compute_and_store_???() functions
FTYPE gdet;
#if(WHICHEOM!=WITHGDET)
FTYPE eomfunc[NPR]; // eomfunc
#endif
FTYPE prim[NPR];
FTYPE Blower[NDIM];
FTYPE vcon[NDIM];
FTYPE gdetBcon[NDIM];
FTYPE overut;
#else
// avoid allocating since expensive for cache misses
// don't take more memory than needed for pointer references for code to compile
// FTYPE gdet;
//#if(WHICHEOM!=WITHGDET)
// FTYPE *eomfunc;
//#endif
// FTYPE *prim;
// FTYPE *Blower;
// FTYPE *gdetBcon; // for FLUXB==FLUXCTSTAG
// FTYPE *vcon; // for FLUXB==FLUXCTSTAG
// FTYPE overut;
#endif
};
struct of_loop {
int is, ie;
int js, je;
int ks, ke;
int dir,intdir;
int ps, pe;
int bs, be;
int di,dj,dk;
};
struct of_newtonstats {
FTYPE lerrx;
int lntries;
int nstroke;
FTYPE invproperty[NUMINVPROPERTY];
char invpropertytext[NUMINVPROPERTY][10];
};
struct of_trueijkp {
int i,j,k,p,dir,iter,interporflux;
};