Added blitz
This commit is contained in:
+54
-43
@@ -1,6 +1,18 @@
|
||||
#ifndef PARTICLE_H
|
||||
#define PARTICLE_H
|
||||
//
|
||||
// particle.h
|
||||
//
|
||||
//
|
||||
// Created by Christian Reiling on 13.09.18.
|
||||
//
|
||||
|
||||
#ifndef particle_h
|
||||
#define particle_h
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "blitz/array.h"
|
||||
#include "blitz/tinyvec2.h"
|
||||
|
||||
@@ -11,51 +23,51 @@ using namespace blitz;
|
||||
class particle
|
||||
{
|
||||
private:
|
||||
double m;
|
||||
double q;
|
||||
long int id;
|
||||
TinyVector<double,3> v,x;
|
||||
species s;
|
||||
|
||||
double m,q,E;
|
||||
TinyVector<double,3> x,v;
|
||||
species s;
|
||||
long int id;
|
||||
public:
|
||||
/* 1. Konstruktor: Parameter explizit angegeben */
|
||||
particle(double masse, double ladung, TinyVector<double,3> ort, TinyVector<double,3> geschwindigkeit, double nummer, species sp)
|
||||
{
|
||||
m = masse;
|
||||
q = ladung;
|
||||
x = ort;
|
||||
v = geschwindigkeit;
|
||||
id = nummer;
|
||||
s = sp;
|
||||
}
|
||||
|
||||
virtual ~particle() { }
|
||||
particle(){}
|
||||
particle(double mass, double charge, double energy,TinyVector<double,3> loc, TinyVector<double,3> speed, double idnum, species spec)
|
||||
{
|
||||
m = mass;
|
||||
q = charge;
|
||||
E = energy;
|
||||
x = loc;
|
||||
v = speed;
|
||||
id = idnum;
|
||||
s = spec;
|
||||
}
|
||||
|
||||
/* 2. Konstruktor: Teilchen aus einem Array, wie es von prop() und array() geschrieben wird, herstellen */
|
||||
particle(Array<double, 1> props);
|
||||
|
||||
|
||||
particle(){}
|
||||
|
||||
virtual ~particle() { }
|
||||
|
||||
double masse() { return(m); }
|
||||
double ladung() { return(q); }
|
||||
TinyVector<double,3> ort() { return(x); }
|
||||
TinyVector<double,3> geschwindigkeit() { return(v); }
|
||||
double nummer() { return(id);}
|
||||
double winkel() { return 42; }
|
||||
TinyVector<double,3> xchange(TinyVector<double, 3> dx, int i, TinyVector<double, 3> xmin, TinyVector<double, 3> nx, TinyVector<double, 3> dvdt);
|
||||
TinyVector<double,3> vchange(TinyVector<double, 3> dv, int i);
|
||||
TinyVector<double, 3> xnew(TinyVector<double, 3> xneu) { return x = xneu; };
|
||||
TinyVector<double, 3> vnew(TinyVector<double, 3> vneu);
|
||||
|
||||
void copyol(particle*);
|
||||
Array<double,1> prop(Array<double,1>);
|
||||
virtual Array<double,1> array(); // ********************** warum virtual???? ******************************
|
||||
//particle(Array<double, 1> props); //Create from Array
|
||||
|
||||
double mass() { return(m); }
|
||||
double charge() { return(q); }
|
||||
TinyVector<double,3> loc() { return(x); }
|
||||
TinyVector<double,3> speed() { return(v); }
|
||||
double number() { return(id);}
|
||||
|
||||
TinyVector<double,3> locChange(TinyVector<double, 3> dx, int i, TinyVector<double, 3> xmin, TinyVector<double, 3> nx, TinyVector<double, 3> dvdt);
|
||||
TinyVector<double,3> speedChange(TinyVector<double, 3> dv, int i);
|
||||
TinyVector<double, 3> locSet(TinyVector<double, 3> xneu) { return x = xneu; };
|
||||
TinyVector<double, 3> speedSet(TinyVector<double, 3> vneu);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
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 {
|
||||
|
||||
private:
|
||||
@@ -106,6 +118,5 @@ public:
|
||||
return(teilchenprop);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
*/
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user