From 0c0087ef9482634273ec1a23d3a915754f94926d Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 11 Nov 2026 01:16:44 +0100 Subject: Snapshot. Migration to Lbm Unit --- examples/particles_gpu/particles_gpu.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'examples/particles_gpu') diff --git a/examples/particles_gpu/particles_gpu.cpp b/examples/particles_gpu/particles_gpu.cpp index f3edbf2..94ec5f1 100644 --- a/examples/particles_gpu/particles_gpu.cpp +++ b/examples/particles_gpu/particles_gpu.cpp @@ -30,7 +30,9 @@ kel::lbm::error_or lbm_main(int argc, char** argv){ auto& old_pos = body.template get<"position_old">(); auto& acceleration = body.template get<"acceleration">(); auto& p_rad = part.template get<"collision">().template get<"radius">(); - p_rad = {0.4f}; + // Scalar base, so the value goes through the element rather than a + // braced whole-unit assignment. + p_rad.at({}).set(0.4f); if(j.get() % 2u == 0) acceleration.at({{1u}}) = {-9.81}; @@ -41,7 +43,9 @@ kel::lbm::error_or lbm_main(int argc, char** argv){ } } - kel::lbm::data> time_step; + // A timestep is a lattice time, which makes (pos - pos_old)/time_step a + // velocity rather than an unlabelled vector. + kel::lbm::data>> time_step; time_step.at({}).set(0.05f); for(kel::lbm::data dt{0u}; dt < kel::lbm::data{32ul}; ++dt){ -- cgit v1.3.1