PLUTO  4.4-patch2
structs.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
9 /* ///////////////////////////////////////////////////////////////////// */
10 
11 typedef struct cmdLine_{
12  char restart;
13  char h5restart;
14  char prestart;
15  char makegrid;
16  char write;
17  char parallel_dim[3];
18  int nrestart;
19  int maxsteps;
20  int jet;
21  int nproc[3];
22  int xres;
23  char fill[26]; /* useless, it makes the struct a power of 2 */
24 } cmdLine;
25 
26 /* ********************************************************************* */
31 typedef struct ElectroMotiveForce{
32 
38  double ***exj;
39  double ***exk;
40  double ***eyi;
41  double ***eyk;
42  double ***ezi;
43  double ***ezj;
45  double ***exj_dff;
46  double ***exk_dff;
47  double ***eyi_dff;
48  double ***eyk_dff;
49  double ***ezi_dff;
50  double ***ezj_dff;
53 #if PHYSICS == ResRMHD
54 
59  double ***Bxj;
60  double ***Bxk;
61  double ***Byi;
62  double ***Byk;
63  double ***Bzi;
64  double ***Bzj;
65  double ***Frho_i;
66  double ***Frho_j;
67  double ***Frho_k;
69 #endif
70 
71  signed char ***svx, ***svy, ***svz;
72 
75  int ibeg, jbeg, kbeg;
76  int iend, jend, kend;
81  double ***SxL, ***SxR;
82  double ***SyL, ***SyR;
83  double ***SzL, ***SzR;
84  double ***dxL, ***dxR, ***axL, ***axR;
85  double ***dyL, ***dyR, ***ayL, ***ayR;
86  double ***dzL, ***dzR, ***azL, ***azR;
91  double ***Ex1e;
92  double ***Ex2e;
93  double ***Ex3e;
96 #if PHYSICS == ResRMHD
97 
99  double ***Bx1e;
100  double ***Bx2e;
101  double ***Bx3e;
103 #endif
104 } EMF;
105 
106 /* ********************************************************************* */
124 typedef struct Grid_{
125  double xbeg[3], xend[3];
126  double xbeg_glob[3], xend_glob[3];
127  double *x[3], *x_glob[3];
128  double *xr[3], *xr_glob[3];
129  double *xl[3], *xl_glob[3];
130  double *dx[3], *dx_glob[3];
131  double *xgc[3];
133  double ***dV;
134  double ***A[3];
135  double **dx_dl[3];
136  double *rt;
137  double *sp;
139  double *s;
141  double *dmu;
143  double *inv_dx[3];
144  double *inv_dxi[3];
147  double dl_min[3];
149  int np_tot_glob[3];
151  int np_int_glob[3];
153  int np_tot[3];
155  int np_int[3];
157  int nghost[3];
158  int lbound[3];
165  int rbound[3];
166  int gbeg[3];
167  int gend[3];
168  int beg[3];
169  int end[3];
170  int lbeg[3];
171  int lend[3];
172  int uniform[3]; /* = 1 when the grid is cartesian AND uniform everywhere */
173  int nproc[3];
174  int rank_coord[3];
175  int level;
177  char fill[344]; /* useless, just to make the structure size a power of 2 */
178 } Grid;
179 
180 /* ********************************************************************* */
201 typedef struct RBox_{
202  int ibeg;
203  int iend;
204  int jbeg;
205  int jend;
206  int kbeg;
207  int kend;
208  int di;
210  int dj;
212  int dk;
214  int vpos;
215  int *n;
217  int *t;
220  int *b;
223  int *nbeg;
225  int *nend;
227  int *tbeg;
229  int *tend;
231  int *bbeg;
233  int *bend;
235 } RBox;
236 
237 /* ********************************************************************* */
247 typedef struct Restart_{
248  int nstep;
249  int nfile[MAX_OUTPUT_TYPES];
250  double t;
251  double dt;
252  char fill[40]; /* Align the structure to power of 2 */
253 } Restart;
254 
255 /* ********************************************************************* */
261 typedef struct State_{
262  double **v;
263  double **u;
264  double **flux;
265  double **fluxCR;
266  double **lambda;
267  double **Bbck;
268  double *prs;
269  double *a2;
270  double *cw;
271  double *h;
272  double **J;
273  double **cCR;
274  double **Fcr;
276  double ***Lp;
277  double ***Rp;
278  char fill[8]; /* Fill structure to power of 2 */
279 } State;
280 
281 /* ********************************************************************* */
289 typedef struct Sweep_{
290  double **vn;
292  double **flux;
293  double **tc_flux;
295  double *lmax;
296  double **src;
297 
298  double **rhs;
299  double *press;
300  double *Bn;
301  double *En;
302  double *SL;
303  double *SR;
305  #if RADIATION
306  double *SrL;
307  double *SrR;
308  #endif
309 
310  double **pnt_flux;
311  double **dff_flux;
312  double *SaL, *SaR, *Sc;
313  double *dL, *dR;
314  double *aL, *aR;
315  uint16_t *flag;
316  State stateL;
317  State stateR;
318  State stateC;
319  char fill[16];
320 } Sweep;
321 
322 typedef struct Table2D_ {
323  char **defined;
324  int nx;
325  int ny;
326  int nf;
327  int interpolation;
328  int **i;
329  int id;
330  double *x;
331  double *y;
332  double *dx;
333  double *dy;
334  double *lnx;
335  double *lny;
336  double **f;
337 
338  double **a;
339  double **b;
340  double **c;
341  double **d;
343  double **dfx;
344  double **dfy;
345  double *fmin;
346  double *fmax;
347  double *df;
348  double lnxmin;
349  double lnxmax;
350  double lnymin;
351  double lnymax;
352  double dlnx;
353  double dlny;
354  double dlnx_1;
355  double dlny_1;
356 } Table2D;
357 
358 /* ********************************************************************* */
363 typedef struct timeStep_{
364  double *cmax;
365  double invDt_hyp;
367  double invDt_par;
371  double dt_cool;
372  double cfl;
373  double cfl_par;
374  double rmax_par;
376  double clock_particles;
377  double clock_particles_bound;
378 
379  double clock_hyp;
380  double clock_par;
381  double clock_cooling;
382  double clock_tot;
383 
385  int Nsts;
386  int Nrkc;
387  int Nrkl;
388 } timeStep;
389 
390 /* ********************************************************************* */
394 typedef struct Output_{
395  int type;
396  int nvar;
398  int cgs;
399  int nfile;
400  int dn;
401  int stag_var[MAX_OUTPUT_VARS];
403  int dump_var[MAX_OUTPUT_VARS];
405  int field_dim[MAX_OUTPUT_VARS];
408  char mode[32];
409  char **var_name;
410  char ext[8];
411  char dir[256];
413  double dt;
414  double dclock;
415  double ***V[MAX_OUTPUT_VARS];
417  char fill[140];
418 } Output;
419 
420 /* ********************************************************************* */
425 typedef struct Runtime_{
426  int npoint[3];
427  int left_bound[3];
428  int right_bound[3];
429  int grid_is_uniform[3]; /* = 1 when grid is uniform, 0 otherwise */
430  int npatch[5];
431  int patch_npoint[5][16]; /* number of points per patch */
432  int patch_type[5][16];
433  int log_freq;
434  int user_var;
436  int anl_dn; /* number of step increment for ANALYSIS */
437  char solv_type[64];
438  char rad_solv_type[64];
439  char user_var_name[128][128];
440  char output_dir[256];
444  char log_dir[256];
447  Output output[MAX_OUTPUT_TYPES];
448  double patch_left_node[5][16]; /* self-expl. */
449  double cfl;
450  double cfl_max_var;
452  double cfl_par;
453  double rmax_par;
455  double tstop;
456  double tfreeze;
457  double first_dt;
458  double anl_dt;
465  double aux[32]; /* we keep aux inside this structure,
466  since in parallel execution it has
467  to be comunicated to all processors */
468 } Runtime;
469 
470 
471 typedef struct RGB{
472  unsigned char r, g, b;
473 } RGB;
474 
475 typedef struct Image_{
476  int nrow, ncol; /* -- image rows and columns -- */
477  int slice_plane; /* -- one of X12_PLANE, X13_PLANE, X23_PLANE -- */
478  int logscale; /* -- YES/NO for log scale -- */
479  char *colormap; /* -- colormap name -- */
480  char basename[32]; /* -- image base name (no extensions) -- */
481  unsigned char r[256], g[256], b[256]; /* -- colortable saved here -- */
482  RGB **rgb; /* -- rgb array containing image values -- */
483  double max; /* -- max image value -- */
484  double min; /* -- min image value -- */
485  double slice_coord; /* -- slice coord orthogonal to slice_plane -- */
486 } Image;
487 
488 typedef struct FLOAT_VECT{
489  float v1, v2, v3;
490 } Float_Vect;
491 
492 /* ********************************************************************* */
503 typedef struct intList_{
504  int nvar;
505  int indx[2046];
506  int i;
507 } intList;
508 
509 /* ********************************************************************* */
514 typedef struct Data_{
515  double ****Vc;
521  double ****Uc;
527  double ****Vs;
533  double ****Vuser;
535  double ***Ax1;
536  double ***Ax2;
537  double ***Ax3;
538  double ****J;
539  double ***Tc;
540  double ***q;
541  uint16_t ***flag;
544  /* -- Particles-related quantities -- */
545 
546  struct particleNode_ *PHead; /* Must use full declaration since particleNode
547  typdef will come later on. */
548 
549  double ****Fcr;
552  double ****Jcr;
553  double ***qcr;
555  double ****Fdust;
556  struct Particle_ **pstr;
559 /* EMF */
560  double ***Ex1;
561  double ***Ex2;
562  double ***Ex3;
564  struct ElectroMotiveForce *emf;
565 
566 /* Others */
567  struct timeStep_ *Dts;
568 
569  /* ForcedTurb */
570  struct ForcedTurb *Ft;
571 
572  void (*fluidRiemannSolver) (const Sweep *, int, int, double *, Grid *);
573  void (*radiationRiemannSolver) (const Sweep *, int, int, double *, Grid *);
574  char fill[54]; /* make the structure a power of two. */
575 } Data;
576 
double * lmax
Definition: structs.h:295
double *** qcr
Definition: structs.h:553
int Nrkc
Definition: structs.h:386
double tstop
Definition: structs.h:455
int vpos
Definition: structs.h:214
int * tend
Definition: structs.h:229
double **** Fdust
Definition: structs.h:555
double *** ezi_dff
Definition: structs.h:49
double *** Ex2
Definition: structs.h:561
char ** var_name
Definition: structs.h:409
double * En
Definition: structs.h:301
uint16_t *** flag
Definition: structs.h:541
double dt
Definition: structs.h:413
double *** exj_dff
Definition: structs.h:45
double *** Bzj
Definition: structs.h:64
Definition: structs.h:503
Definition: structs.h:31
double ** fluxCR
Definition: structs.h:265
double *** eyk_dff
Definition: structs.h:48
int cgs
Definition: structs.h:398
int Nrkl
Definition: structs.h:387
double cfl_par
Definition: structs.h:373
double *** q
Definition: structs.h:540
int * t
Definition: structs.h:217
int user_var
Definition: structs.h:434
Definition: structs.h:394
struct Particle_ ** pstr
Definition: structs.h:556
double *** ezi
Definition: structs.h:42
int Nparticles_glob
Definition: structs.h:462
Definition: structs.h:124
int * nend
Definition: structs.h:225
double *** exk
Definition: structs.h:39
double **** Vuser
Definition: structs.h:533
double * SL
Definition: structs.h:302
double *** Ax3
Definition: structs.h:537
int di
Definition: structs.h:208
Definition: structs.h:425
double dclock
Definition: structs.h:414
double ** tc_flux
Definition: structs.h:293
int level
Definition: structs.h:175
int nvar
Definition: structs.h:504
double *** Bxk
Definition: structs.h:60
double *** ezj
Definition: structs.h:43
double *** Ex1
Definition: structs.h:560
int * tbeg
Definition: structs.h:227
double ** flux
Definition: structs.h:292
double *** exk_dff
Definition: structs.h:46
double * rt
Definition: structs.h:136
double *** eyk
Definition: structs.h:41
double particles_tstart
Definition: structs.h:375
int jbeg
Definition: structs.h:204
double dt_cool
Definition: structs.h:371
Definition: structs.h:247
double anl_dt
Definition: structs.h:458
int i
Definition: structs.h:506
double * prs
Definition: structs.h:268
double ** J
Definition: structs.h:272
double *** Tc
Definition: structs.h:539
int Nsts
Definition: structs.h:385
double ** Fcr
Definition: structs.h:274
double *** exj
Definition: structs.h:38
double *** eyi_dff
Definition: structs.h:47
double invDt_par
Definition: structs.h:367
int * bbeg
Definition: structs.h:231
double **** Jcr
Definition: structs.h:552
double cfl
Definition: structs.h:372
int type
Definition: structs.h:395
double *** Ax2
Definition: structs.h:536
int nfile
Definition: structs.h:399
double **** Fcr
Definition: structs.h:549
int dj
Definition: structs.h:210
double ** Bbck
Definition: structs.h:267
double ** cCR
Definition: structs.h:273
double *** dV
Definition: structs.h:133
double *** Lp
Definition: structs.h:276
int * bend
Definition: structs.h:233
int Nsub_particles
Definition: structs.h:384
Definition: structs.h:514
int nvar
Definition: structs.h:396
int kend
Definition: structs.h:207
double first_dt
Definition: structs.h:457
double *** Byi
Definition: structs.h:61
double cfl_par
Definition: structs.h:452
double * s
Definition: structs.h:139
int dn
Definition: structs.h:400
double ** u
Definition: structs.h:263
double * a2
Definition: structs.h:269
double *** eyi
Definition: structs.h:40
int dk
Definition: structs.h:212
double * SR
Definition: structs.h:303
double tfreeze
Definition: structs.h:456
double *** Bzi
Definition: structs.h:63
Definition: structs.h:261
double cfl
Definition: structs.h:449
double * aR
Definition: structs.h:314
double * sp
Definition: structs.h:137
int kbeg
Definition: structs.h:206
double * Bn
Definition: structs.h:300
int log_freq
Definition: structs.h:433
double invDt_particles
Definition: structs.h:369
double ** lambda
Definition: structs.h:266
double cfl_max_var
Definition: structs.h:450
int particles_GC_InvalidCount
Definition: structs.h:557
double ** flux
Definition: structs.h:264
double omega_particles
Definition: structs.h:370
int ibeg
Definition: structs.h:202
double *** Ax1
Definition: structs.h:535
double * press
Definition: structs.h:299
double particles_tstart
Definition: structs.h:461
double **** Vc
Definition: structs.h:515
double invDt_hyp
Definition: structs.h:365
int iend
Definition: structs.h:203
double ** vn
Definition: structs.h:290
double *** ezj_dff
Definition: structs.h:50
int Nparticles_cell
Definition: structs.h:463
double * cw
Definition: structs.h:270
double *** Bxj
Definition: structs.h:59
double *** Byk
Definition: structs.h:62
int * b
Definition: structs.h:220
double **** Uc
Definition: structs.h:521
Definition: structs.h:201
double *** Ex3
Definition: structs.h:562
int * ring_av_csize
Definition: structs.h:176
int * n
Definition: structs.h:215
Definition: structs.h:363
double ** v
Definition: structs.h:262
double **** J
Definition: structs.h:538
double *** Rp
Definition: structs.h:277
int jend
Definition: structs.h:205
double * dR
Definition: structs.h:313
double rmax_par
Definition: structs.h:453
int * nbeg
Definition: structs.h:223
double * cmax
Definition: structs.h:364
double **** Vs
Definition: structs.h:527
double ** rhs
Definition: structs.h:298
double * h
Definition: structs.h:271
Definition: structs.h:289
double * Sc
Definition: structs.h:312