From 6393b959829a1f7513f3daccbaeb9e275fc4ac0d Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 3 Jul 2025 15:37:25 +0200 Subject: Wrote minor iterator confirmation tests --- examples/poiseulle_2d.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'examples/poiseulle_2d.cpp') diff --git a/examples/poiseulle_2d.cpp b/examples/poiseulle_2d.cpp index c933319..2770221 100644 --- a/examples/poiseulle_2d.cpp +++ b/examples/poiseulle_2d.cpp @@ -1,6 +1,7 @@ #include "../c++/lbm.hpp" #include "../c++/collision.hpp" #include "../c++/boundary.hpp" +#include "../c++/iterator.hpp" #include @@ -38,6 +39,11 @@ using CellStruct = Struct< Member, "info"> >; +template +using MacroStruct = Struct< + Member, "velocity">, + Member +>; using CavityFieldD2Q9 = CellField>; } @@ -48,15 +54,14 @@ void set_geometry(saw::data& latt){ using namespace kel::lbm; auto meta = latt.meta(); - for(saw::data i{0u}; i < meta.at(0u); ++i){ - for(saw::data j{0u}; j < meta.at(1u); ++j ){ - auto& cell = latt({{i,j}}); - auto& info = cell.template get<"info">(); - // if() - } - } + iterate_over([&](const saw::data>& index){ + auto& cell = latt(index); + auto& info = cell.template get<"info">(); + + info({0u}).set(1u); + }, {{0u,0u}}, meta, {1u}); } void set_initial_conditions(saw::data& latt){ @@ -136,7 +141,7 @@ int main(int argc, char** argv){ write_vtk_file(vtk_f_name, macros); } - lbm_step(lattice, even_step, step); + // lbm_step(lattice, i); } return 0; -- cgit v1.2.3