BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Constants and functions for physical unit conversions.
In user code, quantities that have a physical dimension should always be given in the form value * unit, e.g. 0.529 * angstrom for a length, or 45 * deg for an angle.
Internally, BornAgain has length, angle, magnetic field units of nanometer, radians, Tesla. Therefore, in principle, the multipliers nm, rad, tesla could be ommited from code. However, to make code more readable, and to prevent misunderstandings, we recommend that physical dimension be always made clear by multiplying values with an appropriate constant, even if this expands to 1.
Functions | |
double | deg2rad (double angle) |
double | rad2deg (double angle) |
Variables | |
static constexpr double | angstrom = 1.e-1 * nanometer |
static constexpr double | deg = (3.1415926535897932 / 180.0) * rad |
static constexpr double | gauss = 1e-4 |
static constexpr double | micrometer = 1.e+3 * nanometer |
static constexpr double | millimeter = 1.e+6 * nanometer |
static constexpr double | nanometer = 1. |
Internal unit for lengths. More... | |
static constexpr double | nm = nanometer |
static constexpr double | nm2 = nanometer * nanometer |
static constexpr double | rad = 1. |
Radian, internal unit for angles. More... | |
static constexpr double | tesla = 1. |
Internal unit for magnetic fields. More... | |
|
inline |
Definition at line 58 of file Units.h.
References deg.
Referenced by FormFactorComponents::FormFactorComponents(), and ExemplarySamples::createRotatedPyramids().
|
inline |
Definition at line 54 of file Units.h.
References deg.
Referenced by SphericalCoords::calculateValue(), ImageCoords::calculateValue(), OffspecCoordinates::calculateValue(), DepthProbeCoordinates::calculateValue(), AngularReflectometryCoordinates::getTraslatorTo(), and Py::Fmt::printDegrees().
|
staticconstexpr |
Definition at line 34 of file Units.h.
Referenced by ExemplarySamples::createFeNiBilayerNC(), ExemplarySamples::createFeNiBilayerSpinFlipNC(), ExemplarySamples::createFeNiBilayerSpinFlipTanh(), ExemplarySamples::createFeNiBilayerTanh(), and ExemplarySamples::createSimpleMagneticRotationWithRoughness().
|
staticconstexpr |
Definition at line 46 of file Units.h.
Referenced by ExemplarySamples::createBasic2DLattice(), ExemplarySamples::createBasic2DParaCrystalWithFTDis(), ExemplarySamples::createBoxCompositionRotateX(), ExemplarySamples::createBoxCompositionRotateY(), ExemplarySamples::createBoxCompositionRotateZ(), ExemplarySamples::createBoxCompositionRotateZandY(), ExemplarySamples::createBoxStackComposition(), ExemplarySamples::createCoreShellBoxRotateZandY(), ExemplarySamples::createCustomMorphology(), ExemplarySamples::createFeNiBilayerSpinFlip(), ExemplarySamples::createFeNiBilayerSpinFlipNC(), ExemplarySamples::createFeNiBilayerSpinFlipTanh(), ExemplarySamples::createLattice1D(), ExemplarySamples::createLayersWithAbsorptionBySLD(), ExemplarySamples::createLayersWithAbsorptionWithFF(), ExemplarySamples::createMagneticRotation(), ExemplarySamples::createRotatedPyramids(), ExemplarySamples::createRotatedSquareLattice2D(), ExemplarySamples::createSlicedComposition(), ExemplarySamples::createTransformBox(), deg2rad(), and rad2deg().
|
staticconstexpr |
Definition at line 50 of file Units.h.
Referenced by MisesGaussPeakShape::peakDistribution().
|
staticconstexpr |
Definition at line 35 of file Units.h.
Referenced by ExemplarySamples::createBasic2DParaCrystalWithFTDis(), ExemplarySamples::createHexParaCrystal(), and ExemplarySamples::createRectParaCrystal().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Radian, internal unit for angles.
Definition at line 45 of file Units.h.
Referenced by Compute::Kz::computeReducedKz().