File indexing completed on 2025-09-15 08:54:43
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Types.hh"
0010 #include "corecel/cont/Array.hh"
0011 #include "corecel/data/Collection.hh"
0012 #include "corecel/math/ArrayUtils.hh"
0013
0014 #include "FieldDriverOptions.hh"
0015
0016 namespace celeritas
0017 {
0018
0019
0020
0021
0022
0023
0024
0025 template<Ownership W, MemSpace M>
0026 struct UniformFieldParamsData
0027 {
0028 using Real3 = Array<real_type, 3>;
0029 template<class T>
0030 using VolumeItems = celeritas::Collection<T, W, M, VolumeId>;
0031
0032 Real3 field{0, 0, 0};
0033 FieldDriverOptions options;
0034 VolumeItems<char> has_field;
0035
0036
0037 explicit inline CELER_FUNCTION operator bool() const
0038 {
0039 return options && norm(field) > 0;
0040 }
0041
0042
0043 template<Ownership W2, MemSpace M2>
0044 UniformFieldParamsData&
0045 operator=(UniformFieldParamsData<W2, M2> const& other)
0046 {
0047 CELER_EXPECT(other);
0048 field = other.field;
0049 options = other.options;
0050 has_field = other.has_field;
0051 return *this;
0052 }
0053 };
0054
0055
0056 }