Changes to Interaction Processor, making possible to add infinite Interactions for all kind of Particles
This commit is contained in:
@@ -11,43 +11,55 @@
|
||||
|
||||
|
||||
#include "katrin.hpp"
|
||||
#include "electron.hpp"
|
||||
#include "tritiumion.hpp"
|
||||
#include "injector.hpp"
|
||||
#include "mover.hpp"
|
||||
#include "terminator.hpp"
|
||||
#include "interaction_processor.hpp"
|
||||
#include "interaction_builder.hpp"
|
||||
|
||||
#include "particle.hpp"
|
||||
#include <deque>
|
||||
|
||||
|
||||
class Simulation {
|
||||
public:
|
||||
Simulation();
|
||||
|
||||
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 process_firstElectron();
|
||||
void process_firstTIon();
|
||||
|
||||
|
||||
void do_statusUpdate();
|
||||
void move_electron(Electron *moveElectron, H5_Logger *Log);
|
||||
void do_interaction(Electron *interactElectron);
|
||||
bool check_NumberInteractions(int &numberInteractionsThisElectron);
|
||||
|
||||
Katrin Kat;
|
||||
Injector Inj;
|
||||
H5_Logger Log;
|
||||
Mover Mov;
|
||||
InteractionProcessor Inter;
|
||||
Terminator Term;
|
||||
|
||||
ranlib::Uniform<double> rngUni;
|
||||
ranlib::NormalUnit<double> rngNormal;
|
||||
|
||||
// Electrons
|
||||
double mfp;
|
||||
std::deque<Particle> partQue;
|
||||
Particle curPart;
|
||||
//InterOutput IntOut;
|
||||
|
||||
int numberTotalElectrons = 0;
|
||||
int numberDecays = 0;
|
||||
std::deque<Electron> electronQue;
|
||||
Electron *actionElectronPtr;
|
||||
|
||||
// Ions
|
||||
int numberTotalIons = 0;
|
||||
std::deque<TritiumIon> tritiumIonQue;
|
||||
|
||||
// Updater
|
||||
int updater_numberOfPrevious = 0;
|
||||
int updater_fraction;
|
||||
|
||||
@@ -55,7 +67,6 @@ private:
|
||||
static const long int seed;
|
||||
static const long int numberTotalDecays;
|
||||
|
||||
static const int propagationMethod;
|
||||
static const int maxInteractions;
|
||||
public:
|
||||
void doTC6();
|
||||
|
||||
Reference in New Issue
Block a user