Celeritas 0.6.0-dev.115+3b60a5fd
|
Units in Celeritas for macro-scale quantities. More...
Classes | |
struct | Amu |
Atomic mass units [amu]. More... | |
struct | Barn |
Barn cross section [b]. More... | |
struct | Centimeter |
struct | ClhepUnitBField |
Unit magnetic flux density in CLHEP system. More... | |
struct | ClhepUnitMass |
Unit mass in CLHEP system. More... | |
struct | CLight |
Natural unit of speed. More... | |
struct | EElectron |
Natural unit of charge (positive electron) More... | |
struct | ElectronVolt |
Atom-scale energy. More... | |
struct | Gauss |
struct | Gram |
struct | GramPerCentimeterCubed |
Mass density. More... | |
struct | InvCentimeterCubed |
Inverse cubic centimeter for number densities. More... | |
struct | Kilogram |
struct | LogMev |
Annotate a quantity represented the logarithm of (E/MeV) More... | |
struct | Meter |
struct | Mev |
Nucleus-scale energy. More... | |
struct | MevPerC |
Nucleus-scale momentum. More... | |
struct | MevPerCsq |
Nucleus-scale mass. More... | |
struct | Millibarn |
Millibarn cross section [mb]. More... | |
struct | Millimeter |
struct | Mol |
Amount of substance \(N_a\). More... | |
struct | MolPerCentimeterCubed |
Molar density. More... | |
struct | Nanosecond |
struct | Native |
Mark as being in the native/builtin unit system. More... | |
struct | Second |
struct | Tesla |
struct | UnitSystemTraits |
Traits class for units. More... | |
Typedefs | |
using | LogMevEnergy = RealQuantity< LogMev > |
Special faux quantity for overloading cross section calculation. | |
Quantities for atomic scale/natural units | |
using | ElementaryCharge = RealQuantity< EElectron > |
using | MevEnergy = RealQuantity< Mev > |
using | MevMass = RealQuantity< MevPerCsq > |
using | MevMomentum = RealQuantity< MevPerC > |
using | MevMomentumSq = RealQuantity< UnitProduct< MevPerC, MevPerC > > |
using | LightSpeed = RealQuantity< CLight > |
using | AmuMass = RealQuantity< Amu > |
Quantities for manual input and/or test harnesses | |
using | BarnXs = RealQuantity< Barn > |
using | CmLength = RealQuantity< Centimeter > |
using | InvCmXs = RealQuantity< UnitInverse< Centimeter > > |
using | InvCcDensity = RealQuantity< InvCentimeterCubed > |
using | MolCcDensity = RealQuantity< MolPerCentimeterCubed > |
using | GramCcDensity = RealQuantity< GramPerCentimeterCubed > |
using | FieldTesla = RealQuantity< Tesla > |
Type aliases for unit system traits | |
using | CgsTraits = UnitSystemTraits< UnitSystem::cgs > |
using | SiTraits = UnitSystemTraits< UnitSystem::si > |
using | ClhepTraits = UnitSystemTraits< UnitSystem::clhep > |
using | NativeTraits = UnitSystemTraits< UnitSystem::native > |
Functions | |
template<class F > | |
constexpr decltype(auto) | visit_unit_system (F &&func, UnitSystem sys) |
Expand a macro to a switch statement over all possible unit system types. | |
Variables | |
Units with numerical value defined to be 1 for CGS | |
constexpr Constant | centimeter {1} |
Length. | |
constexpr Constant | gram {1} |
Mass. | |
constexpr Constant | second {1} |
Time. | |
constexpr Constant | gauss {1} |
Field strength. | |
constexpr Constant | kelvin {1} |
Temperature. | |
Exact unit transformations to SI units | |
constexpr Constant | meter = 100 * centimeter |
constexpr Constant | kilogram = 1000 * gram |
constexpr Constant | tesla = 10000 * gauss |
Exact unit transformations using SI unit definitions | |
constexpr Constant | newton = kilogram * meter / (second * second) |
constexpr Constant | joule = newton * meter |
constexpr Constant | coulomb = kilogram / (tesla * second) |
constexpr Constant | ampere = coulomb / second |
constexpr Constant | volt = joule / coulomb |
constexpr Constant | farad = coulomb / volt |
CLHEP units | |
constexpr Constant | millimeter = Constant{0.1} * centimeter |
constexpr Constant | nanosecond = Constant{1e-9} * second |
Other common units | |
constexpr Constant | micrometer = Constant{1e-4} * centimeter |
constexpr Constant | nanometer = Constant{1e-7} * centimeter |
constexpr Constant | femtometer = Constant{1e-13} * centimeter |
constexpr Constant | barn = Constant{1e-24} * centimeter * centimeter |
Units in Celeritas for macro-scale quantities.
Celeritas can be configured at build time to use different unit systems for better compatibility with external libraries and applications. The CELERITAS_UNITS
CMake variable can be set to one of the following:
CELERITAS_UNITS_CGS
(default): use Gaussian CGS unitsCELERITAS_UNITS_SI
: use SI unitsCELERITAS_UNITS_CLHEP
: use the Geant4 high energy physics system (a mix of macro-scale and atomic-scale units)The following units have numerical values of 1 in the default Celeritas system (Gaussian CGS) and are often seen in unit tests:
Unless otherwise specified, the user-selected unit system is used for input and output numerical values. They are meant for macro-scale quantities coupling the different code components of Celeritas.
See also:
Constants.hh
for constants defined in this unit systemphysics/base/Units.hh
for unit systems used by the physicsAdditionally:
|
constexpr |
Expand a macro to a switch statement over all possible unit system types.
This helper function is meant for processing user input to convert values to the native unit system. It is not a CELER_FUNCTION
because unit conversion should be done only during preprocessing on the CPU.