Working Version with Population update and T+ interactions.
This commit is contained in:
@@ -9,68 +9,55 @@
|
||||
#ifndef simulation_hpp
|
||||
#define simulation_hpp
|
||||
|
||||
|
||||
#include "katrin.hpp"
|
||||
#include "timer.hpp"
|
||||
#include "population_builder.hpp"
|
||||
#include "injector.hpp"
|
||||
#include "mover.hpp"
|
||||
#include "terminator.hpp"
|
||||
#include "interaction_processor.hpp"
|
||||
#include "interaction_builder.hpp"
|
||||
#include "particle.hpp"
|
||||
|
||||
|
||||
|
||||
class Simulation {
|
||||
public:
|
||||
Simulation() : Kat(&rngUni, &rngNormal),
|
||||
Inj(&Kat, &rngUni, &rngNormal),
|
||||
Log(&Kat),
|
||||
Mov(&Kat, &Log),
|
||||
Inter(&Kat, &rngUni, &rngNormal),
|
||||
Term(&Kat) {
|
||||
rngUni.seed(seed);
|
||||
rngNormal.seed(seed);
|
||||
updater_fraction = numberTotalDecays/100;
|
||||
updater_fraction = updater_fraction==0 ? 1 : updater_fraction;
|
||||
InteractionBuilder InterBuilder(&Kat, &rngUni, &rngNormal);
|
||||
Inter = InterBuilder.build_InteractionProcessor();
|
||||
}
|
||||
void doit();
|
||||
private:
|
||||
void do_statusUpdate();
|
||||
static const long int seed;
|
||||
static const long int numberTotalDecays;
|
||||
static const int maxInteractions;
|
||||
|
||||
UniRNG rngUni;
|
||||
NormalRNG rngNormal;
|
||||
|
||||
Katrin Kat;
|
||||
Injector Inj;
|
||||
H5_Logger Log;
|
||||
Timer Tim;
|
||||
Population Pop;
|
||||
|
||||
Injector Inj;
|
||||
Mover Mov;
|
||||
InteractionProcessor Inter;
|
||||
Terminator Term;
|
||||
|
||||
ranlib::Uniform<double> rngUni;
|
||||
ranlib::NormalUnit<double> rngNormal;
|
||||
|
||||
double mfp;
|
||||
std::deque<Particle> partQue;
|
||||
Particle curPart;
|
||||
//InterOutput IntOut;
|
||||
|
||||
int numberTotalElectrons = 0;
|
||||
int numberTotalParticles = 0;
|
||||
int numberDecays = 0;
|
||||
|
||||
int numberTotalIons = 0;
|
||||
|
||||
int updater_numberOfPrevious = 0;
|
||||
int updater_fraction;
|
||||
|
||||
// Parameters
|
||||
static const long int seed;
|
||||
static const long int numberTotalDecays;
|
||||
public:
|
||||
Simulation() {init_Simulation();}
|
||||
private:
|
||||
void init_Simulation();
|
||||
void set_RNGs();
|
||||
void set_statusUpdater();
|
||||
|
||||
static const int maxInteractions;
|
||||
public:
|
||||
void doit();
|
||||
private:
|
||||
void do_statusUpdate();
|
||||
|
||||
public:
|
||||
void doTC6();
|
||||
private:
|
||||
void parameterCheck_TC6();
|
||||
};
|
||||
|
||||
|
||||
#endif /* simulation_hpp */
|
||||
|
||||
Reference in New Issue
Block a user