Restructuring Code. Removed some small classes which provided only 1 function, like parameter. Now each class calls it own parameters and stores them as static const.
Merged function containers. Added HDF5 output and reworked Logger class into Base class and 2 derived classes ASCI_Logger and H5_Logger
This commit is contained in:
+24
-10
@@ -9,7 +9,6 @@
|
||||
#ifndef katrin_hpp
|
||||
#define katrin_hpp
|
||||
|
||||
#include "parameter.hpp"
|
||||
#include "constants.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "electron.hpp"
|
||||
@@ -20,10 +19,12 @@
|
||||
#include <random/normal.h>
|
||||
|
||||
|
||||
class Katrin: private Parameter, private Constants {
|
||||
class Katrin {
|
||||
public:
|
||||
Katrin();
|
||||
Katrin() {};
|
||||
|
||||
// Katrin Properties
|
||||
public:
|
||||
vec3 getMagField_T(vec3 loc_m);
|
||||
vec3 getElField_Vm(vec3 loc_m);
|
||||
double getTritiumDensity_m3(vec3 loc_m);
|
||||
@@ -31,8 +32,15 @@ public:
|
||||
vec3 getTotSpeedT2_ms(vec3 loc_m, ranlib::Uniform<double> *rngUni, ranlib::NormalUnit<double> *rngNormal);
|
||||
vec3 getFlowSpeedT2_ms(vec3 loc_m);
|
||||
vec3 getTempSpeedT2_ms(vec3 loc_m, ranlib::Uniform<double> *rngUni, ranlib::NormalUnit<double> *rngNormal);
|
||||
private:
|
||||
static const double wgtsMagField_T;
|
||||
static const double wgtsLength_m;
|
||||
static const double wgtsRadius_m;
|
||||
static const double wgtsT2MaxDensity_m3;
|
||||
static const double wgtsTemp_K;
|
||||
static const double wgtsT2FlowSpeed_ms;
|
||||
|
||||
// Injection
|
||||
// Electron Injection
|
||||
public:
|
||||
Electron injectElectron(int newId, ranlib::Uniform<double> *rngUni, ranlib::NormalUnit<double> *rngNormal);
|
||||
private:
|
||||
@@ -40,16 +48,22 @@ private:
|
||||
double get_FermiDecaySpectrumDensity(double Ekin_eV);
|
||||
double get_FermiFunction(double Z, double Ekin_eV);
|
||||
|
||||
static const int injectionMethod;
|
||||
static const double injectionEnergy_eV;
|
||||
|
||||
// Move Electrons
|
||||
public:
|
||||
double get_MFP_m(Electron *moveElectron);
|
||||
void do_BorisPushMovement(Electron *moveElectron, double distance_m, Logger *Log);
|
||||
void do_DriftApproximationMovement(Electron *moveElectron, double distance_m, Logger *Log);
|
||||
void do_BorisPushMovement(Electron *moveElectron, double distance_m, H5_Logger *Log);
|
||||
void do_DriftApproximationMovement(Electron *moveElectron, double distance_m, H5_Logger *Log);
|
||||
private:
|
||||
double getDrift_znew_m(double MFP_m, Electron *moveElectron);
|
||||
void doDrift_WallInteraction(vec3 *oldLoc_m, double *znew_m, Electron *moveElectron, Logger *Log);
|
||||
void doDrift_WallInteraction(vec3 *oldLoc_m, double *znew_m, Electron *moveElectron, H5_Logger *Log);
|
||||
void doBoris_WallInteraction(Electron *moveElectron);
|
||||
void doBoris_LogzDirChange(Electron *moveElectron, double *oldzDir, vec3 *oldLoc_m, Logger *Log);
|
||||
void doBoris_LogzDirChange(Electron *moveElectron, double *oldzDir, vec3 *oldLoc_m, H5_Logger *Log);
|
||||
|
||||
static const double dt_s;
|
||||
|
||||
|
||||
// Terminate Electrons
|
||||
public:
|
||||
@@ -59,8 +73,8 @@ private:
|
||||
bool check_EnergyTermination(Electron checkElectron);
|
||||
bool check_WallTermination(vec3 loc_m);
|
||||
bool check_WallTermination(Electron checkElectron);
|
||||
double cutoffEnergy_eV;
|
||||
void set_cutoffEnergy_eV();
|
||||
|
||||
static const double cutoffEnergy_eV;
|
||||
};
|
||||
|
||||
#endif /* katrin_hpp */
|
||||
|
||||
Reference in New Issue
Block a user