67 lines
1.5 KiB
C++
Executable File
67 lines
1.5 KiB
C++
Executable File
#ifndef PARTICLE_H
|
|
#define PARTICLE_H
|
|
|
|
#include "blitz/array.h"
|
|
#include "simulation/coordinates.h"
|
|
#include "simulation/species.h"
|
|
|
|
namespace particle {
|
|
|
|
class Particle {
|
|
public:
|
|
// Particle(std::shared_ptr<species::TrackedSpecie> specie,
|
|
// Coordinate* position,
|
|
// Vector* velocity);
|
|
Particle(std::shared_ptr<species::TrackedSpecie> specie,
|
|
const Coordinate& position,
|
|
const Vector& velocity,
|
|
const double time_birth);
|
|
|
|
void position(const Coordinate& new_position);
|
|
CartesianCoordinate position() const;
|
|
|
|
void velocity(const CartesianVector& new_velocity);
|
|
CartesianVector velocity() const;
|
|
|
|
void move(const Coordinate& distance);
|
|
|
|
double kineticEnergy_eV() const;
|
|
double absoluteVelocity() const;
|
|
double absoluteVelocitySquared() const;
|
|
|
|
double mass_kg() const;
|
|
double charge_C() const;
|
|
|
|
species::TrackedSpecie* specie() const;
|
|
|
|
static void lastId(long int id);
|
|
static long int lastId(); // only local on this cpu
|
|
|
|
void increaseInteractionCounter();
|
|
long int interactionCounter() const;
|
|
|
|
void increaseTimeAlive(double time_s);
|
|
double timeAlive() const;
|
|
|
|
void increaseTimeInBin(double time_s);
|
|
void resetTimeInBin();
|
|
double timeInBin() const;
|
|
|
|
private:
|
|
CartesianVector velocity_;
|
|
CartesianCoordinate position_;
|
|
|
|
double time_alive_s_;
|
|
double time_in_bin_s_;
|
|
long int interaction_counter_;
|
|
|
|
std::shared_ptr<species::TrackedSpecie> specie_;
|
|
long int id_;
|
|
|
|
static long int last_id_; // only local on this cpu
|
|
};
|
|
|
|
}; // namespace particle
|
|
|
|
#endif /* PARTICLE_H */
|