diff options
Diffstat (limited to 'lib/tests')
| -rw-r--r-- | lib/tests/descriptor.cpp | 4 | ||||
| -rw-r--r-- | lib/tests/iterator.cpp | 26 |
2 files changed, 28 insertions, 2 deletions
diff --git a/lib/tests/descriptor.cpp b/lib/tests/descriptor.cpp index a8337e6..7f743ce 100644 --- a/lib/tests/descriptor.cpp +++ b/lib/tests/descriptor.cpp @@ -32,4 +32,8 @@ SAW_TEST("Opposites and Dirs D2Q9"){ using namespace kel; check_opposite_dirs<lbm::sch::Descriptor<2,9>>(); } +SAW_TEST("Opposites and Dirs D3Q27"){ + using namespace kel; + check_opposite_dirs<lbm::sch::Descriptor<3,27>>(); +} } diff --git a/lib/tests/iterator.cpp b/lib/tests/iterator.cpp index cd1cb7c..261765a 100644 --- a/lib/tests/iterator.cpp +++ b/lib/tests/iterator.cpp @@ -9,7 +9,7 @@ namespace sch { using namespace kel::lbm::sch; } -SAW_TEST("Iterate"){ +SAW_TEST("Old Iterate"){ using namespace kel; saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; @@ -20,7 +20,7 @@ SAW_TEST("Iterate"){ }, start, end); } -SAW_TEST("Iterate with Distance 1"){ +SAW_TEST("Old Iterate with Distance 1"){ using namespace kel; saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; @@ -30,4 +30,26 @@ SAW_TEST("Iterate with Distance 1"){ std::cout<<"Index: "<<index.at({0u}).get()<<" "<<index.at({1u}).get()<<std::endl; }, start, end, {{1u,1u}}); } + +SAW_TEST("Iterate - 2D"){ + using namespace kel; + + saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; + saw::data<sch::FixedArray<sch::UInt64,2u>> end{{3u,3u}}; + + lbm::iterator<2u>::apply([](const saw::data<sch::FixedArray<sch::UInt64,2u>>& index){ + std::cout<<"Index: "<<index.at({0u}).get()<<" "<<index.at({1u}).get()<<std::endl; + }, start, end); +} + +SAW_TEST("Iterate with Distance 1 - 2D"){ + using namespace kel; + + saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; + saw::data<sch::FixedArray<sch::UInt64,2u>> end{{4u,4u}}; + + lbm::iterator<2u>::apply([](const saw::data<sch::FixedArray<sch::UInt64,2u>>& index){ + std::cout<<"Index: "<<index.at({0u}).get()<<" "<<index.at({1u}).get()<<std::endl; + }, start, end, {{1u,1u}}); +} } |
