diff options
Diffstat (limited to 'lib/core')
| -rw-r--r-- | lib/core/c++/boundary.hpp | 7 | ||||
| -rw-r--r-- | lib/core/c++/descriptor.hpp | 18 |
2 files changed, 13 insertions, 12 deletions
diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index adb473d..bb8eed9 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -206,16 +206,17 @@ public: /** * Get the sum of the unknown dfs and precalculate the direction */ - auto sum_unknown_dfs = (rho_setting_ - sum_df) * saw::data<FP>{known_dir}; + auto sum_unknown_dfs = (rho_setting_ - sum_df); + auto unknown_dfs_dir = sum_unknown_dfs * saw::data<FP>{known_dir}; for(saw::data<sch::UInt64> k{0u}; k < saw::data<sch::UInt64>{Descriptor::Q}; ++k){ auto c_k = dfi::directions[k.get()]; if(c_k[0u]*known_dir < 0){ - sum_unknown_dfs += dfs_old.at({k}) * c_k[0u]; + unknown_dfs_dir += dfs_old.at({k}) * c_k[0u]; } } - auto vel_x = sum_unknown_dfs / rho_setting_; + auto vel_x = unknown_dfs_dir / rho_setting_; static_assert(Descriptor::D == 2u and Descriptor::Q == 9u, "Some parts are hard coded sadly"); diff --git a/lib/core/c++/descriptor.hpp b/lib/core/c++/descriptor.hpp index 73f0cce..9f7399a 100644 --- a/lib/core/c++/descriptor.hpp +++ b/lib/core/c++/descriptor.hpp @@ -146,15 +146,15 @@ public: static constexpr uint64_t Q = 9u; static constexpr std::array<std::array<int32_t, D>, Q> directions = {{ - { 0, 0}, - {-1, 0}, - { 1, 0}, - { 0,-1}, - { 0, 1}, - {-1,-1}, - { 1, 1}, - {-1, 1}, - { 1,-1} + { 0, 0}, // 0 + {-1, 0}, // 1 + { 1, 0}, // 2 + { 0,-1}, // 3 + { 0, 1}, // 4 + {-1,-1}, // 5 + { 1, 1}, // 6 + {-1, 1}, // 7 + { 1,-1} // 8 }}; static constexpr std::array<typename saw::native_data_type<T>::type,Q> weights = { |
