From 507440cdf786f7a1a83bdf22371f1844910382fb Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 5 Mar 2026 20:04:09 +0100 Subject: Fixed ordering and somehow mistaking the wrongly assumed wrong pressure boundary --- lib/core/c++/boundary.hpp | 4 ++-- lib/core/tests/collision.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 lib/core/tests/collision.cpp (limited to 'lib/core') diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index 0a4ff4d..d5f3022 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -135,7 +135,7 @@ public: for(saw::data k{0u}; k < saw::data{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 +147,7 @@ public: for(saw::data k{0u}; k < saw::data{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]; } } 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 + +#include "../c++/collision.hpp" + +namespace { +} -- cgit v1.2.3 From 25c85bf962e0646f8e03f67fd4982450f41ee6a6 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 6 Mar 2026 21:05:36 +0100 Subject: Work finished for this week --- lib/core/c++/boundary.hpp | 30 +++++++++++++++++++++++++++++- lib/core/c++/grid.hpp | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 lib/core/c++/grid.hpp (limited to 'lib/core') diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index d5f3022..9afdfd7 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -14,7 +14,10 @@ struct ZouHeHorizontal{}; struct Equilibrium {}; template -struct ZouHeVertical{}; +struct ZouHePressureY{}; + +template +struct ZouHeVelocityX {}; } /** @@ -167,5 +170,30 @@ public: } } }; + +/* +template +class component, Encode> final { +private: + saw::data> velocity_; +public: + component( + saw::data> velocity__ + ): + velocity_{velocity__} + {} + + template + void apply(const saw::data& field, const saw::data>& index, saw::data time_step) const { + + bool is_even = ((time_step.get() % 2u) == 0u); + using dfi = df_info; + + 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 +class domain_registry final { +private: + saw::data> infos_; +public: + template + saw::data get_template_id() { + static saw::data id{std::numeric_limits::type>::max()}; + + if( id == std::numeric_limits::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& info_field){ + +} +} +} -- cgit v1.2.3