diff options
Diffstat (limited to 'examples/poiseulle_particles_2d_gpu/sim.cpp')
| -rw-r--r-- | examples/poiseulle_particles_2d_gpu/sim.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp index 42d8413..f91d54f 100644 --- a/examples/poiseulle_particles_2d_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_gpu/sim.cpp @@ -90,7 +90,7 @@ saw::error_or<void> 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">(); - + iterator<Desc::D>::apply( [&](auto& index){ auto& df = df_f.at(index); @@ -105,6 +105,22 @@ saw::error_or<void> setup_initial_conditions( df_f.get_dims() ); + iterator<Desc::D>::apply( + [&](auto& index){ + 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.1; + auto eq = equilibrium<T,Desc>(rho,vel); + + df = eq; + }, + {},// 0-index + df_f.get_dims(), + {{1u,1u}} + ); + return saw::make_void(); } @@ -127,7 +143,7 @@ saw::error_or<void> step( saw::data<sch::Scalar<T>> rho_b; rho_b.at({}) = 1.0; saw::data<sch::Vector<T,Desc::D>> vel_b; - vel_b.at({{0u}}) = 0.01; + vel_b.at({{0u}}) = 0.1; component<T,Desc,cmpt::Equilibrium,encode::Sycl<saw::encode::Native>> equi{rho_b,vel_b}; |
