File indexing completed on 2026-11-05 10:27:45
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Macros.hh"
0010 #include "corecel/Types.hh"
0011 #include "corecel/data/Collection.hh"
0012 #include "corecel/grid/NonuniformGridData.hh"
0013 #include "corecel/math/Quantity.hh"
0014 #include "celeritas/Quantities.hh"
0015 #include "celeritas/Types.hh"
0016
0017 namespace celeritas
0018 {
0019
0020
0021
0022
0023 struct GammaNuclearScalars
0024 {
0025
0026 ParticleId gamma_id;
0027
0028
0029 static CELER_CONSTEXPR_FUNCTION units::MevEnergy max_valid_energy()
0030 {
0031 return units::MevEnergy{1e+8};
0032 }
0033
0034
0035 explicit CELER_FUNCTION operator bool() const
0036 {
0037 return static_cast<bool>(gamma_id);
0038 }
0039 };
0040
0041
0042
0043
0044
0045 template<Ownership W, MemSpace M>
0046 struct GammaNuclearData
0047 {
0048 template<class T>
0049 using Items = Collection<T, W, M>;
0050 template<class T>
0051 using ElementItems = Collection<T, W, M, ElementId>;
0052
0053
0054
0055
0056 GammaNuclearScalars scalars;
0057
0058
0059 ElementItems<NonuniformGridRecord> xs_iaea;
0060 Items<real_type> reals;
0061
0062
0063 ElementItems<NonuniformGridRecord> xs_chips;
0064
0065
0066 explicit CELER_FUNCTION operator bool() const
0067 {
0068 return scalars && !xs_iaea.empty() && !reals.empty()
0069 && xs_chips.size() == xs_iaea.size();
0070 }
0071
0072
0073 template<Ownership W2, MemSpace M2>
0074 GammaNuclearData& operator=(GammaNuclearData<W2, M2> const& other)
0075 {
0076 CELER_EXPECT(other);
0077 scalars = other.scalars;
0078 xs_iaea = other.xs_iaea;
0079 xs_chips = other.xs_chips;
0080 reals = other.reals;
0081
0082 return *this;
0083 }
0084 };
0085
0086
0087 }