From fb3a5f5bcba542974cf2f3f1f401ec717e662942 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 27 Jul 2026 13:32:05 +0200 Subject: Cleaning up simulation setup --- examples/poiseulle_particles_2d_gpu/step.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/poiseulle_particles_2d_gpu/step.hpp') diff --git a/examples/poiseulle_particles_2d_gpu/step.hpp b/examples/poiseulle_particles_2d_gpu/step.hpp index aa0e382..c1b148f 100644 --- a/examples/poiseulle_particles_2d_gpu/step.hpp +++ b/examples/poiseulle_particles_2d_gpu/step.hpp @@ -18,13 +18,12 @@ saw::error_or step( auto& info_f = fields.template get<"info">(); auto& porous_f = macros.template get<"porosity">(); - component> particle; + // component> particle; // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ component> collision{0.8}; component> bb; - component,encode::Sycl> abb; saw::data> rho_b; rho_b.at({}) = 1.0; @@ -77,11 +76,13 @@ saw::error_or step( }); }).wait(); + /* q.submit([&](acpp::sycl::handler& h){ h.parallel_for(acpp::sycl::range<1u>{1u}, [=](acpp::sycl::id<1u> idx){ particle.apply(fields,macros,particles,{{0u}},t_i); }); }).wait(); + */ // Step /* -- cgit v1.2.3 From a826f7d9d4bb48565036dd665cb4c6a54622010d Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 27 Jul 2026 21:53:27 +0200 Subject: Dangling --- examples/poiseulle_particles_2d_gpu/step.hpp | 55 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 28 deletions(-) (limited to 'examples/poiseulle_particles_2d_gpu/step.hpp') diff --git a/examples/poiseulle_particles_2d_gpu/step.hpp b/examples/poiseulle_particles_2d_gpu/step.hpp index c1b148f..37eb4e7 100644 --- a/examples/poiseulle_particles_2d_gpu/step.hpp +++ b/examples/poiseulle_particles_2d_gpu/step.hpp @@ -5,7 +5,7 @@ namespace kel { namespace lbm { -template +template saw::error_or step( const converter& conv, saw::data>,encode::Sycl>& fields, @@ -17,28 +17,44 @@ saw::error_or step( auto& q = dev.get_handle(); auto& info_f = fields.template get<"info">(); auto& porous_f = macros.template get<"porosity">(); + + q.submit([&](acpp::sycl::handler& h){ + component> hlbm_reset; + h.parallel_for(acpp::sycl::range{dim_x,dim_y}, [=](acpp::sycl::id idx){ + saw::data> index; + for(uint64_t i = 0u; i < Desc::D; ++i){ + index.at({{i}}).set(idx[i]); + } + + hlbm_reset.apply(fields,macros,index,t_i); + }); + }).wait(); + + q.submit([&](acpp::sycl::handler& h){ + component> hlbm_one_part; + + h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ + saw::data> index; + for(uint64_t i = 0u; i < 1u; ++i){ + index.at({{i}}).set(idx[i]); + } - // component> particle; + hlbm_one_part.apply(fields,macros,particles,index,t_i,{16u}); + }); + }).wait(); // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ component> collision{0.8}; component> bb; - saw::data> rho_b; - rho_b.at({}) = 1.0; - saw::data> vel_b; - vel_b.at({{0u}}) = 0.015; - - component> equi{rho_b,vel_b}; - component,encode::Sycl> flow_in{ [&](){ uint64_t target_t_i = 16u; if(t_i.get() < target_t_i){ - return 1.0 + (0.0002 / target_t_i) * t_i.get(); + return 1.0 + (0.01 / target_t_i) * t_i.get(); } - return 1.0002; + return 1.01; }() }; component,encode::Sycl> flow_out{1.0}; @@ -62,12 +78,10 @@ saw::error_or step( break; case 3u: flow_in.apply(fields,index,t_i); - // equi.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); break; case 4u: flow_out.apply(fields,index,t_i); - // equi.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); break; default: @@ -76,21 +90,6 @@ saw::error_or step( }); }).wait(); - /* - q.submit([&](acpp::sycl::handler& h){ - h.parallel_for(acpp::sycl::range<1u>{1u}, [=](acpp::sycl::id<1u> idx){ - particle.apply(fields,macros,particles,{{0u}},t_i); - }); - }).wait(); - */ - - // Step - /* - q.submit([&](acpp::sycl::handler& h){ - // h.depends_on(collision_ev); - }).wait(); - */ - return saw::make_void(); } -- cgit v1.2.3