PLUTO
pluto.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief PLUTO main header file.
5 
6  Contains basic macro definitions, structure definitions and global
7  variable declarations used by the code.
8 
9  \author A. Mignone (mignone@ph.unito.it)
10  \date July 05, 2015
11 */
12 /* ///////////////////////////////////////////////////////////////////// */
13 #ifndef PLUTO_H
14 #define PLUTO_H
15 
16 #define PLUTO_VERSION "4.2"
17 
18 #include <stdio.h>
19 #include <stdarg.h>
20 #include <string.h>
21 #include <math.h>
22 #include <stdlib.h>
23 #include <time.h>
24 
25 #define YES 1
26 #define NO 0
27 #define DEFAULT -1
28 #define TRUE YES
29 #define FALSE NO
30 
31 /* ---- Geometry Labels ( > 0) ---- */
32 
33 #define CARTESIAN 1
34 #define CYLINDRICAL 2
35 #define POLAR 3
36 #define SPHERICAL 4
37 
38 #define UNIFORM_GRID 1
39 #define STRETCHED_GRID 2
40 #define LOGARITHMIC_INC_GRID 3
41 #define LOGARITHMIC_DEC_GRID 4
42 
43 /* ---- Equation of state (EoS) labels ---- */
44 
45 #define IDEAL 1
46 #define PVTE_LAW 2
47 #define TAUB 3
48 #define BAROTROPIC 4
49 #define ISOTHERMAL 5
50 
51 /* ---- Entropy switch options ----- */
52 
53 #define SELECTIVE 1
54 #define ALWAYS 2
55 #define CHOMBO_REGRID 3
56 
57 /* ---- Time stepping labels ---- */
58 
59 #define EULER 1
60 #define HANCOCK 2
61 #define CHARACTERISTIC_TRACING 3
62 #define RK2 5
63 #define RK3 6
64 #define RK_MIDPOINT 7
65 #define SSP_RK4 8
66 
67 #define EXPLICIT 1 /* -- just a number different from 0 !!! -- */
68 #define SUPER_TIME_STEPPING 2 /* -- just a number different from EXPLICIT -- */
69 #define RK_CHEBYSHEV 4
70 
71 /* ---- Operator step labels ---- */
72 
73 #define HYPERBOLIC_STEP 1
74 #define PARABOLIC_STEP 2
75 #define SOURCE_STEP 3
76 
77 /* ---- Output labels ---- */
78 
79 #define DBL_OUTPUT 1
80 #define FLT_OUTPUT 2
81 #define VTK_OUTPUT 3
82 #define DBL_H5_OUTPUT 4
83 #define FLT_H5_OUTPUT 5
84 #define TAB_OUTPUT 6
85 #define PPM_OUTPUT 7
86 #define PNG_OUTPUT 8
87 
88 #define VTK_VECTOR 5 /* -- any number but NOT 1 -- */
89 
90 /*! The maximum number of output file formats is fixed to 11 so that the
91  size of runtime structure (defined below) is 64 bytes.
92  This should prevent, for some compilers, attempts to change the
93  alignment of the structure and therefore troubleshooting when restarting
94  from files written on different architectures. */
95 #define MAX_OUTPUT_TYPES 11
96 #define MAX_OUTPUT_VARS 128
97 
98 /* ---- Cooling labels ---- */
99 
100 #define POWER_LAW 3
101 #define MINEq 4
102 #define SNEq 5
103 #define TABULATED 6
104 #define H2_COOL 7
105 
106 /* ---- Physics modules labels ---- */
107 
108 #define ADVECTION 1
109 #define HD 2
110 #define RHD 3
111 #define MHD 4
112 #define RMHD 5
113 
114  /* ---- SET LABELS FOR DIV.B REMOVAL ----
115  If you move them to the MHD header,
116  definitions.h (which is included before)
117  cannot correctly use them */
118 
119 #define NONE 0
120 #define EIGHT_WAVES 1
121 #define DIV_CLEANING 2
122 #define CONSTRAINED_TRANSPORT 3
123 
124  /* ---- SET LABELS FOR BODY_FORCE ----
125  Please do not change them since they are
126  used in bitwise operations */
127 
128 #define VECTOR 4 /* corresponds to 100 in binary */
129 #define POTENTIAL 8 /* corresponds to 1000 in binary */
130 
131 /* ---- Boundary condition labels ---- */
132 
133 #define OUTFLOW 1 /* any number except 0 !! */
134 #define REFLECTIVE 2
135 #define AXISYMMETRIC 3
136 #define EQTSYMMETRIC 4
137 #define PERIODIC 5
138 #define SHEARING 6
139 #define USERDEF 7
140 
141 /*! \name Labels identifying different boundary and domain regions.
142  These are useful in Boundary() and when setting RBox structures
143  in different points of the code.
144 */
145 /**@{ */
146 #define X1_BEG 101 /**< Boundary region at X1 beg */
147 #define X1_END 102 /**< Boundary region at X1 end */
148 #define X2_BEG 103 /**< Boundary region at X2 beg */
149 #define X2_END 104 /**< Boundary region at X2 end */
150 #define X3_BEG 105 /**< Boundary region at X3 beg */
151 #define X3_END 106 /**< Boundary region at X3 end */
152 #define DOM 107 /**< Computational domain (interior) */
153 #define TOT 108 /**< Computational domain (total) */
154 /**@} */
155 
156 /* ---- LABELS FOR IMAGE SLICING ---- */
157 
158 #define X12_PLANE 3
159 #define X13_PLANE 5
160 #define X23_PLANE 6
161 
162 /*! \name Bit flag labels.
163  The following macros define the bits that can be turned on or off
164  in an unsigned char (= 1 byte = 8 bits) variable.
165  Different bit flags allow to enable or disable certain actions in
166  a given cell at different points in the code, see also flag.c.
167  The 3D unsigned char \c ***flag array is used for bookeeping, in each zone
168  (i,j,k), which bits are actually switched on or off.
169  A simple bitwise operation is used to enable a flag, e.g.,
170  <tt> flag[k][j][i] |= FLAG_XXX </tt>.
171  For instance, by turning the ::FLAG_HLL bit on, we have
172  <tt> flag = 00000100 </tt>, while by also enabling the ::FLAG_SPLIT_CELL
173  one has <tt> flag = 00010100 </tt> and so on.
174  Individual bits can also be turned off with the complement operator
175 
176  Individual bits can also be turned off, e.g., <tt> flag &= ~FLAG_XXX; </tt>
177 */
178 /**@{ */
179 #define FLAG_MINMOD 1 /**< Reconstruct using MINMOD limiter. */
180 #define FLAG_FLAT 2 /**< Reconstruct using FLAT limiter. */
181 #define FLAG_HLL 4 /**< Use HLL Riemann solver. */
182 #define FLAG_ENTROPY 8 /**< Update pressure using entropy equation. */
183 #define FLAG_SPLIT_CELL 16 /**< Zone is covered by a finer level (AMR only). */
184 #define FLAG_INTERNAL_BOUNDARY 32 /**< Zone belongs to an internal boundary
185  region and should be excluded from
186  being updated in time */
187 #define FLAG_CONS2PRIM_FAIL 64
188 #define FLAG_BIT8 128
189 /**@} */
191 #define IDIR 0 /* This sequence (0,1,2) should */
192 #define JDIR 1 /* never be changed */
193 #define KDIR 2 /* */
194 #define ALL_DIR -1
196 /* -- location of a variable inside the cell -- */
197 
198 #define CENTER 0
199 #define X1FACE 1
200 #define X2FACE 2
201 #define X3FACE 3
203 #define CELL_CENTER 50 /* really needed ? */
204 #define FACE_CENTER 51
205 #define EDGE_CENTER 52
207  /* ---- SET LABELS FOR RECONSTRUCTION ---- */
208 
209 #define FLAT 1
210 #define LINEAR 2
211 #define CENO3 3
212 #define PARABOLIC 4
213 #define LINEAR_MULTID 5
214 #define MP5 6
215 #define LimO3 7
216 #define WENO3 8
217 #define SPLINE1 30 /* Used by Table2D interpolation */
218 #define SPLINE2 31 /* Used by Table2D interpolation */
220 #define WENO3_FD 103
221 #define WENO5_FD 105
222 #define WENOZ_FD 106
223 #define WENO7_FD 107
224 #define MP5_FD 125
225 #define LIMO3_FD 300
227 #define ONED 1
228 #define MULTID 3
230 /* ---- limiter labels ---- */
231 
232 #define FLAT_LIM 1
233 #define MINMOD_LIM 2
234 #define VANALBADA_LIM 3
235 #define OSPRE_LIM 4
236 #define UMIST_LIM 5
237 #define VANLEER_LIM 6
238 #define MC_LIM 7
239 #define FOURTH_ORDER_LIM 8
242 /*! \name Physical constants in c.g.s units.
243  The following set of macros express some useful physical constants
244  in c.g.s units (erg, cm and sec). Values have been taken from
245  http://physic.nist.gov/cuu/Constants/index.html
246 */
247 /**@{ */
248 #define CONST_AH 1.008 /*!< Atomic weight of Hydrogen */
249 #define CONST_AHe 4.004 /**< Atomic weight of Helium */
250 #define CONST_AZ 30.0 /**< Mean atomic weight of heavy elements */
251 #define CONST_amu 1.66053886e-24 /**< Atomic mass unit. */
252 #define CONST_au 1.49597892e13 /**< Astronomical unit. */
253 #define CONST_c 2.99792458e10 /**< Speed of Light. */
254 #define CONST_eV 1.602176463158e-12 /**< Electron Volt in erg. */
255 #define CONST_G 6.6726e-8 /**< Gravitational Constant. */
256 #define CONST_h 6.62606876e-27 /**< Planck Constant. */
257 #define CONST_kB 1.3806505e-16 /**< Boltzmann constant. */
258 #define CONST_ly 0.9461e18 /**< Light year. */
259 #define CONST_mp 1.67262171e-24 /**< Proton mass. */
260 #define CONST_mn 1.67492728e-24 /**< Neutron mass. */
261 #define CONST_me 9.1093826e-28 /**< Electron mass. */
262 #define CONST_mH 1.6733e-24 /**< Hydrogen atom mass. */
263 #define CONST_Msun 2.e33 /**< Solar Mass. */
264 #define CONST_Mearth 5.9736e27 /**< Earth Mass. */
265 #define CONST_NA 6.0221367e23 /**< Avogadro Contant. */
266 #define CONST_pc 3.0856775807e18 /**< Parsec. */
267 #define CONST_PI 3.14159265358979 /**< \f$ \pi \f$. */
268 #define CONST_Rearth 6.378136e8 /**< Earth Radius. */
269 #define CONST_Rsun 6.96e10 /**< Solar Radius. */
270 #define CONST_sigma 5.67051e-5 /**< Stephan Boltmann constant. */
271 #define CONST_sigmaT 6.6524e-25 /**< Thomson Cross section. */
272 /**@} */
274 /* **********************************************************
275  Including header files here
276  ********************************************************** */
277 
278 #include "definitions.h" /* Problem-dependent header file */
279 
280 /* *******************************************************************
281  Set default values of fine-tuning macro-define constants.
282  This section of the code is for general-purpose macros although
283  other may exists elsewhere.
284  ******************************************************************* */
285 
286 #ifndef BACKGROUND_FIELD
287  #define BACKGROUND_FIELD NO
288 #endif
290 #ifndef CHAR_LIMITING
291  #define CHAR_LIMITING NO
292 #endif
294 #ifdef CH_SPACEDIM
295  #define CHOMBO 1
296 
297  #ifndef CHOMBO_LOGR
298  #define CHOMBO_LOGR NO
299  #endif
300 
301 /* --------------------------------------------------------------------
302  By default we enable angular momentum conservation only if the
303  entropy swtich is enabled.
304  Otherwise angular momentum conservation is not enforced during
305  refluxing / prolongation / restriction operations since this has
306  been shown to lead to the appearance of negative pressures.
307  (Simultaneous energy and angular momentum conservation in Chombo
308  does not seem to be vary robust)
309  -------------------------------------------------------------------- */
310 
311  #ifndef CHOMBO_CONS_AM
312  #if (GEOMETRY == CYLINDRICAL) && (COMPONENTS == 3) && (ENTROPY_SWITCH)
313  #define CHOMBO_CONS_AM YES
314  #elif (GEOMETRY == SPHERICAL) && (COMPONENTS == 3) && (ENTROPY_SWITCH)
315  #define CHOMBO_CONS_AM YES
316  #elif (GEOMETRY == POLAR) && (COMPONENTS > 1) && (ENTROPY_SWITCH)
317  #define CHOMBO_CONS_AM YES
318  #else
319  #define CHOMBO_CONS_AM NO
320  #endif
321  #endif
322 
323  #if CHOMBO_CONS_AM == YES
324  #define CHOMBO_NDV 2
325  #else
326  #define CHOMBO_NDV 1
327  #endif
328 #endif
329 
330 #ifndef DUST
331  #define DUST NO
332 #endif
334 #ifndef ENTROPY_SWITCH
335  #define ENTROPY_SWITCH NO
336 #endif
338 #ifndef EOS
339  #define EOS -1
340 #endif
342 #ifndef INCLUDE_PARTICLES
343  #define INCLUDE_PARTICLES NO
344 #endif
346 #ifndef RECONSTRUCT_4VEL
347  #define RECONSTRUCT_4VEL NO /**< When set to YES, reconstruct 4-velocity
348  rather than 3-velocity (only for RHD and
349  RMHD physics modules) */
350 #endif
351 
352 #ifndef RESISTIVITY
353  #define RESISTIVITY NO
354 #endif
355 
356 #ifndef ROTATING_FRAME
357  #define ROTATING_FRAME NO
358 #endif
359 
360 #ifndef THERMAL_CONDUCTION
361  #define THERMAL_CONDUCTION NO
362 #endif
363 
364 #ifndef UNIT_DENSITY
365  #define UNIT_DENSITY (CONST_mp) /**< Unit density in gr/cm^3. */
366 #endif
367 
368 #ifndef UNIT_LENGTH
369  #define UNIT_LENGTH (CONST_au) /**< Unit Length in cm. */
370 #endif
371 
372 #ifndef UNIT_VELOCITY
373  #define UNIT_VELOCITY (1.e5) /**< Unit velocity in cm/sec. */
374 #endif
375 
376 #ifndef UPDATE_VECTOR_POTENTIAL
377  #define UPDATE_VECTOR_POTENTIAL NO
378 #endif
379 
380 #ifndef VISCOSITY
381  #define VISCOSITY NO
382 #endif
383 
384 /* -------------------------------------------------------------------
385  Set HAVE_ENERGY to YES if an energy equation exists
386  -------------------------------------------------------------------- */
387 
388 #if (EOS == IDEAL) || (EOS == PVTE_LAW) || (EOS == TAUB)
389  #define HAVE_ENERGY YES
390 #else
391  #define HAVE_ENERGY NO
392 #endif
393 
394 /*! Define the conversion constant between dimensionless
395  temperature prs/rho and physical temperature in Kelvin,
396  T = (prs/rho)*KELVIN*mu */
397 #define KELVIN (UNIT_VELOCITY*UNIT_VELOCITY*CONST_amu/CONST_kB)
398 
399 /* ******************************************************
400  Debug switches
401  ****************************************************** */
402 
403 /* -- CHECK_EIGENVECTORS: used in eigenv.c in HD/, MHD/, RHD/
404  to check orthogonality and the correctness through
405  the relation the A = L*\Lambda*R -- */
406 
407 #define CHECK_EIGENVECTORS NO
408 
409 /* -- CHECK_CONSERVATIVE_VAR: used in RHD/mappers.c to
410  check that conservative vars are physical -- */
412 #define CHECK_CONSERVATIVE_VAR NO
413 
414 /* -- CHECK_DIVB_CONDITION: used in MHD/CT/ct.c
415  to check if div.B = 0 -- */
417 #ifndef CHECK_DIVB_CONDITION
418  #define CHECK_DIVB_CONDITION NO
419 #endif
420 
421 /* -- Shortcut for CTU -- */
423 #if (TIME_STEPPING == HANCOCK) || (TIME_STEPPING == CHARACTERISTIC_TRACING)
424  #if DIMENSIONAL_SPLITTING == NO
425  #define CTU 1 /* -- Corner Transport Upwind method of Colella -- */
426  #endif
427 #endif
428 
429 /* ------------------------------------------------------------
430  the GET_MAX_DT switch determines how the time step is
431  computed. For pure advection, setting it to YES will force
432  PLUTO to compute dt in the old way, i.e., by taking the
433  maximum.
434  When set to NO, the time step is computed only during the
435  predictor step and, for UNSPLIT RK schemes, it will be
436  calculated as the average over dimensions resulting in
437  slightly larger time increments.
438  ------------------------------------------------------------ */
439 
440 #if ((TIME_STEPPING == RK2) || (TIME_STEPPING == RK3)) \
441  && DIMENSIONAL_SPLITTING == NO
442  #define GET_MAX_DT NO
443 #else
444  #define GET_MAX_DT YES
445 #endif
446 
447 /* *********************************************************************
448  Diffusion operators: PARABOLIC_FLUX is the bitwise OR
449  combination of all operators, each being either one of
450  NO, EXPLICIT (1st bit), STS (2nd bit).
451  It can take the following values
452 
453  00 --> no diffusion operator is being used
454  01 --> there's at least one explicit diffusion operator and
455  no sts.
456 
457  10 --> there's at least one sts diffusion operator and
458  no explicit one.
459  11 --> mixed: there is at least one explicit and sts operator
460  ********************************************************************* */
461 
462 #define PARABOLIC_FLUX (RESISTIVITY|THERMAL_CONDUCTION|VISCOSITY)
463 
464 /* ********************************************************
465  Include more header files
466  ******************************************************** */
467 
468 #ifdef PARALLEL /* Only for parallel computations on static grid */
469  #include <al.h>
470 #endif
471 #ifdef CH_MPI /* Include mpi.h for parallel Chombo, in order to */
472  #include <mpi.h> /* use MPI_Abort function in the QUIT_PLUTO macro */
473 #endif
474 #include "macros.h" /* Function-like macro header file */
475 #include "structs.h" /* Structure declaration header file */
476 
477 /* *****************************************************
478  Recurrent types
479  Note: when using Finite Difference Schemes, the
480  "Riemann Solver" function computes the fluxes
481  with high order interpolants.
482  ***************************************************** */
483 
484 typedef double real;
485 typedef void Riemann_Solver (const State_1D *, int, int, double *, Grid *);
486 typedef void Limiter (double *, double *, double *, int, int, Grid *);
487 typedef double Reconstruct (double *, double, int);
488 typedef double ****Data_Arr;
490 /* ********************************************************
491  Include physics module header files
492  ******************************************************** */
493 
494 #include "mod_defs.h" /* Include physics header file (search path is set
495  in the makefile) */
496 #ifdef SHEARINGBOX
498 #endif
499 
500 #if COOLING != NO
501  #include "cooling.h"
502  #define RHOE PRS
503 #endif
504 
505 #if DUST == YES
506  #include "Dust/dust.h" /* Dust header file */
507 #endif
508 
509 #ifdef FARGO
510  #include "Fargo/fargo.h" /* FARGO header file */
511 #endif
512 
513 #if THERMAL_CONDUCTION != NO
514  #include "Thermal_Conduction/tc.h" /* Thermal conduction header file */
515 #endif
516 
517 #if VISCOSITY != NO
518  #include "Viscosity/viscosity.h" /* Viscosity header file */
519 #endif
520 
521 #include "States/plm_coeffs.h" /* PLM header file */
522 #if RECONSTRUCTION == PARABOLIC
523  #include "States/ppm_coeffs.h" /* PPM header file */
524 #endif
525 #include "Math_Tools/math_tools.h" /* Math tools header file */
526 
527 /* *********************************************************************
528  Define mass fractions (H_MASS_FRAC and He_MASS_FRAC).
529 
530  For H2_COOL, Proto-Solar Mass Fractions for Hydrogen
531  and Helium (Lodders, ApJ 591, 2003 ) are used.
532 
533  Define also the number fractions (relative to hydrogen)
534  as FRAC_He and FRAC_Z (FRAC_H = 1.0).
535  ********************************************************************* */
536 
537 #ifndef H_MASS_FRAC /* Sets default values */
538  #define H_MASS_FRAC 0.7110
539 #endif
540 
541 #if (EOS == PVTE_LAW) && (COOLING == NO)
542  #define He_MASS_FRAC (1 - H_MASS_FRAC) /* Effective Y and not 0.2741
543  Baraffe (2008) */
544 #endif
545 
546 #ifndef He_MASS_FRAC
547  #define He_MASS_FRAC 0.2741
548 #endif
549 
550 #define Z_MASS_FRAC (1.0 - H_MASS_FRAC - He_MASS_FRAC)
551 #define FRAC_He (He_MASS_FRAC/CONST_AHe*CONST_AH/H_MASS_FRAC)
552 #define FRAC_Z (Z_MASS_FRAC /CONST_AZ *CONST_AH/H_MASS_FRAC)
553 
555 #ifndef NIONS
556  #define NIONS 0
557 #endif
558 
559 /* ********************************************************************* */
560 /*! The number of scalars (passive tracers).
561  This includes
562  - \c NTRACER (user-supplied)
563  - \c NIONS chemical fractions (added by cooling modules)
564  - Entropy
565  In total, there are <tt>NSCL = NIONS+NTRACER+(ENTROPY</tt> passive
566  scalar to be advected.
567  ********************************************************************** */
568 #define NSCL (NTRACER + NIONS + (ENTROPY_SWITCH != 0))
569 
570 #ifndef NDUST
571  #define NDUST 0
572 #endif
573 #define NDUST_BEG (NFLX + NSCL)
574 #define NDUST_END (NDUST_BEG + NDUST - 1)
576 /* -- Additional variable names -- */
577 #define TRC (NFLX + NIONS)
578 #if ENTROPY_SWITCH
579  #define ENTR (TRC + NTRACER)
580 #else
581  #if HAVE_ENERGY
582  #define ENTR (ENG)
583  #endif
584 #endif
585 
586 /* ********************************************************************* */
587 /*! The total number of variables that are evolved in time.
588  This includes:
589  - \c NFLX: number of equations defining the system of conservation laws.
590  For example, for the HD module, it consists of density, momentum and energy.
591  It is defined in the physics module header file mod_defs.h.
592  - \c NIONS: number of chemical species; defined in the cooling modules
593  cooling.h, if present.
594  - \c NTRACER: number of user-defined tracers; defined in the problem
595  directory header file definitions.h
596  \verbatim
597  NFLX NIONS NTRACER ENTR NDUST
598  <---------------------->
599  NSCL
600  <--------------------------------------->
601  NVAR
602  \endverbatim
603  ********************************************************************* */
604 
605 #define NVAR (NFLX + NSCL + NDUST)
606 
607 /* -- Loop Macros -- */
608 
609 #define NFLX_LOOP(n) for ((n) = NFLX; (n)--; )
610 #define NIONS_LOOP(n) for ((n) = NFLX; (n) < (NFLX+NIONS); (n)++)
611 #define NTRACER_LOOP(n) for ((n) = TRC; (n) < (TRC+NTRACER); (n)++)
612 #define NSCL_LOOP(n) for ((n) = NFLX; (n) < (NFLX+NSCL); (n)++)
613 #define NDUST_LOOP(n) for ((n) = NDUST_BEG; (n) <= NDUST_END; (n)++)
614 #define NVAR_LOOP(n) for ((n) = NVAR; (n)--; )
616 /* -- IF_XXXX() Macros for simpler coding -- */
617 
618 #if DUST == YES
619  #define IF_DUST(a) a
620 #else
621  #define IF_DUST(a)
622 #endif
623 
624 #if HAVE_ENERGY
625  #define IF_ENERGY(a) a
626 #else
627  #define IF_ENERGY(a)
628 #endif
629 
630 #if (defined FARGO) && (!defined SHEARINGBOX)
631  #define IF_FARGO(a) a
632 #else
633  #define IF_FARGO(a)
634 #endif
635 
636 #if ROTATING_FRAME == YES
637  #define IF_ROTATING_FRAME(a) a
638 #else
639  #define IF_ROTATING_FRAME(a)
640 #endif
641 
642 /* ----------------------------------------------------------
643  Include module header files: EOS
644  [This section should be placed before, but NVAR
645  wouldn't be defined. Need to fix this at some point]
646  ---------------------------------------------------------- */
647 
648 #include "eos.h"
649 #include "prototypes.h"
650 
651 /* *****************************************************
652  Declare global variables
653  ***************************************************** */
654 
655  extern int SZ;
656  extern int SZ_stagx;
657  extern int SZ_stagy;
658  extern int SZ_stagz;
659  extern int SZ_char;
660  extern int SZ_float;
661  extern int SZ_Float_Vect;
662  extern int SZ_rgb;
663  extern int SZ_short;
664  extern int prank;
665 
666 extern long int IBEG, IEND, JBEG, JEND, KBEG, KEND;
667 extern long int NX1, NX2, NX3;
668 extern long int NX1_TOT, NX2_TOT, NX3_TOT;
669 extern long int NMAX_POINT;
670 
671 extern int VXn, VXt, VXb;
672 extern int MXn, MXt, MXb;
673 extern int BXn, BXt, BXb;
674 #if DUST == YES
675  extern int VXn_D, VXt_D, VXb_D;
676  extern int MXn_D, MXt_D, MXb_D;
677 #endif
678 
679 
680 extern int g_i, g_j, g_k;
681 
682 extern int g_dir;
683 extern int g_maxRiemannIter;
684 extern int g_maxRootIter;
685 extern long int g_usedMemory;
686 extern long int g_stepNumber;
687 extern int g_intStage;
688 extern int g_operatorStep;
689 
690 extern double g_maxCoolingRate, g_minCoolingTemp;
691 
692 extern double g_smallDensity, g_smallPressure;
693 
694 extern double g_time, g_dt;
695 extern double g_maxMach;
696 #if ROTATING_FRAME
697  extern double g_OmegaZ;
698 #endif
699 
700 extern double g_domBeg[3], g_domEnd[3];
701 
702 extern double g_inputParam[32];
703 #if EOS == IDEAL
704  extern double g_gamma;
705 #elif EOS == ISOTHERMAL
706  extern double g_isoSoundSpeed;
707 #endif
708 
709 #ifdef CHOMBO
710  extern double glm_ch_max, glm_ch_max_loc, g_coeff_dl_min;
711  extern double g_level_dx;
712  extern double g_x2stretch, g_x3stretch;
713  extern int glm_is_defined;
714  #if GEOMETRY == CARTESIAN
715  extern double g_stretch_fact;
716  #endif
717 #endif
718 
719 /* ---- Maximum grid size for allocating static arrays ---- */
720 
721 #ifdef CHOMBO
722 
723  #define NX1_MAX NMAX_POINT
724  #if DIMENSIONS == 1
725  #define NX2_MAX 1
726  #define NX3_MAX 1
727  #elif DIMENSIONS == 2
728  #define NX2_MAX NMAX_POINT
729  #define NX3_MAX 1
730  #else
731  #define NX2_MAX NMAX_POINT
732  #define NX3_MAX NMAX_POINT
733  #endif
734 
735 #else
736 
737  #define NX1_MAX NX1_TOT
738  #define NX2_MAX NX2_TOT
739  #define NX3_MAX NX3_TOT
740 
741 #endif
743 #endif /* PLUTO_H */
long int JEND
Upper grid index of the computational domain in the the X2 direction for the local processor...
Definition: globals.h:41
long int NX1_TOT
Total number of zones in the X1 direction (boundaries included) for the local processor.
Definition: globals.h:55
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
Definition: globals.h:62
double g_gamma
Definition: globals.h:112
int SZ_rgb
Definition: globals.h:30
PLUTO header file for structure declarations.
double **** Data_Arr
Definition: pluto.h:492
double g_time
The current integration time.
Definition: globals.h:117
int g_operatorStep
Gives the current operator step.
Definition: globals.h:101
int MXn_D
Definition: globals.h:78
int SZ_Float_Vect
Definition: globals.h:29
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:37
int MXn
Definition: globals.h:74
double real
Definition: pluto.h:488
int VXn_D
Definition: globals.h:77
long int KBEG
Lower grid index of the computational domain in the the X3 direction for the local processor...
Definition: globals.h:43
void Riemann_Solver(const State_1D *, int, int, double *, Grid *)
Definition: pluto.h:489
int g_k
x3 grid index when sweeping along the x1 or x2 direction.
Definition: globals.h:84
int BXt
Definition: globals.h:75
int VXt_D
Definition: globals.h:77
int SZ_stagy
Definition: globals.h:25
int BXb
Definition: globals.h:75
int prank
Processor rank.
Definition: globals.h:33
long int NX1
Number of interior zones in the X1 directions (boundaries excluded) for the local processor...
Definition: globals.h:48
double g_maxCoolingRate
The maximum fractional variation due to cooling from one step to the next.
Definition: globals.h:104
#define g_OmegaZ
Definition: init.c:64
Math tools header file.
double g_domEnd[3]
Upper limits of the computational domain.
Definition: globals.h:126
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
Definition: globals.h:39
int SZ_stagz
Definition: globals.h:26
double g_minCoolingTemp
The minimum temperature (in K) below which cooling is suppressed.
Definition: globals.h:106
int VXb
Definition: globals.h:73
int g_intStage
Gives the current integration stage of the time stepping method (predictor = 0, 1st corrector = 1...
Definition: globals.h:98
int VXb_D
Definition: globals.h:77
PLUTO header file for function-like macros.
int MXt
Definition: globals.h:74
int g_j
x2 grid index when sweeping along the x1 or x3 direction.
Definition: globals.h:83
ArrayLib main header file.
int MXb_D
Definition: globals.h:78
int g_maxRiemannIter
Maximum number of iterations for iterative Riemann Solver.
Definition: globals.h:93
int g_maxRootIter
Maximum number of iterations for root finder.
Definition: globals.h:95
long int NX2_TOT
Total number of zones in the X2 direction (boundaries included) for the local processor.
Definition: globals.h:57
double Reconstruct(double *, double, int)
Definition: pluto.h:491
double g_maxMach
The maximum Mach number computed during integration.
Definition: globals.h:119
long int NX3_TOT
Total number of zones in the X3 direction (boundaries included) for the local processor.
Definition: globals.h:59
Definition: structs.h:78
double g_smallPressure
Small value for pressure fix.
Definition: globals.h:110
int SZ_short
Definition: globals.h:31
long int NX3
Number of interior zones in the X3 directions (boundaries excluded) for the local processor...
Definition: globals.h:52
long int KEND
Upper grid index of the computational domain in the the X3 direction for the local processor...
Definition: globals.h:45
long int g_usedMemory
Amount of used memory in bytes.
Definition: globals.h:96
int g_dir
Specifies the current sweep or direction of integration.
Definition: globals.h:86
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
double g_domBeg[3]
Lower limits of the computational domain.
Definition: globals.h:125
int SZ_float
Definition: globals.h:27
int VXt
Definition: globals.h:73
int SZ
Definition: globals.h:23
Shearing-Box module header file.
int MXb
Definition: globals.h:74
double g_smallDensity
Small value for density fix.
Definition: globals.h:109
FARGO-MHD module header file.
int VXn
Definition: globals.h:73
Reconstruction coefficients header file.
int MXt_D
Definition: globals.h:78
int SZ_char
Definition: globals.h:28
int SZ_stagx
Definition: globals.h:24
Thermal conduction (TC) module header file.
int g_i
x1 grid index when sweeping along the x2 or x3 direction.
Definition: globals.h:82
void Limiter(double *, double *, double *, int, int, Grid *)
Definition: pluto.h:490
int BXn
Definition: globals.h:75
long int g_stepNumber
Gives the current integration step number.
Definition: globals.h:97
long int NX2
Number of interior zones in the X2 directions (boundaries excluded) for the local processor...
Definition: globals.h:50
double g_dt
The current integration time step.
Definition: globals.h:118
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:35