From 210b04098cfc12e0fdcff0578d39cc9ccafb3b37 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 25 Jun 2025 15:01:48 +0200 Subject: Debugging commit --- c++/boundary.hpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'c++/boundary.hpp') diff --git a/c++/boundary.hpp b/c++/boundary.hpp index 77542c5..e52715e 100644 --- a/c++/boundary.hpp +++ b/c++/boundary.hpp @@ -9,14 +9,14 @@ namespace cmpt { struct BounceBack {}; } +/** + * Full-Way BounceBack. + */ template class component { private: - typename saw::native_data_type::type relaxation_; public: - component(typename saw::native_data_type::type relaxation__): - relaxation_{relaxation__} - {} + component() = default; using Component = cmpt::BounceBack; @@ -30,7 +30,7 @@ public: /** * Thoughts regarding automating order setup */ - static constexpr saw::string_literal name = "collision"; + static constexpr saw::string_literal name = "full_way_bounce_back"; static constexpr saw::string_literal after = ""; static constexpr saw::string_literal before = "streaming"; @@ -38,20 +38,22 @@ public: * Raw setup */ template - void apply(saw::data& field, saw::data> index, uint64_t time_step){ - bool is_even = ((time_step % 2) == 0); - auto& cell = field.at(index); + void apply(saw::data& field, const saw::data>& index, uint64_t time_step){ + bool is_even = ((time_step % 2u) == 0u); - auto& dfs_old = is_even ? cell.template get<"dfs_old">() : cell.template get<"dfs">(); - auto& dfs = (!is_even) ? cell.template get<"dfs_old">() : cell.template get<"dfs">(); + // This is a ref + auto& cell = field(index); - using dfi = df_info; + 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">(); + + using dfi = df_info; // Technically use .copy() - auto df_cpy = dfs; + auto df_cpy = dfs_old; - for(uint64_t i = 1u; i < Desc::Q; ++i){ - dfs({i}) = df_cpy({dfi::opposite_index.at(i)}); + for(uint64_t i = 1u; i < Descriptor::Q; ++i){ + dfs_old({i}) = df_cpy({dfi::opposite_index.at(i)}); } } }; -- cgit v1.2.3