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/particle.hpp | 68 ++++++-------------------------------- 1 file changed, 11 insertions(+), 57 deletions(-) (limited to 'lib/core/c++/particle/particle.hpp') diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index 1a99dcd..13ed37b 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -6,68 +6,22 @@ #include "../iterator.hpp" +#include "schema.hpp" +#include "aabb.hpp" + namespace kel { namespace lbm { -namespace coll { -struct Spheroid{}; -} -namespace sch { -using namespace saw::schema; - -namespace impl { -template -struct rotation_type_helper; - -template -struct rotation_type_helper { - using Schema = Scalar; -}; - -template -struct rotation_type_helper { - using Schema = Vector; -}; -} - -template -using ParticleRigidBody = Struct< - Member, "position">, - Member, "position_old">, - Member::Schema, "rotation">, - Member::Schema, "rotation_old">, - - Member, "acceleration">, - Member::Schema, "angular_acceleration"> ->; - -template::type radius = 1.0f> -using ParticleCollisionSpheroid = Struct< ->; template -using Particle = Struct< - Member, "rigid_body"> - // Problem is that dynamic data would two layered - // Member, "mask">, ->; - -template> -using ParticleGroup = Struct< - Member, "mask">, - Member,1u>, "mask_step">, - Member,1u>, "density">, - Member,1u>, "center_of_mass">, - Member,1u>, "total_mass">, - Member,1u>, "particles"> ->; -} - -template::type radius> -saw::data>> create_spheroid_particle_group( +saw::data>> create_spheroid_particle_group( + saw::data> radius_p, saw::data> density_p, const saw::data& mask_resolution ){ - saw::data>> part; + saw::data>> part; + + auto& rad_s = part.template get<"collision">().at({0u}).template get<"radius">(); + rad_s = radius_p; auto& mask = part.template get<"mask">(); auto& density = part.template get<"density">().at({{0u}}); @@ -83,7 +37,7 @@ saw::data>> cre for(uint64_t i = 0u; i < D; ++i){ mask_dims.at({i}) = mask_resolution; } - saw::data rad_d{radius}; + saw::data rad_d = radius_p.at({}); saw::data dia_d = rad_d * 2; mask = {mask_dims}; @@ -104,7 +58,7 @@ saw::data>> cre saw::data> center; for(uint64_t i = 0u; i < D; ++i){ - center.at({{i}}).set(radius); + center.at({{i}}) = rad_d; } iterator::apply([&](const auto& index){ -- cgit v1.2.3 From 7a7d681ce70133ef0bc47a701f5b8448b15b3a29 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 28 Jun 2026 19:17:52 +0200 Subject: Dangling --- lib/core/c++/particle/particle.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/core/c++/particle/particle.hpp') diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index 13ed37b..8e75e5a 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -8,6 +8,7 @@ #include "schema.hpp" #include "aabb.hpp" +#include "particle_opa.hpp" namespace kel { namespace lbm { -- cgit v1.2.3