From 2bae8b93faf614b1acb5df7269087b4f3786da5a Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 30 Jun 2026 23:52:02 +0200 Subject: Final run --- examples/poiseulle_particles_2d_fplbm_gpu/sim.cpp | 49 ++++++++++++----------- 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'examples/poiseulle_particles_2d_fplbm_gpu/sim.cpp') diff --git a/examples/poiseulle_particles_2d_fplbm_gpu/sim.cpp b/examples/poiseulle_particles_2d_fplbm_gpu/sim.cpp index 93d4b46..3d16884 100644 --- a/examples/poiseulle_particles_2d_fplbm_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_fplbm_gpu/sim.cpp @@ -51,6 +51,7 @@ template using MacroStruct = Struct< Member, "velocity">, Member, "density">, + Member, "force">, Member, "porosity"> >; @@ -144,6 +145,7 @@ saw::error_or setup_initial_conditions( {{1u,1u}} ); + /* iterator::apply( [&](auto& index){ saw::data> middle, ind_vec; @@ -162,6 +164,7 @@ saw::error_or setup_initial_conditions( {},// 0-index df_f.get_dims() ); + */ return saw::make_void(); } @@ -179,16 +182,20 @@ saw::error_or step( // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ - component> collision{0.65}; + component> bgk{0.8}; + component> collision{0.8}; component> bb; - component,encode::Sycl> abb; - - 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}; + saw::data> eps; + eps.at({}).set(1.5f); + saw::data> rad; + rad.at({}).set(dim_y*0.1); + saw::data> p_pos; + { + p_pos.at({{0u}}) = dim_x * 0.25; + p_pos.at({{1u}}) = dim_y * 0.5; + } + component> opa{p_pos,rad,eps}; component,encode::Sycl> flow_in{ [&](){ @@ -217,17 +224,18 @@ saw::error_or step( bb.apply(fields,index,t_i); break; case 2u: + opa.apply(macros,index,t_i); collision.apply(fields,macros,index,t_i); break; case 3u: flow_in.apply(fields,index,t_i); // equi.apply(fields,index,t_i); - collision.apply(fields,macros,index,t_i); + bgk.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); + bgk.apply(fields,macros,index,t_i); break; default: break; @@ -349,20 +357,7 @@ saw::error_or lbm_main(int argc, char** argv){ } } sycl_q.wait(); - if(i.get() % 32u == 0u){ - { - auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr); - if(eov.is_error()){ - return eov; - } - } - { - auto eov = write_csv_file(out_dir,"m",i.get(), *lbm_macro_data_ptr); - if(eov.is_error()){ - return eov; - } - } - } + // Stream sycl_q.submit([&](acpp::sycl::handler& h){ component> stream; @@ -402,6 +397,12 @@ saw::error_or lbm_main(int argc, char** argv){ return eov; } } + { + auto eov = write_csv_file(out_dir,"m",time_steps.get(), *lbm_macro_data_ptr); + if(eov.is_error()){ + return eov; + } + } sycl_q.wait(); return saw::make_void(); -- cgit v1.2.3