Screenshot with working ionization function.
Ionization will be changed to BED model.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
|
||||
#include "particle.h"
|
||||
#include "particle.hpp"
|
||||
|
||||
|
||||
// Overload <<
|
||||
@@ -41,11 +41,11 @@ ostream& operator<<(ostream& os, const species& SpecOut) {
|
||||
os<<"DT";
|
||||
break;
|
||||
default:
|
||||
cerr<<"unknown species";
|
||||
exit(1);
|
||||
os<<"";
|
||||
}
|
||||
return (os);
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& os, const Particle& partOut) {
|
||||
os
|
||||
<< partOut.Id << ";"
|
||||
@@ -58,27 +58,20 @@ ostream& operator<<(ostream& os, const Particle& partOut) {
|
||||
<< partOut.x_m[2] << ";"
|
||||
<< partOut.v_ms[0] << ";"
|
||||
<< partOut.v_ms[1] << ";"
|
||||
<< partOut.v_ms[2] << ";";
|
||||
<< partOut.v_ms[2] ;
|
||||
return os;
|
||||
}
|
||||
|
||||
// Default Constructor
|
||||
Particle::Particle() {
|
||||
x_m = zeroVec();
|
||||
v_ms = zeroVec();
|
||||
s = undef;
|
||||
}
|
||||
|
||||
Particle::Particle(double mass_eV, double charge_e, blitz::TinyVector<double,3> speed_ms, species spec) {
|
||||
m_eV = mass_eV;
|
||||
mass_eV = mass_eV;
|
||||
Z = charge_e;
|
||||
x_m = zeroVec();
|
||||
x_m = blitz::TinyVector<double,3>(0,0,0);
|
||||
v_ms = speed_ms;
|
||||
s = spec;
|
||||
}
|
||||
|
||||
Particle::Particle(double mass_eV, double charge_e,blitz::TinyVector<double,3> loc_m, blitz::TinyVector<double,3> speed_ms, double idnum, double parentIdnum, species spec) {
|
||||
m_eV = mass_eV;
|
||||
mass_eV = mass_eV;
|
||||
Z = charge_e;
|
||||
x_m = loc_m;
|
||||
v_ms = speed_ms;
|
||||
@@ -90,10 +83,10 @@ Particle::Particle(double mass_eV, double charge_e,blitz::TinyVector<double,3> l
|
||||
double Particle::borisFly_m(blitz::TinyVector<double, 3> E_Vm , blitz::TinyVector<double, 3> B_T , double dt_s) {
|
||||
double distance_m;
|
||||
x_m += dt_s/2 * v_ms;
|
||||
distance_m = dt_s/2 * getvAbs_ms();
|
||||
distance_m = dt_s/2 * getSpeedAbs_ms();
|
||||
this->changeSpeedBoris(E_Vm , B_T , dt_s);
|
||||
x_m += dt_s/2 * v_ms;
|
||||
distance_m += dt_s/2 * getvAbs_ms();
|
||||
distance_m += dt_s/2 * getSpeedAbs_ms();
|
||||
return(distance_m);
|
||||
}
|
||||
|
||||
@@ -109,9 +102,3 @@ void Particle::changeSpeedBoris(blitz::TinyVector<double, 3> E_Vm , blitz::TinyV
|
||||
vPlus_ms = vMinus_ms + cross(vPrime_ms,s);
|
||||
v_ms = vPlus_ms + q_C/m_kg*E_Vm*0.5*dt_s;
|
||||
}
|
||||
|
||||
void Particle::loseEkin_eV(double Eloss_eV) {
|
||||
double eNew_eV = getKinEnergy_eV() - Eloss_eV;
|
||||
double vAbsNew_ms = calcV_msFromEkin_eV(eNew_eV, m_eV);
|
||||
v_ms = v_ms / getvAbs_ms() * vAbsNew_ms;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user