From 94953f367542c81d162ff31fb60567143e258c24 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 6 Jul 2026 18:07:55 +0200 Subject: Managed finally to kick myself enough to fix the aabb checks --- modules/core/tests/particles.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'modules/core/tests') diff --git a/modules/core/tests/particles.cpp b/modules/core/tests/particles.cpp index 8c21608..d11fa4f 100644 --- a/modules/core/tests/particles.cpp +++ b/modules/core/tests/particles.cpp @@ -280,13 +280,42 @@ SAW_TEST("Spheroid Particle / AABB"){ constexpr uint64_t D = 2u; saw::data> radi,dense; - radi.at({}) = 2.0f; + radi.at({}) = 2.2f; dense.at({}) = 1.0f; auto spheroid_pgrp = lbm::create_spheroid_particle_group(radi,dense,{8u}); - // auto res = lbm::particle_aabb>>::calculate(spheroid_pgrp,{{0u}},{}); + auto& rb_array = spheroid_pgrp.template get<"particles">(); + rb_array = {1u}; + auto& rb = rb_array.at({0u}).template get<"rigid_body">(); + auto& rb_pos = rb.template get<"position">(); + { + rb_pos.at({{0u}}).set(4.1f); + rb_pos.at({{1u}}).set(2.9f); + } + + auto res = lbm::particle_aabb>>::calculate(spheroid_pgrp,{{0u}},{{64u,32u}}); + + { + auto res_check = [&](const auto& tbp){ + lbm::iterator<1u>::apply([&](const auto& index){ + std::cout<()); + res_check(res.template get<"b">()); + } + auto& rva = res.template get<"a">(); + auto& rvb = res.template get<"b">(); + + SAW_EXPECT(rva.at({{0u}}).get() == 1, std::string{"Expected another value for rva at 0: "} + std::to_string(rva.at({{0u}}).get())); + SAW_EXPECT(rva.at({{1u}}).get() == 0, std::string{"Expected another value for rva at 1: "} + std::to_string(rva.at({{1u}}).get())); + + SAW_EXPECT(rvb.at({{0u}}).get() == 7, std::string{"Expected another value for rvb at 0: "} + std::to_string(rvb.at({{0u}}).get())); + SAW_EXPECT(rvb.at({{1u}}).get() == 6, std::string{"Expected another value for rvb at 1: "} + std::to_string(rvb.at({{1u}}).get())); // std::cout<