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/particles_gpu | |
| parent | 2e63c4a31f946a8bafa92c49c1a0a116c0eb6dae (diff) | |
| download | libs-lbm-0c0087ef9482634273ec1a23d3a915754f94926d.tar.gz | |
Snapshot. Migration to Lbm Unit
Diffstat (limited to 'examples/particles_gpu')
| -rw-r--r-- | examples/particles_gpu/particles_gpu.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<void> 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<T> 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<void> lbm_main(int argc, char** argv){ } } - kel::lbm::data<sch::Scalar<sch::Float32>> 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<sch::LbmSecond<sch::Scalar<sch::Float32>>> time_step; time_step.at({}).set(0.05f); for(kel::lbm::data<sch::UInt64> dt{0u}; dt < kel::lbm::data<sch::UInt64>{32ul}; ++dt){ |
