Working change, before making some adjustments in classes, structure.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user