diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-06-11 14:07:27 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-06-11 14:07:27 +0200 |
| commit | 4c9e43a42c15ce93ffded21dfcaa171f63d20d69 (patch) | |
| tree | 13a8e06228070a1989be24ba09130a5ccbafeb45 /lib/core/c++/particle/aabb.hpp | |
| parent | ad0efe4d0e43a2a4f122677578107c2a0398e53f (diff) | |
| download | libs-lbm-4c9e43a42c15ce93ffded21dfcaa171f63d20d69.tar.gz | |
Fixing deduction issues from constexpr values
Diffstat (limited to 'lib/core/c++/particle/aabb.hpp')
| -rw-r--r-- | lib/core/c++/particle/aabb.hpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/core/c++/particle/aabb.hpp b/lib/core/c++/particle/aabb.hpp index aec95ca..8579695 100644 --- a/lib/core/c++/particle/aabb.hpp +++ b/lib/core/c++/particle/aabb.hpp @@ -1,36 +1,39 @@ #pragma once -#include "particle.hpp" +#include "common.hpp" +#include "schema.hpp" namespace kel { namespace lbm { -template<typename T, uint64_t D, typename PColl> +template<typename PGroup> class particle_aabb final { }; -template<typename T, uint64_t D, typename saw::native_data_type<T>::type radius> -class particle_aabb<ParticleGroup<T,D,sch::ParticleCollisionSpheroid<T,radius> > > final { +template<typename T, uint64_t D> +class particle_aabb< + sch::ParticleGroup<T,D,coll::Spheroid<T>> +> final { public: - using Schema = sch::ParticleGroup<T,D,sch::ParticleCollisionSpheroid<T,radius>>; + using Schema = sch::ParticleGroup<T,D,coll::Spheroid<T>>; - using AABB = Struct< - Member<sch::FixedArray<sch::UInt64,D>"a">, - Member<sch::FixedArray<sch::UInt64,D>"b"> + using AABB = sch::Struct< + sch::Member<sch::FixedArray<sch::UInt64,D>,"a">, + sch::Member<sch::FixedArray<sch::UInt64,D>,"b"> >; public: - static constexpr saw::data<AABB> get(const saw::data<Schema>& p_grp, const saw::data<sch::FixedArray<sch::UInt64,1u>>& i, const saw::data<sch::FixedArray<sch::UInt64,D>>& meta){ + static constexpr saw::data<AABB> calculate(const saw::data<Schema>& p_grp, const saw::data<sch::FixedArray<sch::UInt64,1u>>& i, const saw::data<sch::FixedArray<sch::UInt64,D>>& meta){ + + saw::data<AABB> aabb; auto& parts = p_grp.template get<"particles">(); auto& pi = parts.at(i); auto& pirb = pi.template get<"rigid_body">(); auto& pirb_pos = pirb.template get<"position">(); - saw::data<AABB> aabb; auto& a = aabb.template get<"a">(); auto& b = aabb.template get<"b">(); - saw::data<sch::Scalar<T>> rad_d; - rad_d.at({}).set(radius); + const saw::data<sch::Scalar<T>>& rad_d = p_grp.template get<"collision">().template get<"radius">().at({0u}); saw::data<sch::Vector<T,D>> lower; saw::data<sch::Vector<T,D>> upper; @@ -39,10 +42,11 @@ public: lower.at({{i}}) = pirb_pos.at({{i}}) >= rad_d.at({}) ? (pirb_pos.at({{i}}) - rad_d.at({})) : saw::data<T>{0}; a.at({i}) = lower.at({{i}}).template cast_to<sch::UInt64>(); upper.at({{i}}) = pirb_pos.at({{i}}) + rad_d.at({}); - b.at({i}) = (upper.at({{i}})+saw::data<T>{1}).template cast_to<sch::UInt64>() + b.at({i}) = (upper.at({{i}})+saw::data<T>{1}).template cast_to<sch::UInt64>(); } return aabb; + } }; } |
