diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-11-07 15:47:20 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-11-07 15:47:20 +0100 |
| commit | d0339dded21285dc88f0bb6b196b05583eb984e9 (patch) | |
| tree | b6bb7359daaf04d5755fdcd80db6b477f1b4724f | |
| parent | d9c7b84f757c8e2935eddce74c095a8448b99c55 (diff) | |
| download | libs-lbm-d0339dded21285dc88f0bb6b196b05583eb984e9.tar.gz | |
Fixed misplaced kernel
| -rw-r--r-- | lib/core/c++/boundary.hpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index 5549a80..8ab2457 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -70,18 +70,21 @@ public: const saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>>& index, saw::data<sch::UInt64> time_step ){ - bool is_even = ((time_step.get() % 2) == 0); + bool is_even = ((time_step.get() % 2u) == 0u); + + // This is a ref auto& cell = field[0u]; - + auto& dfs_old = (is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">(); + // auto& dfs = (not is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">(); - saw::data<T> rho; - saw::data<sch::FixedArray<T,Descriptor::D>> vel; - compute_rho_u<T,Descriptor>(dfs_old,rho,vel); - auto eq = equilibrium<T,Descriptor>(rho,vel); + using dfi = df_info<T,Descriptor>; + + // Technically use .copy() + auto df_cpy = dfs_old.copy(); - for(uint64_t i = 0u; i < Descriptor::Q; ++i){ - dfs_old({i}) = dfs_old({i}) + frequency_ * (eq.at(i) - dfs_old({i})); + for(uint64_t i = 1u; i < Descriptor::Q; ++i){ + dfs_old({i}) = df_cpy({dfi::opposite_index.at(i)}); } } }; |
