File indexing completed on 2025-09-17 08:53:41
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
0024 struct ExchangeParameters
0025 {
0026 using Real4 = Array<real_type, 4>;
0027
0028
0029 real_type ss{};
0030 Real4 slope{0, 0, 0, 0};
0031 Real4 expnt{0, 0, 0, 0};
0032 };
0033
0034
0035
0036
0037
0038
0039 struct ChipsDiffXsCoefficients
0040 {
0041 using ChipsArray = Array<real_type, 42>;
0042
0043
0044 ChipsArray par{};
0045 };
0046
0047
0048
0049
0050
0051 template<Ownership W, MemSpace M>
0052 struct NeutronElasticData
0053 {
0054 using XsUnits = units::Native;
0055
0056 template<class T>
0057 using Items = Collection<T, W, M>;
0058 template<class T>
0059 using ElementItems = Collection<T, W, M, ElementId>;
0060 template<class T>
0061 using IsotopeItems = Collection<T, W, M, IsotopeId>;
0062
0063
0064
0065
0066 ParticleId neutron;
0067
0068
0069 units::MevMass neutron_mass;
0070
0071
0072 ElementItems<NonuniformGridRecord> micro_xs;
0073
0074
0075 IsotopeItems<ChipsDiffXsCoefficients> coeffs;
0076
0077
0078 Items<real_type> reals;
0079
0080
0081
0082
0083 static CELER_CONSTEXPR_FUNCTION units::MevEnergy min_valid_energy()
0084 {
0085 return units::MevEnergy{1e-5};
0086 }
0087
0088 static CELER_CONSTEXPR_FUNCTION units::MevEnergy max_valid_energy()
0089 {
0090 return units::MevEnergy{2e+4};
0091 }
0092
0093
0094 explicit CELER_FUNCTION operator bool() const
0095 {
0096 return neutron && neutron_mass > zero_quantity() && !micro_xs.empty()
0097 && !coeffs.empty() && !reals.empty();
0098 }
0099
0100
0101 template<Ownership W2, MemSpace M2>
0102 NeutronElasticData& operator=(NeutronElasticData<W2, M2> const& other)
0103 {
0104 CELER_EXPECT(other);
0105 neutron = other.neutron;
0106 neutron_mass = other.neutron_mass;
0107 micro_xs = other.micro_xs;
0108 coeffs = other.coeffs;
0109 reals = other.reals;
0110 return *this;
0111 }
0112 };
0113
0114 using NeutronElasticHostRef = HostCRef<NeutronElasticData>;
0115 using NeutronElasticDeviceRef = DeviceCRef<NeutronElasticData>;
0116 using NeutronElasticRef = NativeCRef<NeutronElasticData>;
0117
0118
0119 }