Major changes:

- Moved to array operations for main loops.
- Changed to setting pointers to operator only once before loop.
- Changed Population Containers
- Added Recombination
- Added Inelastic Scattering Kinematics
- Reworked Elastic Scattering Cross Section
- Reworked Elastic Scattering Kinematics
- Reworked organisation of different particle species and corresponding operators
This commit is contained in:
Christian
2019-05-27 13:46:59 +02:00
parent 0f2a5625a2
commit ac83bae061
50 changed files with 1057 additions and 2374 deletions
+62
View File
@@ -0,0 +1,62 @@
//
// size_container.hpp
// mc_electron
//
// Created by Christian Reiling on 27.05.19.
// Copyright © 2019 Christian Reiling. All rights reserved.
//
#ifndef size_container_hpp
#define size_container_hpp
#include "linScale.h"
#include "katrin_geo.hpp"
class Size_Container {
double *data;
Lin_Scale r_scale;
double cell_length_m;
public:
~Size_Container() {
delete[] data;
};
Size_Container(int num_z_bins, int num_r_bins, int num_phi_bins) {
r_scale = Lin_Scale(0, Katrin_Geo::get_radius_m(), num_r_bins);
cell_length_m = (Katrin_Geo::get_z_WGTSend_m()-Katrin_Geo::get_z_RW_m()) / (num_z_bins-1);
data = new double[num_r_bins + 1];
for (int i = 0; i<=num_r_bins; i++) {
data[i] = cell_length_m * calc_disc_surface_m2(i)/num_phi_bins;
}
}
double calc_disc_surface_m2 (const int &r_bin) {
if (r_bin == 0) {
return (0);
}
double previous_r_m = r_scale.calc_upper_bound(r_bin-1);
double this_r_m = r_scale.calc_upper_bound(r_bin);
double A_m2 = pi * (this_r_m * this_r_m - previous_r_m * previous_r_m);
return(A_m2);
}
double get_cell_volume_m3(const double &r_m) {
int r_bin = r_scale.calc_index(r_m);
return (data[r_bin]);
}
double get_cell_volume_m3(const vec3 &loc_m) {
double r_m = get_r_m(loc_m);
return (get_cell_volume_m3(r_m));
}
double get_cell_length_m() {
return (cell_length_m);
}
};
#endif /* size_container_hpp */