From 5be771eb356263bf43c57056eba77df7235c78f4 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 27 Jun 2025 21:27:20 +0200 Subject: Fixing things --- examples/poiseulle_2d.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) (limited to 'examples/poiseulle_2d.cpp') diff --git a/examples/poiseulle_2d.cpp b/examples/poiseulle_2d.cpp index 0ec4fc0..2f60ffd 100644 --- a/examples/poiseulle_2d.cpp +++ b/examples/poiseulle_2d.cpp @@ -44,6 +44,55 @@ using CavityFieldD2Q9 = CellField>; } } +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">(); + + + } + } + +} + +void set_initial_conditions(saw::data& latt){ + using namespace kel::lbm; + + typename saw::native_data_type::type rho = 1.0; + auto meta = latt.meta(); + + // Collide + 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">(); + + } + } + /* + { + std::array::type, sch::D2Q9::D> vel = {0.0, 0.0}; + auto eq = equilibrium(rho, vel); + + apply_for_cells([&eq](auto& cell, std::size_t i, std::size_t j){ + (void) i; + (void) j; + auto& dfs = cell.template get<"dfs">(); + auto& dfs_old = cell.template get<"dfs_old">(); + auto info = cell.template get<"info">()(0u).get(); + for(uint64_t k = 0; k < sch::D2Q9::Q; ++k){ + dfs(k).set(eq[k]); + dfs_old(k).set(eq[k]); + } + }, latt); + } + */ +} + int main(int argc, char** argv){ using namespace kel::lbm; @@ -52,7 +101,7 @@ int main(int argc, char** argv){ cfg_file_name = argv[1]; } - auto eo_conf = load_lbm_config>(cfg_file_name); + auto eo_conf = load_lbm_config>(cfg_file_name); if(eo_conf.is_error()){ auto& err = eo_conf.get_error(); std::cerr<<"[Error]: "<()} }; - print_lbm_meta>(conv, {conf.template get<"kinematic_viscosity">()}); - - saw::data> dim{{128, 128}}; + print_lbm_meta>(conv, {conf.template get<"kinematic_viscosity">()}); + saw::data> dim{{1024, 128}}; saw::data lattice{dim}; return 0; -- cgit v1.2.3