feat(GridFire): brought gridfire up to where network module in SERiF was before splitting it off
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -69,6 +69,12 @@ subprojects/packagecache/
|
|||||||
subprojects/hypre/
|
subprojects/hypre/
|
||||||
subprojects/qhull/
|
subprojects/qhull/
|
||||||
subprojects/cppad/
|
subprojects/cppad/
|
||||||
|
subprojects/libcomposition/
|
||||||
|
subprojects/libconfig/
|
||||||
|
subprojects/libconstants/
|
||||||
|
subprojects/liblogging/
|
||||||
|
|
||||||
|
*.dot
|
||||||
|
|
||||||
qhull.wrap
|
qhull.wrap
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
Use the utility `utils/atomic/convertWeightsToHeader.py` to generate atomicWeights.h
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <string_view>
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include "atomicSpecies.h"
|
|
||||||
|
|
||||||
namespace serif::atomic {
|
|
||||||
struct Species {
|
|
||||||
std::string m_name; //< Name of the species
|
|
||||||
std::string m_el; //< Element symbol
|
|
||||||
int m_nz; //< NZ
|
|
||||||
int m_n; //< N
|
|
||||||
int m_z; //< Z
|
|
||||||
int m_a; //< A
|
|
||||||
double m_bindingEnergy; //< Binding energy
|
|
||||||
std::string m_betaCode; //< Beta decay code
|
|
||||||
double m_betaDecayEnergy; //< Beta decay energy
|
|
||||||
double m_atomicMass; //< Atomic mass
|
|
||||||
double m_atomicMassUnc; //< Atomic mass uncertainty
|
|
||||||
|
|
||||||
Species(const std::string_view name, const std::string_view el, const int nz, const int n, const int z, const int a, const double bindingEnergy, const std::string_view betaCode, const double betaDecayEnergy, const double atomicMass, const double atomicMassUnc)
|
|
||||||
: m_name(name), m_el(el), m_nz(nz), m_n(n), m_z(z), m_a(a), m_bindingEnergy(bindingEnergy), m_betaCode(betaCode), m_betaDecayEnergy(betaDecayEnergy), m_atomicMass(atomicMass), m_atomicMassUnc(atomicMassUnc) {};
|
|
||||||
|
|
||||||
//Copy constructor
|
|
||||||
Species(const Species& species) {
|
|
||||||
m_name = species.m_name;
|
|
||||||
m_el = species.m_el;
|
|
||||||
m_nz = species.m_nz;
|
|
||||||
m_n = species.m_n;
|
|
||||||
m_z = species.m_z;
|
|
||||||
m_a = species.m_a;
|
|
||||||
m_bindingEnergy = species.m_bindingEnergy;
|
|
||||||
m_betaCode = species.m_betaCode;
|
|
||||||
m_betaDecayEnergy = species.m_betaDecayEnergy;
|
|
||||||
m_atomicMass = species.m_atomicMass;
|
|
||||||
m_atomicMassUnc = species.m_atomicMassUnc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double mass() const {
|
|
||||||
return m_atomicMass;
|
|
||||||
}
|
|
||||||
|
|
||||||
double massUnc() const {
|
|
||||||
return m_atomicMassUnc;
|
|
||||||
}
|
|
||||||
|
|
||||||
double bindingEnergy() const {
|
|
||||||
return m_bindingEnergy;
|
|
||||||
}
|
|
||||||
|
|
||||||
double betaDecayEnergy() const {
|
|
||||||
return m_betaDecayEnergy;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string_view betaCode() const {
|
|
||||||
return m_betaCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string_view name() const {
|
|
||||||
return m_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string_view el() const {
|
|
||||||
return m_el;
|
|
||||||
}
|
|
||||||
|
|
||||||
int nz() const {
|
|
||||||
return m_nz;
|
|
||||||
}
|
|
||||||
|
|
||||||
int n() const {
|
|
||||||
return m_n;
|
|
||||||
}
|
|
||||||
|
|
||||||
int z() const {
|
|
||||||
return m_z;
|
|
||||||
}
|
|
||||||
|
|
||||||
int a() const {
|
|
||||||
return m_a;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend std::ostream& operator<<(std::ostream& os, const Species& species) {
|
|
||||||
os << species.m_name << " (" << species.m_atomicMass << " u)";
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend bool operator==(const Species& lhs, const Species& rhs);
|
|
||||||
friend bool operator!=(const Species& lhs, const Species& rhs);
|
|
||||||
};
|
|
||||||
inline bool operator==(const Species& lhs, const Species& rhs) {
|
|
||||||
return (lhs.m_name == rhs.m_name);
|
|
||||||
}
|
|
||||||
inline bool operator!=(const Species& lhs, const Species& rhs) {
|
|
||||||
return (lhs.m_name != rhs.m_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace std {
|
|
||||||
template<>
|
|
||||||
struct hash<serif::atomic::Species> {
|
|
||||||
size_t operator()(const serif::atomic::Species& s) const noexcept {
|
|
||||||
return std::hash<std::string>()(s.m_name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // namespace std
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,16 +0,0 @@
|
|||||||
required_headers = [
|
|
||||||
'atomicSpecies.h',
|
|
||||||
'species.h'
|
|
||||||
]
|
|
||||||
|
|
||||||
foreach h : required_headers
|
|
||||||
if not cpp.has_header(h, include_directories: include_directories('include'))
|
|
||||||
error('SERiF requires the header file ' + h + ' to be present in the assets/static/atomic/include directory.')
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
species_weight_dep = declare_dependency(
|
|
||||||
include_directories: include_directories('include'),
|
|
||||||
)
|
|
||||||
|
|
||||||
message('✅ SERiF species_weight dependency declared')
|
|
||||||
@@ -1,470 +0,0 @@
|
|||||||
CODATA 2022 + astrophysical constants
|
|
||||||
Most quantities have been converted to CGS
|
|
||||||
Generated on Feb 10, 2025
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
Reference:
|
|
||||||
|
|
||||||
Mohr, P. , Tiesinga, E. , Newell, D. and Taylor, B. (2024), Codata Internationally Recommended 2022 Values of the Fundamental Physical Constants,
|
|
||||||
Codata Internationally Recommended 2022 Values of the Fundamental Physical Constants,
|
|
||||||
[online], https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=958002, https://physics.nist.gov/constants (Accessed February 10, 2025)
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
Symbol Name Value Unit Uncertainty Source
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
wienK Wien displacement law constant 2.89776850e-01 K cm 5.10000000e-07 CODATA2022
|
|
||||||
au1Hyper atomic unit of 1st hyperpolarizablity 3.20636151e-53 C^3 m^3 J^-2 2.80000000e-60 CODATA2022
|
|
||||||
au2Hyper atomic unit of 2nd hyperpolarizablity 6.23538080e-65 C^4 m^4 J^-3 1.10000000e-71 CODATA2022
|
|
||||||
auEDip atomic unit of electric dipole moment 8.47835309e-30 C m 7.30000000e-37 CODATA2022
|
|
||||||
auEPol atomic unit of electric polarizablity 1.64877727e-41 C^2 m^2 J^-1 1.60000000e-49 CODATA2022
|
|
||||||
auEQuad atomic unit of electric quadrupole moment 4.48655124e-40 C m^2 3.90000000e-47 CODATA2022
|
|
||||||
auMDip atomic unit of magn. dipole moment 1.85480190e-23 J T^-1 1.60000000e-30 CODATA2022
|
|
||||||
auMFlux atomic unit of magn. flux density 2.35051757e+09 G 7.10000000e-01 CODATA2022
|
|
||||||
muD deuteron magn. moment 4.33073482e-27 J T^-1 3.80000000e-34 CODATA2022
|
|
||||||
muD_Bhor deuteron magn. moment to Bohr magneton ratio 4.66975457e-04 5.00000000e-12 CODATA2022
|
|
||||||
muD_Nuc deuteron magn. moment to nuclear magneton ratio 8.57438233e-01 9.20000000e-09 CODATA2022
|
|
||||||
muD_e deuteron-electron magn. moment ratio -4.66434555e-04 5.00000000e-12 CODATA2022
|
|
||||||
muD_p deuteron-proton magn. moment ratio 3.07012208e-01 4.50000000e-09 CODATA2022
|
|
||||||
muD_n deuteron-neutron magn. moment ratio -4.48206520e-01 1.10000000e-07 CODATA2022
|
|
||||||
rgE electron gyromagn. ratio 1.76085963e+11 s^-1 T^-1 5.30000000e+01 CODATA2022
|
|
||||||
rgE_2pi electron gyromagn. ratio over 2 pi 2.80249532e+04 MHz T^-1 2.40000000e-03 CODATA2022
|
|
||||||
muE electron magn. moment -9.28476412e-24 J T^-1 8.00000000e-31 CODATA2022
|
|
||||||
muE_Bhor electron magn. moment to Bohr magneton ratio -1.00115965e+00 3.80000000e-12 CODATA2022
|
|
||||||
muE_Nuc electron magn. moment to nuclear magneton ratio -1.83828197e+03 8.50000000e-07 CODATA2022
|
|
||||||
muE_anom electron magn. moment anomaly 1.15965219e-03 3.80000000e-12 CODATA2022
|
|
||||||
muE_muP_shield electron to shielded proton magn. moment ratio -6.58227596e+02 7.10000000e-06 CODATA2022
|
|
||||||
muE_muH_shield electron to shielded helion magn. moment ratio 8.64058255e+02 1.00000000e-05 CODATA2022
|
|
||||||
muE_D electron-deuteron magn. moment ratio -2.14392349e+03 2.30000000e-05 CODATA2022
|
|
||||||
muE_mu electron-muon magn. moment ratio 2.06766989e+02 5.40000000e-06 CODATA2022
|
|
||||||
muE_n electron-neutron magn. moment ratio 9.60920500e+02 2.30000000e-04 CODATA2022
|
|
||||||
muE_p electron-proton magn. moment ratio -6.58210686e+02 6.60000000e-06 CODATA2022
|
|
||||||
mu0 magn. constant 1.25663706e-06 N A^-2 0.00000000e+00 CODATA2022
|
|
||||||
phi0 magn. flux quantum 2.06783385e-15 Wb 0.00000000e+00 CODATA2022
|
|
||||||
muMu muon magn. moment -4.49044799e-26 J T^-1 4.00000000e-33 CODATA2022
|
|
||||||
muMu_Bhor muon magn. moment to Bohr magneton ratio -4.84197045e-03 1.30000000e-10 CODATA2022
|
|
||||||
muMu_Nuc muon magn. moment to nuclear magneton ratio -8.89059698e+00 2.30000000e-07 CODATA2022
|
|
||||||
muMu_p muon-proton magn. moment ratio -3.18334512e+00 8.90000000e-08 CODATA2022
|
|
||||||
rgN neutron gyromagn. ratio 1.83247171e+08 s^-1 T^-1 4.30000000e+01 CODATA2022
|
|
||||||
rgN_2pi neutron gyromagn. ratio over 2 pi 2.91646950e+01 MHz T^-1 7.30000000e-06 CODATA2022
|
|
||||||
muN neutron magn. moment -9.66236450e-27 J T^-1 2.40000000e-33 CODATA2022
|
|
||||||
muN_Bhor neutron magn. moment to Bohr magneton ratio -1.04187563e-03 2.50000000e-10 CODATA2022
|
|
||||||
muN_Nuc neutron magn. moment to nuclear magneton ratio -1.91304273e+00 4.50000000e-07 CODATA2022
|
|
||||||
muN_p_shield neutron to shielded proton magn. moment ratio -6.84996940e-01 1.60000000e-07 CODATA2022
|
|
||||||
muN_e neutron-electron magn. moment ratio 1.04066882e-03 2.50000000e-10 CODATA2022
|
|
||||||
muN_p neutron-proton magn. moment ratio -6.84979340e-01 1.60000000e-07 CODATA2022
|
|
||||||
rgP proton gyromagn. ratio 2.67522187e+08 s^-1 T^-1 1.10000000e-01 CODATA2022
|
|
||||||
rgP_2pi proton gyromagn. ratio over 2 pi 4.25774813e+01 MHz T^-1 3.70000000e-06 CODATA2022
|
|
||||||
muP proton magn. moment 1.41060671e-26 J T^-1 1.20000000e-33 CODATA2022
|
|
||||||
muP_Bhor proton magn. moment to Bohr magneton ratio 1.52103221e-03 1.50000000e-11 CODATA2022
|
|
||||||
muP_Nuc proton magn. moment to nuclear magneton ratio 2.79284735e+00 2.80000000e-08 CODATA2022
|
|
||||||
muP_shield proton magn. shielding correction 2.56890000e-05 1.10000000e-08 CODATA2022
|
|
||||||
muP_n proton-neutron magn. moment ratio -1.45989805e+00 3.40000000e-07 CODATA2022
|
|
||||||
rgH shielded helion gyromagn. ratio 2.03789457e+08 s^-1 T^-1 2.40000000e+00 CODATA2022
|
|
||||||
rgH_2pi shielded helion gyromagn. ratio over 2 pi 3.24341015e+01 MHz T^-1 2.80000000e-06 CODATA2022
|
|
||||||
muH_shield shielded helion magn. moment -1.07455302e-26 J T^-1 9.30000000e-34 CODATA2022
|
|
||||||
muH_shield_Bhor shielded helion magn. moment to Bohr magneton rati -1.15867147e-03 1.40000000e-11 CODATA2022
|
|
||||||
muH_shield_Nuc shielded helion magn. moment to nuclear magneton r -2.12749772e+00 2.50000000e-08 CODATA2022
|
|
||||||
muH_shield_p shielded helion to proton magn. moment ratio -7.61766562e-01 1.20000000e-08 CODATA2022
|
|
||||||
muH_shield_p_shield shielded helion to shielded proton magn. moment ra -7.61786131e-01 3.30000000e-09 CODATA2022
|
|
||||||
muP_shield shielded proton magn. moment 1.41057047e-26 J T^-1 1.20000000e-33 CODATA2022
|
|
||||||
muP_shield_Bhor shielded proton magn. moment to Bohr magneton rati 1.52099313e-03 1.60000000e-11 CODATA2022
|
|
||||||
muP_shield_Nuc shielded proton magn. moment to nuclear magneton r 2.79277560e+00 3.00000000e-08 CODATA2022
|
|
||||||
aSi_220 {220} lattice spacing of silicon 1.92015571e-08 cm 3.20000000e-16 CODATA2022
|
|
||||||
aSi lattice spacing of silicon 1.92015576e-08 cm 5.00000000e-16 CODATA2022
|
|
||||||
mAlpha_e alpha particle-electron mass ratio 7.29429954e+03 2.40000000e-07 CODATA2022
|
|
||||||
mAlpha alpha particle mass 6.64465734e-24 g 2.00000000e-33 CODATA2022
|
|
||||||
EAlpha alpha particle mass energy equivalent 5.97192019e-03 erg 1.80000000e-12 CODATA2022
|
|
||||||
EAlpha_MeV alpha particle mass energy equivalent in MeV 5.97192019e-03 erg 1.76239430e-12 CODATA2022
|
|
||||||
mAlpha_u alpha particle mass in u 6.64465734e-24 g 1.04613961e-34 CODATA2022
|
|
||||||
MAlpha alpha particle molar mass 4.00150618e+00 g / mol 1.20000000e-09 CODATA2022
|
|
||||||
mAlpha_p alpha particle-proton mass ratio 3.97259969e+00 2.20000000e-10 CODATA2022
|
|
||||||
angstromStar Angstrom star 1.00001495e-08 cm 9.00000000e-15 CODATA2022
|
|
||||||
mU atomic mass constant 1.66053907e-24 g 5.00000000e-34 CODATA2022
|
|
||||||
mU_E atomic mass constant energy equivalent 1.49241809e-03 erg 4.50000000e-13 CODATA2022
|
|
||||||
mU_E_MeV atomic mass constant energy equivalent in MeV 1.49241809e-03 erg 4.48609458e-13 CODATA2022
|
|
||||||
mU_eV atomic mass unit-electron volt relationship 1.49241809e-03 erg 4.48609458e-13 CODATA2022
|
|
||||||
mU_hartree atomic mass unit-hartree relationship 3.42317769e+07 E_h 1.00000000e-02 CODATA2022
|
|
||||||
mU_Hz atomic mass unit-hertz relationship 2.25234272e+23 1 / s 6.80000000e+13 CODATA2022
|
|
||||||
mU_invm atomic mass unit-inverse meter relationship 7.51300661e+12 1 / cm 2.30000000e+03 CODATA2022
|
|
||||||
mU_J atomic mass unit-joule relationship 1.49241809e-03 erg 4.50000000e-13 CODATA2022
|
|
||||||
mU_K atomic mass unit-kelvin relationship 1.08095402e+13 K 3.30000000e+03 CODATA2022
|
|
||||||
mU_kg atomic mass unit-kilogram relationship 1.66053907e-24 g 5.00000000e-34 CODATA2022
|
|
||||||
au1Hyper atomic unit of 1st hyperpolarizability 3.20636131e-53 C^3 m^3 J^-2 1.50000000e-62 CODATA2022
|
|
||||||
au2Hyper atomic unit of 2nd hyperpolarizability 6.23537999e-65 C^4 m^4 J^-3 3.80000000e-74 CODATA2022
|
|
||||||
auAct atomic unit of action 1.05457182e-27 erg s 0.00000000e+00 CODATA2022
|
|
||||||
auC atomic unit of charge 1.60217663e-19 C 0.00000000e+00 CODATA2022
|
|
||||||
auCrho atomic unit of charge density 1.08120238e+12 C m^-3 4.90000000e+02 CODATA2022
|
|
||||||
auI atomic unit of current 6.62361824e-03 A 1.30000000e-14 CODATA2022
|
|
||||||
auMu atomic unit of electric dipole mom. 8.47835363e-30 C m 1.30000000e-39 CODATA2022
|
|
||||||
auE atomic unit of electric field 5.14220675e+11 V m^-1 7.80000000e+01 CODATA2022
|
|
||||||
auEFG atomic unit of electric field gradient 9.71736243e+21 V m^-2 2.90000000e+12 CODATA2022
|
|
||||||
auPol atomic unit of electric polarizability 1.64877727e-41 C^2 m^2 J^-1 5.00000000e-51 CODATA2022
|
|
||||||
auV atomic unit of electric potential 2.72113862e+01 V 5.30000000e-11 CODATA2022
|
|
||||||
auQuad atomic unit of electric quadrupole mom. 4.48655152e-40 C m^2 1.40000000e-49 CODATA2022
|
|
||||||
Eh atomic unit of energy 4.35974472e-11 erg 8.50000000e-23 CODATA2022
|
|
||||||
auF atomic unit of force 8.23872350e-03 dyn 1.20000000e-12 CODATA2022
|
|
||||||
auL atomic unit of length 5.29177211e-09 cm 8.00000000e-19 CODATA2022
|
|
||||||
auM atomic unit of mag. dipole mom. 1.85480202e-23 J T^-1 5.60000000e-33 CODATA2022
|
|
||||||
auB atomic unit of mag. flux density 2.35051757e+09 G 7.10000000e-01 CODATA2022
|
|
||||||
auChi atomic unit of magnetizability 7.89103660e-29 J T^-2 4.80000000e-38 CODATA2022
|
|
||||||
amu atomic unit of mass 9.10938370e-28 g 2.80000000e-37 CODATA2022
|
|
||||||
aup atomic unit of momentum 1.99285191e-19 dyn s 3.00000000e-29 CODATA2022
|
|
||||||
auEps atomic unit of permittivity 1.11265006e-10 F m^-1 1.70000000e-20 CODATA2022
|
|
||||||
aut atomic unit of time 2.41888433e-17 s 4.70000000e-29 CODATA2022
|
|
||||||
auv atomic unit of velocity 2.18769126e+08 cm / s 3.30000000e-02 CODATA2022
|
|
||||||
N_a Avogadro constant 6.02214076e+23 1 / mol 0.00000000e+00 CODATA2022
|
|
||||||
mu_B Bohr magneton 9.27401008e-24 J T^-1 2.80000000e-33 CODATA2022
|
|
||||||
mu_B_eV_T Bohr magneton in eV/T 5.78838181e-05 eV T^-1 1.70000000e-14 CODATA2022
|
|
||||||
mu_B_Hz_T Bohr magneton in Hz/T 1.39962449e+10 Hz T^-1 4.20000000e+00 CODATA2022
|
|
||||||
mu_B__mT Bohr magneton in inverse meters per tesla 4.66864481e+01 m^-1 T^-1 2.90000000e-07 CODATA2022
|
|
||||||
muB_K_T Bohr magneton in K/T 6.71713816e-01 K T^-1 2.00000000e-10 CODATA2022
|
|
||||||
rBhor Bohr radius 5.29177211e-09 cm 8.00000000e-19 CODATA2022
|
|
||||||
kB Boltzmann constant 1.38064900e-16 erg / K 0.00000000e+00 CODATA2022
|
|
||||||
kB_eV_K Boltzmann constant in eV/K 1.38064900e-16 erg / K 0.00000000e+00 CODATA2022
|
|
||||||
kB_Hz_K Boltzmann constant in Hz/K 2.08366191e+10 1 / (K s) 0.00000000e+00 CODATA2022
|
|
||||||
kB__MK Boltzmann constant in inverse meters per kelvin 6.95034570e-01 1 / (K cm) 4.00000000e-07 CODATA2022
|
|
||||||
Z0 characteristic impedance of vacuum 3.76730314e+02 ohm 5.61366546e-08 CODATA2022
|
|
||||||
re classical electron radius 2.81794033e-13 cm 1.30000000e-22 CODATA2022
|
|
||||||
lambda_compt Compton wavelength 2.42631024e-10 cm 7.30000000e-20 CODATA2022
|
|
||||||
lambda_compt_2pi Compton wavelength over 2 pi 3.86159268e-11 cm 1.80000000e-20 CODATA2022
|
|
||||||
G0 conductance quantum 7.74809173e-05 S 0.00000000e+00 CODATA2022
|
|
||||||
K_J-90 conventional value of Josephson constant 4.83597900e+14 Hz V^-1 0.00000000e+00 CODATA2022
|
|
||||||
R_K-90 conventional value of von Klitzing constant 2.58128070e+04 ohm 0.00000000e+00 CODATA2022
|
|
||||||
xu(CuKa1) Cu x unit 1.00207697e-11 cm 2.80000000e-18 CODATA2022
|
|
||||||
muD_e deuteron-electron mag. mom. ratio -4.66434555e-04 1.20000000e-12 CODATA2022
|
|
||||||
mD_e deuteron-electron mass ratio 3.67048297e+03 1.30000000e-07 CODATA2022
|
|
||||||
g_D deuteron g factor 8.57438234e-01 2.20000000e-09 CODATA2022
|
|
||||||
muD deuteron mag. mom. 4.33073509e-27 J T^-1 1.10000000e-35 CODATA2022
|
|
||||||
muD_Bhor deuteron mag. mom. to Bohr magneton ratio 4.66975457e-04 1.20000000e-12 CODATA2022
|
|
||||||
muD_Nuc deuteron mag. mom. to nuclear magneton ratio 8.57438234e-01 2.20000000e-09 CODATA2022
|
|
||||||
mD deuteron mass 3.34358377e-24 g 1.00000000e-33 CODATA2022
|
|
||||||
mD_E deuteron mass energy equivalent 3.00506323e-03 erg 9.10000000e-13 CODATA2022
|
|
||||||
mD_E_MeV deuteron mass energy equivalent in MeV 3.00506323e-03 erg 9.13240681e-13 CODATA2022
|
|
||||||
mD_u deuteron mass in u 3.34358377e-24 g 6.64215627e-35 CODATA2022
|
|
||||||
MD deuteron molar mass 2.01355321e+00 g / mol 6.10000000e-10 CODATA2022
|
|
||||||
muD_n deuteron-neutron mag. mom. ratio -4.48206530e-01 1.10000000e-07 CODATA2022
|
|
||||||
muD_p deuteron-proton mag. mom. ratio 3.07012209e-01 7.90000000e-10 CODATA2022
|
|
||||||
mD_p deuteron-proton mass ratio 1.99900750e+00 1.10000000e-10 CODATA2022
|
|
||||||
RrmsD deuteron rms charge radius 2.12799000e-13 cm 7.40000000e-17 CODATA2022
|
|
||||||
eps_0 electric constant 8.85418781e-12 F m^-1 1.30000000e-21 CODATA2022
|
|
||||||
qE_m electron charge to mass quotient -1.75882001e+11 C kg^-1 5.30000000e+01 CODATA2022
|
|
||||||
muE_D electron-deuteron mag. mom. ratio -2.14392349e+03 5.60000000e-06 CODATA2022
|
|
||||||
mE_D electron-deuteron mass ratio 2.72443711e-04 9.60000000e-15 CODATA2022
|
|
||||||
g_e electron g factor -2.00231930e+00 3.50000000e-13 CODATA2022
|
|
||||||
rg_e electron gyromag. ratio 1.76085963e+11 s^-1 T^-1 5.30000000e+01 CODATA2022
|
|
||||||
rg_e_2pi electron gyromag. ratio over 2 pi 2.80249516e+04 MHz T^-1 1.70000000e-04 CODATA2022
|
|
||||||
muE electron mag. mom. -9.28476470e-24 J T^-1 2.80000000e-33 CODATA2022
|
|
||||||
muE_anom electron mag. mom. anomaly 1.15965218e-03 1.80000000e-13 CODATA2022
|
|
||||||
muE_Bhor electron mag. mom. to Bohr magneton ratio -1.00115965e+00 1.80000000e-13 CODATA2022
|
|
||||||
muE_Nuc electron mag. mom. to nuclear magneton ratio -1.83828197e+03 1.10000000e-07 CODATA2022
|
|
||||||
mE electron mass 9.10938370e-28 g 2.80000000e-37 CODATA2022
|
|
||||||
mE_E electron mass energy equivalent 8.18710578e-07 erg 2.50000000e-16 CODATA2022
|
|
||||||
mE_MeV electron mass energy equivalent in MeV 8.18710578e-07 erg 2.40326495e-16 CODATA2022
|
|
||||||
mE_u electron mass in u 9.10938370e-28 g 2.65686251e-38 CODATA2022
|
|
||||||
ME electron molar mass 5.48579909e-04 g / mol 1.70000000e-13 CODATA2022
|
|
||||||
muE_mu electron-muon mag. mom. ratio 2.06766988e+02 4.60000000e-06 CODATA2022
|
|
||||||
mE_mu electron-muon mass ratio 4.83633169e-03 1.10000000e-10 CODATA2022
|
|
||||||
muE_n electron-neutron mag. mom. ratio 9.60920500e+02 2.30000000e-04 CODATA2022
|
|
||||||
mE_n electron-neutron mass ratio 5.43867344e-04 2.60000000e-13 CODATA2022
|
|
||||||
muE_p electron-proton mag. mom. ratio -6.58210688e+02 2.00000000e-07 CODATA2022
|
|
||||||
mE_p electron-proton mass ratio 5.44617021e-04 3.30000000e-14 CODATA2022
|
|
||||||
mE_tau electron-tau mass ratio 2.87585000e-04 1.90000000e-08 CODATA2022
|
|
||||||
mE_alpha electron to alpha particle mass ratio 1.37093355e-04 4.50000000e-15 CODATA2022
|
|
||||||
muE_H_shield electron to shielded helion mag. mom. ratio 8.64058257e+02 1.00000000e-05 CODATA2022
|
|
||||||
muE_p_shield electron to shielded proton mag. mom. ratio -6.58227597e+02 7.20000000e-06 CODATA2022
|
|
||||||
eV electron volt 1.60217663e-12 erg 0.00000000e+00 CODATA2022
|
|
||||||
eV_amu electron volt-atomic mass unit relationship 1.78266192e-33 g 5.31372501e-43 CODATA2022
|
|
||||||
eV_hartree electron volt-hartree relationship 3.67493222e-02 E_h 7.10000000e-14 CODATA2022
|
|
||||||
eV_Hz electron volt-hertz relationship 2.41798924e+14 1 / s 0.00000000e+00 CODATA2022
|
|
||||||
eV_invm electron volt-inverse meter relationship 8.06554394e+03 1 / cm 0.00000000e+00 CODATA2022
|
|
||||||
eV_J electron volt-joule relationship 1.60217663e-12 erg 0.00000000e+00 CODATA2022
|
|
||||||
eV_K electron volt-kelvin relationship 1.16045181e+04 K 0.00000000e+00 CODATA2022
|
|
||||||
eV_kg electron volt-kilogram relationship 1.78266192e-33 g 0.00000000e+00 CODATA2022
|
|
||||||
e elementary charge 1.60217663e-19 C 0.00000000e+00 CODATA2022
|
|
||||||
e_h elementary charge over h 2.41798926e+14 A J^-1 1.50000000e+06 CODATA2022
|
|
||||||
F Faraday constant 9.64853321e+04 C mol^-1 0.00000000e+00 CODATA2022
|
|
||||||
F_conv Faraday constant for conventional electric current 9.64853251e+04 C_90 mol^-1 1.20000000e-03 CODATA2022
|
|
||||||
G_F Fermi coupling constant 4.54379566e+00 s4 / (g2 cm4) 2.33738613e-06 CODATA2022
|
|
||||||
alpha fine-structure constant 7.29735257e-03 1.10000000e-12 CODATA2022
|
|
||||||
c1 first radiation constant 3.74177185e-05 St erg 0.00000000e+00 CODATA2022
|
|
||||||
c1L first radiation constant for spectral radiance 1.19104297e-05 St erg / rad2 0.00000000e+00 CODATA2022
|
|
||||||
Eh_amu hartree-atomic mass unit relationship 4.85087021e-32 g 1.46127438e-41 CODATA2022
|
|
||||||
Eh_eV hartree-electron volt relationship 4.35974472e-11 erg 8.49153616e-23 CODATA2022
|
|
||||||
Eh Hartree energy 4.35974472e-11 erg 8.50000000e-23 CODATA2022
|
|
||||||
Eh_E_eV Hartree energy in eV 4.35974472e-11 erg 8.49153616e-23 CODATA2022
|
|
||||||
Eh_Hz hartree-hertz relationship 6.57968392e+15 1 / s 1.30000000e+04 CODATA2022
|
|
||||||
Eh_invm hartree-inverse meter relationship 2.19474631e+05 1 / cm 4.30000000e-07 CODATA2022
|
|
||||||
Eh_J hartree-joule relationship 4.35974472e-11 erg 8.50000000e-23 CODATA2022
|
|
||||||
Eh_K hartree-kelvin relationship 3.15775025e+05 K 6.10000000e-07 CODATA2022
|
|
||||||
Eh_kg hartree-kilogram relationship 4.85087021e-32 g 9.40000000e-44 CODATA2022
|
|
||||||
mH_e helion-electron mass ratio 5.49588528e+03 2.40000000e-07 CODATA2022
|
|
||||||
mH helion mass 5.00641278e-24 g 1.50000000e-33 CODATA2022
|
|
||||||
mH_E helion mass energy equivalent 4.49953941e-03 erg 1.40000000e-12 CODATA2022
|
|
||||||
mH_E_eV helion mass energy equivalent in MeV 4.49953941e-03 erg 1.36185014e-12 CODATA2022
|
|
||||||
mH_u helion mass in u 5.00641278e-24 g 1.61072289e-34 CODATA2022
|
|
||||||
MH helion molar mass 3.01493225e+00 g / mol 9.10000000e-10 CODATA2022
|
|
||||||
mH_p helion-proton mass ratio 2.99315267e+00 1.30000000e-10 CODATA2022
|
|
||||||
Hz_amu hertz-atomic mass unit relationship 7.37249732e-48 g 2.15870079e-57 CODATA2022
|
|
||||||
Hz_eV hertz-electron volt relationship 6.62607015e-27 erg 0.00000000e+00 CODATA2022
|
|
||||||
Hz_Eh hertz-hartree relationship 1.51982985e-16 E_h 2.90000000e-28 CODATA2022
|
|
||||||
Hz_invm hertz-inverse meter relationship 3.33564095e-11 1 / cm 0.00000000e+00 CODATA2022
|
|
||||||
Hz_J hertz-joule relationship 6.62607015e-27 erg 0.00000000e+00 CODATA2022
|
|
||||||
Hz_K hertz-kelvin relationship 4.79924307e-11 K 0.00000000e+00 CODATA2022
|
|
||||||
Hz_kg hertz-kilogram relationship 7.37249732e-48 g 0.00000000e+00 CODATA2022
|
|
||||||
invalpha inverse fine-structure constant 1.37035999e+02 2.10000000e-08 CODATA2022
|
|
||||||
invm_amu inverse meter-atomic mass unit relationship 2.21021909e-39 g 6.64215627e-49 CODATA2022
|
|
||||||
invm_eV inverse meter-electron volt relationship 1.98644586e-18 erg 0.00000000e+00 CODATA2022
|
|
||||||
invm_Eh inverse meter-hartree relationship 4.55633525e-08 E_h 8.80000000e-20 CODATA2022
|
|
||||||
invm_Hz inverse meter-hertz relationship 2.99792458e+08 1 / s 0.00000000e+00 CODATA2022
|
|
||||||
invm_J inverse meter-joule relationship 1.98644586e-18 erg 0.00000000e+00 CODATA2022
|
|
||||||
invm_K inverse meter-kelvin relationship 1.43877688e-02 K 0.00000000e+00 CODATA2022
|
|
||||||
invm_kg inverse meter-kilogram relationship 2.21021909e-39 g 0.00000000e+00 CODATA2022
|
|
||||||
invG0 inverse of conductance quantum 1.29064037e+04 ohm 0.00000000e+00 CODATA2022
|
|
||||||
K_J Josephson constant 4.83597848e+14 Hz V^-1 0.00000000e+00 CODATA2022
|
|
||||||
J_amu joule-atomic mass unit relationship 1.11265006e-14 g 3.32107813e-24 CODATA2022
|
|
||||||
J_eV joule-electron volt relationship 1.00000000e+07 erg 0.00000000e+00 CODATA2022
|
|
||||||
J_Eh joule-hartree relationship 2.29371228e+17 E_h 4.50000000e+05 CODATA2022
|
|
||||||
J_Hz joule-hertz relationship 1.50919018e+33 1 / s 0.00000000e+00 CODATA2022
|
|
||||||
J_invm joule-inverse meter relationship 5.03411657e+22 1 / cm 0.00000000e+00 CODATA2022
|
|
||||||
J_K joule-kelvin relationship 7.24297052e+22 K 0.00000000e+00 CODATA2022
|
|
||||||
J_kg joule-kilogram relationship 1.11265006e-14 g 0.00000000e+00 CODATA2022
|
|
||||||
K_amu kelvin-atomic mass unit relationship 1.53617919e-37 g 4.64950939e-47 CODATA2022
|
|
||||||
K_eV kelvin-electron volt relationship 1.38064900e-16 erg 0.00000000e+00 CODATA2022
|
|
||||||
K_Eh kelvin-hartree relationship 3.16681156e-06 E_h 6.10000000e-18 CODATA2022
|
|
||||||
K_Hz kelvin-hertz relationship 2.08366191e+10 1 / s 0.00000000e+00 CODATA2022
|
|
||||||
K_invm kelvin-inverse meter relationship 6.95034800e-01 1 / cm 0.00000000e+00 CODATA2022
|
|
||||||
K_J kelvin-joule relationship 1.38064900e-16 erg 0.00000000e+00 CODATA2022
|
|
||||||
K_kg kelvin-kilogram relationship 1.53617919e-37 g 0.00000000e+00 CODATA2022
|
|
||||||
kg_amu kilogram-atomic mass unit relationship 1.00000000e+03 g 2.98897032e-07 CODATA2022
|
|
||||||
kg_eV kilogram-electron volt relationship 8.98755179e+23 erg 0.00000000e+00 CODATA2022
|
|
||||||
kg_Eh kilogram-hartree relationship 2.06148579e+34 E_h 4.00000000e+22 CODATA2022
|
|
||||||
kg_Hz kilogram-hertz relationship 1.35639249e+50 1 / s 0.00000000e+00 CODATA2022
|
|
||||||
kg_invm kilogram-inverse meter relationship 4.52443833e+39 1 / cm 0.00000000e+00 CODATA2022
|
|
||||||
kg_J kilogram-joule relationship 8.98755179e+23 erg 0.00000000e+00 CODATA2022
|
|
||||||
kg_K kilogram-kelvin relationship 6.50965726e+39 K 0.00000000e+00 CODATA2022
|
|
||||||
aSi lattice parameter of silicon 5.43102051e-08 cm 8.90000000e-16 CODATA2022
|
|
||||||
n0 Loschmidt constant (273.15 K, 101.325 kPa) 2.68678011e+19 1 / cm3 0.00000000e+00 CODATA2022
|
|
||||||
mu0 mag. constant 1.25663706e-06 N A^-2 1.90000000e-16 CODATA2022
|
|
||||||
Phi0 mag. flux quantum 2.06783385e-15 Wb 0.00000000e+00 CODATA2022
|
|
||||||
R molar gas constant 8.31446262e+07 erg / (K mol) 0.00000000e+00 CODATA2022
|
|
||||||
Mu molar mass constant 1.00000000e+00 g / mol 3.00000000e-10 CODATA2022
|
|
||||||
MC12 molar mass of carbon-12 1.20000000e+01 g / mol 3.60000000e-09 CODATA2022
|
|
||||||
h_mol molar Planck constant 3.99031271e-03 St g / mol 0.00000000e+00 CODATA2022
|
|
||||||
ch_mol molar Planck constant times c 1.19626566e+08 cm erg / mol 5.40000000e-02 CODATA2022
|
|
||||||
v_mol_ideal_100kPa molar volume of ideal gas (273.15 K, 100 kPa) 2.27109546e+04 cm3 / mol 0.00000000e+00 CODATA2022
|
|
||||||
v_mol_ideal_101.325kPa molar volume of ideal gas (273.15 K, 101.325 kPa) 2.24139695e+04 cm3 / mol 0.00000000e+00 CODATA2022
|
|
||||||
vSI_mol molar volume of silicon 1.20588320e+01 cm3 / mol 6.00000000e-07 CODATA2022
|
|
||||||
xu Mo x unit 1.00209952e-11 cm 5.30000000e-18 CODATA2022
|
|
||||||
lambda_compt_mu muon Compton wavelength 1.17344411e-12 cm 2.60000000e-20 CODATA2022
|
|
||||||
lambda_compt_mu_2pi muon Compton wavelength over 2 pi 1.86759431e-13 cm 4.20000000e-21 CODATA2022
|
|
||||||
mMu_e muon-electron mass ratio 2.06768283e+02 4.60000000e-06 CODATA2022
|
|
||||||
g_mu muon g factor -2.00233184e+00 1.30000000e-09 CODATA2022
|
|
||||||
muMu muon mag. mom. -4.49044830e-26 J T^-1 1.00000000e-33 CODATA2022
|
|
||||||
muMu_anom muon mag. mom. anomaly 1.16592089e-03 6.30000000e-10 CODATA2022
|
|
||||||
muMu_Bhor muon mag. mom. to Bohr magneton ratio -4.84197047e-03 1.10000000e-10 CODATA2022
|
|
||||||
muMu_Nuc muon mag. mom. to nuclear magneton ratio -8.89059703e+00 2.00000000e-07 CODATA2022
|
|
||||||
mMu muon mass 1.88353163e-25 g 4.20000000e-33 CODATA2022
|
|
||||||
mMu_E muon mass energy equivalent 1.69283380e-04 erg 3.80000000e-12 CODATA2022
|
|
||||||
mMu_E_MeV muon mass energy equivalent in MeV 1.69283380e-04 erg 3.68500626e-12 CODATA2022
|
|
||||||
mMu_E_u muon mass in u 1.88353163e-25 g 4.15134767e-33 CODATA2022
|
|
||||||
MMu muon molar mass 1.13428926e-01 g / mol 2.50000000e-09 CODATA2022
|
|
||||||
mMu_n muon-neutron mass ratio 1.12454517e-01 2.50000000e-09 CODATA2022
|
|
||||||
muMu_p muon-proton mag. mom. ratio -3.18334514e+00 7.10000000e-08 CODATA2022
|
|
||||||
mMu_p muon-proton mass ratio 1.12609526e-01 2.50000000e-09 CODATA2022
|
|
||||||
mMu_tau muon-tau mass ratio 5.94635000e-02 4.00000000e-06 CODATA2022
|
|
||||||
1 natural unit of action 1.05457182e-27 erg s 0.00000000e+00 CODATA2022
|
|
||||||
1_eV_s natural unit of action in eV s 1.05457182e-27 erg s 0.00000000e+00 CODATA2022
|
|
||||||
E natural unit of energy 8.18710578e-07 erg 2.50000000e-16 CODATA2022
|
|
||||||
E_MeV natural unit of energy in MeV 8.18710578e-07 erg 2.40326495e-16 CODATA2022
|
|
||||||
L natural unit of length 3.86159268e-11 cm 1.20000000e-20 CODATA2022
|
|
||||||
M natural unit of mass 9.10938370e-28 g 2.80000000e-37 CODATA2022
|
|
||||||
p natural unit of momentum 2.73092449e-17 dyn s 3.40000000e-25 CODATA2022
|
|
||||||
p_MeV_c natural unit of momentum in MeV/c 5.10998946e-01 MeV/c 3.10000000e-09 CODATA2022
|
|
||||||
t natural unit of time 1.28808867e-21 s 3.90000000e-31 CODATA2022
|
|
||||||
v natural unit of velocity 2.99792458e+10 cm / s 0.00000000e+00 CODATA2022
|
|
||||||
lambda_compt_n neutron Compton wavelength 1.31959091e-13 cm 7.50000000e-23 CODATA2022
|
|
||||||
lambda_compt_n_2pi neutron Compton wavelength over 2 pi 2.10019415e-14 cm 1.40000000e-23 CODATA2022
|
|
||||||
muN_e neutron-electron mag. mom. ratio 1.04066882e-03 2.50000000e-10 CODATA2022
|
|
||||||
mN_e neutron-electron mass ratio 1.83868366e+03 8.90000000e-07 CODATA2022
|
|
||||||
g_n neutron g factor -3.82608545e+00 9.00000000e-07 CODATA2022
|
|
||||||
rg_n neutron gyromag. ratio 1.83247171e+08 s^-1 T^-1 4.30000000e+01 CODATA2022
|
|
||||||
rg_n_2pi neutron gyromag. ratio over 2 pi 2.91646933e+01 MHz T^-1 6.90000000e-06 CODATA2022
|
|
||||||
muN neutron mag. mom. -9.66236510e-27 J T^-1 2.30000000e-33 CODATA2022
|
|
||||||
muN_Bhor neutron mag. mom. to Bohr magneton ratio -1.04187563e-03 2.50000000e-10 CODATA2022
|
|
||||||
muN_Nuc neutron mag. mom. to nuclear magneton ratio -1.91304273e+00 4.50000000e-07 CODATA2022
|
|
||||||
mN neutron mass 1.67492750e-24 g 9.50000000e-34 CODATA2022
|
|
||||||
mN_E neutron mass energy equivalent 1.50534976e-03 erg 8.60000000e-13 CODATA2022
|
|
||||||
mN_E_MeV neutron mass energy equivalent in MeV 1.50534976e-03 erg 8.65175382e-13 CODATA2022
|
|
||||||
mN_u neutron mass in u 1.67492750e-24 g 8.13664143e-34 CODATA2022
|
|
||||||
MN neutron molar mass 1.00866492e+00 g / mol 5.70000000e-10 CODATA2022
|
|
||||||
mN_mu neutron-muon mass ratio 8.89248406e+00 2.00000000e-07 CODATA2022
|
|
||||||
muN_p neutron-proton mag. mom. ratio -6.84979340e-01 1.60000000e-07 CODATA2022
|
|
||||||
mN_p neutron-proton mass ratio 1.00137842e+00 4.90000000e-10 CODATA2022
|
|
||||||
mN_tau neutron-tau mass ratio 5.28779000e-01 3.60000000e-05 CODATA2022
|
|
||||||
muN_p_shield neutron to shielded proton mag. mom. ratio -6.84996940e-01 1.60000000e-07 CODATA2022
|
|
||||||
G Newtonian constant of gravitation 6.67430000e-08 cm3 / (g s2) 1.50000000e-12 CODATA2022
|
|
||||||
G_hbar_c Newtonian constant of gravitation over h-bar c 6.70883000e-39 (GeV/c^2)^-2 1.50000000e-43 CODATA2022
|
|
||||||
mu_N nuclear magneton 5.05078375e-27 J T^-1 1.50000000e-36 CODATA2022
|
|
||||||
mu_N_eV_T nuclear magneton in eV/T 3.15245126e-08 eV T^-1 9.60000000e-18 CODATA2022
|
|
||||||
mu_N_invm_T nuclear magneton in inverse meters per tesla 2.54262343e-02 m^-1 T^-1 1.60000000e-10 CODATA2022
|
|
||||||
mu_N_K_T nuclear magneton in K/T 3.65826778e-04 K T^-1 1.10000000e-13 CODATA2022
|
|
||||||
mu_N_MHz_T nuclear magneton in MHz/T 7.62259323e+00 MHz T^-1 2.30000000e-09 CODATA2022
|
|
||||||
h Planck constant 6.62607015e-27 erg s 0.00000000e+00 CODATA2022
|
|
||||||
h_eV_s Planck constant in eV s 6.62607009e-27 erg s 4.00544159e-35 CODATA2022
|
|
||||||
hbar Planck constant over 2 pi 1.05457180e-27 erg s 1.30000000e-35 CODATA2022
|
|
||||||
hbar_eV_s Planck constant over 2 pi in eV s 1.05457181e-27 erg s 6.40870654e-36 CODATA2022
|
|
||||||
chbar_MeV Planck constant over 2 pi times c in MeV fm 3.16152675e-17 cm erg 1.92261196e-25 CODATA2022
|
|
||||||
planck_length Planck length 1.61625500e-33 cm 1.80000000e-38 CODATA2022
|
|
||||||
planck_mass Planck mass 2.17643400e-05 g 2.40000000e-10 CODATA2022
|
|
||||||
planck_mass_E_GeV Planck mass energy equivalent in GeV 1.95608143e+16 erg 2.24304729e+11 CODATA2022
|
|
||||||
planck_temp Planck temperature 1.41678400e+32 K 1.60000000e+27 CODATA2022
|
|
||||||
plank_time Planck time 5.39124700e-44 s 6.00000000e-49 CODATA2022
|
|
||||||
qP_mP proton charge to mass quotient 9.57883316e+07 C kg^-1 2.90000000e-02 CODATA2022
|
|
||||||
lambda_compt_p proton Compton wavelength 1.32140986e-13 cm 4.00000000e-23 CODATA2022
|
|
||||||
lambda_compt_p_2pi proton Compton wavelength over 2 pi 2.10308910e-14 cm 9.70000000e-24 CODATA2022
|
|
||||||
mP_e proton-electron mass ratio 1.83615267e+03 1.10000000e-07 CODATA2022
|
|
||||||
g_p proton g factor 5.58569469e+00 1.60000000e-09 CODATA2022
|
|
||||||
rg_p proton gyromag. ratio 2.67522187e+08 s^-1 T^-1 1.10000000e-01 CODATA2022
|
|
||||||
rg_p_2pi proton gyromag. ratio over 2 pi 4.25774789e+01 MHz T^-1 2.90000000e-07 CODATA2022
|
|
||||||
muP proton mag. mom. 1.41060680e-26 J T^-1 6.00000000e-36 CODATA2022
|
|
||||||
muP_Bhor proton mag. mom. to Bohr magneton ratio 1.52103220e-03 4.60000000e-13 CODATA2022
|
|
||||||
muP_Nuc proton mag. mom. to nuclear magneton ratio 2.79284734e+00 8.20000000e-10 CODATA2022
|
|
||||||
muP_shield proton mag. shielding correction 2.56890000e-05 1.10000000e-08 CODATA2022
|
|
||||||
mP proton mass 1.67262192e-24 g 5.10000000e-34 CODATA2022
|
|
||||||
mP_E proton mass energy equivalent 1.50327762e-03 erg 4.60000000e-13 CODATA2022
|
|
||||||
mP_E_MeV proton mass energy equivalent in MeV 1.50327762e-03 erg 4.64631224e-13 CODATA2022
|
|
||||||
mP_u proton mass in u 1.67262192e-24 g 8.80085705e-35 CODATA2022
|
|
||||||
MP proton molar mass 1.00727647e+00 g / mol 3.10000000e-10 CODATA2022
|
|
||||||
mP_mu proton-muon mass ratio 8.88024337e+00 2.00000000e-07 CODATA2022
|
|
||||||
muP_n proton-neutron mag. mom. ratio -1.45989805e+00 3.40000000e-07 CODATA2022
|
|
||||||
mP_n proton-neutron mass ratio 9.98623478e-01 4.90000000e-10 CODATA2022
|
|
||||||
RrmsP proton rms charge radius 8.41400000e-14 cm 1.90000000e-16 CODATA2022
|
|
||||||
mP_tau proton-tau mass ratio 5.28051000e-01 3.60000000e-05 CODATA2022
|
|
||||||
kappa quantum of circulation 3.63694755e+00 cm2 / s 1.10000000e-09 CODATA2022
|
|
||||||
2kappa quantum of circulation times 2 7.27389510e+00 cm2 / s 2.20000000e-09 CODATA2022
|
|
||||||
Rinf Rydberg constant 1.09737316e+05 1 / cm 2.10000000e-07 CODATA2022
|
|
||||||
cRinf_Hz Rydberg constant times c in Hz 3.28984196e+15 1 / s 6.40000000e+03 CODATA2022
|
|
||||||
hcRinf_eV Rydberg constant times hc in eV 2.17987236e-11 erg 4.16565925e-23 CODATA2022
|
|
||||||
hcRinf_J Rydberg constant times hc in J 2.17987236e-11 erg 4.20000000e-23 CODATA2022
|
|
||||||
S0_R_100kPa Sackur-Tetrode constant (1 K, 100 kPa) -1.15170754e+00 4.50000000e-10 CODATA2022
|
|
||||||
S0_R_101.325kPa Sackur-Tetrode constant (1 K, 101.325 kPa) -1.16487052e+00 4.50000000e-10 CODATA2022
|
|
||||||
c2 second radiation constant 1.43877688e+00 K cm 0.00000000e+00 CODATA2022
|
|
||||||
rg_h_shield shielded helion gyromag. ratio 2.03789457e+08 s^-1 T^-1 2.40000000e+00 CODATA2022
|
|
||||||
rg_h_shield_2pi shielded helion gyromag. ratio over 2 pi 3.24340997e+01 MHz T^-1 4.30000000e-07 CODATA2022
|
|
||||||
muH_shield shielded helion mag. mom. -1.07455309e-26 J T^-1 1.30000000e-34 CODATA2022
|
|
||||||
muH_shield_Bhor shielded helion mag. mom. to Bohr magneton ratio -1.15867147e-03 1.40000000e-11 CODATA2022
|
|
||||||
muH_shield_Nuc shielded helion mag. mom. to nuclear magneton rati -2.12749772e+00 2.50000000e-08 CODATA2022
|
|
||||||
muH_shield_p shielded helion to proton mag. mom. ratio -7.61766562e-01 8.90000000e-09 CODATA2022
|
|
||||||
muH_shield_p_shield shielded helion to shielded proton mag. mom. ratio -7.61786131e-01 3.30000000e-09 CODATA2022
|
|
||||||
rg_p_shield shielded proton gyromag. ratio 2.67515315e+08 s^-1 T^-1 2.90000000e+00 CODATA2022
|
|
||||||
rg_p_shield_2pi shielded proton gyromag. ratio over 2 pi 4.25763851e+01 MHz T^-1 5.30000000e-07 CODATA2022
|
|
||||||
muP_shield shielded proton mag. mom. 1.41057056e-26 J T^-1 1.50000000e-34 CODATA2022
|
|
||||||
muP_shield_Bhor shielded proton mag. mom. to Bohr magneton ratio 1.52099313e-03 1.70000000e-11 CODATA2022
|
|
||||||
muP_shield_Nuc shielded proton mag. mom. to nuclear magneton rati 2.79277560e+00 3.00000000e-08 CODATA2022
|
|
||||||
c speed of light in vacuum 2.99792458e+10 cm / s 0.00000000e+00 CODATA2022
|
|
||||||
g standard acceleration of gravity 9.80665000e+02 cm / s2 0.00000000e+00 CODATA2022
|
|
||||||
atm standard atmosphere 1.01325000e+06 P / s 0.00000000e+00 CODATA2022
|
|
||||||
sigma Stefan-Boltzmann constant 5.67037442e-05 g / (s3 K4) 0.00000000e+00 CODATA2022
|
|
||||||
lambda_compt_tau tau Compton wavelength 6.97771000e-14 cm 4.70000000e-18 CODATA2022
|
|
||||||
lambda_compt_tau_2pi tau Compton wavelength over 2 pi 1.11056000e-14 cm 1.00000000e-18 CODATA2022
|
|
||||||
mTau_e tau-electron mass ratio 3.47723000e+03 2.30000000e-01 CODATA2022
|
|
||||||
mTau tau mass 3.16754000e-24 g 2.10000000e-28 CODATA2022
|
|
||||||
mTau_E tau mass energy equivalent 2.84684000e-03 erg 1.90000000e-07 CODATA2022
|
|
||||||
mTau_E_MeV tau mass energy equivalent in MeV 2.84677949e-03 erg 2.56348261e-07 CODATA2022
|
|
||||||
mTau_u tau mass in u 3.16754469e-24 g 2.15870079e-28 CODATA2022
|
|
||||||
MTau tau molar mass 1.90754000e+00 g / mol 1.30000000e-04 CODATA2022
|
|
||||||
mTau_mu tau-muon mass ratio 1.68170000e+01 1.10000000e-03 CODATA2022
|
|
||||||
mTau_n tau-neutron mass ratio 1.89115000e+00 1.30000000e-04 CODATA2022
|
|
||||||
mTau_p tau-proton mass ratio 1.89376000e+00 1.30000000e-04 CODATA2022
|
|
||||||
sigma_T Thomson cross section 6.65245873e-25 cm2 6.00000000e-34 CODATA2022
|
|
||||||
muPsi_e triton-electron mag. mom. ratio -1.62051442e-03 2.10000000e-11 CODATA2022
|
|
||||||
mPsi_e triton-electron mass ratio 5.49692154e+03 2.70000000e-07 CODATA2022
|
|
||||||
g_psi triton g factor 5.95792493e+00 1.20000000e-08 CODATA2022
|
|
||||||
muPsi triton mag. mom. 1.50460952e-26 J T^-1 3.00000000e-35 CODATA2022
|
|
||||||
muPsi_Bhor triton mag. mom. to Bohr magneton ratio 1.62239367e-03 3.20000000e-12 CODATA2022
|
|
||||||
muPsi_Nuc triton mag. mom. to nuclear magneton ratio 2.97896247e+00 5.90000000e-09 CODATA2022
|
|
||||||
mPsi triton mass 5.00735674e-24 g 1.50000000e-33 CODATA2022
|
|
||||||
mPsi_E triton mass energy equivalent 4.50038781e-03 erg 1.40000000e-12 CODATA2022
|
|
||||||
mPsi_E_MeV triton mass energy equivalent in MeV 4.50038781e-03 erg 1.36185014e-12 CODATA2022
|
|
||||||
mPsi_u triton mass in u 5.00735674e-24 g 1.99264688e-34 CODATA2022
|
|
||||||
MPsi triton molar mass 3.01550072e+00 g / mol 9.20000000e-10 CODATA2022
|
|
||||||
muPsi_n triton-neutron mag. mom. ratio -1.55718553e+00 3.70000000e-07 CODATA2022
|
|
||||||
muPsi_p triton-proton mag. mom. ratio 1.06663991e+00 1.00000000e-08 CODATA2022
|
|
||||||
mPsi_p triton-proton mass ratio 2.99371703e+00 1.50000000e-10 CODATA2022
|
|
||||||
u unified atomic mass unit 1.66053907e-24 g 5.00000000e-34 CODATA2022
|
|
||||||
R_K von Klitzing constant 2.58128075e+04 ohm 0.00000000e+00 CODATA2022
|
|
||||||
theta_W weak mixing angle 2.22900000e-01 3.00000000e-04 CODATA2022
|
|
||||||
b_freq Wien frequency displacement law constant 5.87892576e+10 1 / (K s) 0.00000000e+00 CODATA2022
|
|
||||||
b_lambda Wien wavelength displacement law constant 2.89777196e-01 K cm 0.00000000e+00 CODATA2022
|
|
||||||
auMom_um atomic unit of mom.um 1.99285188e-19 dyn s 2.40000000e-27 CODATA2022
|
|
||||||
mE_h electron-helion mass ratio 1.81954307e-04 7.90000000e-15 CODATA2022
|
|
||||||
mE_psi electron-triton mass ratio 1.81920006e-04 9.00000000e-15 CODATA2022
|
|
||||||
g_h helion g factor -4.25525061e+00 5.00000000e-08 CODATA2022
|
|
||||||
muH helion mag. mom. -1.07461753e-26 J T^-1 1.30000000e-34 CODATA2022
|
|
||||||
muH_Bhor helion mag. mom. to Bohr magneton ratio -1.15874096e-03 1.40000000e-11 CODATA2022
|
|
||||||
muH_Nuc helion mag. mom. to nuclear magneton ratio -2.12762531e+00 2.50000000e-08 CODATA2022
|
|
||||||
n0 Loschmidt constant (273.15 K, 100 kPa) 2.65164580e+19 1 / cm3 0.00000000e+00 CODATA2022
|
|
||||||
p_um natural unit of mom.um 2.73092449e-17 dyn s 3.40000000e-25 CODATA2022
|
|
||||||
p_um_MeV_c natural unit of mom.um in MeV/c 5.10998946e-01 MeV/c 3.10000000e-09 CODATA2022
|
|
||||||
mN-mP neutron-proton mass difference 2.30557435e-27 g 8.20000000e-34 CODATA2022
|
|
||||||
mN-mP_E neutron-proton mass difference energy equivalent 2.07214689e-06 erg 7.40000000e-13 CODATA2022
|
|
||||||
mN-mP_E_MeV neutron-proton mass difference energy equivalent i 2.07214689e-06 erg 7.37001252e-13 CODATA2022
|
|
||||||
mN-mP_u neutron-proton mass difference in u 2.30557435e-27 g 8.13664143e-34 CODATA2022
|
|
||||||
stp standard-state pressure 1.00000000e+06 P / s 0.00000000e+00 CODATA2022
|
|
||||||
mAlpha alpha particle relative atomic mass 4.00150618e+00 6.30000000e-11 CODATA2022
|
|
||||||
muB_invm_T Bohr magneton in inverse meter per tesla 4.66864478e+01 m^-1 T^-1 1.40000000e-08 CODATA2022
|
|
||||||
kB_invm Boltzmann constant in inverse meter per kelvin 6.95034800e-01 1 / (K cm) 0.00000000e+00 CODATA2022
|
|
||||||
ampere-90 conventional value of ampere-90 1.00000009e+00 A 0.00000000e+00 CODATA2022
|
|
||||||
coulomb-90 conventional value of coulomb-90 1.00000009e+00 C 0.00000000e+00 CODATA2022
|
|
||||||
farad-90 conventional value of farad-90 9.99999982e-01 F 0.00000000e+00 CODATA2022
|
|
||||||
henry-90 conventional value of henry-90 1.00000002e+00 H 0.00000000e+00 CODATA2022
|
|
||||||
ohm-90 conventional value of ohm-90 1.00000002e+00 ohm 0.00000000e+00 CODATA2022
|
|
||||||
volt-90 conventional value of volt-90 1.00000011e+00 V 0.00000000e+00 CODATA2022
|
|
||||||
watt-90 conventional value of watt-90 1.00000020e+07 erg / s 0.00000000e+00 CODATA2022
|
|
||||||
mD_amu_rel deuteron relative atomic mass 2.01355321e+00 4.00000000e-11 CODATA2022
|
|
||||||
rg_e_MHz_T electron gyromag. ratio in MHz/T 2.80249514e+04 MHz T^-1 8.50000000e-06 CODATA2022
|
|
||||||
mE_amu_rel electron relative atomic mass 5.48579909e-04 1.60000000e-14 CODATA2022
|
|
||||||
e_hbar elementary charge over h-bar 1.51926745e+15 A J^-1 0.00000000e+00 CODATA2022
|
|
||||||
mH_amu_rel helion relative atomic mass 3.01493225e+00 9.70000000e-11 CODATA2022
|
|
||||||
h_shield_shift helion shielding shift 5.99674300e-05 1.00000000e-10 CODATA2022
|
|
||||||
F_hyperfine_Cs-133 hyperfine transition frequency of Cs-133 9.19263177e+09 1 / s 0.00000000e+00 CODATA2022
|
|
||||||
aSi_220_ideal lattice spacing of ideal Si (220) 1.92015572e-08 cm 3.20000000e-16 CODATA2022
|
|
||||||
eta luminous efficacy 6.83000000e-05 s3 rad2 cd/(g cm2) 0.00000000e+00 CODATA2022
|
|
||||||
rg_n_MHz_T neutron gyromag. ratio in MHz/T 2.91646931e+01 MHz T^-1 6.90000000e-06 CODATA2022
|
|
||||||
mN_amu_rel neutron relative atomic mass 1.00866492e+00 4.90000000e-10 CODATA2022
|
|
||||||
mu_N_invm nuclear magneton in inverse meter per tesla 2.54262341e-02 m^-1 T^-1 7.80000000e-12 CODATA2022
|
|
||||||
h_eV_Hz Planck constant in eV/Hz 6.62607015e-27 erg s 0.00000000e+00 CODATA2022
|
|
||||||
rg_p_MHz_T proton gyromag. ratio in MHz/T 4.25774785e+01 MHz T^-1 1.80000000e-08 CODATA2022
|
|
||||||
mP_amu_rel proton relative atomic mass 1.00727647e+00 5.30000000e-11 CODATA2022
|
|
||||||
lambda_compt_bar reduced Compton wavelength 3.86159268e-11 cm 1.20000000e-20 CODATA2022
|
|
||||||
lambda_compt_mu_bar reduced muon Compton wavelength 1.86759431e-13 cm 4.20000000e-21 CODATA2022
|
|
||||||
lambda_compt_n_bar reduced neutron Compton wavelength 2.10019416e-14 cm 1.20000000e-23 CODATA2022
|
|
||||||
hbar reduced Planck constant 1.05457182e-27 erg s 0.00000000e+00 CODATA2022
|
|
||||||
hbar_eV_s reduced Planck constant in eV s 1.05457182e-27 erg s 0.00000000e+00 CODATA2022
|
|
||||||
chbar_MeV reduced Planck constant times c in MeV fm 3.16152677e-17 cm erg 0.00000000e+00 CODATA2022
|
|
||||||
lambda_compt_p_bar reduced proton Compton wavelength 2.10308910e-14 cm 6.40000000e-24 CODATA2022
|
|
||||||
lambda_compt_tau_bar reduced tau Compton wavelength 1.11053800e-14 cm 7.50000000e-19 CODATA2022
|
|
||||||
rg_h_shield_MHz_T shielded helion gyromag. ratio in MHz/T 3.24340994e+01 MHz T^-1 3.80000000e-07 CODATA2022
|
|
||||||
rg_p_shield_MHz_T shielded proton gyromag. ratio in MHz/T 4.25763847e+01 MHz T^-1 4.60000000e-07 CODATA2022
|
|
||||||
d_shield-p_shield_HD shielding difference of d and p in HD 2.02000000e-08 2.00000000e-11 CODATA2022
|
|
||||||
t_shield-p_shield_HT shielding difference of t and p in HT 2.41400000e-08 2.00000000e-11 CODATA2022
|
|
||||||
tau_E tau energy equivalent 2.84684357e-03 erg 1.92261196e-07 CODATA2022
|
|
||||||
psi_amu_rel triton relative atomic mass 3.01550072e+00 1.20000000e-10 CODATA2022
|
|
||||||
muPsi_p triton to proton mag. mom. ratio 1.06663992e+00 2.10000000e-09 CODATA2022
|
|
||||||
epsilon0 vacuum electric permittivity 8.85418781e-12 F m^-1 1.30000000e-21 CODATA2022
|
|
||||||
mu0 vacuum mag. permeability 1.25663706e-06 N A^-2 1.90000000e-16 CODATA2022
|
|
||||||
mWZ W to Z mass ratio 8.81530000e-01 1.70000000e-04 CODATA2022
|
|
||||||
au Astronomical Unit 1.49597871e+13 cm 0.00000000e+00 IAU 2012 Resolution B2
|
|
||||||
pc Parsec 3.08567758e+18 cm 0.00000000e+00 Derived from au + IAU 2015 Resolution B 2 note [4]
|
|
||||||
kpc Kiloparsec 3.08567758e+21 cm 0.00000000e+00 Derived from au + IAU 2015 Resolution B 2 note [4]
|
|
||||||
L_bol0 Luminosity for absolute bolometric magnitude 0 3.01280000e+35 erg / s 0.00000000e+00 IAU 2015 Resolution B 2
|
|
||||||
L_sun Nominal solar luminosity 3.82800000e+33 erg / s 0.00000000e+00 IAU 2015 Resolution B 3
|
|
||||||
GM_sun Nominal solar mass parameter 1.32712440e+26 cm3 / s2 0.00000000e+00 IAU 2015 Resolution B 3
|
|
||||||
M_sun Solar mass 1.98840987e+33 g 4.46880543e+28 IAU 2015 Resolution B 3 + CODATA 2018
|
|
||||||
R_sun Nominal solar radius 6.95700000e+10 cm 0.00000000e+00 IAU 2015 Resolution B 3
|
|
||||||
GM_jup Nominal Jupiter mass parameter 1.26686530e+23 cm3 / s2 0.00000000e+00 IAU 2015 Resolution B 3
|
|
||||||
M_jup Jupiter mass 1.89812460e+30 g 4.26589589e+25 IAU 2015 Resolution B 3 + CODATA 2018
|
|
||||||
R_jup Nominal Jupiter equatorial radius 7.14920000e+09 cm 0.00000000e+00 IAU 2015 Resolution B 3
|
|
||||||
GM_earth Nominal Earth mass parameter 3.98600400e+20 cm3 / s2 0.00000000e+00 IAU 2015 Resolution B 3
|
|
||||||
M_earth Earth mass 5.97216787e+27 g 1.34220095e+23 IAU 2015 Resolution B 3 + CODATA 2018
|
|
||||||
R_earth Nominal Earth equatorial radius 6.37810000e+08 cm 0.00000000e+00 IAU 2015 Resolution B 3
|
|
||||||
MeV_to_erg MeV to erg conversion factor 1.60217663e-06 erg 0.00000000e+00 Unit Conversion Factor
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
if [ "$#" -ne 2 ]; then
|
|
||||||
echo "Usage: $0 <input_file> <output_file>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
input_file="$1"
|
|
||||||
output_file="$2"
|
|
||||||
printf 'const char embeddedConstants[] = R"(' > "$output_file"
|
|
||||||
cat "$input_file" >> "$output_file"
|
|
||||||
printf ')";\n' >> "$output_file"
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
data_file = files('const.dat')
|
|
||||||
command_file = files('format.sh')
|
|
||||||
output_file = meson.current_build_dir() + '/embedded_constants.h'
|
|
||||||
|
|
||||||
embedded_constants_h = custom_target('embed_constants',
|
|
||||||
input: data_file,
|
|
||||||
output: 'embedded_constants.h',
|
|
||||||
command: ['sh', '-c', command_file[0].full_path()+' @INPUT@ ' + output_file, '@INPUT@', '@OUTPUT@']
|
|
||||||
)
|
|
||||||
|
|
||||||
# Ensure the generated header is included
|
|
||||||
const_data_header = include_directories('.')
|
|
||||||
|
|
||||||
const_data_dep = declare_dependency(
|
|
||||||
include_directories: const_data_header,
|
|
||||||
sources: embedded_constants_h
|
|
||||||
)
|
|
||||||
@@ -1,3 +1 @@
|
|||||||
subdir('const')
|
subdir('reaclib')
|
||||||
subdir('atomic')
|
|
||||||
subdir('reaclib')
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "cppad/cppad.hpp"
|
#include "cppad/cppad.hpp"
|
||||||
|
|
||||||
namespace serif::network::reaclib {
|
namespace gridfire::reaclib {
|
||||||
/**
|
/**
|
||||||
* @struct RateFitSet
|
* @struct RateFitSet
|
||||||
* @brief Holds the seven fitting parameters for a single REACLIB rate set.
|
* @brief Holds the seven fitting parameters for a single REACLIB rate set.
|
||||||
@@ -33,8 +33,8 @@ namespace serif::network::reaclib {
|
|||||||
private:
|
private:
|
||||||
std::string m_id; ///< Unique identifier for the reaction, generated by the Python script.
|
std::string m_id; ///< Unique identifier for the reaction, generated by the Python script.
|
||||||
int m_chapter; ///< Chapter number from the REACLIB database, defining the reaction structure.
|
int m_chapter; ///< Chapter number from the REACLIB database, defining the reaction structure.
|
||||||
std::vector<serif::atomic::Species> m_reactantNames; ///< Names of the reactant species involved in the reaction.
|
std::vector<fourdst::atomic::Species> m_reactantNames; ///< Names of the reactant species involved in the reaction.
|
||||||
std::vector<serif::atomic::Species> m_productNames; ///< Names of the product species produced by the reaction.
|
std::vector<fourdst::atomic::Species> m_productNames; ///< Names of the product species produced by the reaction.
|
||||||
double m_qValue; ///< Q-value of the reaction in MeV, representing the energy released or absorbed.
|
double m_qValue; ///< Q-value of the reaction in MeV, representing the energy released or absorbed.
|
||||||
std::string m_sourceLabel; ///< Source label for the rate data, indicating the origin of the rate coefficients (e.g., "wc12w", "st08").
|
std::string m_sourceLabel; ///< Source label for the rate data, indicating the origin of the rate coefficients (e.g., "wc12w", "st08").
|
||||||
RateFitSet m_rateSets; ///< Fitting coefficients for the reaction rate, containing the seven parameters used in the rate calculation.
|
RateFitSet m_rateSets; ///< Fitting coefficients for the reaction rate, containing the seven parameters used in the rate calculation.
|
||||||
@@ -57,8 +57,8 @@ namespace serif::network::reaclib {
|
|||||||
REACLIBReaction(
|
REACLIBReaction(
|
||||||
std::string id,
|
std::string id,
|
||||||
int chapter,
|
int chapter,
|
||||||
std::vector<serif::atomic::Species> reactants,
|
std::vector<fourdst::atomic::Species> reactants,
|
||||||
std::vector<serif::atomic::Species> products,
|
std::vector<fourdst::atomic::Species> products,
|
||||||
double qValue,
|
double qValue,
|
||||||
std::string label,
|
std::string label,
|
||||||
RateFitSet sets,
|
RateFitSet sets,
|
||||||
@@ -89,9 +89,9 @@ namespace serif::network::reaclib {
|
|||||||
|
|
||||||
[[nodiscard]] int chapter() const { return m_chapter; }
|
[[nodiscard]] int chapter() const { return m_chapter; }
|
||||||
|
|
||||||
[[nodiscard]] const std::vector<serif::atomic::Species>& reactants() const { return m_reactantNames; }
|
[[nodiscard]] const std::vector<fourdst::atomic::Species>& reactants() const { return m_reactantNames; }
|
||||||
|
|
||||||
[[nodiscard]] const std::vector<serif::atomic::Species>& products() const { return m_productNames; }
|
[[nodiscard]] const std::vector<fourdst::atomic::Species>& products() const { return m_productNames; }
|
||||||
|
|
||||||
[[nodiscard]] double qValue() const { return m_qValue; }
|
[[nodiscard]] double qValue() const { return m_qValue; }
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ namespace serif::network::reaclib {
|
|||||||
return m_reactions.end();
|
return m_reactions.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool containsSpecies(const serif::atomic::Species &species) const {
|
bool containsSpecies(const fourdst::atomic::Species &species) const {
|
||||||
for (const auto& reaction : m_reactions) {
|
for (const auto& reaction : m_reactions) {
|
||||||
if (std::ranges::find(reaction.reactants(), species) != reaction.reactants().end() ||
|
if (std::ranges::find(reaction.reactants(), species) != reaction.reactants().end() ||
|
||||||
std::ranges::find(reaction.products(), species) != reaction.products().end()) {
|
std::ranges::find(reaction.products(), species) != reaction.products().end()) {
|
||||||
@@ -238,8 +238,8 @@ namespace serif::network::reaclib {
|
|||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template<>
|
template<>
|
||||||
struct hash<serif::network::reaclib::REACLIBReaction> {
|
struct hash<gridfire::reaclib::REACLIBReaction> {
|
||||||
size_t operator()(const serif::network::reaclib::REACLIBReaction& r) const noexcept {
|
size_t operator()(const gridfire::reaclib::REACLIBReaction& r) const noexcept {
|
||||||
return std::hash<std::string>()(r.id());
|
return std::hash<std::string>()(r.id());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
7
build-config/fourdst/libcomposition/meson.build
Normal file
7
build-config/fourdst/libcomposition/meson.build
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
composition_p = subproject('libcomposition')
|
||||||
|
comp_dep = composition_p.get_variable('composition_dep')
|
||||||
|
spw_dep = composition_p.get_variable('species_weight_dep')
|
||||||
|
composition_dep = [
|
||||||
|
comp_dep,
|
||||||
|
spw_dep,
|
||||||
|
]
|
||||||
2
build-config/fourdst/libconfig/meson.build
Normal file
2
build-config/fourdst/libconfig/meson.build
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
config_p = subproject('libconfig')
|
||||||
|
config_dep = config_p.get_variable('config_dep')
|
||||||
2
build-config/fourdst/libconstants/meson.build
Normal file
2
build-config/fourdst/libconstants/meson.build
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
const_p = subproject('libconstants')
|
||||||
|
const_dep = const_p.get_variable('const_dep')
|
||||||
6
build-config/fourdst/liblogging/meson.build
Normal file
6
build-config/fourdst/liblogging/meson.build
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
logging_p = subproject('liblogging')
|
||||||
|
|
||||||
|
logging_dep = logging_p.get_variable('logging_dep')
|
||||||
|
quill_dep = logging_p.get_variable('quill_dep')
|
||||||
|
|
||||||
|
log_dep = [logging_dep, quill_dep]
|
||||||
4
build-config/fourdst/meson.build
Normal file
4
build-config/fourdst/meson.build
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
subdir('libconstants')
|
||||||
|
subdir('liblogging')
|
||||||
|
subdir('libconfig')
|
||||||
|
subdir('libcomposition')
|
||||||
7
build-config/meson.build
Normal file
7
build-config/meson.build
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
cmake = import('cmake')
|
||||||
|
|
||||||
|
subdir('fourdst')
|
||||||
|
subdir('boost')
|
||||||
|
subdir('cppad')
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
if get_option('build_python')
|
|
||||||
pybind11_proj = subproject('pybind11')
|
|
||||||
pybind11_dep = pybind11_proj.get_variable('pybind11_dep')
|
|
||||||
python3_dep = dependency('python3')
|
|
||||||
endif
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
quill_cmake_options = cmake.subproject_options()
|
|
||||||
quill_cmake_options.add_cmake_defines({
|
|
||||||
'BUILD_SHARED_LIBS': 'ON',
|
|
||||||
'CMAKE_SKIP_INSTALL_RULES': 'ON'
|
|
||||||
})
|
|
||||||
quill_sp = cmake.subproject(
|
|
||||||
'quill',
|
|
||||||
options: quill_cmake_options,
|
|
||||||
)
|
|
||||||
quill_dep = quill_sp.dependency('quill')
|
|
||||||
@@ -14,14 +14,11 @@ network_headers = files(
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
boost_dep,
|
boost_dep,
|
||||||
const_dep,
|
const_dep,
|
||||||
quill_dep,
|
|
||||||
mfem_dep,
|
|
||||||
config_dep,
|
config_dep,
|
||||||
probe_dep,
|
|
||||||
species_weight_dep,
|
|
||||||
composition_dep,
|
composition_dep,
|
||||||
reaclib_reactions_dep,
|
reaclib_reactions_dep,
|
||||||
cppad_dep,
|
cppad_dep,
|
||||||
|
log_dep
|
||||||
]
|
]
|
||||||
|
|
||||||
# Define the libnetwork library so it can be linked against by other parts of the build system
|
# Define the libnetwork library so it can be linked against by other parts of the build system
|
||||||
@@ -39,4 +36,4 @@ network_dep = declare_dependency(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Make headers accessible
|
# Make headers accessible
|
||||||
install_headers(network_headers, subdir : '4DSSE/network')
|
install_headers(network_headers, subdir : '4DSSE/network')
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ The coefficients to the fit are from reaclib.jinaweb.org .
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace serif::network::approx8{
|
namespace gridfire::approx8{
|
||||||
|
|
||||||
// using namespace std;
|
// using namespace std;
|
||||||
using namespace boost::numeric::odeint;
|
using namespace boost::numeric::odeint;
|
||||||
@@ -245,7 +245,7 @@ namespace serif::network::approx8{
|
|||||||
// a Jacobian matrix for implicit solvers
|
// a Jacobian matrix for implicit solvers
|
||||||
|
|
||||||
void Jacobian::operator() ( const vector_type &y, matrix_type &J, double /* t */, vector_type &dfdt ) const {
|
void Jacobian::operator() ( const vector_type &y, matrix_type &J, double /* t */, vector_type &dfdt ) const {
|
||||||
serif::constant::Constants& constants = serif::constant::Constants::getInstance();
|
fourdst::constant::Constants& constants = fourdst::constant::Constants::getInstance();
|
||||||
const double avo = constants.get("N_a").value;
|
const double avo = constants.get("N_a").value;
|
||||||
const double clight = constants.get("c").value;
|
const double clight = constants.get("c").value;
|
||||||
// EOS
|
// EOS
|
||||||
@@ -350,7 +350,7 @@ namespace serif::network::approx8{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ODE::operator() ( const vector_type &y, vector_type &dydt, double /* t */) const {
|
void ODE::operator() ( const vector_type &y, vector_type &dydt, double /* t */) const {
|
||||||
const serif::constant::Constants& constants = serif::constant::Constants::getInstance();
|
const fourdst::constant::Constants& constants = fourdst::constant::Constants::getInstance();
|
||||||
const double avo = constants.get("N_a").value;
|
const double avo = constants.get("N_a").value;
|
||||||
const double clight = constants.get("c").value;
|
const double clight = constants.get("c").value;
|
||||||
|
|
||||||
@@ -501,7 +501,7 @@ namespace serif::network::approx8{
|
|||||||
netOut.num_steps = num_steps;
|
netOut.num_steps = num_steps;
|
||||||
|
|
||||||
const std::vector<std::string> symbols = {"H-1", "He-3", "He-4", "C-12", "N-14", "O-16", "Ne-20", "Mg-24"};
|
const std::vector<std::string> symbols = {"H-1", "He-3", "He-4", "C-12", "N-14", "O-16", "Ne-20", "Mg-24"};
|
||||||
netOut.composition = serif::composition::Composition(symbols, outComposition);
|
netOut.composition = fourdst::composition::Composition(symbols, outComposition);
|
||||||
|
|
||||||
return netOut;
|
return netOut;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
#include <boost/numeric/odeint.hpp>
|
#include <boost/numeric/odeint.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace serif::network {
|
namespace gridfire {
|
||||||
GraphNetwork::GraphNetwork(
|
GraphNetwork::GraphNetwork(
|
||||||
const serif::composition::Composition &composition
|
const fourdst::composition::Composition &composition
|
||||||
):
|
):
|
||||||
Network(REACLIB),
|
Network(REACLIB),
|
||||||
m_reactions(build_reaclib_nuclear_network(composition)) {
|
m_reactions(build_reaclib_nuclear_network(composition)) {
|
||||||
@@ -31,7 +31,7 @@ namespace serif::network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GraphNetwork::GraphNetwork(
|
GraphNetwork::GraphNetwork(
|
||||||
const serif::composition::Composition &composition,
|
const fourdst::composition::Composition &composition,
|
||||||
const double cullingThreshold,
|
const double cullingThreshold,
|
||||||
const double T9
|
const double T9
|
||||||
):
|
):
|
||||||
@@ -65,8 +65,8 @@ namespace serif::network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& name: uniqueSpeciesNames) {
|
for (const auto& name: uniqueSpeciesNames) {
|
||||||
auto it = serif::atomic::species.find(name);
|
auto it = fourdst::atomic::species.find(name);
|
||||||
if (it != serif::atomic::species.end()) {
|
if (it != fourdst::atomic::species.end()) {
|
||||||
m_networkSpecies.push_back(it->second);
|
m_networkSpecies.push_back(it->second);
|
||||||
m_networkSpeciesMap.insert({name, it->second});
|
m_networkSpeciesMap.insert({name, it->second});
|
||||||
} else {
|
} else {
|
||||||
@@ -104,7 +104,7 @@ namespace serif::network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Basic Accessors and Queries ---
|
// --- Basic Accessors and Queries ---
|
||||||
const std::vector<serif::atomic::Species>& GraphNetwork::getNetworkSpecies() const {
|
const std::vector<fourdst::atomic::Species>& GraphNetwork::getNetworkSpecies() const {
|
||||||
// Returns a constant reference to the vector of unique species in the network.
|
// Returns a constant reference to the vector of unique species in the network.
|
||||||
LOG_DEBUG(m_logger, "Providing access to network species vector. Size: {}.", m_networkSpecies.size());
|
LOG_DEBUG(m_logger, "Providing access to network species vector. Size: {}.", m_networkSpecies.size());
|
||||||
return m_networkSpecies;
|
return m_networkSpecies;
|
||||||
@@ -116,16 +116,16 @@ namespace serif::network {
|
|||||||
return m_reactions;
|
return m_reactions;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GraphNetwork::involvesSpecies(const serif::atomic::Species& species) const {
|
bool GraphNetwork::involvesSpecies(const fourdst::atomic::Species& species) const {
|
||||||
// Checks if a given species is present in the network's species map for efficient lookup.
|
// Checks if a given species is present in the network's species map for efficient lookup.
|
||||||
const bool found = m_networkSpeciesMap.contains(species.name());
|
const bool found = m_networkSpeciesMap.contains(species.name());
|
||||||
LOG_DEBUG(m_logger, "Checking if species '{}' is involved in the network: {}.", species.name(), found ? "Yes" : "No");
|
LOG_DEBUG(m_logger, "Checking if species '{}' is involved in the network: {}.", species.name(), found ? "Yes" : "No");
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unordered_map<serif::atomic::Species, int> GraphNetwork::getNetReactionStoichiometry(const reaclib::REACLIBReaction& reaction) const {
|
std::unordered_map<fourdst::atomic::Species, int> GraphNetwork::getNetReactionStoichiometry(const reaclib::REACLIBReaction& reaction) const {
|
||||||
// Calculates the net stoichiometric coefficients for species in a given reaction.
|
// Calculates the net stoichiometric coefficients for species in a given reaction.
|
||||||
std::unordered_map<serif::atomic::Species, int> stoichiometry;
|
std::unordered_map<fourdst::atomic::Species, int> stoichiometry;
|
||||||
|
|
||||||
// Iterate through reactants, decrementing their counts
|
// Iterate through reactants, decrementing their counts
|
||||||
for (const auto& reactant : reaction.reactants()) {
|
for (const auto& reactant : reaction.reactants()) {
|
||||||
@@ -208,7 +208,7 @@ namespace serif::network {
|
|||||||
return true; // All reactions passed the conservation check
|
return true; // All reactions passed the conservation check
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphNetwork::validateComposition(const serif::composition::Composition &composition, double culling, double T9) {
|
void GraphNetwork::validateComposition(const fourdst::composition::Composition &composition, double culling, double T9) {
|
||||||
|
|
||||||
// Check if the requested network has already been cached.
|
// Check if the requested network has already been cached.
|
||||||
// PERF: Rebuilding this should be pretty fast but it may be a good point of optimization in the future.
|
// PERF: Rebuilding this should be pretty fast but it may be a good point of optimization in the future.
|
||||||
@@ -246,11 +246,11 @@ namespace serif::network {
|
|||||||
size_t reactionColumnIndex = 0;
|
size_t reactionColumnIndex = 0;
|
||||||
for (const auto& reaction : m_reactions) {
|
for (const auto& reaction : m_reactions) {
|
||||||
// Get the net stoichiometry for the current reaction
|
// Get the net stoichiometry for the current reaction
|
||||||
std::unordered_map<serif::atomic::Species, int> netStoichiometry = getNetReactionStoichiometry(reaction);
|
std::unordered_map<fourdst::atomic::Species, int> netStoichiometry = getNetReactionStoichiometry(reaction);
|
||||||
|
|
||||||
// Iterate through the species and their coefficients in the stoichiometry map
|
// Iterate through the species and their coefficients in the stoichiometry map
|
||||||
for (const auto& pair : netStoichiometry) {
|
for (const auto& pair : netStoichiometry) {
|
||||||
const serif::atomic::Species& species = pair.first; // The Species object
|
const fourdst::atomic::Species& species = pair.first; // The Species object
|
||||||
const int coefficient = pair.second; // The stoichiometric coefficient
|
const int coefficient = pair.second; // The stoichiometric coefficient
|
||||||
|
|
||||||
// Find the row index for this species
|
// Find the row index for this species
|
||||||
@@ -452,7 +452,7 @@ namespace serif::network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double> finalAbundances(Y.begin(), Y.begin() + numSpecies);
|
std::vector<double> finalAbundances(Y.begin(), Y.begin() + numSpecies);
|
||||||
serif::composition::Composition outputComposition(speciesNames, finalAbundances);
|
fourdst::composition::Composition outputComposition(speciesNames, finalAbundances);
|
||||||
outputComposition.finalize(true);
|
outputComposition.finalize(true);
|
||||||
|
|
||||||
NetOut netOut;
|
NetOut netOut;
|
||||||
|
|||||||
@@ -23,18 +23,17 @@
|
|||||||
#include <ranges>
|
#include <ranges>
|
||||||
|
|
||||||
#include "approx8.h"
|
#include "approx8.h"
|
||||||
#include "probe.h"
|
|
||||||
#include "quill/LogMacros.h"
|
#include "quill/LogMacros.h"
|
||||||
#include "reaclib.h"
|
#include "reaclib.h"
|
||||||
#include "reactions.h"
|
#include "reactions.h"
|
||||||
|
|
||||||
namespace serif::network {
|
namespace gridfire {
|
||||||
Network::Network(const NetworkFormat format) :
|
Network::Network(const NetworkFormat format) :
|
||||||
m_config(serif::config::Config::getInstance()),
|
m_config(fourdst::config::Config::getInstance()),
|
||||||
m_logManager(serif::probe::LogManager::getInstance()),
|
m_logManager(fourdst::logging::LogManager::getInstance()),
|
||||||
m_logger(m_logManager.getLogger("log")),
|
m_logger(m_logManager.getLogger("log")),
|
||||||
m_format(format),
|
m_format(format),
|
||||||
m_constants(serif::constant::Constants::getInstance()){
|
m_constants(fourdst::constant::Constants::getInstance()){
|
||||||
if (format == NetworkFormat::UNKNOWN) {
|
if (format == NetworkFormat::UNKNOWN) {
|
||||||
LOG_ERROR(m_logger, "nuclearNetwork::Network::Network() called with UNKNOWN format");
|
LOG_ERROR(m_logger, "nuclearNetwork::Network::Network() called with UNKNOWN format");
|
||||||
throw std::runtime_error("nuclearNetwork::Network::Network() called with UNKNOWN format");
|
throw std::runtime_error("nuclearNetwork::Network::Network() called with UNKNOWN format");
|
||||||
@@ -71,13 +70,13 @@ namespace serif::network {
|
|||||||
return netOut;
|
return netOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
serif::network::reaclib::REACLIBReactionSet build_reaclib_nuclear_network(const serif::composition::Composition &composition) {
|
reaclib::REACLIBReactionSet build_reaclib_nuclear_network(const fourdst::composition::Composition &composition) {
|
||||||
using namespace serif::network::reaclib;
|
using namespace reaclib;
|
||||||
REACLIBReactionSet reactions;
|
REACLIBReactionSet reactions;
|
||||||
auto logger = serif::probe::LogManager::getInstance().getLogger("log");
|
auto logger = fourdst::logging::LogManager::getInstance().getLogger("log");
|
||||||
|
|
||||||
if (!s_initialized) {
|
if (!s_initialized) {
|
||||||
LOG_INFO(serif::probe::LogManager::getInstance().getLogger("log"), "REACLIB reactions not initialized. Calling initializeAllReaclibReactions()...");
|
LOG_INFO(logger, "REACLIB reactions not initialized. Calling initializeAllReaclibReactions()...");
|
||||||
initializeAllReaclibReactions();
|
initializeAllReaclibReactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,8 +98,8 @@ namespace serif::network {
|
|||||||
return reactions;
|
return reactions;
|
||||||
}
|
}
|
||||||
|
|
||||||
serif::network::reaclib::REACLIBReactionSet build_reaclib_nuclear_network(const serif::composition::Composition &composition, const double culling, const double T9) {
|
reaclib::REACLIBReactionSet build_reaclib_nuclear_network(const fourdst::composition::Composition &composition, const double culling, const double T9) {
|
||||||
using namespace serif::network::reaclib;
|
using namespace reaclib;
|
||||||
REACLIBReactionSet allReactions = build_reaclib_nuclear_network(composition);
|
REACLIBReactionSet allReactions = build_reaclib_nuclear_network(composition);
|
||||||
REACLIBReactionSet reactions;
|
REACLIBReactionSet reactions;
|
||||||
for (const auto& reaction : allReactions) {
|
for (const auto& reaction : allReactions) {
|
||||||
|
|||||||
@@ -31,10 +31,10 @@
|
|||||||
* This is a general nuclear reaction network; however, it does not currently manage reverse reactions, weak reactions,
|
* This is a general nuclear reaction network; however, it does not currently manage reverse reactions, weak reactions,
|
||||||
* or other reactions which become much more relevant for more extreme astrophysical sources.
|
* or other reactions which become much more relevant for more extreme astrophysical sources.
|
||||||
*
|
*
|
||||||
* @see serif::network::GraphNetwork
|
* @see gridfire::GraphNetwork
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace serif::network {
|
namespace gridfire {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Concept to check if a type is either double or CppAD::AD<double>.
|
* @brief Concept to check if a type is either double or CppAD::AD<double>.
|
||||||
@@ -80,7 +80,7 @@ namespace serif::network {
|
|||||||
* @brief Construct a GraphNetwork from a composition.
|
* @brief Construct a GraphNetwork from a composition.
|
||||||
* @param composition The composition specifying the initial isotopic abundances.
|
* @param composition The composition specifying the initial isotopic abundances.
|
||||||
*/
|
*/
|
||||||
explicit GraphNetwork(const serif::composition::Composition &composition);
|
explicit GraphNetwork(const fourdst::composition::Composition &composition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Construct a GraphNetwork from a composition with culling and temperature.
|
* @brief Construct a GraphNetwork from a composition with culling and temperature.
|
||||||
@@ -90,7 +90,7 @@ namespace serif::network {
|
|||||||
*
|
*
|
||||||
* @see serif::network::build_reaclib_nuclear_network
|
* @see serif::network::build_reaclib_nuclear_network
|
||||||
*/
|
*/
|
||||||
explicit GraphNetwork(const serif::composition::Composition &composition,
|
explicit GraphNetwork(const fourdst::composition::Composition &composition,
|
||||||
const double cullingThreshold, const double T9);
|
const double cullingThreshold, const double T9);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -123,7 +123,7 @@ namespace serif::network {
|
|||||||
* }
|
* }
|
||||||
* @endcode
|
* @endcode
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] const std::vector<serif::atomic::Species>& getNetworkSpecies() const;
|
[[nodiscard]] const std::vector<fourdst::atomic::Species>& getNetworkSpecies() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the set of REACLIB reactions in the network.
|
* @brief Get the set of REACLIB reactions in the network.
|
||||||
@@ -149,7 +149,7 @@ namespace serif::network {
|
|||||||
* }
|
* }
|
||||||
* @endcode
|
* @endcode
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] std::unordered_map<serif::atomic::Species, int> getNetReactionStoichiometry(
|
[[nodiscard]] std::unordered_map<fourdst::atomic::Species, int> getNetReactionStoichiometry(
|
||||||
const reaclib::REACLIBReaction &reaction) const;
|
const reaclib::REACLIBReaction &reaction) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,7 +162,7 @@ namespace serif::network {
|
|||||||
* if (net.involvesSpecies(mySpecies)) { ... }
|
* if (net.involvesSpecies(mySpecies)) { ... }
|
||||||
* @endcode
|
* @endcode
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] bool involvesSpecies(const serif::atomic::Species& species) const;
|
[[nodiscard]] bool involvesSpecies(const fourdst::atomic::Species& species) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Detect cycles in the reaction network (not implemented).
|
* @brief Detect cycles in the reaction network (not implemented).
|
||||||
@@ -190,9 +190,9 @@ namespace serif::network {
|
|||||||
reaclib::REACLIBReactionSet m_reactions; ///< Set of REACLIB reactions in the network.
|
reaclib::REACLIBReactionSet m_reactions; ///< Set of REACLIB reactions in the network.
|
||||||
std::unordered_map<std::string_view, const reaclib::REACLIBReaction> m_reactionIDMap; ///< Map from reaction ID to REACLIBReaction. //PERF: This makes copies of REACLIBReaction and could be a performance bottleneck.
|
std::unordered_map<std::string_view, const reaclib::REACLIBReaction> m_reactionIDMap; ///< Map from reaction ID to REACLIBReaction. //PERF: This makes copies of REACLIBReaction and could be a performance bottleneck.
|
||||||
|
|
||||||
std::vector<serif::atomic::Species> m_networkSpecies; ///< Vector of unique species in the network.
|
std::vector<fourdst::atomic::Species> m_networkSpecies; ///< Vector of unique species in the network.
|
||||||
std::unordered_map<std::string_view, serif::atomic::Species> m_networkSpeciesMap; ///< Map from species name to Species object.
|
std::unordered_map<std::string_view, fourdst::atomic::Species> m_networkSpeciesMap; ///< Map from species name to Species object.
|
||||||
std::unordered_map<serif::atomic::Species, size_t> m_speciesToIndexMap; ///< Map from species to their index in the stoichiometry matrix.
|
std::unordered_map<fourdst::atomic::Species, size_t> m_speciesToIndexMap; ///< Map from species to their index in the stoichiometry matrix.
|
||||||
|
|
||||||
boost::numeric::ublas::compressed_matrix<int> m_stoichiometryMatrix; ///< Stoichiometry matrix (species x reactions).
|
boost::numeric::ublas::compressed_matrix<int> m_stoichiometryMatrix; ///< Stoichiometry matrix (species x reactions).
|
||||||
boost::numeric::ublas::compressed_matrix<double> m_jacobianMatrix; ///< Jacobian matrix (species x species).
|
boost::numeric::ublas::compressed_matrix<double> m_jacobianMatrix; ///< Jacobian matrix (species x species).
|
||||||
@@ -357,7 +357,7 @@ namespace serif::network {
|
|||||||
* @param culling Culling threshold.
|
* @param culling Culling threshold.
|
||||||
* @param T9 Temperature in 10^9 K.
|
* @param T9 Temperature in 10^9 K.
|
||||||
*/
|
*/
|
||||||
void validateComposition(const serif::composition::Composition &composition, double culling, double T9);
|
void validateComposition(const fourdst::composition::Composition &composition, double culling, double T9);
|
||||||
|
|
||||||
// --- Simple Derivative Calculations ---
|
// --- Simple Derivative Calculations ---
|
||||||
|
|
||||||
@@ -494,7 +494,7 @@ namespace serif::network {
|
|||||||
template <IsArithmeticOrAD GeneralScalarType>
|
template <IsArithmeticOrAD GeneralScalarType>
|
||||||
GeneralScalarType GraphNetwork::calculateReactionRate(const reaclib::REACLIBReaction &reaction, const std::vector<GeneralScalarType> &Y,
|
GeneralScalarType GraphNetwork::calculateReactionRate(const reaclib::REACLIBReaction &reaction, const std::vector<GeneralScalarType> &Y,
|
||||||
const GeneralScalarType T9, const GeneralScalarType rho) const {
|
const GeneralScalarType T9, const GeneralScalarType rho) const {
|
||||||
const auto &constants = serif::constant::Constants::getInstance();
|
const auto &constants = fourdst::constant::Constants::getInstance();
|
||||||
|
|
||||||
const auto u = constants.get("u"); // Atomic mass unit in g/mol
|
const auto u = constants.get("u"); // Atomic mass unit in g/mol
|
||||||
const GeneralScalarType uValue = static_cast<GeneralScalarType>(u.value); // Convert to double for calculations
|
const GeneralScalarType uValue = static_cast<GeneralScalarType>(u.value); // Convert to double for calculations
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "probe.h"
|
#include "logging.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "quill/Logger.h"
|
#include "quill/Logger.h"
|
||||||
#include "composition.h"
|
#include "composition.h"
|
||||||
@@ -132,7 +132,7 @@ namespace gridfire {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
fourdst::config::Config& m_config; ///< Configuration instance
|
fourdst::config::Config& m_config; ///< Configuration instance
|
||||||
fourdst::probe::LogManager& m_logManager; ///< Log manager instance
|
fourdst::logging::LogManager& m_logManager; ///< Log manager instance
|
||||||
quill::Logger* m_logger; ///< Logger instance
|
quill::Logger* m_logger; ///< Logger instance
|
||||||
|
|
||||||
NetworkFormat m_format; ///< Format of the network
|
NetworkFormat m_format; ///< Format of the network
|
||||||
|
|||||||
2
subprojects/gtest.wrap
Normal file
2
subprojects/gtest.wrap
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[wrap-redirect]
|
||||||
|
filename = libconstants/subprojects/gtest.wrap
|
||||||
7
subprojects/libcomposition.wrap
Normal file
7
subprojects/libcomposition.wrap
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[wrap-git]
|
||||||
|
url = https://github.com/4D-STAR/libcomposition.git
|
||||||
|
revision = v1.0.1
|
||||||
|
depth = 1
|
||||||
|
|
||||||
|
[provide]
|
||||||
|
libcomposition = composition_dep
|
||||||
7
subprojects/libconfig.wrap
Normal file
7
subprojects/libconfig.wrap
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[wrap-git]
|
||||||
|
url = https://github.com/4D-STAR/libconfig.git
|
||||||
|
revision = v1.0.0
|
||||||
|
depth = 1
|
||||||
|
|
||||||
|
[provide]
|
||||||
|
libconfig = config_dep
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[wrap-git]
|
[wrap-git]
|
||||||
url = https://github.com/tboudreaux/libconstants.git
|
url = https://github.com/4D-STAR/libconstants.git
|
||||||
revision = v1.1
|
revision = v1.1
|
||||||
depth = 1
|
depth = 1
|
||||||
|
|
||||||
|
|||||||
7
subprojects/liblogging.wrap
Normal file
7
subprojects/liblogging.wrap
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[wrap-git]
|
||||||
|
url = https://github.com/4D-STAR/liblogging.git
|
||||||
|
revision = v1.0.1
|
||||||
|
depth = 1
|
||||||
|
|
||||||
|
[provide]
|
||||||
|
liblogging = logging_dep
|
||||||
2
subprojects/yaml-cpp.wrap
Normal file
2
subprojects/yaml-cpp.wrap
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[wrap-redirect]
|
||||||
|
filename = libconfig/subprojects/yaml-cpp.wrap
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Google Test dependency
|
||||||
|
gtest_dep = dependency('gtest', main: true, required : true)
|
||||||
|
gtest_main = dependency('gtest_main', required: true)
|
||||||
|
gtest_nomain_dep = dependency('gtest', main: false, required : true)
|
||||||
|
|
||||||
|
# Subdirectories for unit and integration tests
|
||||||
|
subdir('network')
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ class approx8Test : public ::testing::Test {};
|
|||||||
* @brief Test the constructor of the Config class.
|
* @brief Test the constructor of the Config class.
|
||||||
*/
|
*/
|
||||||
TEST_F(approx8Test, constructor) {
|
TEST_F(approx8Test, constructor) {
|
||||||
serif::config::Config& config = serif::config::Config::getInstance();
|
fourdst::config::Config& config = fourdst::config::Config::getInstance();
|
||||||
config.loadConfig(TEST_CONFIG);
|
config.loadConfig(TEST_CONFIG);
|
||||||
EXPECT_NO_THROW(serif::network::approx8::Approx8Network());
|
EXPECT_NO_THROW(gridfire::approx8::Approx8Network());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(approx8Test, setStiff) {
|
TEST_F(approx8Test, setStiff) {
|
||||||
serif::network::approx8::Approx8Network network;
|
gridfire::approx8::Approx8Network network;
|
||||||
EXPECT_NO_THROW(network.setStiff(true));
|
EXPECT_NO_THROW(network.setStiff(true));
|
||||||
EXPECT_TRUE(network.isStiff());
|
EXPECT_TRUE(network.isStiff());
|
||||||
EXPECT_NO_THROW(network.setStiff(false));
|
EXPECT_NO_THROW(network.setStiff(false));
|
||||||
@@ -33,13 +33,13 @@ TEST_F(approx8Test, setStiff) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(approx8Test, evaluate) {
|
TEST_F(approx8Test, evaluate) {
|
||||||
serif::network::approx8::Approx8Network network;
|
gridfire::approx8::Approx8Network network;
|
||||||
serif::network::NetIn netIn;
|
gridfire::NetIn netIn;
|
||||||
|
|
||||||
std::vector<double> comp = {0.708, 2.94e-5, 0.276, 0.003, 0.0011, 9.62e-3, 1.62e-3, 5.16e-4};
|
std::vector<double> comp = {0.708, 2.94e-5, 0.276, 0.003, 0.0011, 9.62e-3, 1.62e-3, 5.16e-4};
|
||||||
std::vector<std::string> symbols = {"H-1", "He-3", "He-4", "C-12", "N-14", "O-16", "Ne-20", "Mg-24"};
|
std::vector<std::string> symbols = {"H-1", "He-3", "He-4", "C-12", "N-14", "O-16", "Ne-20", "Mg-24"};
|
||||||
|
|
||||||
serif::composition::Composition composition;
|
fourdst::composition::Composition composition;
|
||||||
composition.registerSymbol(symbols, true);
|
composition.registerSymbol(symbols, true);
|
||||||
composition.setMassFraction(symbols, comp);
|
composition.setMassFraction(symbols, comp);
|
||||||
bool isFinalized = composition.finalize(true);
|
bool isFinalized = composition.finalize(true);
|
||||||
@@ -53,7 +53,7 @@ TEST_F(approx8Test, evaluate) {
|
|||||||
netIn.tMax = 3.15e17;
|
netIn.tMax = 3.15e17;
|
||||||
netIn.dt0 = 1e12;
|
netIn.dt0 = 1e12;
|
||||||
|
|
||||||
serif::network::NetOut netOut;
|
gridfire::NetOut netOut;
|
||||||
EXPECT_NO_THROW(netOut = network.evaluate(netIn));
|
EXPECT_NO_THROW(netOut = network.evaluate(netIn));
|
||||||
|
|
||||||
double energyFraction = netOut.energy / 1.6433051127589775E+18;
|
double energyFraction = netOut.energy / 1.6433051127589775E+18;
|
||||||
@@ -67,11 +67,11 @@ TEST_F(approx8Test, evaluate) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(approx8Test, reaclib) {
|
TEST_F(approx8Test, reaclib) {
|
||||||
using namespace serif::network;
|
using namespace gridfire;
|
||||||
const std::vector<double> comp = {0.708, 2.94e-5, 0.276, 0.003, 0.0011, 9.62e-3, 1.62e-3, 5.16e-4};
|
const std::vector<double> comp = {0.708, 2.94e-5, 0.276, 0.003, 0.0011, 9.62e-3, 1.62e-3, 5.16e-4};
|
||||||
const std::vector<std::string> symbols = {"H-1", "He-3", "He-4", "C-12", "N-14", "O-16", "Ne-20", "Mg-24"};
|
const std::vector<std::string> symbols = {"H-1", "He-3", "He-4", "C-12", "N-14", "O-16", "Ne-20", "Mg-24"};
|
||||||
|
|
||||||
serif::composition::Composition composition;
|
fourdst::composition::Composition composition;
|
||||||
composition.registerSymbol(symbols, true);
|
composition.registerSymbol(symbols, true);
|
||||||
composition.setMassFraction(symbols, comp);
|
composition.setMassFraction(symbols, comp);
|
||||||
composition.finalize(true);
|
composition.finalize(true);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ foreach test_file : test_sources
|
|||||||
test_exe = executable(
|
test_exe = executable(
|
||||||
exe_name,
|
exe_name,
|
||||||
test_file,
|
test_file,
|
||||||
dependencies: [gtest_dep, gtest_main, network_dep, species_weight_dep, composition_dep],
|
dependencies: [gtest_dep, gtest_main, network_dep, composition_dep],
|
||||||
include_directories: include_directories('../../src/network/public'),
|
include_directories: include_directories('../../src/network/public'),
|
||||||
link_with: libnetwork, # Link the dobj library
|
link_with: libnetwork, # Link the dobj library
|
||||||
install_rpath: '@loader_path/../../src' # Ensure runtime library path resolves correctly
|
install_rpath: '@loader_path/../../src' # Ensure runtime library path resolves correctly
|
||||||
|
|||||||
267
utils/reaclib/generateEmbeddedReaclibHeader.py
Normal file
267
utils/reaclib/generateEmbeddedReaclibHeader.py
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from collections import defaultdict
|
||||||
|
from typing import List, Tuple
|
||||||
|
import numpy as np
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
#import dataclasses
|
||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Reaction:
|
||||||
|
reactants: List[str]
|
||||||
|
products: List[str]
|
||||||
|
label: str
|
||||||
|
chapter: int
|
||||||
|
qValue: float
|
||||||
|
coeffs: List[float]
|
||||||
|
projectile: str # added
|
||||||
|
ejectile: str # added
|
||||||
|
reactionType: str # added (e.g. "(p,γ)")
|
||||||
|
reverse: bool
|
||||||
|
def format_rp_name(self) -> str:
|
||||||
|
# radiative or particle captures: 2 reactants -> 1 product
|
||||||
|
if len(self.reactants) == 2 and len(self.products) == 1:
|
||||||
|
target = self.reactants[0]
|
||||||
|
prod = self.products[0]
|
||||||
|
return f"{target}({self.projectile},{self.ejectile}){prod}"
|
||||||
|
# fallback: join lists
|
||||||
|
react_str = '+'.join(self.reactants)
|
||||||
|
prod_str = '+'.join(self.products)
|
||||||
|
return f"{react_str}->{prod_str}"
|
||||||
|
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"Reaction({self.format_rp_name()})"
|
||||||
|
|
||||||
|
|
||||||
|
def evaluate_rate(coeffs: List[float], T9: float) -> float:
|
||||||
|
rateExponent: float = coeffs[0] + \
|
||||||
|
coeffs[1] / T9 + \
|
||||||
|
coeffs[2] / (T9 ** (1/3)) + \
|
||||||
|
coeffs[3] * (T9 ** (1/3)) + \
|
||||||
|
coeffs[4] * T9 + \
|
||||||
|
coeffs[5] * (T9 ** (5/3)) + \
|
||||||
|
coeffs[6] * (np.log(T9))
|
||||||
|
return np.exp(rateExponent)
|
||||||
|
|
||||||
|
class ReaclibParseError(Exception):
|
||||||
|
"""Custom exception for parsing errors."""
|
||||||
|
def __init__(self, message, line_num=None, line_content=None):
|
||||||
|
self.line_num = line_num
|
||||||
|
self.line_content = line_content
|
||||||
|
full_message = f"Error"
|
||||||
|
if line_num is not None:
|
||||||
|
full_message += f" on line {line_num}"
|
||||||
|
full_message += f": {message}"
|
||||||
|
if line_content is not None:
|
||||||
|
full_message += f"\n -> Line content: '{line_content}'"
|
||||||
|
super().__init__(full_message)
|
||||||
|
|
||||||
|
|
||||||
|
def format_cpp_identifier(name: str) -> str:
|
||||||
|
name_map = {'p': 'H_1', 'n': 'n_1', 'd': 'd', 't': 't', 'a': 'a'}
|
||||||
|
if name.lower() in name_map:
|
||||||
|
return name_map[name.lower()]
|
||||||
|
match = re.match(r"([a-zA-Z]+)(\d+)", name)
|
||||||
|
if match:
|
||||||
|
element, mass = match.groups()
|
||||||
|
return f"{element.capitalize()}_{mass}"
|
||||||
|
return f"{name.capitalize()}_1"
|
||||||
|
|
||||||
|
def parse_reaclib_entry(entry: str) -> Tuple[List[str], str, float, List[float], bool]:
|
||||||
|
pattern = re.compile(r"""^([1-9]|1[0-1])\r?\n
|
||||||
|
[ \t]*
|
||||||
|
((?:[A-Za-z0-9-*]+[ \t]+)*
|
||||||
|
[A-Za-z0-9-*]+)
|
||||||
|
[ \t]+
|
||||||
|
([A-Za-z0-9+]+)
|
||||||
|
[ \t]+
|
||||||
|
([+-]?(?:\d+\.\d*|\.\d+)(?:[eE][+-]?\d+))
|
||||||
|
[ \t\r\n]+
|
||||||
|
[ \t\r\n]*([+-]?\d+\.\d*e[+-]?\d+)\s*
|
||||||
|
([+-]?\d+\.\d*e[+-]?\d+)\s*
|
||||||
|
([+-]?\d+\.\d*e[+-]?\d+)\s*
|
||||||
|
([+-]?\d+\.\d*e[+-]?\d+)\s*
|
||||||
|
([+-]?\d+\.\d*e[+-]?\d+)\s*
|
||||||
|
([+-]?\d+\.\d*e[+-]?\d+)\s*
|
||||||
|
([+-]?\d+\.\d*e[+-]?\d+)
|
||||||
|
""", re.MULTILINE | re.VERBOSE)
|
||||||
|
match = pattern.match(entry)
|
||||||
|
reverse = True if entry.split('\n')[1][48] == 'v' else False
|
||||||
|
return match, reverse
|
||||||
|
|
||||||
|
|
||||||
|
def get_rp(group: str, chapter: int) -> Tuple[List[str], List[str]]:
|
||||||
|
rpGroupings = {
|
||||||
|
1: (1, 1), 2: (1, 2), 3: (1, 3), 4: (2, 1), 5: (2, 2),
|
||||||
|
6: (2, 3), 7: (2, 4), 8: (3, 1), 9: (3, 2), 10: (4, 2), 11: (1, 4)
|
||||||
|
}
|
||||||
|
species = group.split()
|
||||||
|
nReact, nProd = rpGroupings[chapter]
|
||||||
|
reactants = species[:nReact]
|
||||||
|
products = species[nReact:nReact + nProd]
|
||||||
|
return reactants, products
|
||||||
|
|
||||||
|
|
||||||
|
def determine_reaction_type(reactants: List[str], products: List[str]) -> Tuple[str, str, str]:
|
||||||
|
# assumes no reverse flag applied
|
||||||
|
projectile = ''
|
||||||
|
ejectile = ''
|
||||||
|
# projectile is the lighter reactant (p, n, he4)
|
||||||
|
for sp in reactants:
|
||||||
|
if sp in ('p', 'n', 'he4'):
|
||||||
|
projectile = sp
|
||||||
|
break
|
||||||
|
# ejectile logic
|
||||||
|
if len(products) == 1:
|
||||||
|
ejectile = 'g'
|
||||||
|
elif 'he4' in products:
|
||||||
|
ejectile = 'a'
|
||||||
|
elif 'p' in products:
|
||||||
|
ejectile = 'p'
|
||||||
|
elif 'n' in products:
|
||||||
|
ejectile = 'n'
|
||||||
|
reactionType = f"({projectile},{ejectile})"
|
||||||
|
return projectile, ejectile, reactionType
|
||||||
|
def extract_groups(match: re.Match, reverse: bool) -> Reaction:
|
||||||
|
groups = match.groups()
|
||||||
|
chapter = int(groups[0].strip())
|
||||||
|
rawGroup = groups[1].strip()
|
||||||
|
rList, pList = get_rp(rawGroup, chapter)
|
||||||
|
if reverse:
|
||||||
|
rList, pList = pList, rList
|
||||||
|
proj, ejec, rType = determine_reaction_type(rList, pList)
|
||||||
|
reaction = Reaction(
|
||||||
|
reactants=rList,
|
||||||
|
products=pList,
|
||||||
|
label=groups[2].strip(),
|
||||||
|
chapter=chapter,
|
||||||
|
qValue=float(groups[3].strip()),
|
||||||
|
coeffs=[float(groups[i].strip()) for i in range(4, 11)],
|
||||||
|
projectile=proj,
|
||||||
|
ejectile=ejec,
|
||||||
|
reactionType=rType,
|
||||||
|
reverse=reverse
|
||||||
|
)
|
||||||
|
return reaction
|
||||||
|
def format_emplacment(reaction: Reaction) -> str:
|
||||||
|
reactantNames = [f'{format_cpp_identifier(r)}' for r in reaction.reactants]
|
||||||
|
productNames = [f'{format_cpp_identifier(p)}' for p in reaction.products]
|
||||||
|
|
||||||
|
reactants_cpp = [f'fourdst::atomic::{format_cpp_identifier(r)}' for r in reaction.reactants]
|
||||||
|
products_cpp = [f'fourdst::atomic::{format_cpp_identifier(p)}' for p in reaction.products]
|
||||||
|
|
||||||
|
label = f"{'_'.join(reactantNames)}_to_{'_'.join(productNames)}_{reaction.label.upper()}"
|
||||||
|
|
||||||
|
|
||||||
|
reactants_str = ', '.join(reactants_cpp)
|
||||||
|
products_str = ', '.join(products_cpp)
|
||||||
|
|
||||||
|
q_value_str = f"{reaction.qValue:.6e}"
|
||||||
|
chapter_str = reaction.chapter
|
||||||
|
|
||||||
|
rate_sets_str = ', '.join([str(x) for x in reaction.coeffs])
|
||||||
|
emplacment: str = f"s_all_reaclib_reactions.emplace(\"{label}\", REACLIBReaction(\"{label}\", {chapter_str}, {{{reactants_str}}}, {{{products_str}}}, {q_value_str}, \"{reaction.label}\", {{{rate_sets_str}}}, {"true" if reaction.reverse else "false"}));"
|
||||||
|
|
||||||
|
return emplacment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def generate_reaclib_header(reaclib_filepath: str, culling: float, T9: float, verbose: bool) -> str:
|
||||||
|
"""
|
||||||
|
Parses a JINA REACLIB file using regular expressions and generates a C++ header file string.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
reaclib_filepath: The path to the REACLIB data file.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A string containing the complete C++ header content.
|
||||||
|
"""
|
||||||
|
with open(reaclib_filepath, 'r') as file:
|
||||||
|
content = file.read()
|
||||||
|
fileHash = hashlib.sha256(content.encode('utf-8')).hexdigest()
|
||||||
|
# split the file into blocks of 4 lines each
|
||||||
|
lines = content.split('\n')
|
||||||
|
entries = ['\n'.join(lines[i:i+4]) for i in range(0, len(lines), 4) if len(lines[i:i+4]) == 4]
|
||||||
|
reactions = list()
|
||||||
|
for entry in entries:
|
||||||
|
m, r = parse_reaclib_entry(entry)
|
||||||
|
if m is not None:
|
||||||
|
reac = extract_groups(m, r)
|
||||||
|
reactions.append(reac)
|
||||||
|
|
||||||
|
# --- Generate the C++ Header String ---
|
||||||
|
cpp_lines = [
|
||||||
|
"// This file is automatically generated. Do not edit!",
|
||||||
|
"// Generated on: " + str(np.datetime64('now')),
|
||||||
|
"// REACLIB file hash (sha256): " + fileHash,
|
||||||
|
"// Generated from REACLIB data file: " + reaclib_filepath,
|
||||||
|
"// Culling threshold: rate >" + str(culling) + " at T9 = " + str(T9),
|
||||||
|
"// Note that if the culling threshold is set to 0.0, no reactions are culled.",
|
||||||
|
"// Includes %%TOTAL%% reactions.",
|
||||||
|
"// Note: Only reactions with species defined in the atomicSpecies.h header will be included at compile time.",
|
||||||
|
"#pragma once",
|
||||||
|
"#include \"atomicSpecies.h\"",
|
||||||
|
"#include \"species.h\"",
|
||||||
|
"#include \"reaclib.h\"",
|
||||||
|
"\nnamespace gridfire::reaclib {\n",
|
||||||
|
"""
|
||||||
|
inline void initializeAllReaclibReactions() {
|
||||||
|
if (s_initialized) return; // already initialized
|
||||||
|
s_initialized = true;
|
||||||
|
s_all_reaclib_reactions.clear();
|
||||||
|
s_all_reaclib_reactions.reserve(%%TOTAL%%); // reserve space for total reactions
|
||||||
|
"""
|
||||||
|
]
|
||||||
|
totalSkipped = 0
|
||||||
|
totalIncluded = 0
|
||||||
|
for reaction in reactions:
|
||||||
|
reactantNames = [f'{format_cpp_identifier(r)}' for r in reaction.reactants]
|
||||||
|
productNames = [f'{format_cpp_identifier(p)}' for p in reaction.products]
|
||||||
|
reactionName = f"{'_'.join(reactantNames)}_to_{'_'.join(productNames)}_{reaction.label.upper()}"
|
||||||
|
if culling > 0.0:
|
||||||
|
rate = evaluate_rate(reaction.coeffs, T9)
|
||||||
|
if rate < culling:
|
||||||
|
if verbose:
|
||||||
|
print(f"Skipping reaction {reactionName} with rate {rate:.6e} at T9={T9} (culling threshold: {culling} at T9={T9})")
|
||||||
|
totalSkipped += 1
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
totalIncluded += 1
|
||||||
|
|
||||||
|
defines = ' && '.join(set([f"defined(SERIF_SPECIES_{name.upper().replace('-', '_min_').replace('+', '_add_').replace('*', '_mult_')})" for name in reactantNames + productNames]))
|
||||||
|
cpp_lines.append(f" #if {defines}")
|
||||||
|
emplacment = format_emplacment(reaction)
|
||||||
|
cpp_lines.append(f" {emplacment}")
|
||||||
|
cpp_lines.append(f" #endif // {defines}")
|
||||||
|
cpp_lines.append("\n }\n} // namespace gridfire::reaclib\n")
|
||||||
|
return "\n".join(cpp_lines), totalSkipped, totalIncluded
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
import argparse
|
||||||
|
parser = argparse.ArgumentParser(description="Generate a C++ header from a REACLIB file.")
|
||||||
|
parser.add_argument("reaclib_file", type=str, help="Path to the REACLIB data file.")
|
||||||
|
parser.add_argument("-o", "--output", type=str, default=None, help="Output file path (default: stdout).")
|
||||||
|
parser.add_argument('-c', "--culling", type=float, default=0.0, help="Culling threshold for reaction rates at T9 (when 0.0, no culling is applied).")
|
||||||
|
parser.add_argument('-T', '--T9', type=float, default=0.01, help="Temperature in billions of Kelvin (default: 0.01) to evaluate the reaction rates for culling.")
|
||||||
|
parser.add_argument('-v', '--verbose', action='store_true', help="Enable verbose output.")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
try:
|
||||||
|
cpp_header_string, skipped, included = generate_reaclib_header(args.reaclib_file, args.culling, args.T9, args.verbose)
|
||||||
|
cpp_header_string = cpp_header_string.replace("%%TOTAL%%", str(included))
|
||||||
|
print("--- Generated C++ Header (Success!) ---")
|
||||||
|
if args.output:
|
||||||
|
with open(args.output, 'w') as f:
|
||||||
|
f.write(cpp_header_string)
|
||||||
|
print(f"Header written to {args.output}")
|
||||||
|
print(f"Total reactions included: {included}, Total reactions skipped: {skipped}")
|
||||||
|
else:
|
||||||
|
print(cpp_header_string)
|
||||||
|
except ReaclibParseError as e:
|
||||||
|
print(f"\n--- PARSING FAILED ---")
|
||||||
|
print(e, file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
63
utils/reaclib/readme.md
Normal file
63
utils/reaclib/readme.md
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# Reaclib to Header File Utility
|
||||||
|
This utility module provides a script to convert reaclib2 format (with chapters
|
||||||
|
9, 10, and 11) data into a c++ header file formated for use within SERiF. This
|
||||||
|
script uses preprocessor directives to ensure that the only reactions included
|
||||||
|
are ones for which all reactants and products are defined. That is to say that
|
||||||
|
at compile time this will cull any reaction for which we do not have data from
|
||||||
|
AME2020. One effect of this is that the non-elemental reactions which reaclib
|
||||||
|
traces (such as things like nrf, and pkrf) are not included in the reaction
|
||||||
|
library.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
There are no dependencies which are not part of a standard python installation
|
||||||
|
|
||||||
|
You will however need to provide the reaclib2 formated file. This can be downloaded from
|
||||||
|
the [reaclib snapshot library](https://reaclib.jinaweb.org/library.php?action=viewsnapshots).
|
||||||
|
|
||||||
|
Assuming you download that file to your ~/Downloads directory, and it is called something like
|
||||||
|
`results123` then usage is as simple as
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python generateEmbeddedReaclibHeader.py ~/Downloads/results123 -o reaclib.h -c 1e-8 -T 0.1
|
||||||
|
```
|
||||||
|
|
||||||
|
This will generate the `reaclib.h` header file in your current directory.
|
||||||
|
|
||||||
|
> The c and T flags are optional, but they are used to set the culling parameter. c is the minimum rate
|
||||||
|
that a reaction must have to be included in the header file and T is the T9 temperature to evaluate that
|
||||||
|
rate at. Without culling (when -c is set to 0 or not set) the header file may be very large.
|
||||||
|
|
||||||
|
In order to make a translation unit `reaclib.h` depends on `atomicSpecies.h`
|
||||||
|
which is another header file automatically generated by a utility module (utils/atomic).
|
||||||
|
|
||||||
|
> `atomicSpecies.h` provides the Species structs which are used to ensure that only reactions
|
||||||
|
where the reactants and products are species in AME2020 are included. This pretty significantly
|
||||||
|
cuts down on compiled binary size. This is done using preprocessor directives.
|
||||||
|
|
||||||
|
Once `reaclib.h` has been generated you can recompile `SERiF` with it simply by
|
||||||
|
running the following (from your `SERiF` root directory and assuming
|
||||||
|
`reaclib.h` is in `SERiF/utils/reaclib`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mv assets/static/reaclib/reaclib.h assets/static/reaclib/reaclib.h.bak
|
||||||
|
cp utils/reaclib/reaclib.h assets/static/reaclib/reaclib.h
|
||||||
|
meson compile -C build
|
||||||
|
```
|
||||||
|
|
||||||
|
> All tests are run with the bundled reaclib.h based on a checkout of the
|
||||||
|
reaclib default snapshot on June 17th, 2025 where the most recent documented
|
||||||
|
change was on June 24th, 2021. This means that if you update reaclib.h some
|
||||||
|
tests may fail.
|
||||||
|
|
||||||
|
## For Developers
|
||||||
|
If you are updating the default reaclib.h file, please ensure that you also
|
||||||
|
update any relevant tests and documentation to reflect the changes made.
|
||||||
|
|
||||||
|
Further, if in the future the parser needs updating, please ensure that
|
||||||
|
those changes get upstreamed into this utility script. It is a key development guideline
|
||||||
|
that all of our tools are well documented and easy for non `SERiF` developers
|
||||||
|
to use.
|
||||||
|
|
||||||
|
## Citations
|
||||||
|
REACLIB:
|
||||||
|
- Rauscher, T., Heger, A., Hoffman, R. D., & Woosley, S. E. 2010, ApJS, 189, 240.
|
||||||
Reference in New Issue
Block a user