File indexing completed on 2025-09-17 08:53:44
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 "celeritas/Types.hh"
0014
0015 namespace celeritas
0016 {
0017 namespace optical
0018 {
0019
0020
0021
0022
0023 struct WlsMaterialRecord
0024 {
0025 real_type mean_num_photons{};
0026 real_type time_constant{};
0027
0028
0029 explicit CELER_FUNCTION operator bool() const
0030 {
0031 return mean_num_photons > 0 && time_constant > 0;
0032 }
0033 };
0034
0035
0036
0037
0038
0039 template<Ownership W, MemSpace M>
0040 struct WavelengthShiftData
0041 {
0042 template<class T>
0043 using Items = Collection<T, W, M>;
0044 template<class T>
0045 using OpticalMaterialItems = Collection<T, W, M, OptMatId>;
0046
0047
0048
0049 OpticalMaterialItems<WlsMaterialRecord> wls_record;
0050
0051
0052 OpticalMaterialItems<NonuniformGridRecord> energy_cdf;
0053
0054
0055 Items<real_type> reals;
0056
0057
0058
0059
0060 explicit CELER_FUNCTION operator bool() const
0061 {
0062 return !wls_record.empty() && !energy_cdf.empty();
0063 }
0064
0065
0066 template<Ownership W2, MemSpace M2>
0067 WavelengthShiftData& operator=(WavelengthShiftData<W2, M2> const& other)
0068 {
0069 CELER_EXPECT(other);
0070 wls_record = other.wls_record;
0071 energy_cdf = other.energy_cdf;
0072 reals = other.reals;
0073 return *this;
0074 }
0075 };
0076
0077
0078 }
0079 }