From 15a0453cf45066f3d88db783b08ce266af59230f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 20 Apr 2025 17:30:52 +0200 Subject: Add unit printing and removed type from delta type --- c++/converter.hpp | 9 +++++++++ c++/lbm.hpp | 23 +++++++++++++++++++++++ examples/cavity_2d.cpp | 11 ++++++++++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 c++/lbm.hpp diff --git a/c++/converter.hpp b/c++/converter.hpp index 67058aa..2ad5185 100644 --- a/c++/converter.hpp +++ b/c++/converter.hpp @@ -20,6 +20,14 @@ public: second_conv_{second_conv__} {} + auto delta_x() const { + return meter_conv_*saw::data>{1.0}; + } + + auto delta_t() const { + return second_conv_*saw::data>{1.0}; + } + saw::data> meter_si_to_lbm(const saw::data>& m_si) const { return m_si / meter_conv_; } @@ -40,5 +48,6 @@ public: return kin_si * second_conv_ / (meter_conv_ * meter_conv_); } }; + } } diff --git a/c++/lbm.hpp b/c++/lbm.hpp new file mode 100644 index 0000000..ddfa948 --- /dev/null +++ b/c++/lbm.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include "descriptor.hpp" +#include "converter.hpp" + +#include +#include + +namespace kel { +namespace lbm { +template +void print_lbm_meta(const converter& conv){ + std::cout + <<"[LBM Meta]\n" + <<"==========\n" + <<"\n" + <<"Δx: "< lattice{dim}; - // auto& df_field = lattices.at(0).template get<"dfs">(); + converter conv{ + {0.1}, + {0.1} + }; + + print_lbm_meta(conv); + + //auto& df_field = lattices.at(0).template get<"dfs">(); //for(uint64_t i = 0; i < df_field.get_dim_size<0u>(); ++i){ // lattices.at(i) = {dim_x, dim_y}; //} @@ -380,6 +388,7 @@ int main(){ * Set meta information describing what this cell is */ set_geometry(lattice); + /** * */ -- cgit v1.2.3