ARTS 2.5.0 (git: 9ee3ac6c)
constants.h File Reference

Constants of physical expressions as constexpr. More...

#include "enums.h"
#include "matpack.h"
#include <cmath>

Go to the source code of this file.

Namespaces

namespace  Constant
 Namespace containing several constants, physical and mathematical.
 
namespace  Conversion
 Namespace containing several practical unit conversions, physical and mathematical.
 
namespace  Options
 

Functions

template<class T >
constexpr auto Constant::pow2 (T x) -> decltype(x *x)
 power of two More...
 
template<class T >
constexpr auto Constant::pow3 (T x) -> decltype(pow2(x) *x)
 power of three More...
 
template<class T >
constexpr auto Constant::pow4 (T x) -> decltype(pow2(pow2(x)))
 power of four More...
 
template<class T >
constexpr auto Conversion::deg2rad (T x) -> decltype(x *one_degree_in_radians)
 Converts degrees to radians. More...
 
template<class T >
constexpr auto Conversion::rad2deg (T x) -> decltype(x/one_degree_in_radians)
 Converts radians to degrees. More...
 
template<class T >
auto Conversion::cosd (T x) -> decltype(std::cos(deg2rad(x)))
 Returns the cosine of the deg2rad of the input. More...
 
template<class T >
auto Conversion::sind (T x) -> decltype(std::sin(deg2rad(x)))
 Returns the sine of the deg2rad of the input. More...
 
template<class T >
auto Conversion::tand (T x) -> decltype(std::tan(deg2rad(x)))
 Returns the tangent of the deg2rad of the input. More...
 
template<class T >
auto Conversion::acosd (T x) -> decltype(rad2deg(std::acos(x)))
 Returns rad2deg of the arc-cosine of the input. More...
 
template<class T >
auto Conversion::asind (T x) -> decltype(rad2deg(std::asin(x)))
 Returns rad2deg of the arc-sine of the input. More...
 
template<class T >
auto Conversion::atand (T x) -> decltype(rad2deg(std::atan(x)))
 Returns rad2deg of the arc-tangent of the input. More...
 
template<class T1 , class T2 >
auto Conversion::atan2d (T1 y, T2 x) -> decltype(rad2deg(std::atan2(y, x)))
 Returns rad2deg of the arc-tangent of inputs #T1/#T2
More...
 
template<class T >
constexpr auto Conversion::kaycm2freq (T x) -> decltype(x *(100 *c))
 Conversion from Kayser wavenumber to Hz. More...
 
template<class T >
constexpr auto Conversion::freq2kaycm (T x) -> decltype(x/(100 *c))
 Conversion from Hz to Kayser wavenumber. More...
 
template<class T >
constexpr auto Conversion::angcm2freq (T x) -> decltype(kaycm2freq(inv_two_pi))
 Conversion from Angular wavenumber to Hz. More...
 
template<class T >
constexpr auto Conversion::freq2angcm (T x) -> decltype(x/kaycm2freq(inv_two_pi))
 Conversion from Hz to Angular wavenumber. More...
 
template<class T >
constexpr auto Conversion::angfreq2freq (T x) -> decltype(x *inv_two_pi)
 Conversion from Angular Hz to Hz. More...
 
template<class T >
constexpr auto Conversion::freq2angfreq (T x) -> decltype(x *two_pi)
 Conversion from Hz to Angular Hz. More...
 
template<class T >
constexpr auto Conversion::wavelen2freq (T x) -> decltype(c/x)
 Conversion from wavelength to Hz. More...
 
template<class T >
constexpr auto Conversion::freq2wavelen (T x) -> decltype(c/x)
 Conversion from Hz to wavelength. More...
 
template<class T >
constexpr auto Conversion::atm2pa (T x) -> decltype(x *101 '325.0)
 Conversion from Atm to Pa. More...
 
template<class T >
constexpr auto Conversion::pa2atm (T x) -> decltype(x/101 '325.0)
 Conversion from Pa to Atm. More...
 
template<class T >
constexpr auto Conversion::torr2pa (T x) -> decltype(x *atm2pa(1.0/760.0))
 Conversion from Torr to Pa. More...
 
template<class T >
constexpr auto Conversion::pa2torr (T x) -> decltype(x/atm2pa(1.0/760.0))
 Conversion from Pa to Torr. More...
 
template<class T >
constexpr auto Conversion::mhz_per_torr2hz_per_pa (T x) -> decltype(x *pa2torr(1e6))
 Conversion from MHz/Torr to Hz/Pa. More...
 
template<class T >
constexpr auto Conversion::celsius2kelvin (T x) -> decltype(x+273.15)
 Conversion from C to K. More...
 
template<class T >
constexpr auto Conversion::kelvin2celsius (T x) -> decltype(x - 273.15)
 Conversion from K to C. More...
 
template<class T >
constexpr auto Conversion::kaycm_per_cmsquared2hz_per_msquared (T x) -> decltype(x *kaycm2freq(1e-4))
 Conversion from cm-1 per molecule per cm^2 to Hz per molecule per m^2. More...
 
template<class T >
constexpr auto Conversion::hz_per_msquared2kaycm_per_cmsquared (T x) -> decltype(x *freq2kaycm(1e4))
 Conversion from Hz per molecule per m^2 to cm-1 per molecule per cm^2. More...
 
template<class T >
constexpr auto Conversion::kaycm_per_atm2hz_per_pa (T x) -> decltype(x *kaycm2freq(pa2atm(1)))
 Conversion from cm-1 per atmosphere to Hz per Pascal. More...
 
template<class T >
constexpr auto Conversion::hz_per_pa2kaycm_per_atm (T x) -> decltype(x *freq2kaycm(atm2pa(1)))
 Conversion from Hz per Pascal to cm-1 per atmosphere. More...
 
template<class T >
constexpr auto Conversion::kaycm2joule (T x) -> decltype(x *kaycm2freq(h))
 Conversion from cm-1 to Joule. More...
 
template<class T >
constexpr auto Conversion::hz2joule (T x) -> decltype(x *h)
 Conversion from MHz to Joule. More...
 
template<class T >
constexpr auto Conversion::mhz2joule (T x) -> decltype(hz2joule(x) *1e6)
 Conversion from MHz to Joule. More...
 
template<class T >
constexpr auto Conversion::kelvin2joule (T x) -> decltype(x *k)
 Conversion from Kelvin to Joule. More...
 
template<class T >
constexpr auto Conversion::joule2hz (T x) -> decltype(x/h)
 Conversion from Hz to Joule. More...
 
template<class T >
constexpr auto Conversion::joule2kaycm (T x) -> decltype(x/kaycm2freq(h))
 Conversion from Joule to cm-1. More...
 
template<class T >
constexpr auto Conversion::angstrom2meter (T x) -> decltype(x *1e-10)
 Conversion from Å to meter. More...
 
template<class T >
constexpr auto Conversion::meter2angstrom (T x) -> decltype(x *1e10)
 Conversion from meter to Å More...
 
 Options::ENUMCLASS (TimeStep, char, hour, hours, h, minute, minutes, min, second, seconds, s) ENUMCLASS(LineShapeCoeff
 Keep time options available to switch over them. More...
 
X3 Options::ENUMCLASS (WindMagJacobian, char, u, v, w, strength) ENUMCLASS(BasicCatParamJacobian
 Possible Jacobian for Wind and Magnetic field. More...
 
X3 LineCenter Options::ENUMCLASS (HitranType, char, Pre2004, From2004To2012, Post2012, Online) ENUMCLASS(LblSpeedup
 Possible HITRAN types of catalogs. More...
 

Variables

 Options::char
 
 Options::X0
 
 Options::X1
 
 Options::X2
 
X3 Options::LineStrength
 
X3 LineCenter Options::None
 
X3 LineCenter Options::QuadraticIndependent
 

Detailed Description

Constants of physical expressions as constexpr.

Following May 2019 reported SI unit updates, several previously important constant are proper constants and not derived constants.

This file contains the intended May 2019 constants update meaning that the Planck constant, Boltzmann constant, elementary charge, Avogadro number, the definition of a luminosity, the frequency of Cesium, and the speed of light have been given constant values.

All other values are derived. To be internally consistent in ARTS, the adaptation of these rules below take the approach that only the fine structure constant and the Rydberg constant are 'measurable' quantities. All other quantities are derived by their formal relationships. As an example, the resting mass of an electron is defined as 2 h R_inf / c alpha^2. This means that they should be constant in their internal relationships to the level permitted by the select floating point accuracy.

Note 1: The constants below contains both named and a few convenience variables

Note 2: Derived constants of convenience, such as the Doppler broadening constant, should also go into here if they have a clear name.

Note 3: The PrintPhysicalConstants convenience function is part of the global ARTS namespace. Please update this if and when new constants are added to this namespace.

Author
Richard Larsson
Date
2019-04-01

Definition in file constants.h.