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/one_particle_sedimentation_2d/step.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'examples/one_particle_sedimentation_2d/step.hpp') diff --git a/examples/one_particle_sedimentation_2d/step.hpp b/examples/one_particle_sedimentation_2d/step.hpp index de42dec..f28586a 100644 --- a/examples/one_particle_sedimentation_2d/step.hpp +++ b/examples/one_particle_sedimentation_2d/step.hpp @@ -90,7 +90,8 @@ kel::lbm::error_or step( }).wait(); q.submit([&](acpp::sycl::handler& h){ - kel::lbm::data> gf; + // Gravity is an acceleration, which is what the integrator expects. + kel::lbm::data>> gf; gf.at({{1u}}) = conv.acceleration_si_to_lbm({-9.81}).handle(); component> fplbm_one_part{gf}; @@ -134,8 +135,8 @@ kel::lbm::error_or step( [&]() -> kel::lbm::data> { kel::lbm::data> vel; { - auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((1.2 / 0.41) * y_si.get() - (1.2 / (0.41*0.41)) * y_si.get() * y_si.get())}}).handle(); + auto y_si = conv.meter_lbm_to_si(as_unit>(index.at({{1u}}).template cast_to())).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast::type>((1.2 / 0.41) * y_si.get() - (1.2 / (0.41*0.41)) * y_si.get() * y_si.get())}).handle(); vel.at({{1u}}) = 0.0f; } return vel; @@ -210,8 +211,8 @@ kel::lbm::error_or step( [&]() -> kel::lbm::data> { kel::lbm::data> vel; { - auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((1.2 / 0.41) * y_si.get() - (1.2 / (0.41*0.41)) * y_si.get() * y_si.get())}}).handle(); + auto y_si = conv.meter_lbm_to_si(as_unit>(index.at({{1u}}).template cast_to())).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast::type>((1.2 / 0.41) * y_si.get() - (1.2 / (0.41*0.41)) * y_si.get() * y_si.get())}).handle(); vel.at({{1u}}) = 0.0f; } return vel; -- cgit v1.3.1