PLUTO  4.4-patch2
pluto.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
12 /* ///////////////////////////////////////////////////////////////////// */
13 #ifndef PLUTO_H
14 #define PLUTO_H
15 
16 #define PLUTO_VERSION "4.4-patch2"
17 
18 #include <stdio.h>
19 #include <stdarg.h>
20 #include <stdint.h>
21 #include <string.h>
22 #include <math.h>
23 #include <stdlib.h>
24 #include <time.h>
25 
26 #define YES 1
27 #define NO 0
28 #define DEFAULT -1
29 #define TRUE YES
30 #define FALSE NO
31 
32 /* ---- Geometry Labels ( > 0) ---- */
33 
34 #define CARTESIAN 1
35 #define CYLINDRICAL 2
36 #define POLAR 3
37 #define SPHERICAL 4
38 
39 #define UNIFORM_GRID 1
40 #define STRETCHED_GRID 2
41 #define LOGARITHMIC_INC_GRID 3
42 #define LOGARITHMIC_DEC_GRID 4
43 
44 /* ---- Equation of sweep (EoS) labels ---- */
45 
46 #define IDEAL 1
47 #define PVTE_LAW 2
48 #define TAUB 3
49 #define BAROTROPIC 4
50 #define ISOTHERMAL 5
51 
52 /* ---- Entropy switch options ----- */
53 
54 #define SELECTIVE 1
55 #define ALWAYS 2
56 #define CHOMBO_REGRID 3
57 
58 /* ---- Time stepping labels ---- */
59 
60 #define EULER 1
61 #define HANCOCK 2
62 #define CHARACTERISTIC_TRACING 3
63 #define RK2 5
64 #define RK3 6
65 #define SSP_RK4 8
66 #define EXP_MIDPOINT 9 /* -- Used for dust time stepping -- */
67 #define SEMI_IMPLICIT 10 /* -- Used for dust time stepping -- */
68 #define RK_MIDPOINT 11
69 #define RK4 12
70 
71 #define EXPLICIT 1 /* -- just a number different from 0 !!! -- */
72 #define SUPER_TIME_STEPPING 2 /* -- just a number different from EXPLICIT -- */
73 #define RK_CHEBYSHEV 4
74 #define RK_LEGENDRE 8
75 
76 #define IMEX 2 /* Any number different from EXPLICIT (=1) */
77 
78 /* ---- Output labels ---- */
79 
80 #define DBL_OUTPUT 1
81 #define FLT_OUTPUT 2
82 #define VTK_OUTPUT 3
83 #define DBL_H5_OUTPUT 4
84 #define FLT_H5_OUTPUT 5
85 #define TAB_OUTPUT 6
86 #define PPM_OUTPUT 7
87 #define PNG_OUTPUT 8
88 
89 #define PARTICLES_DBL_OUTPUT 9
90 #define PARTICLES_FLT_OUTPUT 10
91 #define PARTICLES_VTK_OUTPUT 11
92 #define PARTICLES_TAB_OUTPUT 12
93 #define PARTICLES_HDF5_OUTPUT 13
94 
95 #define VTK_VECTOR 5 /* -- any number but NOT 1 -- */
96 
97 #define MAX_OUTPUT_TYPES 16 /* The max number of allowed data formats
98  including fluid and particles */
99 #define MAX_OUTPUT_VARS 64 /* The maximum nuber of variables that can be
100  dumped to disk for a single format. */
101 
102 
103 #define CONS_ARRAY 0
104 #define PRIM_ARRAY 1
105 
106 /* ---- Cooling labels ---- */
107 
108 #define POWER_LAW 3
109 #define MINEq 4
110 #define SNEq 5
111 #define TABULATED 6
112 #define H2_COOL 7
113 #define KROME 8
114 
115 /*----- Particle Labels ----- */
116 
117 #define PARTICLES_LP 1
118 #define PARTICLES_CR 2
119 #define PARTICLES_DUST 3
120 
121 /* ---- Physics modules labels ---- */
122 
123 #define ADVECTION 1
124 #define HD 2
125 #define RHD 3
126 #define MHD 4
127 #define RMHD 5
128 #define ResRMHD 6
129 #define CR_TRANSPORT 7
130 
131 /* ---- SET LABELS FOR DIV.B Control ----
132  If you move them to the MHD header,
133  definitions.h (which is included before)
134  cannot correctly use them */
135 
136 #define EIGHT_WAVES 1
137 #define DIV_CLEANING 2
138 #define CONSTRAINED_TRANSPORT 3
139 
140 /* ---- SET LABELS FOR BODY_FORCE ----
141  Please do not change them since they are
142  used in bitwise operations */
143 
144 #define VECTOR 4 /* corresponds to 100 in binary */
145 #define POTENTIAL 8 /* corresponds to 1000 in binary */
146 
147 /* ---- Boundary condition labels ---- */
148 
149 #define OUTFLOW 1 /* any number except 0 !! */
150 #define REFLECTIVE 2
151 #define AXISYMMETRIC 3
152 #define EQTSYMMETRIC 4
153 #define PERIODIC 5
154 #define SHEARING 6
155 #define USERDEF 7
156 #define POLARAXIS 8
157 #define CONSTANT 9
158 
164 #define X1_BEG 101
165 #define X1_END 102
166 #define X2_BEG 103
167 #define X2_END 104
168 #define X3_BEG 105
169 #define X3_END 106
170 #define DOM 107
171 #define TOT 108
174 /* ---- LABELS FOR IMAGE SLICING ---- */
175 
176 #define X12_PLANE 3
177 #define X13_PLANE 5
178 #define X23_PLANE 6
179 
197 #define FLAG_MINMOD 1
198 #define FLAG_FLAT 2
199 #define FLAG_HLL 4
200 #define FLAG_ENTROPY 8
201 #define FLAG_SPLIT_CELL 16
203 #define FLAG_INTERNAL_BOUNDARY 32
206 #define FLAG_CONS2PRIM_FAIL 64
207 #define FLAG_NEGATIVE_PRESSURE 128
208 #define FLAG_NEGATIVE_ENERGY 256
209 #define FLAG_NEGATIVE_DENSITY 512
210 #define FLAG_BIT_11 1024
211 #define FLAG_BIT_12 2048
212 #define FLAG_BIT_13 4096
213 #define FLAG_BIT_14 8192
214 #define FLAG_BIT_15 16384
215 #define FLAG_GCA_FAILURE 32768
219 #define IDIR 0 /* This sequence (0,1,2) should */
220 #define JDIR 1 /* never be changed */
221 #define KDIR 2 /* */
222 #define ALL_DIR -1
223 
224 /* -- location of a variable inside the cell -- */
225 
226 #define CENTER 0 /* -- Means (i, j, k) -- */
227 #define X1FACE 1 /* -- Means (i+1/2, j, k) -- */
228 #define X2FACE 2 /* -- Means (i, j+1/2, k) -- */
229 #define X3FACE 3 /* -- Means (i, j, k+1/2) -- */
230 #define X1EDGE 4 /* -- Means (i, j+1/2, k+1/2) -- */
231 #define X2EDGE 5 /* -- Means (i+1/2, j, k+1/2) -- */
232 #define X3EDGE 6 /* -- Means (i+1/2, j+1/2, k) -- */
233 
234 #define CELL_CENTER 50 /* really needed ? */
235 #define FACE_CENTER 51
236 #define EDGE_CENTER 52
237 
238 /* -- Set reconstruction labels -- */
239 
240 #define FLAT 10
241 #define LINEAR 20
242 #define LimO3 30
243 #define WENO3 40
244 #define PARABOLIC 50
245 #define MP5 60
246 #define WENOZ 70
247 #define SPLINE1 11 /* Used by Table2D interpolation */
248 #define SPLINE2 12 /* Used by Table2D interpolation */
249 
250 #define WENO3_FD 103
251 #define WENO5_FD 105
252 #define WENOZ_FD 106
253 #define WENO7_FD 107
254 #define MP5_FD 125
255 #define LIMO3_FD 300
256 
257 #define ONED 1
258 #define MULTID 3
259 
260 /* ----------------------------------------------
261  Set limiter labels.
262  These labels must be in the range [21,29]
263  in order to allow different limiters to be
264  used during the transverse reconstruction.
265  ---------------------------------------------- */
266 
267 #define FLAT_LIM 21
268 #define MINMOD_LIM 22
269 #define VANALBADA_LIM 23
270 #define OSPRE_LIM 24
271 #define UMIST_LIM 25
272 #define VANLEER_LIM 26
273 #define MC_LIM 27
274 #define FOURTH_ORDER_LIM 28
275 
282 #define CONST_AH 1.008
283 #define CONST_AHe 4.004
284 #define CONST_AZ 30.0
285 #define CONST_amu 1.66053886e-24
286 #define CONST_au 1.49597892e13
287 #define CONST_c 2.99792458e10
288 #define CONST_e 4.80320425e-10
289 #define CONST_eV 1.602176463158e-12
290 #define CONST_G 6.6726e-8
291 #define CONST_h 6.62606876e-27
292 #define CONST_kB 1.3806505e-16
293 #define CONST_ly 0.9461e18
294 #define CONST_mp 1.67262171e-24
295 #define CONST_mn 1.67492728e-24
296 #define CONST_me 9.1093826e-28
297 #define CONST_mH 1.6733e-24
298 #define CONST_Msun 2.e33
299 #define CONST_Mearth 5.9736e27
300 #define CONST_NA 6.0221367e23
301 #define CONST_pc 3.0856775807e18
302 #define CONST_PI 3.14159265358979
303 #define CONST_Rearth 6.378136e8
304 #define CONST_Rgas 8.3144598e7
305 #define CONST_Rsun 6.96e10
306 #define CONST_sigma 5.67051e-5
307 #define CONST_sigmaT 6.6524e-25
310 /* ********************************************************
311  Including header files here
312  ******************************************************** */
313 
314 #include "definitions.h" /* Problem-dependent header file */
315 
316 /* ********************************************************
317  Set default values of fine-tuning macro-define
318  constants.
319  This section of the code is for general-purpose macros
320  although other may exists elsewhere.
321  ******************************************************** */
322 
323 #ifndef AMBIPOLAR_DIFFUSION
324  #define AMBIPOLAR_DIFFUSION NO
325 #endif
326 
327 #ifndef ASSIGN_VECTOR_POTENTIAL
328  #define ASSIGN_VECTOR_POTENTIAL NO
329 #endif
330 
331 #ifndef BACKGROUND_FIELD
332  #define BACKGROUND_FIELD NO
333 #endif
334 
335 #ifndef CHAR_LIMITING
336  #define CHAR_LIMITING NO
337 #endif
338 
339 #ifdef CH_SPACEDIM
340  #define CHOMBO 1
341 
342  #ifndef CHOMBO_LOGR
343  #define CHOMBO_LOGR NO
344  #endif
345 
346 /* ********************************************************
347  By default we enable angular momentum conservation only
348  if the entropy switch is enabled.
349  Otherwise angular momentum conservation is not enforced
350  during refluxing / prolongation / restriction
351  operations since this has been shown to lead to the
352  appearance of negative pressures.
353  (Simultaneous energy and angular momentum conservation
354  in Chombo does not seem to be very robust)
355  ******************************************************** */
356 
357  #ifndef CHOMBO_CONS_AM
358  #if (GEOMETRY == CYLINDRICAL) && (ENTROPY_SWITCH)
359  #define CHOMBO_CONS_AM YES
360  #elif (GEOMETRY == SPHERICAL) && (ENTROPY_SWITCH)
361  #define CHOMBO_CONS_AM YES
362  #elif (GEOMETRY == POLAR) && (ENTROPY_SWITCH)
363  #define CHOMBO_CONS_AM YES
364  #else
365  #define CHOMBO_CONS_AM NO
366  #endif
367  #endif
368 
369  #if CHOMBO_CONS_AM == YES
370  #define CHOMBO_NDV 2
371  #else
372  #define CHOMBO_NDV 1
373  #endif
374 #endif
375 
376 #ifndef DUST_FLUID
377  #define DUST_FLUID NO
378 #endif
379 
380 #ifndef ENABLE_HLLEM
381  #define ENABLE_HLLEM NO
382 #endif
383 
384 #ifndef ENTROPY_SWITCH
385  #define ENTROPY_SWITCH NO
386 #endif
387 
388 #ifndef EOS
389  #define EOS -1
390 #endif
391 
392 #ifndef FAILSAFE
393  #define FAILSAFE NO
394 #endif
395 
396 #ifndef HALL_MHD
397  #define HALL_MHD NO
398 #endif
399 
400 #ifndef INITIAL_SMOOTHING
401  #define INITIAL_SMOOTHING NO
403 #endif
404 
405 #ifndef INTERNAL_BOUNDARY
406  #define INTERNAL_BOUNDARY NO
407 #endif
408 
409 #ifndef INTERNAL_BOUNDARY_REFLECT
410  #define INTERNAL_BOUNDARY_REFLECT NO
411 #endif
412 
413 #ifndef LIMITER
414  #define LIMITER DEFAULT
415 #endif
416 
417 #ifndef MULTIPLE_LOG_FILES
418  #define MULTIPLE_LOG_FILES NO
419 #endif
420 
421 #ifndef NGHOST_USR
422  #define NGHOST_USR -1
424 #endif
425 
426 #ifndef RECONSTRUCT_4VEL
427  #define RECONSTRUCT_4VEL NO
430 #endif
431 
432 #ifndef RESISTIVITY
433  #define RESISTIVITY NO
434 #endif
435 
436 #ifndef RING_AVERAGE
437  #define RING_AVERAGE NO
438 #endif
439 
440 #ifndef RING_AVERAGE_REC
441  #if RING_AVERAGE > 1
442  #define RING_AVERAGE_REC 5
443  #else
444  #define RING_AVERAGE_REC 1
445  #endif
446 #endif
447 
448 #ifndef ROTATING_FRAME
449  #define ROTATING_FRAME NO
450 #endif
451 
452 #ifndef SHOCK_FLATTENING
453  #define SHOCK_FLATTENING NO
454 #endif
455 
456 #ifndef SHOW_TIMINIG
457  #define SHOW_TIMING NO
458 #endif
459 
460 #ifndef TIME_STEP_CONTROL
461  #define TIME_STEP_CONTROL NO
462 #endif
463 
464 #ifndef THERMAL_CONDUCTION
465  #define THERMAL_CONDUCTION NO
466 #endif
467 
468 #ifndef UNIT_DENSITY
469  #define UNIT_DENSITY (CONST_mp)
470 #endif
471 
472 #ifndef UNIT_LENGTH
473  #define UNIT_LENGTH (CONST_au)
474 #endif
475 
476 #ifndef UNIT_VELOCITY
477  #if (PHYSICS == RHD) || (PHYSICS == RMHD) || (PHYSICS == ResRMHD)
478  #define UNIT_VELOCITY (CONST_c)
479  #else
480  #define UNIT_VELOCITY (1.e5)
481  #endif
482 #endif
483 
484 #ifndef UPDATE_VECTOR_POTENTIAL
485  #define UPDATE_VECTOR_POTENTIAL NO
486 #endif
487 
488 #ifndef VISCOSITY
489  #define VISCOSITY NO
490 #endif
491 
492 #ifndef RADIATION
493  #define RADIATION NO
494 #endif
495 
496 #ifndef WARNING_MESSAGES
497  #define WARNING_MESSAGES YES
498 #endif
499 
500 /* ********************************************************
501  Set HAVE_ENERGY to YES if an energy equation exists
502  ******************************************************** */
503 
504 #if (EOS == IDEAL) || (EOS == PVTE_LAW) || (EOS == TAUB)
505  #define HAVE_ENERGY YES
506 #else
507  #define HAVE_ENERGY NO
508 #endif
509 
513 #define KELVIN (UNIT_VELOCITY*UNIT_VELOCITY*CONST_amu/CONST_kB)
514 
515 /* ********************************************************
516  Debug switches
517  ******************************************************** */
518 
519 /* -- CHECK_DIVB_CONDITION: used in MHD/CT/ct.c
520  to check if div.B = 0 -- */
522 #ifndef CHECK_DIVB_CONDITION
523  #define CHECK_DIVB_CONDITION NO
524 #endif
525 
526 /* -- CHECK_EIGENVECTORS: used in eigenv.c in HD/, MHD/, RHD/
527  to check orthogonality and the correctness through
528  the relation the A = L*\Lambda*R -- */
529 
530 #ifndef CHECK_EIGENVECTORS
531  #define CHECK_EIGENVECTORS NO
532 #endif
533 
534 /* -- CHECK_ROE_MATRIX: used in roe.c to verify L.Lambda.R = A -- */
535 /*
536 #ifndef CHECK_ROE_MATRIX
537  #define CHECK_ROE_MATRIX NO
538 #endif
539 */
540 /* -- Shortcut for CTU -- */
541 
542 #if (TIME_STEPPING == HANCOCK) || (TIME_STEPPING == CHARACTERISTIC_TRACING)
543  #define CTU 1 /* -- Corner Transport Upwind method of Colella -- */
544 #endif
545 
546 /* -- Select Primitive / Conservative form of Hancock scheme -- */
547 
548 #if TIME_STEPPING == HANCOCK
549  #ifndef PRIMITIVE_HANCOCK
550  #if (PHYSICS == MHD) && (PARTICLES == PARTICLES_CR)
551  #define PRIMITIVE_HANCOCK NO
552  #elif (PHYSICS == RMHD) || (PHYSICS == ResRMHD)
553  #define PRIMITIVE_HANCOCK NO
554  #else
555  #define PRIMITIVE_HANCOCK YES
556  #endif
557  #endif
558 #endif
559 
560 /* ********************************************************
561  Diffusion operators (HD and MHD only):
562  PARABOLIC_FLUX is the bitwise OR combination of all
563  operators, each being either one of NO,
564  EXPLICIT (1st bit), STS (2nd bit), RKL (3rd bit).
565  It can take the following values
566 
567  00 --> no diffusion operator is being used;
568  01 --> there's at least one explicit diffusion
569  operator and no STS.
570 
571  10 --> there's at least one STS diffusion
572  operator and no explicit one.
573  11 --> mixed: there is at least one explicit
574  and sts operator
575  ******************************************************** */
576 
577 #if PHYSICS == HD || PHYSICS == MHD
578  #define PARABOLIC_FLUX (RESISTIVITY|THERMAL_CONDUCTION|VISCOSITY)
579 #else
580  #define PARABOLIC_FLUX NO
581 #endif
582 
583 /* ********************************************************
584  Include more header files
585  ******************************************************** */
586 
587 #ifdef PARALLEL /* Only for parallel computations on static grid */
588  #include <al.h>
589 #endif
590 #ifdef CH_MPI /* Include mpi.h for parallel Chombo, in order to */
591  #include <mpi.h> /* use MPI_Abort function in the QUIT_PLUTO macro */
592 #endif
593 #include "macros.h" /* Function-like macro header file */
594 #include "structs.h" /* Structure declaration header file */
595 
596 /* ********************************************************
597  Recurrent types
598  Note: when using Finite Difference Schemes, the
599  "Riemann Solver" function computes the fluxes
600  with high order interpolants.
601  ******************************************************** */
602 
603 typedef void Riemann_Solver (const Sweep *, int, int, double *, Grid *);
604 typedef void Limiter (double *, double *, double *, int, int, Grid *);
605 typedef double Reconstruct (double *, double, int);
606 typedef double ****Data_Arr;
607 
608 /* ********************************************************
609  Include physics module header files
610  ******************************************************** */
611 
612 #include "mod_defs.h" /* Include physics header file (search path is set
613  in the makefile) */
614 
615 #if COOLING != NO /* Cooling should be included as soon as possible */
616  #include "Cooling/cooling.h" /* since it may change the number of variables */
617 #endif
618 
619 /* ********************************************************
620  Define mass fractions (H_MASS_FRAC = xH and
621  He_MASS_FRAC = xHe):
622 
623  xH = mH / mtot
624  xHe = mHe / mtot
625  xZ = mZ / mtot
626 
627  where xH + xHe + xZ = 1.
628  Number fraction are defined from mass fraction in
629  pluto.h
630 
631  - For SNEq, mass fractions are chosen so as to preserve
632  the original Raymond hydrogen number fraction (fZ = 1.e-3,
633  fHe = 0.082):
634 
635  xH = 1 - xZ - xHe = 1 - xH/AH*(fZ*AZ + fHe*AHe)
636 
637  giving xH = AH/(AH + fZ*AZ + fHe*AHe) while
638  xHe = fHe*AHe*xH/AH.
639 
640  - For H2_COOL, Proto-Solar Mass Fractions for Hydrogen
641  and Helium (Lodders, ApJ 591, 2003 ) are used.
642 
643  ******************************************************** */
644 
645 #ifndef H_MASS_FRAC /* Set default values */
646  #if COOLING == SNEq
647  #define H_MASS_FRAC 0.737743792120194
648  #else
649  #define H_MASS_FRAC 0.7110
650  #endif
651 #endif
652 
653 #ifndef He_MASS_FRAC
654  #if (EOS == PVTE_LAW) && (COOLING == NO)
655  #define He_MASS_FRAC (1 - H_MASS_FRAC) /* Effective Y and not 0.2741
656  Baraffe (2008) */
657  #elif COOLING == SNEq
658  #define He_MASS_FRAC (0.082*CONST_AHe*H_MASS_FRAC/CONST_AH)
659  #else
660  #define He_MASS_FRAC 0.2741
661  #endif
662 #endif
663 
664 /* *********************************************************************
665  Define number fractions (FRAC_He = fHe and FRAC_Z = fZ, with
666  respect to hydrogen - FRAC_H = 1):
667 
668  fH = NH/NH = 1, fHe = NHe/NH, fZ = NZ/NH
669  ********************************************************************* */
670 
671 #define Z_MASS_FRAC (1.0 - H_MASS_FRAC - He_MASS_FRAC)
672 #define FRAC_He (He_MASS_FRAC/CONST_AHe*CONST_AH/H_MASS_FRAC)
673 #define FRAC_Z (Z_MASS_FRAC /CONST_AZ *CONST_AH/H_MASS_FRAC)
674 
675 /* ******************************************************** */
686 #ifndef NIONS
687  #define NIONS 0
688 #endif
689 
690 #define NSCL (NTRACER + NIONS + (ENTROPY_SWITCH != 0))
691 
692 /* -- Additional variable names -- */
693 
694 #define TRC (NFLX + NIONS)
695 #if ENTROPY_SWITCH
696  #define ENTR (TRC + NTRACER)
697 #else
698  #if HAVE_ENERGY
699  #define ENTR (ENG)
700  #endif
701 #endif
702 
703 /* ******************************************************** */
727 /* -- Loop Macros -- */
728 
729 #define NFLX_LOOP(n) for ((n) = NFLX; (n)--; )
730 #define NIONS_LOOP(n) for ((n) = NFLX; (n) < (NFLX+NIONS); (n)++)
731 #define NTRACER_LOOP(n) for ((n) = TRC; (n) < (TRC+NTRACER); (n)++)
732 #define NSCL_LOOP(n) for ((n) = NFLX; (n) < (NFLX+NSCL); (n)++)
733 
734 #if DUST_FLUID == YES
735  #include "Dust_Fluid/dust_fluid.h" /* Dust header file */
736 #else
737  #define NDUST_FLUID 0
738 #endif
739 #define NVAR (NFLX + NSCL + NDUST_FLUID)
740 
741 #define NVAR_LOOP(n) for ((n) = NVAR; (n)--; )
742 
743 /* ********************************************************
744  Keep on adding module header files
745  ******************************************************** */
746 
747 #ifdef FARGO
748  #include "Fargo/fargo.h" /* FARGO header file */
749 #endif
750 
751 #define FORCED_TURB NO
752 #if FORCED_TURB == YES
753  #include "Forced_Turb/forced_turb.h" /* Forced Turb Header file */
754 #endif
755 
756 #ifdef HALL_MHD
757  #include "MHD/Hall_MHD/hall_mhd.h" /* Hall-MHD module header */
758 #endif
759 
760 #if (PARTICLES != NO) /* Particle Header File */
761  #include "Particles/particles.h"
762 #endif
763 
764 #ifdef SHEARINGBOX
765  #include "MHD/ShearingBox/shearingbox.h" /* Shearing box header file */
766 #endif
767 
768 #if THERMAL_CONDUCTION != NO
769  #include "Thermal_Conduction/tc.h" /* Thermal conduction header file */
770 #endif
771 
772 #if VISCOSITY != NO
773  #include "Viscosity/viscosity.h" /* Viscosity header file */
774 #endif
775 
776 #include "States/plm_coeffs.h" /* PLM header file */
777 #if RECONSTRUCTION == PARABOLIC
778  #include "States/ppm_coeffs.h" /* PPM header file */
779 #endif
780 #include "Math_Tools/math_tools.h" /* Math tools header file */
781 
782 /* ********************************************************
783  Define IF_XXXX() Macros for simpler coding
784  ******************************************************** */
785 
786 #if DUST_FLUID == YES
787  #define IF_DUST_FLUID(a) a
788 #else
789  #define IF_DUST_FLUID(a)
790 #endif
791 
792 #if HAVE_ENERGY
793  #define IF_ENERGY(a) a
794 #else
795  #define IF_ENERGY(a)
796 #endif
797 
798 #if (defined FARGO) && (!defined SHEARINGBOX)
799  #define IF_FARGO(a) a
800 #else
801  #define IF_FARGO(a)
802 #endif
803 
804 #if ROTATING_FRAME == YES
805  #define IF_ROTATING_FRAME(a) a
806 #else
807  #define IF_ROTATING_FRAME(a)
808 #endif
809 
810 /* ********************************************************
811  Include module header files: EOS
812  [This section should be placed before, but NVAR
813  wouldn't be defined. Need to fix this at some point]
814  ******************************************************** */
815 
816 #include "eos.h"
817 #include "prototypes.h"
818 
819 /* ********************************************************
820  Declare global variables
821  ******************************************************** */
822 
823  extern int SZ;
824  extern int SZ_stagx;
825  extern int SZ_stagy;
826  extern int SZ_stagz;
827  extern int SZ_char;
828  extern int SZ_uint16_t;
829  extern int SZ_float;
830  extern int SZ_Float_Vect;
831  extern int SZ_rgb;
832  extern int SZ_short;
833  extern int prank;
834 
835 extern long int IBEG, IEND, JBEG, JEND, KBEG, KEND;
836 extern long int NX1, NX2, NX3;
837 extern long int NX1_TOT, NX2_TOT, NX3_TOT;
838 extern long int NMAX_POINT;
839 
840 extern int VXn, VXt, VXb;
841 extern int MXn, MXt, MXb;
842 extern int BXn, BXt, BXb;
843 extern int EXn, EXt, EXb;
844 #if DUST_FLUID == YES
845  extern int VXn_D, VXt_D, VXb_D;
846  extern int MXn_D, MXt_D, MXb_D;
847 #endif
848 #if RADIATION
849  extern int FRn, FRt, FRb;
850 #endif
851 
852 extern int g_i, g_j, g_k;
853 
854 extern int g_dir;
855 extern int g_intStage;
856 extern int g_maxIMEXIter;
857 extern int g_maxRiemannIter;
858 extern int g_maxRootIter;
859 extern int g_nprocs;
860 extern long int g_stepNumber;
861 extern long int g_usedMemory;
862 
863 extern double g_maxCoolingRate, g_minCoolingTemp;
864 
865 extern double g_smallDensity, g_smallPressure;
866 
867 extern double g_time, g_dt;
868 extern double g_maxMach;
869 #if ROTATING_FRAME
870  extern double g_OmegaZ;
871 #endif
872 
873 extern double g_domBeg[3], g_domEnd[3];
874 
875 extern double g_inputParam[32];
876 #if EOS == IDEAL
877  extern double g_gamma;
878 #elif EOS == ISOTHERMAL
879  extern double g_isoSoundSpeed;
880 #endif
881 
882 #if RADIATION
883  extern double g_absorptionCoeff;
884  extern double g_scatteringCoeff;
885  extern double g_radiationConst;
886  extern double g_idealGasConst;
887  extern double g_totalOpacity;
888 #endif
889 
890 #ifdef CHOMBO
891  extern double glm_ch_max, glm_ch_max_loc, g_coeff_dl_min;
892  extern double g_level_dx;
893  extern double g_x2stretch, g_x3stretch;
894  extern int glm_is_defined;
895  #if GEOMETRY == CARTESIAN
896  extern double g_stretch_fact;
897  #endif
898 #endif
899 
900 #if DEBUG == TRUE
901  extern int d_indent;
902  extern int d_condition;
903 #endif
904 
905 /* ---- Maximum grid size for allocating static arrays ---- */
906 
907 #ifdef CHOMBO
908 
909  #define NX1_MAX NMAX_POINT
910  #if DIMENSIONS == 1
911  #define NX2_MAX 1
912  #define NX3_MAX 1
913  #elif DIMENSIONS == 2
914  #define NX2_MAX NMAX_POINT
915  #define NX3_MAX 1
916  #else
917  #define NX2_MAX NMAX_POINT
918  #define NX3_MAX NMAX_POINT
919  #endif
920 
921 #else
922 
923  #define NX1_MAX NX1_TOT
924  #define NX2_MAX NX2_TOT
925  #define NX3_MAX NX3_TOT
926 
927 #endif
928 
929 #endif /* PLUTO_H */
Header file for Hall MHD.
long int JEND
Definition: globals.h:42
long int NX1_TOT
Definition: globals.h:56
long int NMAX_POINT
Definition: globals.h:63
int g_maxIMEXIter
Definition: globals.h:109
PLUTO header file for structure declarations.
double g_time
Definition: globals.h:132
long int IEND
Definition: globals.h:38
long int KBEG
Definition: globals.h:44
Set labels, indexes and prototypes for the dust module.
int g_k
Definition: globals.h:90
Particle module header file.
int prank
Definition: globals.h:34
long int NX1
Definition: globals.h:49
double g_maxCoolingRate
Definition: globals.h:104
Definition: structs.h:124
Math tools header file.
double g_domEnd[3]
Definition: globals.h:141
long int JBEG
Definition: globals.h:40
double g_minCoolingTemp
Definition: globals.h:106
int g_intStage
Definition: globals.h:101
PLUTO header file for function-like macros.
int g_j
Definition: globals.h:89
ArrayLib main header file.
int g_maxRiemannIter
Definition: globals.h:110
int g_maxRootIter
Definition: globals.h:112
long int NX2_TOT
Definition: globals.h:58
double g_maxMach
Definition: globals.h:134
long int NX3_TOT
Definition: globals.h:60
Cooling main header file.
double g_smallPressure
Definition: globals.h:116
long int NX3
Definition: globals.h:53
long int KEND
Definition: globals.h:46
long int g_usedMemory
Definition: globals.h:133
int g_dir
Definition: globals.h:92
double g_inputParam[32]
Definition: globals.h:146
double g_domBeg[3]
Definition: globals.h:140
Shearing-Box module header file.
double g_smallDensity
Definition: globals.h:115
FARGO-MHD module header file.
int g_nprocs
Definition: globals.h:113
Reconstruction coefficients header file.
int d_indent
Definition: globals.h:169
Thermal conduction (TC) module header file.
int g_i
Definition: globals.h:88
int d_condition
Definition: globals.h:170
long int g_stepNumber
Definition: globals.h:131
long int NX2
Definition: globals.h:51
Definition: structs.h:289
double g_dt
Definition: globals.h:99
long int IBEG
Definition: globals.h:36