The SKIRT project
advanced radiative transfer for astrophysics
Functions
Constants Namespace Reference

Functions

constexpr double amu ()
 
constexpr double AU ()
 
constexpr double c ()
 
constexpr double EinsteinALya ()
 
constexpr double EinsteinASpinFlip ()
 
constexpr double h ()
 
constexpr double k ()
 
constexpr double lambdaIon ()
 
constexpr double lambdaLya ()
 
constexpr double lambdaSpinFlip ()
 
constexpr double Lsun ()
 
constexpr double Melectron ()
 
constexpr double Mproton ()
 
constexpr double Msun ()
 
constexpr double NA ()
 
constexpr double pc ()
 
constexpr double Qelectron ()
 
constexpr double sigmaThomson ()
 
constexpr double Tcmb ()
 
constexpr double year ()
 

Detailed Description

The Constants namespace offers functions that return the value of physical constants or units used in astronomy. Other parts of the code should use these functions rather than defining the values locally. All functions are defined inline as constexpr to avoid runtime overhead.

Function Documentation

◆ amu()

constexpr double Constants::amu ( )
constexpr

This function returns the mass of an atomic mass unit (1/12 of the mass of an unbound neutral atom of carbon-12 in its nuclear and electronic ground state and at rest).

◆ AU()

constexpr double Constants::AU ( )
constexpr

This function returns the distance of one astronomical unit.

◆ c()

constexpr double Constants::c ( )
constexpr

This function returns the speed of light \(c\).

◆ EinsteinALya()

constexpr double Constants::EinsteinALya ( )
constexpr

This function returns the Einstein A-coefficient of the Lyman-alpha transition.

◆ EinsteinASpinFlip()

constexpr double Constants::EinsteinASpinFlip ( )
constexpr

This function returns the Einstein A-coefficient of the hydrogen spinflip transition.

◆ h()

constexpr double Constants::h ( )
constexpr

This function returns Planck's constant \(h\).

◆ k()

constexpr double Constants::k ( )
constexpr

This function returns the Boltzmann constant \(k\).

◆ lambdaIon()

constexpr double Constants::lambdaIon ( )
constexpr

This function returns the ionization wavelength of atomic hydrogen.

◆ lambdaLya()

constexpr double Constants::lambdaLya ( )
constexpr

This function returns the central wavelength of the hydrogen Lyman-alpha transition.

◆ lambdaSpinFlip()

constexpr double Constants::lambdaSpinFlip ( )
constexpr

This function returns the central wavelength of the hydrogen spinflip transition.

◆ Lsun()

constexpr double Constants::Lsun ( )
constexpr

This function returns the solar bolometric luminosity without neutrino radiation.

◆ Melectron()

constexpr double Constants::Melectron ( )
constexpr

This function returns the rest mass of the electron.

◆ Mproton()

constexpr double Constants::Mproton ( )
constexpr

This function returns the rest mass of the proton.

◆ Msun()

constexpr double Constants::Msun ( )
constexpr

This function returns the solar mass.

◆ NA()

constexpr double Constants::NA ( )
constexpr

This function returns the Avogadro constant \(N_\text{A}\), i.e. the number of atoms or molecules in one mole of a given substance.

◆ pc()

constexpr double Constants::pc ( )
constexpr

This function returns the distance of one parsec.

◆ Qelectron()

constexpr double Constants::Qelectron ( )
constexpr

This function returns the electric charge of an electron in coulombs, which is equivalent to the value of 1 eV in joules.

◆ sigmaThomson()

constexpr double Constants::sigmaThomson ( )
constexpr

This function returns the Thomson cross section for an electron.

◆ Tcmb()

constexpr double Constants::Tcmb ( )
constexpr

This function returns the average temperature of the cosmic microwave background (CMB) in the Local Universe.

◆ year()

constexpr double Constants::year ( )
constexpr

This function returns the length of a Julian year in seconds. A Julian year has exactly 365.25 days of exactly 86400 seconds each.