Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
analysis.h
1#ifdef ANALYSIS
2
3 #ifndef ANALYSIS_H
4 #define ANALYSIS_H
5
6 #include <vector>
7
8 #include "../global/global.h"
9
10 #ifdef LYA_STATISTICS
11 #include <fftw3.h>
12 #endif
13
14class AnalysisModule
15{
16 public:
17 Real Lbox_x;
18 Real Lbox_y;
19 Real Lbox_z;
20
21 Real xMin;
22 Real yMin;
23 Real zMin;
24
25 Real dx;
26 Real dy;
27 Real dz;
28
29 Real xMin_global;
30 Real yMin_global;
31 Real zMin_global;
32
33 int nx_total;
34 int ny_total;
35 int nz_total;
36
37 int nx_local;
38 int ny_local;
39 int nz_local;
40 int n_ghost;
41
42 int n_outputs;
43 int next_output_indx;
44 real_vector_t scale_outputs;
45 Real next_output;
46 bool Output_Now;
47 int n_file;
48
49 #ifdef COSMOLOGY
50 Real current_z;
51 #endif
52
53 #ifdef PHASE_DIAGRAM
54 int n_dens;
55 int n_temp;
56 Real temp_min;
57 Real temp_max;
58 Real dens_min;
59 Real dens_max;
60 float *phase_diagram;
61 #ifdef MPI_CHOLLA
62 float *phase_diagram_global;
63 #endif
64 #endif
65
66 #ifdef LYA_STATISTICS
67 int Computed_Flux_Power_Spectrum;
68 int n_stride;
69 int n_skewers_local_x;
70 int n_skewers_local_y;
71 int n_skewers_local_z;
72 int n_skewers_total_x;
73 int n_skewers_total_y;
74 int n_skewers_total_z;
75
76 int n_skewers_processed_root_x;
77 int n_skewers_processed_root_y;
78 int n_skewers_processed_root_z;
79
80 int n_skewers_processed_x;
81 int n_skewers_processed_y;
82 int n_skewers_processed_z;
83
84 int skewers_direction;
85 int root_id_x;
86 int root_id_y;
87 int root_id_z;
88 bool am_I_root_x;
89 bool am_I_root_y;
90 bool am_I_root_z;
91 Real *skewers_HI_density_local_x;
92 Real *skewers_HI_density_local_y;
93 Real *skewers_HI_density_local_z;
94
95 Real *skewers_HeII_density_local_x;
96 Real *skewers_HeII_density_local_y;
97 Real *skewers_HeII_density_local_z;
98
99 Real *skewers_velocity_local_x;
100 Real *skewers_velocity_local_y;
101 Real *skewers_velocity_local_z;
102
103 Real *skewers_temperature_local_x;
104 Real *skewers_temperature_local_y;
105 Real *skewers_temperature_local_z;
106
107 Real *skewers_HI_density_root_x;
108 Real *skewers_HI_density_root_y;
109 Real *skewers_HI_density_root_z;
110
111 Real *skewers_HeII_density_root_x;
112 Real *skewers_HeII_density_root_y;
113 Real *skewers_HeII_density_root_z;
114
115 Real *skewers_velocity_root_x;
116 Real *skewers_velocity_root_y;
117 Real *skewers_velocity_root_z;
118
119 Real *skewers_temperature_root_x;
120 Real *skewers_temperature_root_y;
121 Real *skewers_temperature_root_z;
122
123 Real *full_HI_density_x;
124 Real *full_HI_density_y;
125 Real *full_HI_density_z;
126
127 Real *full_HeII_density_x;
128 Real *full_HeII_density_y;
129 Real *full_HeII_density_z;
130
131 Real *full_velocity_x;
132 Real *full_velocity_y;
133 Real *full_velocity_z;
134
135 Real *full_temperature_x;
136 Real *full_temperature_y;
137 Real *full_temperature_z;
138
139 Real *full_optical_depth_HI_x;
140 Real *full_optical_depth_HI_y;
141 Real *full_optical_depth_HI_z;
142
143 Real *full_optical_depth_HeII_x;
144 Real *full_optical_depth_HeII_y;
145 Real *full_optical_depth_HeII_z;
146
147 Real *full_vel_Hubble_x;
148 Real *full_vel_Hubble_y;
149 Real *full_vel_Hubble_z;
150
151 Real *skewers_transmitted_flux_HI_x;
152 Real *skewers_transmitted_flux_HI_y;
153 Real *skewers_transmitted_flux_HI_z;
154
155 Real *skewers_transmitted_flux_HeII_x;
156 Real *skewers_transmitted_flux_HeII_y;
157 Real *skewers_transmitted_flux_HeII_z;
158
159 #ifdef OUTPUT_SKEWERS
160
161 Real *skewers_density_local_x;
162 Real *skewers_density_local_y;
163 Real *skewers_density_local_z;
164
165 Real *skewers_density_root_x;
166 Real *skewers_density_root_y;
167 Real *skewers_density_root_z;
168
169 Real *skewers_density_x_global;
170 Real *skewers_density_y_global;
171 Real *skewers_density_z_global;
172
173 Real *skewers_HI_density_x_global;
174 Real *skewers_HI_density_y_global;
175 Real *skewers_HI_density_z_global;
176
177 Real *skewers_HeII_density_x_global;
178 Real *skewers_HeII_density_y_global;
179 Real *skewers_HeII_density_z_global;
180
181 Real *skewers_temperature_x_global;
182 Real *skewers_temperature_y_global;
183 Real *skewers_temperature_z_global;
184
185 Real *skewers_los_velocity_x_global;
186 Real *skewers_los_velocity_y_global;
187 Real *skewers_los_velocity_z_global;
188
189 Real *skewers_transmitted_flux_HI_x_global;
190 Real *skewers_transmitted_flux_HI_y_global;
191 Real *skewers_transmitted_flux_HI_z_global;
192
193 Real *skewers_transmitted_flux_HeII_x_global;
194 Real *skewers_transmitted_flux_HeII_y_global;
195 Real *skewers_transmitted_flux_HeII_z_global;
196
197 Real *transfer_buffer_root_x;
198 Real *transfer_buffer_root_y;
199 Real *transfer_buffer_root_z;
200 #endif
201
202 Real Flux_mean_root_HI_x;
203 Real Flux_mean_root_HI_y;
204 Real Flux_mean_root_HI_z;
205
206 Real Flux_mean_root_HeII_x;
207 Real Flux_mean_root_HeII_y;
208 Real Flux_mean_root_HeII_z;
209
210 Real Flux_mean_HI_x;
211 Real Flux_mean_HI_y;
212 Real Flux_mean_HI_z;
213
214 Real Flux_mean_HeII_x;
215 Real Flux_mean_HeII_y;
216 Real Flux_mean_HeII_z;
217
218 Real Flux_mean_HI;
219 Real Flux_mean_HeII;
220
221 int n_skewers_processed;
222
223 int n_ghost_skewer;
224 int n_los_full_x;
225 int n_los_full_y;
226 int n_los_full_z;
227
228 Real *vel_Hubble_x;
229 Real *vel_Hubble_y;
230 Real *vel_Hubble_z;
231 Real *delta_F_x;
232 Real *delta_F_y;
233 Real *delta_F_z;
234
235 Real d_log_k;
236 int n_PS_processed_x;
237 int n_PS_processed_y;
238 int n_PS_processed_z;
239 int n_PS_axis_x;
240 int n_PS_axis_y;
241 int n_PS_axis_z;
242 int n_hist_edges_x;
243 int n_hist_edges_y;
244 int n_hist_edges_z;
245 int n_fft_x;
246 int n_fft_y;
247 int n_fft_z;
248 fftw_complex *fft_delta_F_x;
249 fftw_complex *fft_delta_F_y;
250 fftw_complex *fft_delta_F_z;
251 Real *fft2_delta_F_x;
252 Real *fft2_delta_F_y;
253 Real *fft2_delta_F_z;
254 Real *k_vals_x;
255 Real *k_vals_y;
256 Real *k_vals_z;
257 fftw_plan fftw_plan_x;
258 fftw_plan fftw_plan_y;
259 fftw_plan fftw_plan_z;
260 Real *hist_k_edges_x;
261 Real *hist_k_edges_y;
262 Real *hist_k_edges_z;
263 Real *hist_PS_x;
264 Real *hist_PS_y;
265 Real *hist_PS_z;
266 Real *hist_n_x;
267 Real *hist_n_y;
268 Real *hist_n_z;
269 Real *ps_root_x;
270 Real *ps_root_y;
271 Real *ps_root_z;
272 Real *ps_global_x;
273 Real *ps_global_y;
274 Real *ps_global_z;
275 Real *ps_mean;
276 Real *k_centers;
277
278 bool *root_procs_x;
279 bool *root_procs_y;
280 bool *root_procs_z;
281
282 #ifdef MPI_CHOLLA
283 Real *mpi_domain_boundary_x;
284 Real *mpi_domain_boundary_y;
285 Real *mpi_domain_boundary_z;
286 vector<int> mpi_indices_x;
287 vector<int> mpi_indices_y;
288 vector<int> mpi_indices_z;
289 #endif
290
291 #endif
292
293 AnalysisModule(void);
294 void Initialize(Real Lx, Real Ly, Real Lz, Real x_min, Real y_min, Real z_min, int nx, int ny, int nz, int nx_real,
295 int ny_real, int nz_real, Real dx_real, Real dy_real, Real dz_real, int n_ghost_hydro, Real z_now,
296 struct Parameters *P);
297 void Reset(void);
298
299 void Load_Scale_Outputs(struct Parameters *P);
300 void Set_Next_Scale_Output();
301
302 #ifdef PHASE_DIAGRAM
303 void Initialize_Phase_Diagram(struct Parameters *P);
304 #endif
305
306 #ifdef LYA_STATISTICS
307 void Initialize_Lya_Statistics(struct Parameters *P);
308 void Initialize_Lya_Statistics_Measurements(int axis);
309 void Transfer_Skewers_Data(int axis);
310 void Compute_Lya_Mean_Flux_Skewer(int skewer_id, int axis);
311 void Reduce_Lya_Mean_Flux_Axis(int axis);
312 void Reduce_Lya_Mean_Flux_Global();
313 void Clear_Power_Spectrum_Measurements(void);
314 void Reduce_Power_Spectrum_Axis(int axis);
315 void Reduce_Power_Spectrum_Global();
316 void Transfer_Skewers_Global_Axis(int axis);
317 #endif
318};
319
320 #endif
321#endif
Definition global.h:217