Working change, before making some adjustments in classes, structure.

This commit is contained in:
Christian
2019-01-15 09:49:36 +01:00
parent ae5546a3ed
commit 0534f00fbd
12 changed files with 451 additions and 168 deletions
+7 -8
View File
@@ -64,23 +64,17 @@ ostream& operator<<(ostream& os, const Particle& partOut) {
// Default Constructor
Particle::Particle() {
m_eV = NAN;
Z = NAN;
x_m = zeroVec();
v_ms = zeroVec();
Id = NAN;
parentId = NAN;
s = undef;
}
Particle::Particle(double mass_eV, double charge_e, blitz::TinyVector<double,3> speed_ms) {
Particle::Particle(double mass_eV, double charge_e, blitz::TinyVector<double,3> speed_ms, species spec) {
m_eV = mass_eV;
Z = charge_e;
x_m = zeroVec();
v_ms = speed_ms;
Id = NAN;
parentId = NAN;
s = undef;
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) {
@@ -118,3 +112,8 @@ void Particle::changeSpeedBoris(blitz::TinyVector<double, 3> E_Vm , blitz::TinyV
}
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;
}