diff options
| -rw-r--r-- | modules/core/c++/hlbm.hpp | 18 | ||||
| -rw-r--r-- | modules/sycl/c++/data.hpp | 4 |
2 files changed, 14 insertions, 8 deletions
diff --git a/modules/core/c++/hlbm.hpp b/modules/core/c++/hlbm.hpp index eccc2cd..a749035 100644 --- a/modules/core/c++/hlbm.hpp +++ b/modules/core/c++/hlbm.hpp @@ -103,16 +103,13 @@ public: template<typename T, typename Desc, typename Encode> class component<T, Desc, cmpt::HlbmParticle, Encode> final { private: +/* template<typename CellFieldSchema, typename MacroFieldSchema, typename ParticleSchema, uint64_t i> void apply_i(const saw::data<CellFieldSchema, Encode>& field, const saw::data<MacroFieldSchema,Encode>& macros, const saw::data<ParticleSchema,Encode>& part_groups, saw::data<sch::FixedArray<sch::UInt64,1u>> index, saw::data<sch::UInt64> time_step) const { // if constexpr ( i < ) - } + } +*/ public: - /* - template<typename CellFieldSchema, typename MacroFieldSchema, typename ParticleSchema, uint64_t i> - void apply_i() - */ - template<typename CellFieldSchema, typename MacroFieldSchema, typename ParticleSchema> void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<MacroFieldSchema,Encode>& macros, const saw::data<ParticleSchema,Encode>& part_group, saw::data<sch::FixedArray<sch::UInt64,1u>> index, saw::data<sch::UInt64> time_step) const { /// Figure out how to access the particle list @@ -125,7 +122,7 @@ public: auto& mvel = macros.template get<"velocity">(); { auto& parts = part_spheroid_group.template get<"particles">(); - auto parts_size = parts.dims().at({0u}); + auto parts_size = parts.meta().at({0u}); auto& pi = parts.at(index); auto& pirb = pi.template get<"rigid_body">(); @@ -134,7 +131,12 @@ public: saw::data<sch::FixedArray<sch::UInt64,Desc::D>> start; saw::data<sch::FixedArray<sch::UInt64,Desc::D>> stop; - auto aabb = particle_aabb<ParticleSchema>::calculate(part_spheroid_group,index,mvel.meta()); + auto eo_aabb = particle_aabb<typename ParticleSchema::ValueType>::calculate(part_spheroid_group,index,mvel.meta()); + if(eo_aabb.is_error()){ + return; + } + auto& aabb = eo_aabb.get_value(); + /// Ok, I iterate over the space which covers our particle? So lower bounds to upper bounds start = aabb.template get<"a">(); stop = aabb.template get<"b">(); diff --git a/modules/sycl/c++/data.hpp b/modules/sycl/c++/data.hpp index 9f43848..ec0fccf 100644 --- a/modules/sycl/c++/data.hpp +++ b/modules/sycl/c++/data.hpp @@ -103,6 +103,10 @@ public: return saw::data<schema::FixedArray<schema::UInt64, sizeof...(Dims)>>{{Dims...}}; } + static constexpr data<schema::FixedArray<schema::UInt64, sizeof...(Dims)>> meta() { + return saw::data<schema::FixedArray<schema::UInt64, sizeof...(Dims)>>{{Dims...}}; + } + constexpr data<Sch,Encode>& at(const data<schema::FixedArray<schema::UInt64,sizeof...(Dims)>>& index){ return values_[kel::lbm::flatten_index<schema::UInt64,sizeof...(Dims)>::apply(index,get_dims()).get()]; } |
