Class TF17Field

Inheritance Relationships

Base Type

Class Documentation

class TF17Field : public MagneticField

TF17Field galactic magnetic field model.

Implements the TF2017 galactic magnetic field model, consisting of large-scale regular disk and halo fields. The field is defined in the usual galactocentric coordinate system with the Galactic center at the origin, the x-axis pointing in the opposite direction of the Sun, and the z-axis pointing towards Galactic north. See: Terral, Ferriere 2017 - Constraints from Faraday rotation on the magnetic field structure in the galactic halo, DOI: 10.1051/0004-6361/201629572, arXiv:1611.10222

Public Functions

TF17Field(TF17DiskModel disk_model_ = TF17DiskModel::Ad1, TF17HaloModel halo_model_ = TF17HaloModel::C1)

Constructor

Parameters:
  • disk_model_ – model to use for the disk (model are defined in enum class TF17DiskModel: Ad1, Bd1, Dd1)

  • halo_model_ – model to use for the halo (model are defined in enum class TF17HaloModel: C0, C1)

void setUseDiskField(bool use)
void setUseHaloField(bool use)
bool isUsingDiskField()
bool isUsingHaloField()
void set_B1_disk(const double B1)

set reference amplitude for the disk magnetic field Automatically set at initialization

Parameters:

B1 – magnetic field amplitude in Gauss

void set_z1_disk(const double z1)

set reference height for the disk magnetic field (model Dd1) Automatically set at initialization

Parameters:

z1 – height in kpc

void set_r1_disk(const double r1)

set reference radius for the disk magnetic field (models Ad1 and Bd1) Automatically set at initialization

Parameters:

r1 – radius in kpc

void set_H_disk(const double H)

set scale height of Br for the disk magnetic field (models Ad1 and Bd1) Automatically set at initialization

Parameters:

H – height in kpc

void set_L_disk(const double L)

set scale length of Bz for the disk magnetic field (models Dd1) Automatically set at initialization

Parameters:

L – length in kpc

void set_a_disk(const double a)

set opening parameter for poloidal lines for the disk magnetic field (models Ad1) Automatically set at initialization

Parameters:

a – opening parameter in / kpc / kpc

void set_phi_star_disk(const double phi)

set orientation angle of the azimuthal pattern for the disk magnetic field Automatically set at initialization

Parameters:

phi – opening parameter in rad

void set_B1_halo(const double B1)

set reference amplitude for the halo magnetic field Automatically set at initialization

Parameters:

B1 – magnetic field amplitude in Gauss

void set_z1_halo(const double z1)

set reference height for the halo magnetic field Automatically set at initialization

Parameters:

z1 – height in kpc

void set_L_halo(const double L)

set scale length of Bz for the halo magnetic field Automatically set at initialization

Parameters:

L – length in kpc

void set_a_halo(const double a)

set opening parameter for poloidal lines for the halo magnetic field Automatically set at initialization

Parameters:

a – opening parameter in / kpc / kpc

void set_phi_star_halo(const double phi)

set orientation angle of the azimuthal pattern for the disk magnetic field Automatically set at initialization

Parameters:

phi – opening parameter in rad

void set_p0(const double p0)

set pitch angle origin (all models) Automatically set at initialization

Parameters:

p0 – height in rad

void set_Hp(const double H)

set scale height of winding function (all models) Automatically set at initialization

Parameters:

H – height in kpc

void set_Lp(const double L)

set scale length of winding function (all models) Automatically set at initialization

Parameters:

L – length in kpc

string getDiskModel() const

Get the disk model used as a string.

Returns:

disk model

string getHaloModel() const

Get the halo model used as a string.

Returns:

halo model

virtual Vector3d getField(const Vector3d &pos) const
Vector3d getDiskField(const double &r, const double &z, const double &phi, const double &sinPhi, const double &cosPhi) const
Vector3d getHaloField(const double &r, const double &z, const double &phi, const double &sinPhi, const double &cosPhi) const
double azimuthalFieldComponent(const double &r, const double &z, const double &B_r, const double &B_z) const

Compute the azimuthal field component Bphi as define by equation 28 in TF17.

Parameters:
  • r – radius in cylindrical coordinates

  • z – radius in cylindrical coordinates

  • B_r – radial component of the magnetic field at position (r,z)

  • B_z – height component of the magnetic field at position (r,z)

Returns:

the value of the azimuthal field component Bphi

double radialFieldScale(const double &B1, const double &phi_star, const double &z1, const double &phi, const double &r, const double &z) const

Compute the scaling of the disk magnetic field amplitude (equation 30, models Ad1 and Bd1)

Parameters:
  • B1 – magnetic field amplitude in Gauss

  • phi_star – orientation angle of the azimuthal pattern in rad

  • z1 – scale height in kpc

  • phi – cylindrical coordinates

  • r – cylindrical coordinates

  • z – cylindrical coordinates

Returns:

the radial field component Br(r1, z1, phi1)

double shiftedWindingFunction(const double &r, const double &z) const

Compute the shifted winding function (equation 23)

Parameters:
  • r – cylindrical coordinates

  • z – cylindrical coordinates

Returns:

g_phi, the shifted winding function

double zscale(const double &z) const

Compute the height scaling appearing numerous times in the equations.

Parameters:

z – cylindrical coordinates

Returns:

z_scale = 1 + (z/Hp)^2

inline virtual Vector3d getField(const Vector3d &position, double z) 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