From 792e3a52a7e0839905837c031a027b917b36a241 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 11 Aug 2026 09:56:17 +0200 Subject: Dangling --- .../sim.cpp | 13 +++++++-- examples/poiseulle_3d_gpu/sim.cpp | 34 +++++++--------------- 2 files changed, 21 insertions(+), 26 deletions(-) (limited to 'examples') diff --git a/examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp b/examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp index 328f6e2..cc7649a 100644 --- a/examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp +++ b/examples/moving_poiseulle_particles_2d_fplbm_gpu/sim.cpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace kel { namespace lbm { @@ -18,6 +19,14 @@ constexpr uint64_t particle_amount = 1ul; namespace sch { using namespace saw::schema; +using LbmArgs = Args< + Struct< + Member, + Member + >, + Tuple<> +>; + using InfoChunk = Chunk; template @@ -185,7 +194,7 @@ saw::error_or step( }).wait(); q.submit([&](acpp::sycl::handler& h){ - component> fplbm_one_part; + component> fplbm_one_part; h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ saw::data> index; @@ -193,7 +202,7 @@ saw::error_or step( index.at({{i}}).set(idx[i]); } - fplbm_one_part.apply(fields,macros,particles,index,t_i,{16u}); + fplbm_one_part.apply(fields,macros,particles,index,t_i,{64u}); }); }).wait(); diff --git a/examples/poiseulle_3d_gpu/sim.cpp b/examples/poiseulle_3d_gpu/sim.cpp index 6916ef2..167234d 100644 --- a/examples/poiseulle_3d_gpu/sim.cpp +++ b/examples/poiseulle_3d_gpu/sim.cpp @@ -39,22 +39,17 @@ using ChunkStruct = Struct< >; template -using VelChunk = Chunk, 0u, dim_x, dim_y, dim_z>; +using MomChunk = Chunk, 0u, dim_x, dim_y, dim_z>; template using RhoChunk = Chunk, 0u, dim_x, dim_y, dim_z>; template using MacroStruct = Struct< - Member, "velocity">, + Member, "momentum">, Member, "density">, Member, "porosity"> >; - -//template -//using ParticleArray = Array< -// Particle -//>; } template @@ -106,7 +101,7 @@ saw::error_or setup_initial_conditions( // auto& df_f = fields.template get<"dfs_old">(); auto& rho_f = macros.template get<"density">(); - auto& vel_f = macros.template get<"velocity">(); + auto& mom_f = macros.template get<"momentum">(); auto& por_f = macros.template get<"porosity">(); iterator::apply( @@ -115,8 +110,8 @@ saw::error_or setup_initial_conditions( auto& rho = rho_f.at(index); por_f.at(index).at({}) = {1}; rho.at({}) = {1}; - auto& vel = vel_f.at(index); - auto eq = equilibrium(rho,vel); + auto& mom = mom_f.at(index); + auto eq = equilibrium(rho,mom); df = eq; }, @@ -129,9 +124,9 @@ saw::error_or setup_initial_conditions( auto& df = df_f.at(index); auto& rho = rho_f.at(index); rho.at({}) = {1}; - auto& vel = vel_f.at(index); - vel.at({{0u}}) = 0.01; - auto eq = equilibrium(rho,vel); + auto& mom = mom_f.at(index); + mom.at({{0u}}) = 0.01; + auto eq = equilibrium(rho,mom); df = eq; }, @@ -165,13 +160,6 @@ saw::error_or step( // component> collision{0.6}; component> bb; - saw::data> rho_b; - rho_b.at({}) = 1.0; - saw::data> vel_b; - vel_b.at({{0u}}) = 0.01; - - component> equi{rho_b,vel_b}; - component,encode::Sycl> flow_in{ [&](){ uint64_t target_t_i = 256u; @@ -201,13 +189,11 @@ saw::error_or step( collision.apply(fields,macros,index,t_i); break; case 3u: - equi.apply(fields,index,t_i); - // flow_in.apply(fields,index,t_i); + flow_in.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); break; case 4u: - equi.apply(fields,index,t_i); - // flow_out.apply(fields,index,t_i); + flow_out.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); break; default: -- cgit v1.2.3