PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
mod_defs.h
1 /* ****************************************************************
2 
3  Set label, indexes and basic prototyping for the Hydro (HD)
4  module.
5 
6  We make extra vector components, when not needed, point
7  to the last element (255) of the array stored by startup.c.
8  **************************************************************** */
9 
10 enum {
11  #if COMPONENTS == 1
12  RHO, MX1,
13  #if EOS == IDEAL
14  ENG, PRS = ENG,
15  #endif
16  MX2 = 255, MX3 = 255,
17  #elif COMPONENTS == 2
18  RHO, MX1, MX2,
19  #if EOS == IDEAL
20  ENG, PRS = ENG,
21  #endif
22  MX3 = 255,
23  #elif COMPONENTS == 3
24  RHO, MX1, MX2, MX3,
25  #if EOS == IDEAL
26  ENG, PRS = ENG,
27  #endif
28  #endif
29  VX1 = MX1, VX2 = MX2, VX3 = MX3,
30 
31 /* -- backward compatibility -- */
32 
33  DN = RHO,
34  #if EOS != ISOTHERMAL
35  PR = PRS, EN = ENG,
36  #endif
37  VX = VX1, VY = VX2, VZ = VX3,
38  MX = MX1, MY = MX2, MZ = MX3
39 };
40 
41 #define NFLX (COMPONENTS + (EOS == IDEAL ? 2:1))
42 
43 /* *************************************************
44  Now define more convenient and user-friendly
45  pointer labels for geometry setting
46  ************************************************* */
47 
48 #if GEOMETRY == CYLINDRICAL
49 
50  #define iVR VX1
51  #define iVZ VX2
52  #define iVPHI VX3
53 
54  #define iMR MX1
55  #define iMZ MX2
56  #define iMPHI MX3
57 
58 #endif
59 
60 #if GEOMETRY == POLAR
61 
62  #define iVR VX1
63  #define iVPHI VX2
64  #define iVZ VX3
65 
66  #define iMR MX
67  #define iMPHI MY
68  #define iMZ MZ
69 
70 #endif
71 
72 #if GEOMETRY == SPHERICAL
73 
74  #define iVR VX
75  #define iVTH VY
76  #define iVPHI VZ
77 
78  #define iMR MX
79  #define iMTH MY
80  #define iMPHI MZ
81 
82 #endif
83 
84 /* *************************************************
85  Label the different waves in increasing order
86  following the number of vector components.
87  ************************************************* */
88 
89 enum KWAVES {
90  KSOUNDM, KSOUNDP
91  #if EOS == IDEAL
92  , KENTRP
93  #endif
94 };
95 
96 /* ***********************************************************
97  Prototyping goes here
98  *********************************************************** */
99 
100 int ConsToPrim (double **, double **, int, int, unsigned char *);
101 void Eigenvalues (double **, double *, double **, int, int);
102 void PrimEigenvectors (double *, double, double, double *, double **, double **);
103 void ConsEigenvectors (double *, double *, double,
104  double **, double **, double *);
105 
106 void Enthalpy (double **, double *, int, int);
107 void Entropy (double **, double *, int, int );
108 void Flux (double **, double **, double *, double **, double *, int, int);
109 void HLL_Speed (double **, double **, double *, double *,
110  double *, double *, int, int);
111 void MaxSignalSpeed (double **, double *, double *, double *, int, int);
112 void PrimToCons (double **, double **, int, int);
113 void PrimRHS (double *, double *, double, double, double *);
114 void PrimSource (const State_1D *, int, int,
115  double *, double *, double **, Grid *);
116 
117 Riemann_Solver TwoShock_Solver, LF_Solver, MUSTA_FLUX,
118  Roe_Solver, HLL_Solver, HLLC_Solver;
119 Riemann_Solver AUSMp_Solver;
120 
121