diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-05 22:13:52 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-05 22:13:52 +0200 |
| commit | 4fab8965692f75fea3cbbabb3381bfeb00511669 (patch) | |
| tree | fcd5a0e373e5dee979541f6b963d6ef55cca79f2 | |
| parent | b86c43b9f64704611be04810ba6f12d072f82ece (diff) | |
| download | libs-lbm-4fab8965692f75fea3cbbabb3381bfeb00511669.tar.gz | |
Found c++ magic
| -rw-r--r-- | examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp | 2 | ||||
| -rw-r--r-- | modules/core/c++/hlbm.hpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp b/examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp index a919bbe..49e6d43 100644 --- a/examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp +++ b/examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp @@ -197,6 +197,7 @@ saw::error_or<void> step( q.submit([&](acpp::sycl::handler& h){ component<T,Desc,cmpt::BGK, encode::Sycl<saw::encode::Native>> bgk{0.8}; component<T,Desc,cmpt::Hlbm,encode::Sycl<saw::encode::Native>> collision{0.8}; + component<T,Desc,cmpt::HlbmOneParticleMomentumExchange,encode::Sycl<saw::encode::Native>> one_part_moment; component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb; component<T,Desc,cmpt::AntiBounceBack<0u>,encode::Sycl<saw::encode::Native>> abb; @@ -241,6 +242,7 @@ saw::error_or<void> step( break; case 2u: opa.apply(macros,index,t_i); + one_part_moment.apply(fields,macros,index,t_i); collision.apply(fields,macros,index,t_i); fg.apply(fields,macros,index,t_i); break; diff --git a/modules/core/c++/hlbm.hpp b/modules/core/c++/hlbm.hpp index 677d37a..346ec04 100644 --- a/modules/core/c++/hlbm.hpp +++ b/modules/core/c++/hlbm.hpp @@ -156,8 +156,9 @@ template<typename T, typename Desc, typename Encode> class component<T, Desc, cmpt::HlbmOneParticleMomentumExchange, Encode> final { public: template<typename CellFieldSchema, typename MacroFieldSchema, typename ParticleSchema> - void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<MacroFieldSchema,Encode>& macros, const saw::data<ParticleSchema,Encode>& part_group, saw::data<sch::FixedArray<sch::UInt64,1u>> index, saw::data<sch::UInt64> time_step) const { + void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<MacroFieldSchema,Encode>& macros, saw::data<sch::FixedArray<sch::UInt64,Desc::D>> index, saw::data<sch::UInt64> time_step) const { // + using dfi = df_info<T,Desc>; bool is_even = ((time_step.get() % 2) == 0); auto& dfs_old_f = (is_even) ? field.template get<"dfs_old">() : field.template get<"dfs">(); @@ -177,7 +178,7 @@ public: auto& force_f = macros.template get<"force">(); // Set Force - force.at(index) = momentum * macros.template get<"density">().at(index); + force_f.at(index) = momentum * macros.template get<"porosity">().at(index); } }; } |
