diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-03-23 17:33:05 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-03-23 17:33:05 +0100 |
| commit | 571e79c4d0b72202186fd11314cf268723b1844d (patch) | |
| tree | 79d7b84a7a5054a962db7f736b528d73a2d107f6 | |
| parent | 46b49e3b4fa283590d120703f80f892ee1f03ffc (diff) | |
| download | libs-lbm-571e79c4d0b72202186fd11314cf268723b1844d.tar.gz | |
Fixed boundary setting
| -rw-r--r-- | examples/poiseulle_particles_2d_psm_gpu/sim.cpp | 25 | ||||
| -rw-r--r-- | lib/core/c++/boundary.hpp | 5 |
2 files changed, 25 insertions, 5 deletions
diff --git a/examples/poiseulle_particles_2d_psm_gpu/sim.cpp b/examples/poiseulle_particles_2d_psm_gpu/sim.cpp index 0d356dd..7702808 100644 --- a/examples/poiseulle_particles_2d_psm_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_psm_gpu/sim.cpp @@ -83,7 +83,24 @@ saw::error_or<void> setup_initial_conditions( info_f.get_dims(), {{1u,1u}} ); - + // Corners + /// Inflow + iterator<Desc::D>::apply( + [&](auto& index){ + info_f.at(index).set(5u); + }, + {{0u,0u}}, + {{1u,dim_y}} + ); + /// Outflow + iterator<Desc::D>::apply( + [&](auto& index){ + info_f.at(index).set(5u); + }, + {{dim_x-1u,0u}}, + {{dim_x, dim_y}} + ); + // Overwrite with // Inflow iterator<Desc::D>::apply( [&](auto& index){ @@ -251,7 +268,11 @@ saw::error_or<void> step( flow_out.apply(fields,index,t_i); // equi.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); - break; + break; + case 5u: + // Corners + bb.apply(fields,index,t_i); + break; default: break; } diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index 217013d..4dbbdf8 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -174,14 +174,13 @@ class component<FP, Descriptor, cmpt::ZouHeHorizontal<Dir>, Encode> final { private: saw::data<FP> rho_setting_; public: - component(const saw::data<FP>& density_setting__): - rho_setting_{density_setting__} + component(const saw::data<FP>& rho_setting__): + rho_setting_{rho_setting__} {} template<typename CellFieldSchema> void apply(const saw::data<CellFieldSchema, Encode>& field, saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>> index, saw::data<sch::UInt64> time_step) const { using dfi = df_info<FP,Descriptor>; - constexpr int known_dir = Dir ? 1 : -1; bool is_even = ((time_step.get() % 2) == 0); |
