From 45176fc5a35b5843dadf1712b297ab23abe1aec5 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 19 Mar 2025 14:31:38 +0100 Subject: Compute the collision --- c++/examples/cavity_2d.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'c++/examples/cavity_2d.cpp') diff --git a/c++/examples/cavity_2d.cpp b/c++/examples/cavity_2d.cpp index ccb6433..f0d6794 100644 --- a/c++/examples/cavity_2d.cpp +++ b/c++/examples/cavity_2d.cpp @@ -80,7 +80,7 @@ public: eq[i] = dfi::weights[i] * rho * ( 1 + vel_c_cs2 - + vel_c_cs2 * vel_c_cs2 + + vel_c_cs2 * vel_c_cs2 / 2. - ( vel[0] * vel[0] + vel[1] * vel[1] ) / ( 2. * dfi::cs2 ) ); } @@ -89,7 +89,7 @@ public: } void compute_rho_u( - saw::data>& dfs, + saw::data>& dfs, typename saw::native_data_type::type& rho, std::array::type, 2>& vel ){ @@ -107,6 +107,15 @@ public: vel[0] /= rho; vel[1] /= rho; } + + void apply(saw::data>& dfs){ + for(uint64_t i = 0u; i < Desc::Q; ++i){ + typename saw::native_data_type::type rho; + std::array::type, Desc::D> vel; + compute_rho_u(dfs,rho,vel); + auto eq = equilibrium(rho,vel); + } + } }; } } -- cgit v1.2.3