From 4353831172a4f2d1a61a31e2821a8179d88147fb Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 6 Jul 2026 13:30:47 +0200 Subject: Fixed compilation issues. Rerunning momentum gather --- modules/core/c++/hlbm.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'modules/core/c++/hlbm.hpp') diff --git a/modules/core/c++/hlbm.hpp b/modules/core/c++/hlbm.hpp index 346ec04..d9fb3de 100644 --- a/modules/core/c++/hlbm.hpp +++ b/modules/core/c++/hlbm.hpp @@ -155,25 +155,34 @@ public: template class component final { public: - template + template void apply(const saw::data& field, const saw::data& macros, saw::data> index, saw::data time_step) const { // using dfi = df_info; bool is_even = ((time_step.get() % 2) == 0); auto& dfs_old_f = (is_even) ? field.template get<"dfs_old">() : field.template get<"dfs">(); + auto& dfs = dfs_old_f.at(index); saw::data> momentum; for(uint64_t i = 0u; i < Desc::Q; ++i){ - saw::data> e_i; + saw::data> e_i; + saw::data> n_ind_i; for(uint64_t k{0u}; k < Desc::D; ++k){ e_i.at({{k}}) = dfi::directions[i][k]; + n_ind_i.at({k}) = (dfi::directions[i])[k]; } + uint64_t i_opp = dfi::opposite_index[i]; - momentum = momentum + e_i * (dfs_old_f.at({{i}}) + dfs_old_f.at({{i_opp}})); + saw::data dfs_added = dfs.at({i}) + dfs_old_f.at(n_ind_i).at({i_opp}); + saw::data> dfs_added_v; + dfs_added_v.at({}) = dfs_added; + auto ei_dfs = e_i * dfs_added_v; + + momentum = momentum + ei_dfs; } auto& force_f = macros.template get<"force">(); -- cgit v1.2.3