summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-07-16 14:34:19 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-07-16 14:34:19 +0200
commit18346ca25b838908b21c29a3e29f89e7a55a1474 (patch)
treeb1bbb55a7595015be1bd010e362631cc1d8a68b7
parentaedeb28b41ffbe0229d065c69f7d2e4570968ace (diff)
downloadlibs-lbm-18346ca25b838908b21c29a3e29f89e7a55a1474.tar.gz
Adding meta as dims name
-rw-r--r--modules/core/c++/hlbm.hpp18
-rw-r--r--modules/sycl/c++/data.hpp4
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()];
}