From e0d16921a2f78355f69ebeec64207f6c0d9fe1a5 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 9 Apr 2024 13:13:48 +0200 Subject: Minor changes --- c++/examples/cavity_2d.cpp | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/c++/examples/cavity_2d.cpp b/c++/examples/cavity_2d.cpp index 7fa526a..f682523 100644 --- a/c++/examples/cavity_2d.cpp +++ b/c++/examples/cavity_2d.cpp @@ -32,6 +32,11 @@ using Cell = CellData< } +template +struct cell_type { + using Type = schema::CellType; +}; + template class df_cell_view; @@ -39,15 +44,13 @@ class df_cell_view; * Minor helper for the AA-Pull Pattern */ template -class df_cell_view> { +class df_cell_view> { private: std::array::type>*, QN> view_; public: - df_cell(const std::array::type>*, QN>& view): + df_cell_view(const std::array::type>*, QN>& view): view_{view} {} - - }; template @@ -145,23 +148,32 @@ void set_geometry(saw::data> void set_initial_conditions(saw::data>& latt){ using namespace kel::lbm; apply_for_cells([](auto& cell, std::size_t i, std::size_t j){ + (void) i; + (void) j; cell.template get<"dfs">().at(0).set(1.0); }, latt); } +void lbm_step( + saw::data>& old_latt, + saw::data>& new_latt +){ + +} + int main(){ using namespace kel::lbm; - saw::data, saw::encode::Native> lattice{dim_x, dim_y}; + saw::data>, saw::encode::Native> lattice{dim_x, dim_y}; /** * Set meta information describing what this cell is */ - set_geometry(lattice); + set_geometry(lattices.at(0)); /** * */ - set_initial_conditions(lattice); + set_initial_conditions(lattices.at(0)); /** * Timeloop @@ -179,7 +191,7 @@ int main(){ }else{ std::cout<<"\n"; } - }, lattice); + }, lattice.at(0)); std::cout<<"\n"; apply_for_cells([](auto& cell, std::size_t i, std::size_t j){ @@ -191,11 +203,24 @@ int main(){ }else{ std::cout<<"\n"; } - }, lattice); + }, lattices.at(0)); + + uint64_t lattice_steps = 32; + bool even_step = true; - std::cout<