Major changes:

- Added individul operators for species and better selecting process.
- Switched to C arrays for main loop operations and calculating array indizes using knowledge of binning instead of doing sorted search
- Added Recombination
- Reworked elastic scattering kinematics
- Added inelastic scattering kinematics
This commit is contained in:
Christian
2019-05-27 13:51:32 +02:00
parent ac83bae061
commit 79bf420f8d
56 changed files with 82194 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
//
// multiz_particle_logger.h
// mc_electron
//
// Created by Christian Reiling on 19.05.19.
// Copyright © 2019 Christian Reiling. All rights reserved.
//
#ifndef multiz_particle_logger_h
#define multiz_particle_logger_h
#include "particle_logger_base.h"
class MuliZ_Particle_Logger : public Particle_Logger_Base {
H5TB_Interface *h5tb;
int numberZBins;
double *zLogValues;
hid_t *h5g_z;
public:
MuliZ_Particle_Logger(species this_species, const int &numberZBins, double *zLogValues, hid_t *h5g_z) : Particle_Logger_Base(this_species) {
this->numberZBins = numberZBins;
this->zLogValues = zLogValues;
this->h5g_z = h5g_z;
create();
}
private:
void create();
public:
void log(const Particle &logPart, const vec3 &oldLoc_m);
};
inline void MuliZ_Particle_Logger::create() {
std::string speciesName = get_species_string(get_species());
if (numberZBins < 1) {
std::stringstream ss;
ss<<"MuliZ_Particle_Logger::create: numberZBins < 1.\n";
}
h5tb = new H5TB_Interface[numberZBins];
for (int i = 0; i < numberZBins; i++) {
h5tb[i] = H5TB_Interface(speciesName, &h5g_z[i]);
}
}
inline void MuliZ_Particle_Logger::log(const Particle &logPart, const vec3 &oldLoc_m) {
double zold = oldLoc_m[2];
double znew = logPart.get_Location_m()[2];
double zmin = std::min(zold,znew);
double zmax = std::max(zold,znew);
for (int i=0;i<numberZBins;i++) {
if (zLogValues[i]>=zmin && zLogValues[i]<=zmax) {
h5tb[i].write(logPart); // Location wrong, because set to new Location, instead of logging location.
}
}
}
#endif /* multiz_particle_logger_h */