diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-11-11 01:16:44 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-11-11 01:16:44 +0100 |
| commit | 0c0087ef9482634273ec1a23d3a915754f94926d (patch) | |
| tree | 972a8e48c1fae67af23b982d7a9e1a506fc8705f /examples/one_particle_sedimentation_2d/step.hpp | |
| parent | 2e63c4a31f946a8bafa92c49c1a0a116c0eb6dae (diff) | |
| download | libs-lbm-0c0087ef9482634273ec1a23d3a915754f94926d.tar.gz | |
Snapshot. Migration to Lbm Unit
Diffstat (limited to 'examples/one_particle_sedimentation_2d/step.hpp')
| -rw-r--r-- | examples/one_particle_sedimentation_2d/step.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
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<void> step( }).wait(); q.submit([&](acpp::sycl::handler& h){ - kel::lbm::data<sch::Vector<T,Desc::D>> gf; + // Gravity is an acceleration, which is what the integrator expects. + kel::lbm::data<sch::LbmAcceleration<sch::Vector<T,Desc::D>>> gf; gf.at({{1u}}) = conv.acceleration_si_to_lbm({-9.81}).handle(); component<T,Desc,cmpt::FpLbmOneParticle,encode::Sycl<kel::lbm::enc::Native>> fplbm_one_part{gf}; @@ -134,8 +135,8 @@ kel::lbm::error_or<void> step( [&]() -> kel::lbm::data<sch::Vector<T,Desc::D>> { kel::lbm::data<sch::Vector<T,Desc::D>> vel; { - auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to<T>()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast<typename kel::lbm::native_data_type<T>::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<sch::LbmMeter<T>>(index.at({{1u}}).template cast_to<T>())).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast<typename kel::lbm::native_data_type<T>::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<void> step( [&]() -> kel::lbm::data<sch::Vector<T,Desc::D>> { kel::lbm::data<sch::Vector<T,Desc::D>> vel; { - auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to<T>()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast<typename kel::lbm::native_data_type<T>::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<sch::LbmMeter<T>>(index.at({{1u}}).template cast_to<T>())).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast<typename kel::lbm::native_data_type<T>::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; |
