Minor Changes

This commit is contained in:
Christian
2019-03-01 10:29:17 +01:00
parent 96e9ee4f2b
commit a20aa7a071
22 changed files with 733 additions and 705 deletions
+19 -50
View File
@@ -9,67 +9,36 @@
#ifndef simulation_hpp
#define simulation_hpp
#include "parameter.hpp"
#include "constants.hpp"
#include "katrin.hpp"
#include "electron.hpp"
#include "logger.hpp"
#include <deque>
class Simulation: public Parameter {
class Simulation: private Parameter, private Constants {
public:
~Simulation(){};
Simulation() {
numInjectedElectrons = 0;
rngUni.seed(seed);
logging = false;
if (cutoffMode==0) {
cutoffEnergy_eV = cutoffEnergySet_eV;
} else if (cutoffMode==1) {
cutoffEnergy_eV = kb_eVK*wgtsTemp_K*cutoffFactor;
} else {
stringstream ss;
ss<<"Simulation::Simulation: cutoffMode= "<<cutoffMode<<" not defined.";
throw (ss.str());
}
};
void initLogger(void);
void doit(void);
void doTC6(void);
Simulation();
void doit();
// void doTC6(void);
private:
void status_updater();
void move_electron(Electron *moveElectron);
void do_interaction(Electron *interactElectron);
protected:
// Simulation
Katrin Kat;
Logger Log;
ranlib::Uniform<double> rngUni;
ranlib::NormalUnit<double> rngNormal;
int numInjectedElectrons;
deque<Electron> electronQue;
// Injection
Electron injectElectron();
double getEkin_eVFermi_eV();
double ESpectrumBetaDecay(double Ekin_eV);
double FermiFunction(double Z, double Ekin_eV);
// Moving
void moveElectronBorisPush(Electron *moveElectron, double MFP_m);
void moveElectronDriftApproximation(Electron *moveElectron, double MFP_m);
double getMFP_m(Electron moveElectron);
bool movedOutside(blitz::TinyVector<double,3> loc_m);
// Termination
bool checkTermination(Electron termElectron);
double cutoffEnergy_eV;
// Logging
bool logging;
ofstream *outStream;
vector<double> zLogValues;
void logElectron(Electron *logElectron,blitz::TinyVector<double,3> oldLoc_m);
string getDirName();
string getTimeString();
int numberElectrons;
std::deque<Electron> electronQue;
int updater_numberOfPrevious;
};
#endif /* simulation_hpp */