diff options
Diffstat (limited to 'lib/core/tests/math.cpp')
| -rw-r--r-- | lib/core/tests/math.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/core/tests/math.cpp b/lib/core/tests/math.cpp index 738d637..7c9dc14 100644 --- a/lib/core/tests/math.cpp +++ b/lib/core/tests/math.cpp @@ -1,5 +1,6 @@ #include <forstio/test/suite.hpp> +#include <iostream> #include "../c++/math/n_linear.hpp" namespace { @@ -7,13 +8,34 @@ namespace sch { using namespace saw::schema; } -SAW_TEST("Math 2-Linear"){ +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::data<sch::FixedArray<sch::Vector<sch::Float64,2u>,32u,32u>> field; +SAW_TEST("Math/Floor Index from Pos"){ + using namespace kel; saw::data<sch::Vector<sch::Float64,2u>> pos; + { + pos.at({{0u}}) = 43.999; + pos.at({{1u}}) = -50.0; + } + + auto ind = lbm::floor_index_from_position(pos); + for(uint64_t i = 0u; i < 2u; ++i){ + std::cout<<ind.at({{i}}).get()<<" "; + } + std::cout<<std::endl; + SAW_EXPECT(true, "Default true check"); } |
