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