TYCHO  1.3.0
 All Data Structures Files Functions Variables Enumerations Enumerator
/home/kapf/tycho_docu/prototypes.h
Go to the documentation of this file.
1 /*
2  * prototypes.h
3  * all the functions used in TYCHO
4  *
5  * Author: Wolfgang Kapferer
6  */
7 
8 #ifndef PROTOTYPES_H_
9 #define PROTOTYPES_H_
10 
11 int callocate_arrays_global(int x, int y, int z, int max_array_length);
14 int free_sweep(void);
15 int free_ppm(void);
16 
17 int initiate_grid(int x, double xmin, double xmax, int y, double ymin, double ymax, int z, double zmin, double zmax);
18 int initiate_domain(int x, int y, int z);
19 int initiate_domain_dom(int x, int y, int z);
20 int initiate_domain_marker(int x, int y, int z);
21 
22 int hydro_sweeps(int x, int y, int z, int direction);
23 
24 int init_ppm(double **rho_1D, double **pre_1D, double **eng_1D, double **vx_1D, double **vy_1D,
25  double **vz_1D, double **marker_1D, double **dx0, double **xa0, double **xa, double **dx, double **a_coef,
26  double **ai_coef, double **b_coef, double **bi_coef, double **c_coef, double **ci_coef,
27  double **d_x, double **da, double **ar, double **dp, double **dr, double **du,
28  double **pl, double **p6, double **rl, double **r6, double **ul, double **u6,
29  double **vl, double **v6, double **wl, double **w6, double **el, double **e6,
30  double **ql, double **q6, double **deltaa, double **dv, double **dw, double **dq,
31  double **de, double **scratch1, double **scratch2, double **scratch3, double **diffa,
32  double **plft, double **prgh, double **ulft, double **urgh, double **rlft, double **rrgh,
33  double **Cdtdx, double **fCdtdx, double **clft, double **crgh, double **plfti, double **prghi,
34  double **pmid, double **pmold, double **wlft, double **wrgh, double **zlft, double **zrgh,
35  double **umidl, double **umidr, double **umid, double **dm, double **dtbdm, double **upmid,
36  double **xa1, double **xa2, double **xa3, double **vx_1D_old, double **e_int_1D, double **dvol,
37  double **dvol0, double **dvol1, double **delta, double **fluxr, double **fluxu, double **fluxv,
38  double **fluxw, double **fluxe, double **fluxq, double **dm0, double **steep, double **flat,
39  double ***para, double **pressure_solid_1D, double **rhodown, double **rhoup, double **rhofront,
40  double **rhoback, double **vxdown, double **vxup, double **vxfront, double **vxback, double **vydown,
41  double **vyup, double **vyfront, double **vyback, double **vzdown, double **vzup, double **vzfront,
42  double **vzback, int dimension);
43 
44 int ppm_free(double **rho_1D, double **pre_1D, double **eng_1D, double **vx_1D, double **vy_1D,
45  double **vz_1D, double **marker_1D, double **pressure_solid_1D,
46  double **dx0, double **xa0, double **xa, double **dx, double **a_coef,
47  double **ai_coef, double **b_coef, double **bi_coef, double **c_coef, double **ci_coef,
48  double **d_x, double **da, double **ar, double **dp, double **dr, double **du,
49  double **pl, double **p6, double **rl, double **r6, double **ul, double **u6,
50  double **vl, double **v6, double **wl, double **w6, double **el, double **e6,
51  double **ql, double **q6, double **deltaa, double **dv, double **dw, double **dq,
52  double **de, double **scratch1, double **scratch2, double **scratch3, double **diffa,
53  double **plft, double **prgh, double **ulft, double **urgh, double **rlft, double **rrgh,
54  double **Cdtdx, double **fCdtdx, double **clft, double **crgh, double **plfti, double **prghi,
55  double **pmid, double **pmold, double **wlft, double **wrgh, double **zlft, double **zrgh,
56  double **umidl, double **umidr, double **umid, double **dm, double **dtbdm, double **upmid,
57  double **xa1, double **xa2, double **xa3, double **vx_1D_old, double **e_int_1D, double **dvol,
58  double **dvol0, double **dvol1, double **delta, double **fluxr, double **fluxu, double **fluxv,
59  double **fluxw, double **fluxe, double **fluxq, double **dm0, double **steep, double **flat,
60  double ***para, double **rhodown, double **rhoup, double **rhofront,
61  double **rhoback, double **vxdown, double **vxup, double **vxfront, double **vxback, double **vydown,
62  double **vyup, double **vyfront, double **vyback, double **vzdown, double **vzup, double **vzfront,
63  double **vzback, int dimension);
64 
65 int init_diffusion(double **temperature_1D, double **temperature_1D_future, double **mass, int **dom_1D);
66 int init_diffusion(double **temperature_1D, double **temperature_1D_future, double **mass, int **dom_1D);
67 
68 int make_ic(int x, int y, int z);
69 int make_sod_ic(int x, int y, int z);
70 int make_kh_instabilities(int x, int y, int z);
71 
72 int read_ic(int x, int y, int z);
73 int read_restart(int x, int y, int z);
74 int read_dom(int x, int y, int z);
75 
76 int read_marker_file(int x, int y, int z);
77 
78 int start_file_reader(char filename[]);
79 
80 int calculate_pressure(int x, int y, int z, double temperature);
81 
82 long long int ntohll(const long long int data);
83 
84 int write_ic_tyc(int x, int y, int z);
85 int write_ic_vtk(int x, int y, int z);
86 int write_ic_amira(int x, int y, int z);
87 int write_ic_ifrit(int x, int y, int z);
88 
89 int write_tyc(int x, int y, int z, int counter);
90 int write_vtk(int x, int y, int z, int counter);
91 int write_amira(int x, int y, int z, int counter);
92 int write_ifrit(int x, int y, int z, int counter);
93 
94 int write_restart_tyc(int x, int y, int z);
95 
96 int dt_calc(int x, int y, int z);
97 int dt_calc_first(int x, int y, int z);
98 
99 int sweep_x(int x, int y, int z, int flag);
100 int sweep_y(int x, int y, int z, int flag);
101 int sweep_z(int x, int y, int z, int flag);
102 
103 int ppm_step(int i, int j, int k, int direction, int flag, int nmin, int nmax, double *a_coef, double *ai_coef,
104  double *b_coef, double *bi_coef, double *c_coef, double *ci_coef,
105  double *d_x, double *diffa, double *da, double *ar, double *pl,
106  double *p6, double *rl, double *r6, double *u6, double *ul,
107  double *vl, double *v6, double *wl, double *w6, double *el,
108  double *e6, double *ql, double *q6, double *dp, double *du,
109  double *dr, double *dv, double *dw, double *dq, double *de,
110  double *scratch1, double *scratch2, double *scratch3,
111  double *plft, double *prgh, double *ulft, double *urgh,
112  double *rlft, double *rrgh, double *Cdtdx, double *fCdtdx,
113  double *steep, double *flat, double **para, double *clft,
114  double *crgh, double *plfti, double *prghi, double *pmid,
115  double *pmold, double *wlft, double *wrgh, double *zlft,
116  double *zrgh, double *umidl, double *umidr, double *umid,
117  double *dm, double *dtbdm, double *upmid, double *xa1,
118  double *xa2, double *xa3, double *vx_1D_old, double *dvol,
119  double *dvol0, double *dvol1, double *delta, double *fluxr,
120  double *fluxu, double *fluxv, double *fluxw, double *fluxe,
121  double *fluxq, double *dm0, double *e_int_1D, double *rho_1D,
122  double *pre_1D, double *eng_1D, double *vx_1D, double *vy_1D,
123  double *vz_1D, double *marker_1D, double *pressure_solid_1D,
124  double *dx0, double *xa0, double *xa, double *dx, int bound_checker, int lefter,
125  double *rhodown, double *rhoup, double *rhofront, double *rhoback, double *vxdown,
126  double *vxup, double *vxfront, double *vxback, double *vydown, double *vyup,
127  double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
128  double *vzback, int viscosity_on_off, int dimension);
129 
130 int set_boundary(int nmin, int nmax, int flag, int bound_checker, int lefter,
131  double *rho_1D, double *eng_1D, double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
132  double *pressure_solid_1D, double *xa0, double *dx0, double *xa, double *dx, double *rhodown,
133  double *rhoup, double *rhofront, double *rhoback, double *vxdown, double *vxup, double *vxfront,
134  double *vxback, double *vydown, double *vyup, double *vyfront, double *vyback, double *vzdown,
135  double *vzup, double *vzfront, double *vzback, int viscosity_on_off, int dimension);
136 
137 int left_boundary_zero_gradient(int nmin, int nmax, double *rho_1D, double *eng_1D,
138  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
139  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
140  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
141  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
142  double *vzback, int viscosity_on_off, int dimension);
143 
144 int right_boundary_zero_gradient(int nmin, int nmax, double *rho_1D, double *eng_1D,
145  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
146  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
147  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
148  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
149  double *vzback, int viscosity_on_off, int dimension);
150 
151 int left_boundary_reflecting(int nmin, int nmax, double *rho_1D, double *eng_1D,
152  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
153  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
154  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
155  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
156  double *vzback, int viscosity_on_off, int dimension);
157 
158 int right_boundary_reflecting(int nmin, int nmax, double *rho_1D, double *eng_1D,
159  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
160  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
161  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
162  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
163  double *vzback, int viscosity_on_off, int dimension);
164 
165 int left_boundary_small_padding_on_obstacle(int nmin, int nmax, double *rho_1D, double *eng_1D,
166  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
167  double *pressure_solid_1D, double *xa0, double *dx0, double *xa, double *dx, int flag,
168  double *rhodown, double *rhoup, double *rhofront, double *rhoback, double *vxdown, double *vxup, double *vxfront,
169  double *vxback, double *vydown, double *vyup, double *vyfront, double *vyback, double *vzdown,
170  double *vzup, double *vzfront, double *vzback, int viscosity_on_off, int dimension);
171 
172 int right_boundary_reflecting_on_obstacle(int nmin, int nmax, double *rho_1D, double *eng_1D,
173  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
174  double *pressure_solid_1D, double *xa0, double *dx0, double *xa, double *dx, int flag,
175  double *rhodown, double *rhoup, double *rhofront, double *rhoback, double *vxdown, double *vxup, double *vxfront,
176  double *vxback, double *vydown, double *vyup, double *vyfront, double *vyback, double *vzdown,
177  double *vzup, double *vzfront, double *vzback, int viscosity_on_off, int dimension);
178 
179 int left_boundary_reflecting_on_obstacle(int nmin, int nmax, double *rho_1D, double *eng_1D,
180  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
181  double *pressure_solid_1D, double *xa0, double *dx0, double *xa, double *dx, int flag,
182  double *rhodown, double *rhoup, double *rhofront, double *rhoback, double *vxdown, double *vxup, double *vxfront,
183  double *vxback, double *vydown, double *vyup, double *vyfront, double *vyback, double *vzdown,
184  double *vzup, double *vzfront, double *vzback, int viscosity_on_off, int dimension);
185 
186 int left_boundary_small_padding(int nmin, int nmax, double *rho_1D, double *eng_1D,
187  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
188  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
189  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
190  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
191  double *vzback, int viscosity_on_off, int dimension);
192 
193 int right_boundary_small_padding(int nmin, int nmax, double *rho_1D, double *eng_1D,
194  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
195  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
196  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
197  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
198  double *vzback, int viscosity_on_off, int dimension);
199 
200 int left_boundary_outflow(int nmin, int nmax, double *rho_1D, double *eng_1D,
201  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
202  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
203  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
204  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
205  double *vzback, int viscosity_on_off, int dimension);
206 
207 int right_boundary_outflow(int nmin, int nmax, double *rho_1D, double *eng_1D,
208  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
209  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
210  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
211  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
212  double *vzback, int viscosity_on_off, int dimension);
213 
214 int left_boundary_inflow(int nmin, int nmax, double *rho_1D, double *eng_1D,
215  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
216  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
217  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
218  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
219  double *vzback, int viscosity_on_off, int dimension);
220 
221 int right_boundary_inflow(int nmin, int nmax, double *rho_1D, double *eng_1D,
222  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
223  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
224  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
225  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
226  double *vzback, int viscosity_on_off, int dimension);
227 
228 int left_boundary_periodic(int nmin, int nmax, double *rho_1D, double *eng_1D,
229  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
230  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
231  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
232  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
233  double *vzback, int viscosity_on_off, int dimension);
234 
235 int right_boundary_periodic(int nmin, int nmax, double *rho_1D, double *eng_1D,
236  double *pre_1D, double *vx_1D, double *vy_1D, double *vz_1D,
237  double *xa0, double *dx0, double *xa, double *dx, int flag, double *rhodown, double *rhoup, double *rhofront,
238  double *rhoback, double *vxdown, double *vxup, double *vxfront, double *vxback, double *vydown,
239  double *vyup, double *vyfront, double *vyback, double *vzdown, double *vzup, double *vzfront,
240  double *vzback, int viscosity_on_off, int dimension);
241 
242 int para_coef(int nmin, int nmax, int flag1, double *a_coef, double *dx,
243  double *ai_coef, double *b_coef, double *bi_coef, double *c_coef,
244  double *d_x, double **para, double *ci_coef);
245 
246 int volume(int nmin, int nmax, double *vol, double *dx, double *vol0, double *dx0);
247 
248 int flatten(int nmin, int nmax, double *pre_1D, double *vx_1D,
249  double *steep, double *flat);
250 
251 int parabola(int nmin, int nmax, double *a, double *deltaa,
252  double *a6, double *al, int flag1, double *diffa,
253  double *da, double **para, double *ar, double *flat,
254  double *scratch1, double *scratch2, double *scratch3);
255 
256 int states(int nmin, int nmax, int flag, double *pre_1D, double *rho_1D,
257  double *dx, double *Cdtdx, double *fCdtdx, double *plft,
258  double *pl, double *dp, double *p6, double *ulft, double *ul,
259  double *du, double *u6, double *rlft, double *rl, double *dr,
260  double *r6, double *prgh, double *urgh, double *rrgh);
261 
262 int riemann(int nmin, int nmax, double *clft, double *crgh,
263  double *rlft, double *rrgh, double *plfti,
264  double *prghi, double *pmid, double *pmold,
265  double *plft, double *wrgh, double *prgh, double *wlft,
266  double *zlft, double *zrgh, double *umidl, double *umidr,
267  double *umid, double *urgh, double *ulft);
268 
269 int evolve(int nmin, int nmax, int flag, double *rho_1D,
270  double *dvol, double *dm, double *dtbdm, double *xa1,
271  double *xa, double *dvol1, double *umid, double *upmid,
272  double *pmid, double *xa2, double *dx, double *xa3,
273  double *vx_1D_old, double *vx_1D, double *vy_1D,
274  double *vz_1D, double *eng_1D, double *e_int_1D,
275  double *pre_1D);
276 
277 int remap(int nmin, int nmax, int flag, double *a_coef, double *dx,
278  double *ai_coef, double *b_coef, double *bi_coef, double *c_coef,
279  double *d_x, double **para, double *ci_coef, double *dr, double *r6, double *rl, double *diffa,
280  double *da, double *ar, double *flat, double *scratch1, double *scratch2, double *scratch3,
281  double *du, double *u6, double *ul, double *dv, double *v6, double *vl, double *w6, double *wl,
282  double *dq, double *q6, double *ql, double *de, double *e6, double *el, double *xa, double *xa0, double *delta,
283  double *fluxr, double *fluxu, double *fluxv, double *fluxw, double *dw, double *fluxe, double *fluxq,
284  double *dm, double *rho_1D, double *dvol, double *dvol0, double *dm0, double * vx_1D, double *vy_1D,
285  double *vz_1D, double *eng_1D, double *e_int_1D, double *pre_1D);
286 
287 int advect(int nmin, int nmax, int flag, double *dx, double *vx_1D, double *marker_1D);
288 
289 int diffusion(int x, int y, int z);
290 
291 double alpha_heat_transfer(int x, int y, int z, int direction);
292 
293 int copy_arrays_for_viscosity(int x, int y, int z);
294 
295 int viscosity(int i, int j, int k, int flag, int nmin, int nmax,
296  double *rho_1D, double * vx_1D, double *vy_1D, double *vz_1D,
297  double *pre_1D, double *e_int_1D, double *eng_1D, int lefter,
298  double *rhodown, double *rhoup, double *rhofront, double *rhoback,
299  double *vxdown, double *vxup, double *vxfront, double *vxback,
300  double *vydown, double *vyup, double *vyfront, double *vyback,
301  double *vzdown, double *vzup, double *vzfront, double *vzback,
302  int dimension);
303 
304 double kinematic_viscosity(double temperature, double density);
305 
306 double dynamic_viscosity(double temperature);
307 
308 int wind(int x, int y, int z);
309 
310 int upper_atmos(int x, int y, int z);
311 
312 //For data exploration
313 int velocity_field_analyser(int x, int y, int z);
314 
315 int pressure_on_solid_calc(int x, int y, int z);
316 
317 //The wind tunnel corrector
318 int boundary_velo_corrector(int x, int y, int z);
319 
320 //An explosion
321 int insert_pressure(int x, int y, int z);
322 
323 //to reset the dB-Map
324 int reset_pressure_integrated(int x, int y, int z);
325 
326 //to prepare the dB-Map
327 int prepare_the_dB_map(int x, int y, int z);
328 int pre_old_copy(int x, int y, int z);
329 
330 #endif /* PROTOTYPES_H_ */