13inline constexpr std::string_view
Joker =
"*";
42 constexpr bool operator==(
const std::string_view specstr)
const noexcept {
43 auto lim = specstr.find(
'-');
44 return (lim not_eq specstr.npos) and (fromShortName(specstr.substr(0, lim)) ==
spec) and (specstr.substr(lim+1) ==
isotname);
54#define deal_with_spec(SPEC) IsotopeRecord(Species::SPEC),
69 IsotopeRecord(fromShortName(
"H2O"),
"ForeignContStandardType"),
347 IsotopeRecord(fromShortName(
"ClONO2"),
"5646", 96.956672, 12),
348 IsotopeRecord(fromShortName(
"ClONO2"),
"7646", 98.953723, 12),
497 IsotopeRecord(fromShortName(
"COCl2"),
"2657", 99.929670, 16),
582consteval std::array<std::size_t, std::size_t(Species::FINAL)+1>
start_positions() noexcept {
583 std::array<bool, std::size_t(Species::FINAL)> found{};
584 for (
auto& x: found) x =
false;
586 std::array<std::size_t, std::size_t(Species::FINAL)+1> out{};
591 if (not found[ind]) {
601template <Species spec>
606template <Species spec>
607consteval std::array<IsotopeRecord, count_isotopologues<spec>()>
isotopologues() noexcept {
608 static_assert(count_isotopologues<spec>() not_eq 0,
"All species must be defined in the Isotopologues!");
609 std::array<IsotopeRecord, count_isotopologues<spec>()> isots;
610 for (std::size_t i=0; i<count_isotopologues<spec>(); i++) {
619 const std::string_view isot)
noexcept {
636 const std::string_view isot)
noexcept {
641 auto minus = s.find(
'-');
650 const std::string_view isotname)
noexcept {
675 if (ir1.spec not_eq ir2.spec)
return false;
676 if (ir1.joker() or ir2.joker())
return true;
677 return ir1.isotname == ir2.isotname;
682 std::array<Numeric, maxsize>
data;
685 for (
auto& x:
data) x = std::numeric_limits<Numeric>::quiet_NaN();
690 return data[spec_ind];
696 "Cannot understand: ", ir.
FullName(),
" as a valid species")
697 return data[spec_ind];
701 for (
size_t i=0; i<iso_rat.
maxsize; i++) {
722 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2O", ISOT)] = VAL
732 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CO2", ISOT)] = VAL
747 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O3", ISOT)] = VAL
755 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("N2O", ISOT)] = VAL
763 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CO", ISOT)] = VAL
772 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH4", ISOT)] = VAL
779 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O2", ISOT)] = VAL
785 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO", ISOT)] = VAL
791 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO2", ISOT)] = VAL
798 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO2", ISOT)] = VAL
803 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NH3", ISOT)] = VAL
809 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HNO3", ISOT)] = VAL
814 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OH", ISOT)] = VAL
820 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HF", ISOT)] = VAL
825 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCl", ISOT)] = VAL
832 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HBr", ISOT)] = VAL
839 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HI", ISOT)] = VAL
844 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("ClO", ISOT)] = VAL
849 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OCS", ISOT)] = VAL
858 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2CO", ISOT)] = VAL
864 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HDCO", ISOT)] = VAL
868 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("D2CO", ISOT)] = VAL
872 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HOCl", ISOT)] = VAL
877 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("N2", ISOT)] = VAL
882 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCN", ISOT)] = VAL
889 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3Cl", ISOT)] = VAL
894 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2O2", ISOT)] = VAL
898 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H2", ISOT)] = VAL
904 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H6", ISOT)] = VAL
909 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("PH3", ISOT)] = VAL
913 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("COF2", ISOT)] = VAL
918 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SF6", ISOT)] = VAL
922 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2S", ISOT)] = VAL
929 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCOOH", ISOT)] = VAL
934 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("DCOOH", ISOT)] = VAL
938 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCOOD", ISOT)] = VAL
942 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HO2", ISOT)] = VAL
946 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O", ISOT)] = VAL
950 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("ClONO2", ISOT)] = VAL
955 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO+", ISOT)] = VAL
959 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OClO", ISOT)] = VAL
964 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("BrO", ISOT)] = VAL
969 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2SO4", ISOT)] = VAL
973 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("Cl2O2", ISOT)] = VAL
978 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HOBr", ISOT)] = VAL
983 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H4", ISOT)] = VAL
988 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3OH", ISOT)] = VAL
992 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3Br", ISOT)] = VAL
997 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3CN", ISOT)] = VAL
1004 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH2DCN", ISOT)] = VAL
1008 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CF4", ISOT)] = VAL
1012 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HC3N", ISOT)] = VAL
1021 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CS", ISOT)] = VAL
1028 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HNC", ISOT)] = VAL
1035 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO", ISOT)] = VAL
1041 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C3H8", ISOT)] = VAL
1045 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2", ISOT)] = VAL
1050 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H", ISOT)] = VAL
1054 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("He", ISOT)] = VAL
1058 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("Ar", ISOT)] = VAL
1062 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C4H2", ISOT)] = VAL
1066 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO3", ISOT)] = VAL
1070 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CS2", ISOT)] = VAL
1077 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2N2", ISOT)] = VAL
1081 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("COCl2", ISOT)] = VAL
1086 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3F", ISOT)] = VAL
1090 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("GeH4", ISOT)] = VAL
1098 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3I", ISOT)] = VAL
1102 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NF3", ISOT)] = VAL
1106 return isotopologue_ratios;
1128 if (sum_r not_eq 0)
return sum_rm / sum_r;
1129 return std::numeric_limits<Numeric>::signaling_NaN();
This can be used to make arrays out of anything.
#define ARTS_ASSERT(condition,...)
#define ARTS_USER_ERROR_IF(condition,...)
constexpr bool good_enum(EnumType x) noexcept
Checks if the enum number is good.
#define deal_with_spec(SPEC)
#define set_isot_val(ISOT, VAL)
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
This file contains the definition of String, the ARTS string class.
my_basic_string< char > String
The String type for ARTS.
String isotopologues_names(Species spec)
consteval std::size_t count_isotopologues() noexcept
constexpr bool all_have_ratio(const Species spec, const IsotopologueRatios &ir) noexcept
consteval std::array< std::size_t, std::size_t(Species::FINAL)+1 > start_positions() noexcept
constexpr Numeric mean_mass(Species spec, const IsotopologueRatios &ir) noexcept
constexpr const IsotopeRecord & select_joker(Species spec) noexcept
constexpr bool is_predefined_model(const IsotopeRecord &ir) noexcept
constexpr std::array Isotopologues
A list of all ARTS isotopologues, note how the species enum class input HAS to be sorted.
constexpr bool is_normal_isotopologue(const IsotopeRecord &ir) noexcept
constexpr bool same_or_joker(const IsotopeRecord &ir1, const IsotopeRecord &ir2) noexcept
constexpr auto IsotopologuesStart
std::pair< ArrayOfString, ArrayOfString > names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios &ir) noexcept
consteval std::array< IsotopeRecord, count_isotopologues< spec >()> isotopologues() noexcept
constexpr IsotopologueRatios isotopologue_ratiosInitFromBuiltin()
String update_isot_name(const String &old_name)
Updates the name of the isotopologue based on updates of the isotopologues.
String predefined_model_names() noexcept
constexpr const IsotopeRecord & select(Species spec, const std::string_view isotname) noexcept
constexpr Index find_species_index(const Species spec, const std::string_view isot) noexcept
constexpr std::string_view Joker
constexpr int isdigit(int ch) noexcept
constexpr bool isnan(double d) noexcept
Struct containing all information needed about one isotope.
String FullName() const noexcept
Index gi
The degeneracy of states of the molecule. It is -1 if not defined.
Species spec
Species type as defined in species.h.
Numeric mass
The mass of the isotope in units of grams per mol. It is Nan if not defined.
std::string_view isotname
A custom name that is unique for this Species type.
constexpr bool joker() const noexcept
friend std::ostream & operator<<(std::ostream &os, const IsotopeRecord &ir)
constexpr IsotopeRecord(Species spec_, const std::string_view isotname_=Joker, Numeric mass_=std::numeric_limits< Numeric >::quiet_NaN(), Index gi_=-1) noexcept
constexpr IsotopeRecord() noexcept
constexpr bool OK() const noexcept
constexpr bool operator==(const IsotopeRecord &that) const noexcept
constexpr bool operator!=(T x) const noexcept
constexpr bool operator==(const std::string_view specstr) const noexcept
A comparison with pure named string (this is not an exact comparison)
constexpr bool all_isotopes_have_a_value() const noexcept
friend std::ostream & operator<<(std::ostream &os, const IsotopologueRatios &iso_rat)
constexpr Numeric operator[](const IsotopeRecord &ir) const
constexpr IsotopologueRatios() noexcept
constexpr Numeric operator[](const Index spec_ind) const ARTS_NOEXCEPT
std::array< Numeric, maxsize > data
static constexpr Index maxsize