HARM
harm and utilities
 All Data Structures Files Functions Variables Typedefs Macros Pages
phys.funcdeclare.h
Go to the documentation of this file.
1 
5 extern int sourcephysics(FTYPE *pi, FTYPE *ph, FTYPE *pf, int *didreturnpf, int *eomtype, struct of_geom *geom, struct of_state *q, FTYPE *Ugeomfreei, FTYPE *Ugeomfreef, FTYPE* CUf, FTYPE *CUimp, FTYPE dissmeasure, FTYPE *dUother, FTYPE (*dUcomp)[NPR]);
6 
7 extern void postdt(void);
8 extern int primtoU(int returntype, FTYPE *p, struct of_state *q, struct of_geom *geom,
9  FTYPE *U, FTYPE *Uabs);
10 
11 extern int ucon_calc_3vel(FTYPE *pr, struct of_geom *geom, FTYPE *ucon, FTYPE *others);
12 extern int ucon_calc_rel4vel(FTYPE *pr, struct of_geom *geom, FTYPE *ucon, FTYPE *others);
13 extern int ucon_calc_4vel(FTYPE *pr, struct of_geom *geom, FTYPE *ucon, FTYPE *others);
14 extern int ucon_calc_4vel_bothut(FTYPE *pr, struct of_geom *geom, FTYPE *ucon, FTYPE *ucon2, FTYPE *others);
15 
16 extern int ucon_calc_rel4vel_fromuconrel(FTYPE *uconrel, struct of_geom *geom, FTYPE *ucon, FTYPE *others);
17 extern int gamma_calc_fromuconrel(FTYPE *uconrel, struct of_geom *geom, FTYPE*gamma, FTYPE *qsq);
18 
19 extern int uconrel(FTYPE *ucon, FTYPE *uconrel, struct of_geom *geom);
20 
21 
22 #if(RELTYPE==RELEOM)
23 
24 #if(WHICHVEL==VEL4)
25 #define ucon_calc ucon_calc_4vel
26 #define dudp_calc dudp_calc_gen
27 #define compute_1plusud0 compute_1plusud0_general
28 #define bsq_calc bsq_calc_general
29 #define bsq_calc_fromq bsq_calc_fromq_general
30 #elif(WHICHVEL==VEL3)
31 #define ucon_calc ucon_calc_3vel
32 #define dudp_calc dudp_calc_3vel
33 #define compute_1plusud0 compute_1plusud0_general
34 #define bsq_calc bsq_calc_general
35 #define bsq_calc_fromq bsq_calc_fromq_general
36 #elif(WHICHVEL==VELREL4)
37 #define ucon_calc ucon_calc_rel4vel
38 #define dudp_calc dudp_calc_gen
39 #define compute_1plusud0 compute_1plusud0_rel4vel // uses qsq and gamma from ucon_calc_rel4vel()
40 #define bsq_calc bsq_calc_rel4vel
41 #define bsq_calc_fromq bsq_calc_fromq_rel4vel
42 #elif(RELTYPE==NONRELEOM) // not really right
43 #define ucon_calc ucon_calc_nonrel
44 #define dudp_calc dudp_calc_nonrel
45 #define compute_1plusud0 compute_1plusud0_general
46 #define bsq_calc bsq_calc_general
47 #define bsq_calc_fromq bsq_calc_fromq_general
48 #endif
49 #endif
50 
51 
52 extern int ucon_calcother(FTYPE *pr, FTYPE *ucon, FTYPE *others);
53 extern void ucon_precalc(FTYPE *ucon, FTYPE *AA, FTYPE *BB,FTYPE *CC, FTYPE *discr);
54 
55 
56 extern int ucon_calc_whichvel(int whichvel, FTYPE *pr, struct of_geom *geom, FTYPE *ucon, FTYPE *others);
57 
58 
59 // physics stuff
60 extern int set_zamo_velocity(int whichvel, struct of_geom *ptrgeom, FTYPE *pr);
61 extern int set_zamo_ucovuconplus1ud0(struct of_geom *ptrgeom, FTYPE *ucov, FTYPE *ucon, FTYPE *plus1ud0);
62 extern int set_zamo_ucon(struct of_geom *ptrgeom, FTYPE *ucon);
63 
64 extern int bsq_calc(FTYPE *pr, struct of_geom *geom, FTYPE *b2);
65 extern int bsq_calc_fromq(FTYPE *pr, struct of_geom *geom, struct of_state *q, FTYPE *b2);
66 extern void b_calc(FTYPE *pr, FTYPE *ucon, FTYPE *b);
67 extern void bsq_calc_rel4vel_fromq(FTYPE *pr, struct of_geom *ptrgeom, struct of_state *q, FTYPE *bsq);
68 
69 
70 extern int gamma_calc(FTYPE *pr, struct of_geom *geom,FTYPE *gamma, FTYPE *qsq);
71 
72 
73 extern int dudp_calc_gen(int whicheos, int whichcons, FTYPE *EOSextra, FTYPE *pr, struct of_state *q, struct of_geom *ptrgeom, FTYPE **alpha);
74 
75 extern int dudp_calc_3vel(int whicheos, int whichcons, FTYPE *EOSextra, FTYPE *pr, struct of_state *q, struct of_geom *geom, FTYPE **alpha);
76 
77 
78 extern int sol(FTYPE *pr, struct of_state *q, int dir, struct of_geom *geom, FTYPE *vmax, FTYPE *vmin);
79 
80 extern void UtoU(int inputtype, int returntype,struct of_geom *ptrgeom,FTYPE *Uin, FTYPE *Uout);
81 extern void UtoU_evolve2diag(int inputtype, int returntype,struct of_geom *ptrgeom,FTYPE *Uin, FTYPE *Uout);
82 
83 
84 // presume get_geometry() only necessarily feeds back pointer where geometry is located
85 // if want hard copy to be created using a memory, should use copy_geometry()
86 // still required to have pointer point to physical allocated memory in general
87 #if(NEWMETRICSTORAGE)
88 // overwrites any prior pointer reference
89 // better than copying since no point in copying if memory already exists and get_geometry() is always for real computational geometry
90 // This only works if feed pointer directly into get_geometry. Can't feed &geom.
91 
92 #if(MCOORD!=CARTMINKMETRIC)
93 
94 #define get_geometry(ii,jj,kk,pp,ptrgeom) ptrgeom=&GLOBALMETMACP1A0(compgeom,pp,ii,jj,kk);
95 #define get_geometry_gdetmix(ii,jj,kk,pp,ptrgeom) ptrgeom=&GLOBALMETMACP0A1(gdetgeom,ii,jj,kk,pp);
96 #define get_geometry_gdetonly(ii,jj,kk,pp,ptrgeom) ptrgeom=&GLOBALMETMACP1A0(gdetgeomnormal,pp,ii,jj,kk);
97 #define get_geometry_geomeonly(ii,jj,kk,pp,ptrgeom) ptrgeom=&GLOBALMETMACP1A0(gdetgeomnormal,pp,ii,jj,kk);
98 #define set_igdet(arg)
99 #define set_igdetsimple(arg)
100 
101 #else// else if CARTMINKMETRIC
102 
103 #define get_geometry(ii,jj,kk,pp,ptrgeom) ptrgeom=&GLOBALMETMACP1A0(compgeom,pp,0,0,0);
104 #define get_geometry_gdetmix(ii,jj,kk,pp,ptrgeom) ptrgeom=&GLOBALMETMACP0A1(gdetgeom,0,0,0,pp);
105 #define get_geometry_gdetonly(ii,jj,kk,pp,ptrgeom) ptrgeom=&GLOBALMETMACP1A0(gdetgeomnormal,pp,0,0,0);
106 #define get_geometry_geomeonly(ii,jj,kk,pp,ptrgeom) ptrgeom=&GLOBALMETMACP1A0(gdetgeomnormal,pp,0,0,0);
107 #define set_igdet(arg)
108 #define set_igdetsimple(arg)
109 
110 #endif // end if CARTMINKMETRIC
111 
112 
113 
114 #else // else if old metric storage method
115 
116 
117 #define get_geometry(ii,jj,kk,pp,ptrgeom) get_geometry_old(ii,jj,kk,pp,ptrgeom)
118 #define get_geometry_gdetmix(ii,jj,kk,pp,ptrgeom) get_geometry_old(ii,jj,kk,pp,ptrgeom)
119 #define get_geometry_gdetonly(ii,jj,kk,pp,ptrgeom) get_geometry_gdetonly_old(ii,jj,kk,pp,ptrgeom)
120 #define get_geometry_geomeonly(ii,jj,kk,pp,ptrgeom) get_geometry_geomeonly_old(ii,jj,kk,pp,ptrgeom)
121 #define set_igdet(arg) set_igdet_old(arg)
122 #define set_igdetsimple(arg) set_igdetsimple_old(arg)
123 
124 
125 #endif
126 
127 
128 
129 #if(NEWMETRICSTORAGE==0)
130 extern void get_geometry_old(int i, int j, int k, int loc, struct of_geom *geom);
131 extern void get_geometry_gdetonly_old(int ii, int jj, int kk, int pp, struct of_geom *geom);
132 extern void get_geometry_geomeonly_old(int ii, int jj, int kk, int pp, struct of_geom *geom);
133 extern void set_igdetsimple_old(struct of_geom *geom);
134 #endif
135 
136 
137 
138 
139 
140 
141 extern void get_allgeometry(int i, int j, int k, int loc, struct of_allgeom *allgeom, struct of_geom *geom);
142 
143 
144 
145 extern int get_state(FTYPE *pr, struct of_geom *geom,struct of_state *q);
146 extern int get_state_norad_part1(FTYPE *pr, struct of_geom *geom,struct of_state *q);
147 extern int get_state_norad_part2(int needentropy, FTYPE *pr, struct of_geom *geom,struct of_state *q);
148 extern int get_state_radonly(FTYPE *pr, struct of_geom *geom,struct of_state *q);
149 extern int get_state_nofield(FTYPE *pr, struct of_geom *geom,struct of_state *q);
150 extern int get_stateforcheckinversion(FTYPE *pr, struct of_geom *geom,struct of_state *q);
151 extern int get_state_uconucovonly(FTYPE *pr, struct of_geom *ptrgeom, struct of_state *q);
152 extern int get_stateforsource(FTYPE *pr, struct of_geom *ptrgeom, struct of_state **q);
153 extern int get_stateforfluxcalc(int dimen, int isleftright, FTYPE *pr, struct of_geom *ptrgeom, struct of_state **qptr);
154 extern int get_stateforUdiss(FTYPE *pr, struct of_geom *ptrgeom, struct of_state *q);
155 extern int get_stateforinterpline(FTYPE *pr, struct of_geom *ptrgeom, struct of_state **qptr);
156 extern int get_stateforglobalwavespeeds(FTYPE *pr, struct of_geom *ptrgeom, struct of_state **qptr);
157 
158 
159 extern void compute_and_store_fluxstatecent(FTYPE (*pr)[NSTORE2][NSTORE3][NPR]);
160 
161 
162 extern int primtoflux(int returntype, FTYPE *pa, struct of_state *q, int dir,
163  struct of_geom *geom, FTYPE *fl, FTYPE *flabs);
164 extern int primtoflux_splitmaem(int returntype, FTYPE *pa, struct of_state *q, int fluxdir, int fundir, struct of_geom *geom, FTYPE *flma, FTYPE *flem);
165 
166 
167 extern int flux_compute_general(int i, int j, int k, int dir, struct of_geom *geom, FTYPE CUf, FTYPE *p_c, FTYPE *p_l, FTYPE *p_r, FTYPE *F, FTYPE *ctopall);
168 extern int flux_compute_splitmaem(int i, int j, int k, int dir, struct of_geom *geom, FTYPE CUf, FTYPE *p_c, FTYPE *p_l, FTYPE *p_r, FTYPE *F, FTYPE *FEM, FTYPE *ctopall);
169 
170 extern void mks_source_conn(FTYPE *ph, struct of_geom *ptrgeom,
171  struct of_state *q,FTYPE *dU);
172 extern int source(FTYPE *pi, FTYPE *pa, FTYPE *pf, int *didreturnpf, int *eomtype, struct of_geom *geom, struct of_state *q, FTYPE *Ui, FTYPE *Uf, FTYPE *CUf, FTYPE *CUimp, FTYPE dissmeasure, FTYPE *dUriemann,
173  FTYPE (*Uacomp)[NPR], FTYPE *Ua);
174 
175 extern FTYPE taper_func(FTYPE R,FTYPE rin) ;
176 
177 extern FTYPE lc4(int updown, FTYPE detg, int mu,int nu,int kappa,int lambda);
178 extern void faraday_calc(int which, FTYPE *b, FTYPE *u, struct of_geom *geom, FTYPE (*faraday)[NDIM]);
179 extern void current_precalc(int which, struct of_geom *geom, struct of_state *q, SFTYPE Dt,FTYPE (*faraday)[3]);
180 extern void current_calc(FTYPE (*cfaraday)[NSTORE2][NSTORE3][NUMCURRENTSLOTS][3]);
181 extern int current_doprecalc(int which, FTYPE (*p)[NSTORE2][NSTORE3][NPR]);