File indexing completed on 2025-09-18 09:09:07
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Macros.hh"
0010 #include "celeritas/Quantities.hh"
0011 #include "celeritas/Types.hh"
0012 #include "celeritas/phys/AtomicNumber.hh"
0013
0014 #include "MaterialData.hh"
0015
0016 namespace celeritas
0017 {
0018
0019
0020
0021
0022
0023
0024
0025
0026 class IsotopeView
0027 {
0028 public:
0029
0030
0031 using MaterialParamsRef = NativeCRef<MaterialParamsData>;
0032 using MevEnergy = units::MevEnergy;
0033 using MevMass = units::MevMass;
0034 using AtomicMassNumber = AtomicNumber;
0035
0036
0037 public:
0038
0039 inline CELER_FUNCTION
0040 IsotopeView(MaterialParamsRef const& params, IsotopeId isot_id);
0041
0042
0043 CELER_FORCEINLINE_FUNCTION IsotopeId isotope_id() const;
0044
0045
0046 CELER_FORCEINLINE_FUNCTION AtomicNumber atomic_number() const;
0047
0048
0049 CELER_FORCEINLINE_FUNCTION AtomicMassNumber atomic_mass_number() const;
0050
0051
0052 CELER_FORCEINLINE_FUNCTION MevEnergy binding_energy() const;
0053
0054
0055 CELER_FORCEINLINE_FUNCTION MevEnergy proton_loss_energy() const;
0056
0057
0058 CELER_FORCEINLINE_FUNCTION MevEnergy neutron_loss_energy() const;
0059
0060
0061 CELER_FORCEINLINE_FUNCTION MevMass nuclear_mass() const;
0062
0063 private:
0064 MaterialParamsRef const& params_;
0065 IsotopeId isotope_;
0066
0067
0068
0069 CELER_FORCEINLINE_FUNCTION IsotopeRecord const& isotope_def() const
0070 {
0071 return params_.isotopes[isotope_];
0072 }
0073 };
0074
0075
0076
0077
0078
0079
0080
0081 CELER_FUNCTION
0082 IsotopeView::IsotopeView(MaterialParamsRef const& params, IsotopeId isot_id)
0083 : params_{params}, isotope_{isot_id}
0084 {
0085 CELER_EXPECT(isotope_ < params.isotopes.size());
0086 }
0087
0088
0089
0090
0091
0092 CELER_FUNCTION IsotopeId IsotopeView::isotope_id() const
0093 {
0094 return isotope_;
0095 }
0096
0097
0098
0099
0100
0101 CELER_FUNCTION AtomicNumber IsotopeView::atomic_number() const
0102 {
0103 return isotope_def().atomic_number;
0104 }
0105
0106
0107
0108
0109
0110 CELER_FUNCTION IsotopeView::AtomicMassNumber
0111 IsotopeView::atomic_mass_number() const
0112 {
0113 return isotope_def().atomic_mass_number;
0114 }
0115
0116
0117
0118
0119
0120 CELER_FUNCTION units::MevEnergy IsotopeView::binding_energy() const
0121 {
0122 return isotope_def().binding_energy;
0123 }
0124
0125
0126
0127
0128
0129 CELER_FUNCTION units::MevEnergy IsotopeView::proton_loss_energy() const
0130 {
0131 return isotope_def().proton_loss_energy;
0132 }
0133
0134
0135
0136
0137
0138 CELER_FUNCTION units::MevEnergy IsotopeView::neutron_loss_energy() const
0139 {
0140 return isotope_def().neutron_loss_energy;
0141 }
0142
0143
0144
0145
0146
0147 CELER_FUNCTION units::MevMass IsotopeView::nuclear_mass() const
0148 {
0149 return isotope_def().nuclear_mass;
0150 }
0151
0152
0153 }