From cb514e099515934322d9400d559a65b831cf4c5f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 20 Feb 2026 13:55:00 +0100 Subject: Adding fake particles --- lib/core/c++/particle.hpp | 2 +- lib/core/c++/particle/particle.hpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/core/c++') diff --git a/lib/core/c++/particle.hpp b/lib/core/c++/particle.hpp index f8a5cb0..b098ecc 100644 --- a/lib/core/c++/particle.hpp +++ b/lib/core/c++/particle.hpp @@ -24,8 +24,8 @@ public: verlet_step_lambda(p,{1.0}); // Update porosity over lattice nodes + - } }; } diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp index a82b12d..8ef590d 100644 --- a/lib/core/c++/particle/particle.hpp +++ b/lib/core/c++/particle/particle.hpp @@ -40,19 +40,21 @@ using ParticleRigidBody = Struct< template using ParticleCollisionSpheroid = Struct< - Member + Member, "radius"> >; template> using Particle = Struct< Member, "rigid_body">, Member, - Member + // Problem is that dynamic data would two layered + // Member, "mask">, + Member, "mass"> >; } template -saw::data, sch::ParticleCollisionSpheroid> create_spheroid_particle( +saw::data>> create_spheroid_particle( saw::data> pos_p, saw::data> vec_p, saw::data> acc_p, @@ -175,9 +177,11 @@ constexpr auto broadphase_collision_distance_squared = [](saw::data::type>(2); + saw::data> two; + two.at({}) = 2.0; + auto rad_ab_2 = rad_l * rad_l + rad_r * rad_r + rad_r * rad_l * two; - return std::make_pair((norm_2.at({}).get() < rad_ab_2.get()), norm_2); + return std::make_pair((norm_2.at({}).get() < rad_ab_2.at({}).get()), norm_2); }; /** * -- cgit v1.2.3