Class PropagationCK
Defined in File PropagationCK.h
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public Module
(Class Module)
Class Documentation
-
class PropagationCK : public Module
Rectilinear propagation through magnetic fields using the Cash-Karp method.
This module solves the equations of motion of a relativistic charged particle when propagating through a magnetic field.
It uses the Runge-Kutta integration method with Cash-Karp coefficients.
The step size control tries to keep the relative error close to, but smaller than the designated tolerance. Additionally a minimum and maximum size for the steps can be set. For neutral particles a rectilinear propagation is applied and a next step of the maximum step size proposed.Public Functions
-
PropagationCK(ref_ptr<MagneticField> field = NULL, double tolerance = 1e-4, double minStep = (0.1 * kpc), double maxStep = (1 * Gpc))
Constructor for the adaptive Kash Carp.
- Parameters:
field –
tolerance – tolerance is criterion for step adjustment. Step adjustment takes place only if minStep < maxStep
minStep – minStep/c_light is the minimum integration time step
maxStep – maxStep/c_light is the maximum integration time step.
-
Y dYdt(const Y &y, ParticleState &p, double z) const
-
void tryStep(const Y &y, Y &out, Y &error, double t, ParticleState &p, double z) const
-
void setField(ref_ptr<MagneticField> field)
-
void setTolerance(double tolerance)
-
void setMinimumStep(double minStep)
-
void setMaximumStep(double maxStep)
-
ref_ptr<MagneticField> getField() const
get functions for the parameters of the class PropagationCK, similar to the set functions
-
Vector3d getFieldAtPosition(Vector3d pos, double z) const
get magnetic field vector at current candidate position
- Parameters:
pos – current position of the candidate
z – current redshift is needed to calculate the magnetic field
- Returns:
magnetic field vector at the position pos
-
double getTolerance() const
-
double getMinimumStep() const
-
double getMaximumStep() const
-
virtual std::string getDescription() const
-
void setDescription(const std::string &description)
-
inline size_t addReference() const
-
inline size_t removeReference() const
-
inline int removeReferenceNoDelete() const
-
inline size_t getReferenceCount() const
Protected Attributes
-
mutable size_t _referenceCount
-
PropagationCK(ref_ptr<MagneticField> field = NULL, double tolerance = 1e-4, double minStep = (0.1 * kpc), double maxStep = (1 * Gpc))