Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Constants.hpp File Reference

Physical constants in a unit system, plus a few dimensionless numbers. More...

#include "UnitSystem.hpp"
#include "constant_table.hpp"
Include dependency graph for Constants.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  shamunits::Constants< T >
 Physical constants in a unit system. More...

Namespaces

namespace  shamunits
 namespace containing the units library

Variables

template<class T>
constexpr T shamunits::pi = 3.141592653589793116
 Value of pi Usage : auto pi = shamunits::pi<T>;.
template<class T>
constexpr T shamunits::fine_structure = 0.0072973525693
 Fine structure constant.
template<class T>
constexpr T shamunits::proton_electron_ratio = 1836.1526734311
 Mass ration between the proton and electron.
template<class T>
constexpr T shamunits::electron_proton_ratio = 1 / proton_electron_ratio<T>
 Mass ration between the electron and proton.

Detailed Description

Physical constants in a unit system, plus a few dimensionless numbers.

Author
David Fang (david.nosp@m..fan.nosp@m.g@ikm.nosp@m.ail..nosp@m.com)
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)
Yona Lapeyre (yona..nosp@m.lape.nosp@m.yre@e.nosp@m.ns-l.nosp@m.yon.f.nosp@m.r)

The constants themselves are the values of shamunits::constants (constant_table.hpp). Constants<T> is kept for backward compatibility: it is a thin wrapper around a UnitSystem, and Constants<T>{usys}.get<constants::G>() is the same as usys.get<constants::G>().

Definition in file Constants.hpp.