From 24827b7753fcdc6c837301064afe60e3d1df3145 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 14 Apr 2025 16:24:56 +0200 Subject: wip. Doing a basic modular design for GPU prep --- c++/equilibrium.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'c++/equilibrium.hpp') diff --git a/c++/equilibrium.hpp b/c++/equilibrium.hpp index 326fc9e..ac36dbc 100644 --- a/c++/equilibrium.hpp +++ b/c++/equilibrium.hpp @@ -5,7 +5,7 @@ namespace kel { namespace lbm { template -saw::data> equilibrium(saw::data rho, saw::data> vel){ +saw::data> equilibrium(saw::data rho, saw::data> vel){ using dfi = df_info; saw::data> eq; @@ -18,26 +18,26 @@ saw::data> equilibrium(saw::data rho, vel_vel = vel_vel + vel.at(j) * vel.at(j); } - for(uint64_t i = 0u; i < eq.get_dim_size<0u>(); ++i){ + for(uint64_t i = 0u; i < eq.template get_dim_size<0u>(); ++i){ saw::data vel_c{}; for(uint64_t j = 0u; j < Descriptor::D; ++j){ - vel_c = vel_c + (vel.at(j) * {dfi::directions[i][j]}); + vel_c = vel_c + (vel.at(j) * saw::data{static_cast::type>(dfi::directions[i][j])}); } - auto vel_c_cs2 = vel_c * {dfi::inv_cs2}; + auto vel_c_cs2 = vel_c * saw::data{dfi::inv_cs2}; eq.at(i).set( dfi::weights[i] * rho.get() * ( 1.0 - + vel_c_cs2 + + vel_c_cs2.get() - dfi::inv_cs2 * 0.5 * vel_vel.get() - + vel_c_cs2 * vel_c_cs2 * 0.5 + + vel_c_cs2.get() * vel_c_cs2.get() * 0.5 ) ); - - return eq; } + + return eq; } } } -- cgit v1.2.3