diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-04-03 13:13:37 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-04-03 13:13:37 +0200 |
commit | 6b1a01d1cbf3809ddcf6bfb14c337d89f6f7c2b5 (patch) | |
tree | fafea7ffd7c8e77bbe0a2224c79094fac9250e61 /tests | |
parent | e7f5a1110bfafcd605b9330f9c7d3f5147298ed3 (diff) |
Wrote test for opposite index and corresponding dirs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/descriptor.cpp | 30 | ||||
-rw-r--r-- | tests/equilibrium.cpp | 3 |
2 files changed, 30 insertions, 3 deletions
diff --git a/tests/descriptor.cpp b/tests/descriptor.cpp new file mode 100644 index 0000000..5e23ebc --- /dev/null +++ b/tests/descriptor.cpp @@ -0,0 +1,30 @@ +#include <forstio/test/suite.hpp> + +#include "../c++/descriptor.hpp" + + +namespace { +template<typename Descriptor> +void check_opposite_dirs(){ + using namespace kel; + + using dfi = lbm::df_info<lbm::sch::Float32, Descriptor>; + + for(uint64_t k = 0u; k < Descriptor::Q; ++k){ + auto k_inv = dfi::opposite_index[k]; + + for(uint64_t i = 0u; i < Descriptor::D; ++i){ + SAW_EXPECT(dfi::directions[k][i] == (-1*dfi::directions[k_inv][i]), "Opposites are inconsistent"); + } + } +} + +SAW_TEST("Opposites and Dirs D2Q5"){ + using namespace kel; + check_opposite_dirs<lbm::sch::Descriptor<2,5>>(); +} +SAW_TEST("Opposites and Dirs D2Q9"){ + using namespace kel; + check_opposite_dirs<lbm::sch::Descriptor<2,9>>(); +} +} diff --git a/tests/equilibrium.cpp b/tests/equilibrium.cpp deleted file mode 100644 index 8d53125..0000000 --- a/tests/equilibrium.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include <forstio/test/suite.hpp> - -#include "../c++/descriptor.hpp" |