summaryrefslogtreecommitdiff
path: root/lib/core/tests
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-03-20 18:17:55 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-03-20 18:17:55 +0100
commit16c1198f8fb401c3a98d927053fb2d29c2ce5f91 (patch)
tree650a0f654728eab06bb32b46346e209732774b42 /lib/core/tests
parente85b713cf31697a3309e12f30ba5759fee1cd3cc (diff)
downloadlibs-lbm-16c1198f8fb401c3a98d927053fb2d29c2ce5f91.tar.gz
Too much time spent on downcasts, but well. Here I am.
Diffstat (limited to 'lib/core/tests')
-rw-r--r--lib/core/tests/math.cpp26
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");
}