Class JF12Field

Inheritance Relationships

Base Type

Class Documentation

class JF12Field : public MagneticField

JF12Field galactic magnetic field model.

Implements the JF2012 magnetic field model, consisting of a large-scale regular and random (striated) field and a small-scale random (turbulent) field. See: Jansson 2012a, ApJ. 757, A New Model of the Galactic Magnetic Field Jansson 2012b, arXiv:1210.7820, The Galactic Magnetic Field

All three components may individually turned on and off. Currently only best fit values of the field paramaters are implemented and cannot be changed.

The field is defined in the usual galactocentric coordinate system with the Galactic center at the origin, the x-axis pointing in the direction of the Sun, and the z-axis pointing towards Galactic north.

Public Functions

JF12Field()
void randomStriated(int seed = 0)
void randomTurbulent(int seed = 0)
void setStriatedGrid(std::shared_ptr<ScalarGrid> grid)

Set a striated grid and activate the striated field component

Parameters
  • grid: scalar grid containing random +1/-1 values, 100 parsec grid spacing

void setTurbulentGrid(std::shared_ptr<VectorGrid> grid)

Set a turbulent grid and activate the turbulent field component

Parameters
  • grid: vector grid containing a random field of Brms = 1

std::shared_ptr<ScalarGrid> getStriatedGrid()
std::shared_ptr<VectorGrid> getTurbulentGrid()
void setUseRegular(bool use)
void setUseStriated(bool use)
void setUseTurbulent(bool use)
bool isUsingRegular() const
bool isUsingStriated() const
bool isUsingTurbulent() const
Vector3QMField getRegularField(const Vector3QLength &pos) const
Vector3QMField getStriatedField(const Vector3QLength &pos) const
QMField getTurbulentStrength(const Vector3QLength &pos) const
Vector3QMField getTurbulentField(const Vector3QLength &pos) const
Vector3QMField getField(const Vector3QLength &pos) const