PLUTO
cooling.h
Go to the documentation of this file.
1 /* ############################################################
2 
3  FILE: cooling.h
4 
5  PURPOSE: contains common definitions for the
6  whole CODE
7 
8  Notice: the order is absolutely important and MUST NOT
9  be changed !!!
10  ############################################################ */
11 
12 
13 #define C_IONS 3 /* in [1,5] */
14 #define N_IONS 3 /* in [1,5] */
15 #define O_IONS 3 /* in [1,5] */
16 #define Ne_IONS 3 /* in [1,5] */
17 #define S_IONS 3 /* in [1,5] */
18 #define Fe_IONS 0 /* in [0,3] */
19 
20 #if C_IONS == 0
21  #define C_EXPAND(a,b,c,d,e)
22 #elif C_IONS == 1
23  #define C_EXPAND(a,b,c,d,e) ,a
24 #elif C_IONS == 2
25  #define C_EXPAND(a,b,c,d,e) ,a,b
26 #elif C_IONS == 3
27  #define C_EXPAND(a,b,c,d,e) ,a,b,c
28 #elif C_IONS == 4
29  #define C_EXPAND(a,b,c,d,e) ,a,b,c,d
30 #elif C_IONS == 5
31  #define C_EXPAND(a,b,c,d,e) ,a,b,c,d,e
32 #endif
33 
34 #if N_IONS == 0
35  #define N_EXPAND(a,b,c,d,e)
36 #elif N_IONS == 1
37  #define N_EXPAND(a,b,c,d,e) ,a
38 #elif N_IONS == 2
39  #define N_EXPAND(a,b,c,d,e) ,a,b
40 #elif N_IONS == 3
41  #define N_EXPAND(a,b,c,d,e) ,a,b,c
42 #elif N_IONS == 4
43  #define N_EXPAND(a,b,c,d,e) ,a,b,c,d
44 #elif N_IONS == 5
45  #define N_EXPAND(a,b,c,d,e) ,a,b,c,d,e
46 #endif
47 
48 #if O_IONS == 0
49  #define O_EXPAND(a,b,c,d,e)
50 #elif O_IONS == 1
51  #define O_EXPAND(a,b,c,d,e) ,a
52 #elif O_IONS == 2
53  #define O_EXPAND(a,b,c,d,e) ,a,b
54 #elif O_IONS == 3
55  #define O_EXPAND(a,b,c,d,e) ,a,b,c
56 #elif O_IONS == 4
57  #define O_EXPAND(a,b,c,d,e) ,a,b,c,d
58 #elif O_IONS == 5
59  #define O_EXPAND(a,b,c,d,e) ,a,b,c,d,e
60 #endif
61 
62 #if Ne_IONS == 0
63  #define Ne_EXPAND(a,b,c,d,e)
64 #elif Ne_IONS == 1
65  #define Ne_EXPAND(a,b,c,d,e) ,a
66 #elif Ne_IONS == 2
67  #define Ne_EXPAND(a,b,c,d,e) ,a,b
68 #elif Ne_IONS == 3
69  #define Ne_EXPAND(a,b,c,d,e) ,a,b,c
70 #elif Ne_IONS == 4
71  #define Ne_EXPAND(a,b,c,d,e) ,a,b,c,d
72 #elif Ne_IONS == 5
73  #define Ne_EXPAND(a,b,c,d,e) ,a,b,c,d,e
74 #endif
75 
76 #if S_IONS == 0
77  #define S_EXPAND(a,b,c,d,e)
78 #elif S_IONS == 1
79  #define S_EXPAND(a,b,c,d,e) ,a
80 #elif S_IONS == 2
81  #define S_EXPAND(a,b,c,d,e) ,a,b
82 #elif S_IONS == 3
83  #define S_EXPAND(a,b,c,d,e) ,a,b,c
84 #elif S_IONS == 4
85  #define S_EXPAND(a,b,c,d,e) ,a,b,c,d
86 #elif S_IONS == 5
87  #define S_EXPAND(a,b,c,d,e) ,a,b,c,d,e
88 #endif
89 
90 #if Fe_IONS == 0
91  #define Fe_EXPAND(a,b,c)
92 #elif Fe_IONS == 1
93  #define Fe_EXPAND(a,b,c) ,a
94 #elif Fe_IONS == 2
95  #define Fe_EXPAND(a,b,c) ,a,b
96 #elif Fe_IONS == 3
97  #define Fe_EXPAND(a,b,c) ,a,b,c
98 #endif
99 
100 /* **********************************************************************
101  Ions are labeled progressively, depending on how many ionization
102  stages are effectively included in the network through the previous
103  X_EXPAND macros.
104  Elements are ordered as {H, He, C, N, O, Ne, S, Fe} and must be
105  carefully respected everywhere in the code.
106  Hydrogen and Helium are always included.
107  ********************************************************************** */
108 
109 enum {
110  X_HI = NFLX, X_HeI, X_HeII
111  C_EXPAND(X_CI, X_CII, X_CIII, X_CIV, X_CV)
112  N_EXPAND(X_NI, X_NII, X_NIII, X_NIV, X_NV)
113  O_EXPAND(X_OI, X_OII, X_OIII, X_OIV, X_OV)
114  Ne_EXPAND(X_NeI, X_NeII, X_NeIII, X_NeIV, X_NeV)
115  S_EXPAND(X_SI, X_SII, X_SIII, X_SIV, X_SV)
116  Fe_EXPAND(X_FeI, X_FeII, X_FeIII)
117 };
118 
119 #define NIONS (3+C_IONS+N_IONS+O_IONS+Ne_IONS+S_IONS+Fe_IONS)
120 
121 double GetMaxRate (double *, double *, double);
122 double H_MassFrac (void);
123 double CompEquil (double, double, double *);
124 double find_N_rho ();
125 void Radiat (double *, double *);
126 void NormalizeIons (double *);
127 
#define Ne_EXPAND(a, b, c, d, e)
Definition: cooling.h:69
double GetMaxRate(double *, double *, double)
Definition: maxrate.c:4
void Radiat(double *, double *)
Definition: radiat.c:94
double H_MassFrac(void)
Definition: radiat.c:721
void NormalizeIons(double *)
#define S_EXPAND(a, b, c, d, e)
Definition: cooling.h:83
#define N_EXPAND(a, b, c, d, e)
Definition: cooling.h:41
void CompEquil(double n, double T, double *v)
Definition: comp_equil.c:44
Definition: cooling.h:110
#define NFLX
Definition: mod_defs.h:32
#define C_EXPAND(a, b, c, d, e)
Definition: cooling.h:27
Definition: cooling.h:110
double find_N_rho()
Definition: radiat.c:694
#define O_EXPAND(a, b, c, d, e)
Definition: cooling.h:55
#define Fe_EXPAND(a, b, c)
Definition: cooling.h:91