File indexing completed on 2025-02-22 10:31:27
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 #include "corecel/data/Collection.hh"
0013 #include "celeritas/Types.hh"
0014 #include "celeritas/grid/GenericGridData.hh"
0015
0016 #include "Types.hh"
0017
0018 namespace celeritas
0019 {
0020 namespace optical
0021 {
0022
0023
0024
0025
0026 template<Ownership W, MemSpace M>
0027 struct MaterialParamsData
0028 {
0029 template<class T>
0030 using Items = Collection<T, W, M>;
0031 template<class T>
0032 using OpticalMaterialItems = Collection<T, W, M, OpticalMaterialId>;
0033 template<class T>
0034 using VolumeItems = celeritas::Collection<T, W, M, VolumeId>;
0035
0036
0037
0038 OpticalMaterialItems<GenericGridRecord> refractive_index;
0039 VolumeItems<OpticalMaterialId> optical_id;
0040
0041
0042 Items<real_type> reals;
0043
0044
0045
0046
0047 explicit CELER_FUNCTION operator bool() const
0048 {
0049 return !refractive_index.empty() && !optical_id.empty()
0050 && !reals.empty();
0051 }
0052
0053
0054 template<Ownership W2, MemSpace M2>
0055 MaterialParamsData& operator=(MaterialParamsData<W2, M2> const& other)
0056 {
0057 CELER_EXPECT(other);
0058 refractive_index = other.refractive_index;
0059 optical_id = other.optical_id;
0060 reals = other.reals;
0061 return *this;
0062 }
0063 };
0064
0065
0066 }
0067 }