NEURON
units.hpp
Go to the documentation of this file.
1 /*
2 # =============================================================================
3 # Copyright (c) 2016 - 2022 Blue Brain Project/EPFL
4 #
5 # See top-level LICENSE file for details.
6 # =============================================================================
7 */
8 #pragma once
9 namespace coreneuron {
10 namespace units {
11 /* NMODL translated MOD files get unit constants typically from
12  * share/lib/nrnunits.lib. But there were other source files that hardcode
13  * some of the constants. Here we gather a few modern units into a single place
14  * (but, unfortunately, also in nrnunits.lib). Legacy units cannot be
15  * gathered here because they can differ slightly from place to place.
16  *
17  * These come from https://physics.nist.gov/cuu/Constants/index.html.
18  * Termed the "2018 CODATA recommended values", they became available
19  * on 20 May 2019 and replace the 2014 CODATA set.
20  *
21  * See oc/hoc_init.c, nrnoc/eion.c, nrniv/kschan.h
22  */
23 namespace detail {
24 constexpr double electron_charge{1.602176634e-19}; // coulomb exact
25 constexpr double avogadro_number{6.02214076e+23}; // exact
26 constexpr double boltzmann{1.380649e-23}; // joule/K exact
27 } // namespace detail
28 constexpr double faraday{detail::electron_charge * detail::avogadro_number}; // 96485.33212...
29  // coulomb/mol
30 constexpr double gasconstant{detail::boltzmann * detail::avogadro_number}; // 8.314462618...
31  // joule/mol-K
32 } // namespace units
33 } // namespace coreneuron
constexpr double electron_charge
Definition: units.hpp:24
constexpr double boltzmann
Definition: units.hpp:26
constexpr double avogadro_number
Definition: units.hpp:25
constexpr double faraday
Definition: units.hpp:28
constexpr double gasconstant
Definition: units.hpp:30
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
void units(unit *)
Definition: units.cpp:641