From ae8711ba90ac2a47ea7654dc873927fb2783ff91 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 18 Apr 2025 16:25:30 +0200 Subject: wip rendering in terminal and extracting example code to files --- examples/cavity_2d.cpp | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'examples/cavity_2d.cpp') diff --git a/examples/cavity_2d.cpp b/examples/cavity_2d.cpp index 3e2e064..5085635 100644 --- a/examples/cavity_2d.cpp +++ b/examples/cavity_2d.cpp @@ -1,4 +1,5 @@ #include "../c++/descriptor.hpp" +#include "../c++/macroscopic.hpp" /** */ @@ -46,31 +47,6 @@ using CellStruct = Struct< using CavityFieldD2Q9 = CellField>; } -/** - * Calculate the macroscopic variables rho and u in Lattice Units. - */ -template -void compute_rho_u ( - saw::data>& dfs, - typename saw::native_data_type::type& rho, - std::array::type, 2>& vel - ) -{ - using dfi = df_info; - - rho = 0; - std::fill(vel.begin(), vel.end(), 0); - - for(size_t i = 0; i < Desc::Q; ++i){ - rho += dfs(i).get(); - vel[0] += dfi::directions[i][0] * dfs(i).get(); - vel[1] += dfi::directions[i][1] * dfs(i).get(); - } - - vel[0] /= rho; - vel[1] /= rho; -} - /** * Unsure if feasible. I would have a rho normalization on the dfs and then I would use the const rho_computation */ -- cgit v1.2.3