Many, many more comments
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "simulation/electromagnetic_field.h"
|
||||
#include "simulation/particle.h"
|
||||
|
||||
// class defining the minimum requirements of a mover class
|
||||
class Mover {
|
||||
public:
|
||||
virtual void move(particle::Particle* particle,
|
||||
@@ -12,10 +13,18 @@ class Mover {
|
||||
MagneticField* magnetic_field) = 0;
|
||||
};
|
||||
|
||||
// Mover class using the Boris push algorithm for propagation
|
||||
class BorisMover : public Mover {
|
||||
public:
|
||||
// Constructor: sets the maximal timestep acceptable for the Boris puhs algorithm
|
||||
// (should at the very least resolve the gyro timescale of the particle)
|
||||
BorisMover(double maximal_time_step_s);
|
||||
|
||||
// propagate the Particle particle using the electric and magnetic fields
|
||||
// until the particle has moved a distance of mfp_m or until it changes
|
||||
// either its energy or position bin or it reaches the maximal time the
|
||||
// particle is allowed to live
|
||||
// also updates the density, deletion logger and current collector of the particle species
|
||||
void move(particle::Particle* particle,
|
||||
double mfp_m,
|
||||
ElectricField* electric_field,
|
||||
@@ -24,16 +33,26 @@ class BorisMover : public Mover {
|
||||
private:
|
||||
const double maximal_time_step_s_;
|
||||
|
||||
// single update step of the Boris push algorithm
|
||||
// updates moved_distance by the distance the particle moved during the update step
|
||||
void movementStep(particle::Particle* particle,
|
||||
const blitz::TinyVector<double, 3>& electric_field,
|
||||
const blitz::TinyVector<double, 3>& magnetic_field,
|
||||
double& moved_distance) const;
|
||||
};
|
||||
|
||||
// Mover class using the drift approximation for propagation
|
||||
class DriftMover : public Mover {
|
||||
public:
|
||||
// Constructor: takes the maximal distance the particle is allowed to move during one step
|
||||
// (should be smaller than the length scale defined by the gradient of the modulus of the magnetic field)
|
||||
DriftMover(double maximal_distance);
|
||||
|
||||
// propagate the Particle particle using the electric and magnetic fields
|
||||
// until the particle has moved a distance of mfp_m or until it changes
|
||||
// either its energy or position bin or it reaches the maximal time the
|
||||
// particle is allowed to live
|
||||
// also updates the density, deletion logger and current collector of the particle species
|
||||
void move(particle::Particle* particle,
|
||||
double mfp_m,
|
||||
ElectricField* electric_field,
|
||||
@@ -42,15 +61,20 @@ class DriftMover : public Mover {
|
||||
private:
|
||||
const double maximal_distance_m_;
|
||||
|
||||
// single update step using the drift approximation
|
||||
// updates moved_distance by the distance the particle moved during the update step
|
||||
blitz::TinyVector<double, 3> driftVelocity(
|
||||
const blitz::TinyVector<double, 3>& magnetic_field,
|
||||
const blitz::TinyVector<double, 3>& electric_field) const;
|
||||
};
|
||||
|
||||
// Mover for the case of 0 magnetic field. Simply ignores electric and magnetic field
|
||||
// Mover for the case of no magnetic field. Simply ignores electric and magnetic field
|
||||
// for the movement step, i.e. velocity doesn't change.
|
||||
class EulerMover : public Mover {
|
||||
public:
|
||||
// Constructor: takes the maxium distance the particle is allowed to move during
|
||||
// one update step (used to limit the distance a particle can move
|
||||
// into a neighboring bin before the check can be performed if the bin has been changed)
|
||||
EulerMover(double maximal_distance);
|
||||
|
||||
void move(particle::Particle* particle,
|
||||
|
||||
Reference in New Issue
Block a user