From 06d7ee4e384f81e862d0bdc1605bd3c21e0720d3 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 19 Mar 2025 13:40:40 +0100 Subject: Fixed typing and lots of compile issues --- c++/examples/cavity_2d.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'c++/examples/cavity_2d.cpp') diff --git a/c++/examples/cavity_2d.cpp b/c++/examples/cavity_2d.cpp index 0cd3f9b..f9353e9 100644 --- a/c++/examples/cavity_2d.cpp +++ b/c++/examples/cavity_2d.cpp @@ -131,7 +131,10 @@ template void apply_for_cells(Func&& func, saw::data& dat){ for(std::size_t i = 0; i < dat.template get_dim_size<0>().get(); ++i){ for(std::size_t j = 0; j < dat.template get_dim_size<1>().get(); ++j){ - func(dat({i,j}), i, j); + saw::data di{i}; + saw::data dj{j}; + auto& cell_v = dat({{di,dj}}); + func(cell_v, i, j); } } } @@ -180,7 +183,7 @@ int main(){ , saw::encode::Native > lattices; //{dim_x, dim_y}; - auto& df_field = lattices.at(0).template get<"dfs">(); + // 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}; //} @@ -204,7 +207,7 @@ int main(){ apply_for_cells([](auto& cell, std::size_t i, std::size_t j){ // Not needed (void) i; - std::cout<(cell.template get<"info">().at(0).get()); + std::cout<(cell.template get<"info">()({0}).get()); if( (j+1) < dim_y){ std::cout<<" "; }else{ @@ -216,7 +219,7 @@ int main(){ apply_for_cells([](auto& cell, std::size_t i, std::size_t j){ // Not needed (void) i; - std::cout<().at(0).get(); + std::cout<()({0}).get(); if( (j+1) < dim_y){ std::cout<<" "; }else{ -- cgit v1.2.3