From 4c9e43a42c15ce93ffded21dfcaa171f63d20d69 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 11 Jun 2026 14:07:27 +0200 Subject: Fixing deduction issues from constexpr values --- lib/core/c++/particle/aabb.hpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'lib/core/c++/particle/aabb.hpp') 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 +template class particle_aabb final { }; -template::type radius> -class particle_aabb > > final { +template +class particle_aabb< + sch::ParticleGroup> +> final { public: - using Schema = sch::ParticleGroup>; + using Schema = sch::ParticleGroup>; - using AABB = Struct< - Member"a">, - Member"b"> + using AABB = sch::Struct< + sch::Member,"a">, + sch::Member,"b"> >; public: - static constexpr saw::data get(const saw::data& p_grp, const saw::data>& i, const saw::data>& meta){ + static constexpr saw::data calculate(const saw::data& p_grp, const saw::data>& i, const saw::data>& meta){ + + saw::data 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; auto& a = aabb.template get<"a">(); auto& b = aabb.template get<"b">(); - saw::data> rad_d; - rad_d.at({}).set(radius); + const saw::data>& rad_d = p_grp.template get<"collision">().template get<"radius">().at({0u}); saw::data> lower; saw::data> 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{0}; a.at({i}) = lower.at({{i}}).template cast_to(); upper.at({{i}}) = pirb_pos.at({{i}}) + rad_d.at({}); - b.at({i}) = (upper.at({{i}})+saw::data{1}).template cast_to() + b.at({i}) = (upper.at({{i}})+saw::data{1}).template cast_to(); } return aabb; + } }; } -- cgit v1.2.3 From ff702d3c9427794c5557360c53b93f9861f97554 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 22 Jun 2026 17:36:51 +0200 Subject: Dangling --- lib/core/c++/particle/aabb.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/core/c++/particle/aabb.hpp') diff --git a/lib/core/c++/particle/aabb.hpp b/lib/core/c++/particle/aabb.hpp index 8579695..d74ea88 100644 --- a/lib/core/c++/particle/aabb.hpp +++ b/lib/core/c++/particle/aabb.hpp @@ -7,6 +7,7 @@ namespace kel { namespace lbm { template class particle_aabb final { + static_assert(saw::always_false::value, "Not supported"); }; template @@ -21,7 +22,8 @@ public: sch::Member,"b"> >; public: - static constexpr saw::data calculate(const saw::data& p_grp, const saw::data>& i, const saw::data>& meta){ + template + static constexpr saw::data calculate(const saw::data& p_grp, const saw::data>& i, const saw::data>& meta){ saw::data aabb; auto& parts = p_grp.template get<"particles">(); -- cgit v1.2.3 From 90f242af3036e0863a067c3f55457566d1f1e4ce Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 23 Jun 2026 14:13:48 +0200 Subject: Fixing hlbm and particle aabb --- lib/core/c++/particle/aabb.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/core/c++/particle/aabb.hpp') diff --git a/lib/core/c++/particle/aabb.hpp b/lib/core/c++/particle/aabb.hpp index d74ea88..1773dea 100644 --- a/lib/core/c++/particle/aabb.hpp +++ b/lib/core/c++/particle/aabb.hpp @@ -7,7 +7,7 @@ namespace kel { namespace lbm { template class particle_aabb final { - static_assert(saw::always_false::value, "Not supported"); + static_assert(saw::always_false, "Not supported"); }; template -- cgit v1.2.3