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 ElectroNuclearScalars
0024 {
0025
0026 ParticleId electron_id;
0027 ParticleId positron_id;
0028
0029
0030 static CELER_CONSTEXPR_FUNCTION units::MevEnergy min_valid_energy()
0031 {
0032 return units::MevEnergy{1e+2};
0033 }
0034
0035
0036 static CELER_CONSTEXPR_FUNCTION units::MevEnergy max_valid_energy()
0037 {
0038 return units::MevEnergy{1e+8};
0039 }
0040
0041
0042 explicit CELER_FUNCTION operator bool() const
0043 {
0044 return electron_id && positron_id;
0045 }
0046 };
0047
0048
0049
0050
0051
0052 template<Ownership W, MemSpace M>
0053 struct ElectroNuclearData
0054 {
0055 template<class T>
0056 using Items = Collection<T, W, M>;
0057 template<class T>
0058 using ElementItems = Collection<T, W, M, ElementId>;
0059
0060
0061
0062
0063 ElectroNuclearScalars scalars;
0064
0065
0066 ElementItems<NonuniformGridRecord> micro_xs;
0067 Items<real_type> reals;
0068
0069
0070 explicit CELER_FUNCTION operator bool() const
0071 {
0072 return scalars && !micro_xs.empty() && !reals.empty();
0073 }
0074
0075
0076 template<Ownership W2, MemSpace M2>
0077 ElectroNuclearData& operator=(ElectroNuclearData<W2, M2> const& other)
0078 {
0079 CELER_EXPECT(other);
0080 scalars = other.scalars;
0081 micro_xs = other.micro_xs;
0082 reals = other.reals;
0083
0084 return *this;
0085 }
0086 };
0087
0088
0089 }