Class DiffusionSDE

Inheritance Relationships

Base Type

Class Documentation

class DiffusionSDE : public Module

Propagates candidates as pseudo(!)-particles. The time integration of SDEs is used to solve the transport equation. Here an Euler-Mayurama integration scheme is used. The diffusion tensor can be anisotropic with respect to the magnetic field line coordinates. The integration of field lines is done via the CK-algorithm.

Public Functions

DiffusionSDE(ref_ptr<crpropa::MagneticField> magneticField, double tolerance = 1e-4, double minStep = 10 * pc, double maxStep = 1 * kpc, double epsilon = 0.1)

Constructor

Parameters:
  • magneticField – the magnetic field to be used

  • tolerance – Tolerance is criterion for step adjustment. Step adjustment takes place when the tangential vector of the magnetic field line is calculated.

  • minStep – minStep/c_light is the minimum integration time step

  • maxStep – maxStep/c_light is the maximum integration time step

  • epsilon – Ratio of parallel and perpendicular diffusion coefficient D_par = epsilon*D_perp

DiffusionSDE(ref_ptr<crpropa::MagneticField> magneticField, ref_ptr<crpropa::AdvectionField> advectionField, double tolerance = 1e-4, double minStep = 10 * pc, double maxStep = 1 * kpc, double epsilon = 0.1)

Constructor

Parameters:
  • magneticField – the magnetic field to be used

  • advectionField – object containing advection field

  • tolerance – Tolerance is criterion for step adjustment. Step adjustment takes place when the tangential vector of the magnetic field line is calculated.

  • minStep – minStep/c_light is the minimum integration time step

  • maxStep – maxStep/c_light is the maximum integration time step

  • epsilon – Ratio of parallel and perpendicular diffusion coefficient D_par = epsilon*D_perp

virtual void process(crpropa::Candidate *candidate) const
void tryStep(const Vector3d &Pos, Vector3d &POut, Vector3d &PosErr, double z, double propStep) const
void driftStep(const Vector3d &Pos, Vector3d &LinProp, double h) const
void calculateBTensor(double rig, double BTen[], Vector3d pos, Vector3d dir, double z) const
void setMinimumStep(double minStep)
void setMaximumStep(double maxStep)
void setTolerance(double tolerance)
void setEpsilon(double kappa)
void setAlpha(double alpha)
void setScale(double Scale)
void setMagneticField(ref_ptr<crpropa::MagneticField> magneticField)
void setAdvectionField(ref_ptr<crpropa::AdvectionField> advectionField)
double getMinimumStep() const
double getMaximumStep() const
double getTolerance() const
double getEpsilon() const
double getAlpha() const
double getScale() const
virtual std::string getDescription() const
ref_ptr<MagneticField> getMagneticField() const
Vector3d getMagneticFieldAtPosition(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

ref_ptr<AdvectionField> getAdvectionField() const
Vector3d getAdvectionFieldAtPosition(Vector3d pos) const

get advection field vector at current candidate position

Parameters:

pos – current position of the candidate

Returns:

magnetic field vector at the position pos

void setDescription(const std::string &description)
inline void process(ref_ptr<Candidate> candidate) const
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