Aktuelle Stand

This commit is contained in:
Christian
2018-09-26 15:12:27 +02:00
parent b702929cf7
commit bc6eb5cfbf
12 changed files with 367 additions and 241 deletions
+48 -36
View File
@@ -20,85 +20,95 @@
typedef enum species{electron, positron, proton, tritium, tritium2, helium, deuterium, DT}species;
std::ostream& operator<<(std::ostream& os, const species& SpecOut);
class Particle
{
private:
double m,q;
blitz::TinyVector<double,3> x,v;
double m_eV;
double q_e;
blitz::TinyVector<double,3> x_m;
blitz::TinyVector<double,3> v_ms;
species s;
long int id, parentId;
unsigned long int Id;
unsigned long int parentId;
public:
virtual ~Particle() { }
Particle(){}
Particle(double mass, double charge,blitz::TinyVector<double,3> loc, blitz::TinyVector<double,3> speed, double idnum, double parentIdnum, species spec) {
m = mass;
q = charge;
x = loc;
v = speed;
id = idnum;
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;
q_e = charge_e;
x_m = loc_m;
v_ms = speed_ms;
Id = idnum;
parentId = parentIdnum;
s = spec;
}
//Particle(Array<double, 1> props); //Create from Array
double getMass() {
return(m);
// Get Properties Methods
double getMass_eV() {
return(m_eV);
}
double getCharge() {
return(q);
double getCharge_e() {
return(q_e);
}
blitz::TinyVector<double,3> getLoc() {
return(x);
blitz::TinyVector<double,3> getLoc_m() {
return(x_m);
}
blitz::TinyVector<double,3> getSpeed() {
return(v);
blitz::TinyVector<double,3> getSpeed_ms() {
return(v_ms);
}
double getId() {
return(id);
return(Id);
}
double getParentId() {
return(parentId);
}
double getRadius() {
return (sqrt( pow(x[0],2) + pow(x[1],2) ));
double getRadius_m() {
return (sqrt( pow(x_m[0],2) + pow(x_m[1],2) ));
}
double getSpeedAbs() {
return (sqrt( pow(v[0],2) + pow(v[1],2) + pow(v[2],2)));
double getSpeedAbs_ms() {
return (sqrt( pow(v_ms[0],2) + pow(v_ms[1],2) + pow(v_ms[2],2)));
}
double getEnergy(); // muss noch implementiert werden
double getKinEnergy_eV() {
// Implement Constants here, else Particle::Parameters
const double c_ms = 299792458;
const double me_eV = 0.511e6;
double SpeedAbs_ms = sqrt( pow(v_ms[0],2) + pow(v_ms[1],2) + pow(v_ms[2],2) );
double beta = SpeedAbs_ms/c_ms;
double gamma = pow(1- pow(beta,2),-0.5);
return ( (gamma-1) * me_eV);
}
// Set Properties Methods
void setLoc_m(blitz::TinyVector<double, 3> xnew_m) {x_m = xnew_m; };
void setSpeed_ms(blitz::TinyVector<double, 3> vnew_ms) {v_ms = vnew_ms; };
void setLoc(blitz::TinyVector<double, 3> xnew) {x = xnew; };
void setSpeed(blitz::TinyVector<double, 3> vnew) {v = vnew; };
// Write Methods
friend std::ostream& operator<<(std::ostream& os, const Particle& partOut);
};
// Some Code, maybe required later
/*
blitz::TinyVector<double,3> locChange(blitz::TinyVector<double, 3> dx, int i, blitz::TinyVector<double, 3> xmin, blitz::TinyVector<double, 3> nx, blitz::TinyVector<double, 3> dvdt);
blitz::TinyVector<double,3> speedChange(blitz::TinyVector<double, 3> dv, int i);
friend std::ostream& operator<<(std::ostream& os, const Particle& partOut);
/*
void copyol(particle*);
Array<double,1> prop(Array<double,1>);
virtual Array<double,1> array(); // ********************** warum virtual???? ******************************
//void copyol(particle);
*/
};
/*
class particle_info : public particle {
@@ -152,4 +162,6 @@ public:
};
*/
// Other Functions
#endif