File indexing completed on 2026-11-07 10:11:40
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/io/Logger.hh"
0013 #include "celeritas/Quantities.hh"
0014 #include "celeritas/Types.hh"
0015
0016 namespace celeritas
0017 {
0018 namespace optical
0019 {
0020
0021
0022
0023
0024 struct MieMaterialData
0025 {
0026
0027 real_type forward_g{};
0028
0029 real_type backward_g{};
0030
0031 real_type forward_ratio{};
0032
0033 explicit operator bool() const
0034 {
0035 return forward_ratio >= 0 && forward_ratio <= 1 && forward_g >= -1
0036 && forward_g <= 1 && backward_g >= -1 && backward_g <= 1;
0037 }
0038 };
0039
0040
0041
0042
0043
0044 template<Ownership W, MemSpace M>
0045 struct MieData
0046 {
0047 template<class T>
0048 using Items = Collection<T, W, M>;
0049 template<class T>
0050 using OpticalMaterialItems = Collection<T, W, M, OptMatId>;
0051
0052
0053
0054 OpticalMaterialItems<MieMaterialData> mie_record;
0055
0056
0057
0058
0059 explicit CELER_FUNCTION operator bool() const
0060 {
0061 return !mie_record.empty();
0062 }
0063
0064
0065 template<Ownership W2, MemSpace M2>
0066 MieData& operator=(MieData<W2, M2> const& other)
0067 {
0068 CELER_EXPECT(other);
0069 mie_record = other.mie_record;
0070 return *this;
0071 }
0072 };
0073
0074
0075 }
0076 }