From 9e37ff62b668694f705a8d132469f40ead9f6f0f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 5 Jun 2025 13:09:07 +0200 Subject: Dangling changes --- examples/cavity_2d.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'examples/cavity_2d.cpp') diff --git a/examples/cavity_2d.cpp b/examples/cavity_2d.cpp index d40e06e..a10276a 100644 --- a/examples/cavity_2d.cpp +++ b/examples/cavity_2d.cpp @@ -44,6 +44,11 @@ using CellStruct = Struct< Member, "info"> >; +template +using MacroStruct = Struct< + Member, "velocity">, + Member +>; using CavityFieldD2Q9 = CellField>; } @@ -390,6 +395,8 @@ int main(){ uint64_t print_every = 256u; uint64_t file_no = 0u; + saw::data,sch::D2Q9::D>> macros{dim}; + for(uint64_t step = 0; step < lattice_steps; ++step){ if(step % print_every == 0u){ @@ -481,28 +488,17 @@ int main(){ /// std::cout<<"Average rho: "<<(sum / ((dim_x-4)*(dim_y-4)))<() : cell.template get<"dfs">(); - typename saw::native_data_type::type rho; - std::array::type, sch::D2Q9::D> vel; + auto& rho = macros.at({{i,j}}).template get<"pressure">(); + auto& vel = macros.at({{i,j}}).template get<"velocity">(); compute_rho_u(dfs,rho,vel); - - vtk_file << static_cast(vel[0u]) << " " << static_cast(vel[1u])<<" 0.0\n"; }, lattice); - + + std::string vtk_f_name{"tmp/cavity_2d_"}; + vtk_f_name += std::to_string(file_no) + ".vtk"; + write_vtk_file(vtk_f_name, macros); ++file_no; } -- cgit v1.2.3