13inline constexpr std::string_view
Joker =
"*";
29 constexpr explicit IsotopeRecord(
Species spec_,
const std::string_view isotname_=
Joker, Numeric mass_=std::numeric_limits<Numeric>::quiet_NaN(), Index gi_=-1) noexcept
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),
70 IsotopeRecord(fromShortName(
"H2O"),
"ForeignContStandardType"),
355 IsotopeRecord(fromShortName(
"ClONO2"),
"5646", 96.956672, 12),
356 IsotopeRecord(fromShortName(
"ClONO2"),
"7646", 98.953723, 12),
505 IsotopeRecord(fromShortName(
"COCl2"),
"2657", 99.929670, 16),
590consteval std::array<std::size_t, std::size_t(Species::FINAL)+1>
start_positions() noexcept {
591 std::array<bool, std::size_t(Species::FINAL)> found{};
592 for (
auto& x: found) x =
false;
594 std::array<std::size_t, std::size_t(Species::FINAL)+1> out{};
599 if (not found[ind]) {
609template <Species spec>
614template <Species spec>
615consteval std::array<IsotopeRecord, count_isotopologues<spec>()>
isotopologues() noexcept {
616 static_assert(count_isotopologues<spec>() not_eq 0,
"All species must be defined in the Isotopologues!");
617 std::array<IsotopeRecord, count_isotopologues<spec>()> isots;
618 for (std::size_t i=0; i<count_isotopologues<spec>(); i++) {
627 const std::string_view isot)
noexcept {
644 const std::string_view isot)
noexcept {
649 auto minus = s.find(
'-');
658 const std::string_view isotname)
noexcept {
683 if (ir1.spec not_eq ir2.spec)
return false;
684 if (ir1.joker() or ir2.joker())
return true;
685 return ir1.isotname == ir2.isotname;
690 std::array<Numeric, maxsize>
data;
693 for (
auto& x:
data) x = std::numeric_limits<Numeric>::quiet_NaN();
698 return data[spec_ind];
704 "Cannot understand: ", ir.
FullName(),
" as a valid species")
705 return data[spec_ind];
709 for (
size_t i=0; i<iso_rat.
maxsize; i++) {
718 for (Index i=0; i<
maxsize; i++) {
730 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2O", ISOT)] = VAL
740 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CO2", ISOT)] = VAL
755 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O3", ISOT)] = VAL
763 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("N2O", ISOT)] = VAL
771 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CO", ISOT)] = VAL
780 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH4", ISOT)] = VAL
787 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O2", ISOT)] = VAL
793 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO", ISOT)] = VAL
799 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO2", ISOT)] = VAL
806 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO2", ISOT)] = VAL
811 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NH3", ISOT)] = VAL
817 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HNO3", ISOT)] = VAL
822 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OH", ISOT)] = VAL
828 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HF", ISOT)] = VAL
833 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCl", ISOT)] = VAL
840 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HBr", ISOT)] = VAL
847 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HI", ISOT)] = VAL
852 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("ClO", ISOT)] = VAL
857 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OCS", ISOT)] = VAL
866 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2CO", ISOT)] = VAL
872 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HDCO", ISOT)] = VAL
876 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("D2CO", ISOT)] = VAL
880 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HOCl", ISOT)] = VAL
885 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("N2", ISOT)] = VAL
890 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCN", ISOT)] = VAL
897 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3Cl", ISOT)] = VAL
902 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2O2", ISOT)] = VAL
906 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H2", ISOT)] = VAL
912 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H6", ISOT)] = VAL
917 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("PH3", ISOT)] = VAL
921 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("COF2", ISOT)] = VAL
926 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SF6", ISOT)] = VAL
930 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2S", ISOT)] = VAL
937 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCOOH", ISOT)] = VAL
942 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("DCOOH", ISOT)] = VAL
946 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCOOD", ISOT)] = VAL
950 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HO2", ISOT)] = VAL
954 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O", ISOT)] = VAL
958 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("ClONO2", ISOT)] = VAL
963 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO+", ISOT)] = VAL
967 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OClO", ISOT)] = VAL
972 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("BrO", ISOT)] = VAL
977 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2SO4", ISOT)] = VAL
981 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("Cl2O2", ISOT)] = VAL
986 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HOBr", ISOT)] = VAL
991 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H4", ISOT)] = VAL
996 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3OH", ISOT)] = VAL
1000 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3Br", ISOT)] = VAL
1005 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3CN", ISOT)] = VAL
1012 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH2DCN", ISOT)] = VAL
1016 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CF4", ISOT)] = VAL
1020 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HC3N", ISOT)] = VAL
1029 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CS", ISOT)] = VAL
1036 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HNC", ISOT)] = VAL
1043 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO", ISOT)] = VAL
1049 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C3H8", ISOT)] = VAL
1053 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2", ISOT)] = VAL
1058 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H", ISOT)] = VAL
1062 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("He", ISOT)] = VAL
1066 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("Ar", ISOT)] = VAL
1070 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C4H2", ISOT)] = VAL
1074 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO3", ISOT)] = VAL
1078 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CS2", ISOT)] = VAL
1085 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2N2", ISOT)] = VAL
1089 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("COCl2", ISOT)] = VAL
1094 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3F", ISOT)] = VAL
1098 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("GeH4", ISOT)] = VAL
1106 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3I", ISOT)] = VAL
1110 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NF3", ISOT)] = VAL
1114 return isotopologue_ratios;
1136 if (sum_r not_eq 0)
return sum_rm / sum_r;
1137 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)
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