summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/core/c++/boundary.hpp34
-rw-r--r--lib/core/c++/grid.hpp34
-rw-r--r--lib/core/tests/collision.cpp6
3 files changed, 71 insertions, 3 deletions
diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp
index 0a4ff4d..9afdfd7 100644
--- a/lib/core/c++/boundary.hpp
+++ b/lib/core/c++/boundary.hpp
@@ -14,7 +14,10 @@ struct ZouHeHorizontal{};
struct Equilibrium {};
template<bool North>
-struct ZouHeVertical{};
+struct ZouHePressureY{};
+
+template<bool East>
+struct ZouHeVelocityX {};
}
/**
@@ -135,7 +138,7 @@ public:
for(saw::data<sch::UInt64> k{0u}; k < saw::data<sch::UInt64>{Descriptor::Q}; ++k){
auto c_k = dfi::directions[k.get()];
- if(c_k[0u]*known_dir >= 0){
+ if(c_k[0u]*known_dir <= 0){
sum_df += dfs_old.at({k});
}
}
@@ -147,7 +150,7 @@ public:
for(saw::data<sch::UInt64> k{0u}; k < saw::data<sch::UInt64>{Descriptor::Q}; ++k){
auto c_k = dfi::directions[k.get()];
- if(c_k[0u]*known_dir > 0){
+ if(c_k[0u]*known_dir < 0){
sum_unknown_dfs += dfs_old.at({k}) * c_k[0u];
}
}
@@ -167,5 +170,30 @@ public:
}
}
};
+
+/*
+template<typename FP, typename Descriptor, bool East, typename Encode>
+class component<FP, Descriptor, cmpt::ZouHeVelocityX<East>, Encode> final {
+private:
+ saw::data<sch::Vector<FP,Descriptor::D>> velocity_;
+public:
+ component(
+ saw::data<sch::Vector<FP,Descriptor::D>> velocity__
+ ):
+ velocity_{velocity__}
+ {}
+
+ template<typename CellFieldSchema>
+ void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>>& index, saw::data<sch::UInt64> time_step) const {
+
+ bool is_even = ((time_step.get() % 2u) == 0u);
+ using dfi = df_info<FP,Descriptor>;
+
+ auto& dfs_old_f = (is_even) ? field.template get<"dfs_old">() : field.template get<"dfs">();
+
+ }
+};
+*/
+
}
}
diff --git a/lib/core/c++/grid.hpp b/lib/core/c++/grid.hpp
new file mode 100644
index 0000000..be86e18
--- /dev/null
+++ b/lib/core/c++/grid.hpp
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "common.hpp"
+
+namespace kel {
+namespace lbm {
+
+/**
+ * I'm mixing up the geometry values regarding inflow etc. And a bit of logic
+ */
+template<typename InfoSchema>
+class domain_registry final {
+private:
+ saw::data<sch::Array<InfoSchema>> infos_;
+public:
+ template<typename T>
+ saw::data<InfoSchema> get_template_id() {
+ static saw::data<InfoSchema> id{std::numeric_limits<typename saw::native_data_type<InfoSchema>::type>::max()};
+
+ if( id == std::numeric_limits<typename saw::native_data_type<InfoSchema>::type>::max() ){
+ auto err_or_id = search_or_register_id(T::name);
+ if(err_or_id.is_error()){
+ // Unsure about recovery from this
+ exit(-1);
+ }
+ }
+ }
+};
+
+void clean_grid(saw::data<Schema>& info_field){
+
+}
+}
+}
diff --git a/lib/core/tests/collision.cpp b/lib/core/tests/collision.cpp
new file mode 100644
index 0000000..cd53336
--- /dev/null
+++ b/lib/core/tests/collision.cpp
@@ -0,0 +1,6 @@
+#include <forstio/test/suite.hpp>
+
+#include "../c++/collision.hpp"
+
+namespace {
+}