diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-06 01:37:34 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-06 01:37:34 +0200 |
| commit | af4b3f8f9bf7b19c169d9fbd0a2b49668af8ad10 (patch) | |
| tree | 3e98fff4bad333affa55e082de0da759bad57229 /lib/core/tests/math.cpp | |
| parent | 52326efc80dfeae6e830527df2e7803ecf61b00a (diff) | |
| parent | 015e941a91552ce6ea4cde4507ec9451c3708e77 (diff) | |
| download | libs-lbm-af4b3f8f9bf7b19c169d9fbd0a2b49668af8ad10.tar.gz | |
Merge branch 'dev'
Diffstat (limited to 'lib/core/tests/math.cpp')
| -rw-r--r-- | lib/core/tests/math.cpp | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/lib/core/tests/math.cpp b/lib/core/tests/math.cpp deleted file mode 100644 index d456ce8..0000000 --- a/lib/core/tests/math.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include <forstio/test/suite.hpp> - -#include <iostream> -#include "../c++/math/n_linear.hpp" - -namespace { -namespace sch { -using namespace saw::schema; -} - -SAW_TEST("Math 1-Linear"){ - using namespace kel; - - saw::data<sch::FixedArray<sch::Vector<sch::Float64,1u>,2u>> field; - { - field.at({{0u}}).at({{0u}}).set(-1.0); - field.at({{1u}}).at({{0u}}).set(2.0); - } - saw::data<sch::Vector<sch::Float64,1u>> pos; - pos.at({{0u}}).set(0.3); -} - -SAW_TEST("Math/Floor Index and Fraction from Position"){ - using namespace kel; - - saw::data<sch::Vector<sch::Float64,2u>> pos; - - { - pos.at({{0u}}) = 43.999; - pos.at({{1u}}) = -50.0; - } - - auto ind_frac = lbm::position_to_index_and_fraction(pos); - auto& ind = ind_frac.template get<0u>(); - for(uint64_t i = 0u; i < 2u; ++i){ - std::cout<<ind.at({{i}}).get()<<" "; - } - std::cout<<std::endl; - auto& frac = ind_frac.template get<1u>(); - for(uint64_t i = 0u; i < 2u; ++i){ - std::cout<<frac.at({{i}}).get()<<" "; - } - std::cout<<std::endl; - - SAW_EXPECT(true, "Default true check"); -} - -SAW_TEST("Math/Floor Index and Fraction from Position and Bounded"){ - using namespace kel; - - saw::data<sch::Vector<sch::Float64,2u>> pos; - - { - pos.at({{0u}}) = 43.999; - pos.at({{1u}}) = -50.0; - } - - saw::data<sch::Vector<sch::UInt64,2U>> bound; - { - bound.at({{0u}}) = 32u; - bound.at({{1u}}) = 16u; - } - - auto ind_frac = lbm::position_to_index_and_fraction_bounded(pos,bound); - auto& ind = ind_frac.template get<0u>(); - for(uint64_t i = 0u; i < 2u; ++i){ - std::cout<<ind.at({{i}}).get()<<" "; - } - std::cout<<std::endl; - auto& frac = ind_frac.template get<1u>(); - for(uint64_t i = 0u; i < 2u; ++i){ - std::cout<<frac.at({{i}}).get()<<" "; - } - std::cout<<std::endl; - - SAW_EXPECT(true, "Default true check"); -} - -} |
