PLUTO
globals.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Collects global variables definitions.
5 
6  This file contains definitions for all global variables
7  (visible anywhere in the code) used by PLUTO.
8  Global variables names, by convention, are prefixed with a "g_"
9  unless they're used as constants throughout the code in which case
10  they keep the full-capitalized notation typical of macros.
11 
12  For modules, global variables are prefixed with the initial letters
13  of the module name, e.g., \c sb_vy or \c glm_ch.
14 
15  In the following "local" means "for the local processor".
16  "Interior" means inside the computational domain.
17 
18  \author A. Mignone (mignone@ph.unito.it)
19  \date Sep 16, 2012
20 */
21 /* ///////////////////////////////////////////////////////////////////// */
22 
23  int SZ;
24  int SZ_stagx;
25  int SZ_stagy;
26  int SZ_stagz;
27  int SZ_float;
28  int SZ_char;
30  int SZ_rgb;
31  int SZ_short;
32 
33 int prank; /**< Processor rank. In serial mode it is defined to be 0. */
34 
35 long int IBEG; /**< Lower grid index of the computational domain in the
36  the X1 direction for the local processor. */
37 long int IEND; /**< Upper grid index of the computational domain in the
38  the X1 direction for the local processor. */
39 long int JBEG; /**< Lower grid index of the computational domain in the
40  the X2 direction for the local processor. */
41 long int JEND; /**< Upper grid index of the computational domain in the
42  the X2 direction for the local processor. */
43 long int KBEG; /**< Lower grid index of the computational domain in the
44  the X3 direction for the local processor. */
45 long int KEND; /**< Upper grid index of the computational domain in the
46  the X3 direction for the local processor. */
47 
48 long int NX1; /**< Number of interior zones in the X1 directions (boundaries
49  \e excluded) for the local processor. */
50 long int NX2; /**< Number of interior zones in the X2 directions (boundaries
51  \e excluded) for the local processor. */
52 long int NX3; /**< Number of interior zones in the X3 directions (boundaries
53  \e excluded) for the local processor. */
54 
55 long int NX1_TOT; /**< Total number of zones in the X1 direction (boundaries
56  \e included) for the local processor.*/
57 long int NX2_TOT; /**< Total number of zones in the X2 direction (boundaries
58  \e included) for the local processor.*/
59 long int NX3_TOT; /**< Total number of zones in the X3 direction (boundaries
60  \e included) for the local processor.*/
61 
62 long int NMAX_POINT; /**< Maximum number of points among the three
63  directions, boundaries \a excluded.*/
64 
65 /*! \name Direction-dependent Vector Labels
66  Vector indices permuted during sweeps are used to distinguish between
67  normal ("n"), tangent ("t") and bi-tangent ("b") directions.
68  In vector notations, \f$ \hvec{b} = \hvec{n} \times \hvec{t} \f$, they
69  form a right-handed triad.
70  Values are set in the SetIndex() function before commencing
71  integration. */
72 /**@{ */
73 int VXn, VXt, VXb;
74 int MXn, MXt, MXb;
75 int BXn, BXt, BXb;
76 #if DUST == YES
77  int VXn_D, VXt_D, VXb_D;
78  int MXn_D, MXt_D, MXb_D;
79 #endif
80 /**@} */
81 
82 int g_i; /**< x1 grid index when sweeping along the x2 or x3 direction. */
83 int g_j; /**< x2 grid index when sweeping along the x1 or x3 direction. */
84 int g_k; /**< x3 grid index when sweeping along the x1 or x2 direction. */
85 
86 int g_dir; /**< Specifies the current sweep or direction of integration.
87  Its value is set usually in the time stepping functions
88  and can take the values
89  - IDIR, for integration in the X1 dir;
90  - JDIR, for integration in the X2 dir;
91  - KDIR, for integration in the X3 dir; */
92 
93 int g_maxRiemannIter; /**< Maximum number of iterations for
94  iterative Riemann Solver. */
95 int g_maxRootIter; /**< Maximum number of iterations for root finder */
96 long int g_usedMemory; /**< Amount of used memory in bytes. */
97 long int g_stepNumber; /**< Gives the current integration step number. */
98 int g_intStage; /**< Gives the current integration stage of the time
99  stepping method (predictor = 0, 1st
100  corrector = 1, and so on). */
101 int g_operatorStep; /**< Gives the current operator step.
102  (HYPERBOLIC_STEP/PARABOLIC_STEP/SOURCE_STEP). */
103 
104 double g_maxCoolingRate = 0.1; /**< The maximum fractional variation due to
105  cooling from one step to the next. */
106 double g_minCoolingTemp = 50.0; /**< The minimum temperature (in K) below which
107  cooling is suppressed. */
108 
109 double g_smallDensity = 1.e-12; /**< Small value for density fix. */
110 double g_smallPressure = 1.e-12; /**< Small value for pressure fix. */
111 #if EOS == IDEAL
112  double g_gamma = 5./3.;
113 #elif EOS == ISOTHERMAL
114  double g_isoSoundSpeed = 1.0; /* g_isoSoundSpeed */
115 #endif
116 
117 double g_time; /**< The current integration time. */
118 double g_dt; /**< The current integration time step. */
119 double g_maxMach; /**< The maximum Mach number computed during integration. */
120 #if ROTATING_FRAME
121  double g_OmegaZ; /**< The angular rotation frequency when rotation is
122  included. */
123 #endif
124 
125 double g_domBeg[3]; /**< Lower limits of the computational domain. */
126 double g_domEnd[3]; /**< Upper limits of the computational domain. */
127 
128 /* g_inputParam is an array containing the user-defined
129  parameters */
130 
131 double g_inputParam[32]; /**< Array containing the user-defined parameters.
132  The index names of this array are defined in
133  definitions.h through the python interface. */
134 #ifdef CH_SPACEDIM
135  double glm_ch_max, glm_ch_max_loc, g_coeff_dl_min;
136  /**< Variables used by Chombo to compute glm_ch. They must be
137  always declared since Chombo does not define GLM_MHD */
138 
139  double g_level_dx; /**< Global variable to pass m_dx ivalue
140  (C++ Chombo library value) to C Pluto functions */
141  double g_x2stretch, g_x3stretch; /**< Grid spacing stretch factor */
142  #ifdef GLM_MHD
143  int glm_is_defined = 1; /**< Integer used to tell Chombo to compute glm_ch
144  (glm_is_defined = 1) or not (glm_is_not_defined = 0) */
145  #else
146  int glm_is_defined = 0;
147  #endif
148  #if GEOMETRY == CARTESIAN
149  double g_stretch_fact;
150  #endif
151 #endif
152 
double g_gamma
Definition: globals.h:112
double g_smallDensity
Small value for density fix.
Definition: globals.h:109
int MXn_D
Definition: globals.h:78
int g_maxRootIter
Maximum number of iterations for root finder.
Definition: globals.h:95
int SZ
Definition: globals.h:23
long int NX1
Number of interior zones in the X1 directions (boundaries excluded) for the local processor...
Definition: globals.h:48
int VXn_D
Definition: globals.h:77
int SZ_float
Definition: globals.h:27
long int NX2_TOT
Total number of zones in the X2 direction (boundaries included) for the local processor.
Definition: globals.h:57
int VXt_D
Definition: globals.h:77
int g_intStage
Gives the current integration stage of the time stepping method (predictor = 0, 1st corrector = 1...
Definition: globals.h:98
int g_maxRiemannIter
Maximum number of iterations for iterative Riemann Solver.
Definition: globals.h:93
double g_dt
The current integration time step.
Definition: globals.h:118
#define g_OmegaZ
Definition: init.c:64
double g_smallPressure
Small value for pressure fix.
Definition: globals.h:110
int prank
Processor rank.
Definition: globals.h:33
int VXb_D
Definition: globals.h:77
int SZ_stagx
Definition: globals.h:24
int SZ_stagy
Definition: globals.h:25
int VXb
Definition: globals.h:73
int SZ_Float_Vect
Definition: globals.h:29
int BXn
Definition: globals.h:75
int g_i
x1 grid index when sweeping along the x2 or x3 direction.
Definition: globals.h:82
int MXt
Definition: globals.h:74
int MXb_D
Definition: globals.h:78
double g_maxMach
The maximum Mach number computed during integration.
Definition: globals.h:119
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
int g_dir
Specifies the current sweep or direction of integration.
Definition: globals.h:86
int g_j
x2 grid index when sweeping along the x1 or x3 direction.
Definition: globals.h:83
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
long int NX3_TOT
Total number of zones in the X3 direction (boundaries included) for the local processor.
Definition: globals.h:59
int VXt
Definition: globals.h:73
int SZ_stagz
Definition: globals.h:26
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:37
double g_domBeg[3]
Lower limits of the computational domain.
Definition: globals.h:125
int MXn
Definition: globals.h:74
int SZ_char
Definition: globals.h:28
int g_k
x3 grid index when sweeping along the x1 or x2 direction.
Definition: globals.h:84
int VXn
Definition: globals.h:73
double g_minCoolingTemp
The minimum temperature (in K) below which cooling is suppressed.
Definition: globals.h:106
int SZ_short
Definition: globals.h:31
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
Definition: globals.h:62
int g_operatorStep
Gives the current operator step.
Definition: globals.h:101
int SZ_rgb
Definition: globals.h:30
double g_time
The current integration time.
Definition: globals.h:117
int MXt_D
Definition: globals.h:78
long int KBEG
Lower grid index of the computational domain in the the X3 direction for the local processor...
Definition: globals.h:43
long int KEND
Upper grid index of the computational domain in the the X3 direction for the local processor...
Definition: globals.h:45
double g_domEnd[3]
Upper limits of the computational domain.
Definition: globals.h:126
int BXt
Definition: globals.h:75
double g_maxCoolingRate
The maximum fractional variation due to cooling from one step to the next.
Definition: globals.h:104
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
Definition: globals.h:39
int BXb
Definition: globals.h:75
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 g_usedMemory
Amount of used memory in bytes.
Definition: globals.h:96
long int NX1_TOT
Total number of zones in the X1 direction (boundaries included) for the local processor.
Definition: globals.h:55
long int NX3
Number of interior zones in the X3 directions (boundaries excluded) for the local processor...
Definition: globals.h:52
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:35
int MXb
Definition: globals.h:74