-
Notifications
You must be signed in to change notification settings - Fork 7
/
global.funcdeclare.h
344 lines (213 loc) · 10.9 KB
/
global.funcdeclare.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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// function declarations
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPECIAL USE OF PTRDEF: (and in metric.c):
// int interpX_gcov(FTYPE *X, struct of_compgeom (*compgeom)[NSTORE1+SHIFTSTORE1][NSTORE2+SHIFTSTORE2][NSTORE3+SHIFTSTORE3], FTYPE (*gcovgrid)[NSTORE1+SHIFTSTORE1][NSTORE2+SHIFTSTORE2][NSTORE3+SHIFTSTORE3][SYMMATRIXNDIM], FTYPE (*gcovpertgrid)[NSTORE1+SHIFTSTORE1][NSTORE2+SHIFTSTORE2][NSTORE3+SHIFTSTORE3][NDIM], FTYPE *gcov, FTYPE *gcovpert);
int interpX_gcov(FTYPE *X, struct of_compgeom PTRDEFMETMACP1A0(compgeom,FILL,N1M+SHIFT1,N2M+SHIFT2,N3M+SHIFT3), FTYPE PTRDEFMETMACP1A2(gcovgrid,FILL,N1M+SHIFT1,N2M+SHIFT2,N3M+SHIFT3,NDIM,NDIM), FTYPE PTRDEFMETMACP1A1(gcovpertgrid,FILL,N1M+SHIFT1,N2M+SHIFT2,N3M+SHIFT3,NDIM), FTYPE *gcov, FTYPE *gcovpert);
extern int main(int argc, char *argv[]);
extern int init(int *argc, char **argv[]);
extern void parainitchecks(void);
extern void myargs(int argc, char *argv[]);
extern void pre_interpolate_and_advance(FTYPE (*pb)[NSTORE2][NSTORE3][NPR]);
extern int set_dt(FTYPE (*prim)[NSTORE2][NSTORE3][NPR], SFTYPE *dt);
#include "copyandinit_functions.funcdeclare.h"
#include "flux.funcdeclare.h"
#include "metric_selfgravity_or_evolvemetric.funcdeclare.h"
extern void get_inversion_startendindices(int *loop, int *is,int *ie,int *js,int *je,int *ks,int *ke);
extern void get_stag_startendindices(int *loop, int dir, int *is,int *ie,int *js,int *je,int *ks,int *ke);
extern void get_flux_startendindices(int *loop, int *is,int *ie,int *js,int *je,int *ks,int *ke);
extern int avg2cen_interp(int *locpl, int *whichpltoavg, int *ifnotavgthencopy, int whichquantity, int whichavg2cen, FTYPE (*prims_from_avg_cons)[NSTORE2][NSTORE3][NPR], FTYPE (*in)[NSTORE2][NSTORE3][NPR], FTYPE (*out)[NSTORE2][NSTORE3][NPR]);
extern void set_defaults_performance_checks_prepreinit(void);
extern void set_defaults_performance_checks_preinit(void);
extern void set_file_versionnumbers(void);
extern int timecheck(int whichlocation, SFTYPE comptstart);
extern int gocheck(int whichlocation);
extern int output_steptimedt_info(SFTYPE comptstart);
#if(PRODUCTION<=1)
extern int error_check(int wherefrom);
#endif
extern int find_horizon(int fromwhere);
// initialize DUMP stuff
extern int init_dumps(void);
extern void output_nprlist_info(void);
extern void init_dnumcolumns_dnumversion(void);
extern int init_linklists(void);
int setuplinklist(int numcolumns,int which);
extern struct blink * addlink(struct blink * clinkptr);
extern void report_systeminfo(FILE * fileout);
extern int IsLittleEndian(void);
extern void *SwapEndian(void* Addr, const int Nb);
extern void makedirs(void);
// DUMP file stuff
extern int isenoughfreespace(unsigned long long need);
#include "initbase.funcdeclare.h"
extern int higherorder_set(int whichquantity, int recontype, int*weightsplittype);
extern int get_fluxpldirs(int *Nvec, int dir, int *fluxdir, int* pldir, int *plforflux, FTYPE *signflux);
extern void get_odirs(int dir,int *odir1,int *odir2);
extern int set_location_fluxasemforvpot(int dir, int *numdirs, int *odir1, int *odir2, int *loc);
extern int get_numdirs_fluxasemforvpot(int *numdirs, int *fieldloc);
extern int plstart_set(int whichquantity, int dir, int recontype, int *plstart);
#include "set_grid.funcdeclare.h"
extern FTYPE interpn( int order, FTYPE x_eval, FTYPE x1, FTYPE f1, FTYPE x2, FTYPE f2, FTYPE x3, FTYPE f3, FTYPE x4, FTYPE f4, FTYPE x5, FTYPE f5, FTYPE x6, FTYPE f6 );
extern void interpfun(int interptype, int numpoints, int i, FTYPE pos, FTYPE *xfun, FTYPE *fun, FTYPE *answer);
// log file stuff
#include "mpi_fprintfs.funcdeclare.h"
#include "bounds.funcdeclare.h"
#include "transforms.funcdeclare.h"
#include "coord.funcdeclare.h"
#include "metric.funcdeclare.h"
#include "eos.funcdeclare.h"
#include "phys.funcdeclare.h"
#include "phys.tools.funcdeclare.h"
#include "utoprimgen.funcdeclare.h"
#include "tetrad.funcdeclare.h"
//extern void SHOULDNOTREACHHEREEVERBUGYOUHAVE(void);
#include "wavespeeds.funcdeclare.h"
#include "fixup.funcdeclare.h"
#include "diag.funcdeclare.h"
// interpolation stuff
extern int get_loop(int pointorlinetype, int interporflux, int dir, struct of_loop *loop);
extern int set_interpalltypes_loop_ranges(int pointorlinetype, int interporflux, int dir, int *intdir, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk, int *bs, int *ps, int *pe, int *be);
// line types:
extern void set_interp_loop_gen(int withshifts, int interporflux, int dir, int *intdir, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk, int *bs, int *ps, int *pe, int *be);
//extern void set_interp_loop(int withshifts, int interporflux, int dir, int *intdir, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk, int *bs, int *ps, int *pe, int *be);
//extern void set_interp_loop_expanded(int withshifts, int interporflux, int dir, int *intdir, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk, int *bs, int *ps, int *pe, int *be);
// point types:
extern int set_interppoint_loop_ranges(int interporflux, int dir, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk);
extern int set_interppoint_loop_ranges_3Dextended(int interporflux, int *maxis, int *maxie, int *maxjs, int *maxje, int *maxks, int *maxke, int *di, int *dj, int *dk);
extern void set_interppoint_loop_ranges_2D_EMF_formerged(int interporflux, int corner, int odir1, int odir2, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk);
extern void set_interppoint_loop_ranges_geomcorn_formerged(int interporflux, int corner, int odir1, int odir2, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk);
extern void set_interppoint_loop(int interporflux, int dir, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk);
extern void set_interppoint_loop_expanded(int interporflux, int dir, int *is, int *ie, int *js, int *je, int *ks, int *ke, int *di, int *dj, int *dk);
#include "fluxvpot.funcdeclare.h"
// functions for loop stuff
extern void setup_nprlocalist(int whichprimtype, int *nprlocalstart, int *nprlocalend,int *nprlocallist, int *numprims);
#include "nrutil.funcdeclare.h"
////////////////////////////////
////
//// specialty functions
////
////////////////////////////////
//extern void bondi_solve(FTYPE K, FTYPE gam, FTYPE *Rs, FTYPE *Urs,
// FTYPE *Edot);
//extern FTYPE bondi_trace(FTYPE K, FTYPE gam, FTYPE edotf, FTYPE r,
// FTYPE rs, FTYPE urs);
//extern void timestep(FTYPE ndtr, FTYPE ndth);
//extern FTYPE dtset(FTYPE ndtr, FTYPE ndth);
//
//extern FTYPE bondi_trace(FTYPE K, FTYPE gam, FTYPE edotf,
// FTYPE r, FTYPE rs, FTYPE urs);
//extern void bondi_solve(FTYPE K, FTYPE gam, FTYPE *Rs,
// FTYPE *Urs, FTYPE *Edot);
//extern FTYPE edot_calc(FTYPE r, FTYPE ur, FTYPE g, FTYPE K);
//extern FTYPE dedr_calc(FTYPE r, FTYPE ur, FTYPE g, FTYPE K);
//extern FTYPE dedur_calc(FTYPE r, FTYPE ur, FTYPE g, FTYPE K);
//extern FTYPE d2edr2_calc(FTYPE r, FTYPE ur, FTYPE g, FTYPE K);
//extern FTYPE d2edur2_calc(FTYPE r, FTYPE ur, FTYPE g, FTYPE K);
//extern FTYPE d2edrdur_calc(FTYPE r, FTYPE ur, FTYPE g, FTYPE K);
//
#include "metric.tools.funcdeclare.h"
extern FTYPE sign_bad(FTYPE a);
extern FTYPE sign_func(FTYPE a);
#ifdef WIN32
// GODMARK: Could refine for a=0
#define sign(a) ((a)>0 ? 1.0 : -1.0)
#else
#if(SUPERLONGDOUBLE)
#define sign(a) (sign_bad(a))
#else
#define sign(a) (copysign(1.0,a))
#endif
#endif
extern FTYPE signavoidzero(FTYPE a);
#ifndef WIN32
extern FTYPE max(FTYPE a, FTYPE b);
extern FTYPE min(FTYPE a, FTYPE b);
#endif
// supplemental trig functions
extern FTYPE mysign(FTYPE x);
extern FTYPE myfabs(FTYPE x);
extern FTYPE mysin(FTYPE th);
extern FTYPE mycos(FTYPE th);
extern FTYPE cot(FTYPE arg);
extern FTYPE csc(FTYPE arg);
extern FTYPE sec(FTYPE arg);
///////////////////////////////////
//
// SUPERLONGDOUBLE declarations
//
///////////////////////////////////
#if(SUPERLONGDOUBLE)
#include "mconf.h"
extern long double ceill ( long double );
extern long double floorl ( long double );
extern long double atan2l ( long double, long double );
extern int signbitl ( long double );
//
extern long double fabsl ( long double );
extern long double sqrtl ( long double );
extern long double cbrtl ( long double );
extern long double expl ( long double );
extern long double logl ( long double );
extern long double tanl ( long double );
extern long double atanl ( long double );
extern long double sinl ( long double );
extern long double asinl ( long double );
extern long double cosl ( long double );
extern long double acosl ( long double );
extern long double powl ( long double, long double );
extern long double tanhl ( long double );
extern long double atanhl ( long double );
extern long double sinhl ( long double );
extern long double asinhl ( long double );
extern long double coshl ( long double );
extern long double acoshl ( long double );
extern long double exp2l ( long double );
extern long double log2l ( long double );
extern long double exp10l ( long double );
extern long double log10l ( long double );
extern long double gammal ( long double );
extern long double lgaml ( long double );
extern long double jnl ( int, long double );
extern long double ynl ( int, long double );
extern long double ndtrl ( long double );
extern long double ndtril ( long double );
extern long double stdtrl ( int, long double );
extern long double stdtril ( int, long double );
extern long double ellpel ( long double );
extern long double ellpkl ( long double );
long double lgammal(long double);
extern int isfinitel ( long double );
#define finite(arg) isfinitel(arg)
//#define isfinite(arg) isfinitel(arg)
#define copysign( a, b ) ( fabsl(a) * sign(b) )
extern int merror;
#else
#include <math.h>
#ifdef WIN32
#define finite(arg) _finite(arg)
#define isfinite(arg) _finite(arg)
#endif
#ifndef WIN32
//#if USINGICC==0
#if( !defined(isfinite))
// needed for Sauron
#define isfinite(arg) finite(arg) //atch -- on mako, in force-free it would complain about multiply-defined __finite() if not include this line
#endif
#endif // end if not defined WIN32
#endif
#ifdef WIN32
#define copysign( a, b ) ( fabs(a) * sign(b) )
#endif
#if(!DO_ASSERTS)
#define assert assert_func_empty
#else
#define assert assert_func
#endif
extern int assert_func( int is_bad_val, char *s, ... );
extern int assert_func_empty( int is_bad_val, char *s, ... );
#include "global.funcdeclare.user.h"