Moved serial mode to target mcelecron_serial.

Implemented parallelization with mpi.
This commit is contained in:
Christian
2019-07-18 14:02:19 +02:00
parent fd131afdd3
commit 578d673b65
35 changed files with 916 additions and 469 deletions
+23 -12
View File
@@ -13,14 +13,17 @@
#include "katrin_geo.h"
#include "timer.hpp"
struct loc_bins {
int z_bin;
int r_bin;
int phi_bin;
};
class Pop4_Container {
double ****data;
Lin_Scale z_scale;
Lin_Scale r_scale;
Lin_Scale phi_scale;
double *data;
Lin_Scale z_scale, r_scale, phi_scale;
Log_Scale E_scale;
int z_offset, r_offset, phi_offset, total_data_size;
public:
//Pop4_Container() {};
Pop4_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins);
@@ -32,19 +35,27 @@ public:
void increase_value(const double &value, const vec3 &loc_m, const double &E_eV);
void increase_value(const double &value, const vec3 &loc1_m, const vec3 &loc2_m, const double &E_eV);
double get_value(const vec3 &loc_m, const double &E_eV);
double get_value_sum(const vec3 &loc_m);
double *get_E_bins (const vec3 &loc_m);
int get_num_E_bins(){return E_scale.get_number_bins();}
double get_corresponding_E_lower_eV(int E_bin){return E_scale.get_lower_bin_bound(E_bin);}
double get_corresponding_E_upper_eV(int E_bin){return E_scale.get_upper_bin_bound(E_bin);}
void set_value_by_bin(double value, int z_bin, int r_bin, int phi_bin, int E_bin) {data[z_bin][r_bin][phi_bin][E_bin] = value;}
double get_value_by_bin(int z_bin, int r_bin, int phi_bin, int E_bin) {return data[z_bin][r_bin][phi_bin][E_bin];}
void set_value_by_bin(double value, int z_bin, int r_bin, int phi_bin, int E_bin) {data[calc_data_bin(z_bin, r_bin, phi_bin, E_bin)] = value;}
double get_value_by_bin(int z_bin, int r_bin, int phi_bin, int E_bin) {return data[calc_data_bin(z_bin, r_bin, phi_bin, E_bin)];}
loc_bins get_loc_bins(const vec3 &loc_m);
int get_num_E_bins() {return E_scale.get_number_bins();}
double get_lower_E_boarder_eV(int E_bin) {return E_scale.get_lower_bin_bound(E_bin);}
double get_upper_E_boarder_eV(int E_bin) {return E_scale.get_upper_bin_bound(E_bin);}
Lin_Scale get_z_scale(){return z_scale;}
Lin_Scale get_r_scale(){return r_scale;}
Lin_Scale calc_phi_scale(){return phi_scale;}
Log_Scale get_E_scale(){return E_scale;}
int calc_data_bin(int z_bin, int r_bin, int phi_bin, int E_bin);
public:
int get_total_data_size() {return total_data_size;}
double *get_array() {return data;}
};