Multiple Changes:
Conceptional Change, where terminated Particles were set to Energy = 0. Now Particles are just moved within mover and termination detects, position and starts Interaction only if particle remains in tank. Added function_container: Filled with anker points and get values corresponding to input by interpolation. 2D Interpolation needs improvement. CSV-Read in function needs error checks of input file. Changes in katrin class: Boris Push and Drift Approximation improved. Minor Renamings.
This commit is contained in:
@@ -32,12 +32,11 @@ void Simulation::doit() {
|
||||
}
|
||||
|
||||
status_updater();
|
||||
oldLoc_m = electronQue.front().getLoc_m();
|
||||
move_electron(&electronQue.front());
|
||||
Log.log_Electron(&electronQue.front(), oldLoc_m);
|
||||
do_interaction(&electronQue.front());
|
||||
|
||||
if (Kat.get_Terminated (electronQue.front())) {
|
||||
move_electron(&electronQue.front(), &Log);
|
||||
if (!Kat.check_EnergyTermination (electronQue.front()) ) {
|
||||
do_interaction(&electronQue.front());
|
||||
}
|
||||
if (Kat.check_EnergyTermination (electronQue.front())) {
|
||||
electronQue.pop_front();
|
||||
}
|
||||
}
|
||||
@@ -69,11 +68,12 @@ void Simulation::status_updater() {
|
||||
}
|
||||
}
|
||||
|
||||
void Simulation::move_electron(Electron *moveElectron) {
|
||||
void Simulation::move_electron(Electron *moveElectron, Logger *Log) {
|
||||
double MFP_m = Kat.get_MFP_m(&electronQue.front());
|
||||
if (propagationMethod==0) {
|
||||
Kat.do_DriftApproximation(moveElectron);
|
||||
Kat.do_DriftApproximationMovement(moveElectron, MFP_m, Log);
|
||||
} else if (propagationMethod==1) {
|
||||
Kat.do_BorisPush(moveElectron); // If moved outside set v = 0,0,0;
|
||||
Kat.do_BorisPushMovement(moveElectron, MFP_m, Log); // If moved outside set v = 0,0,0;
|
||||
} else {
|
||||
stringstream ss;
|
||||
ss<<"Simulation::move_electron: propagationMethod="<<propagationMethod<<" not valid.";
|
||||
@@ -82,11 +82,14 @@ void Simulation::move_electron(Electron *moveElectron) {
|
||||
}
|
||||
|
||||
void Simulation::do_interaction(Electron *interactElectron) {
|
||||
vec3 newLoc_m = electronQue.front().getLoc_m();
|
||||
vec3 newLoc_m = electronQue.front().get_Location_m();
|
||||
if (Kat.check_Termination(*interactElectron)) {
|
||||
stringstream ss;
|
||||
ss<<"Simulation::do_interaction: Particle already terminated.";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
int process = interactElectron->roll_Interaction(Kat.getFlowSpeedT2_ms(newLoc_m),&rngUni);
|
||||
switch ( process ) {
|
||||
case 0: //Moved Outside
|
||||
break;
|
||||
switch (process) {
|
||||
case 1: // Elastic Scattering
|
||||
interactElectron->do_elaScattering(Kat.getTotSpeedT2_ms(newLoc_m, &rngUni, &rngNormal) , &rngUni);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user