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 --- tests/equilibrium.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/equilibrium.cpp b/tests/equilibrium.cpp index bb26dd0..9201e55 100644 --- a/tests/equilibrium.cpp +++ b/tests/equilibrium.cpp @@ -9,17 +9,17 @@ template void check_equilibrium(){ using namespace kel; - using dfi = df_info; + using dfi = lbm::df_info; saw::data rho{1.0}; - saw::data> vel; - for(saw::data i{0u}; i < {Descriptor::D}; ++i){ + saw::data> vel; + for(saw::data i{0u}; i.get() < Descriptor::D; ++i){ vel.at(i) = {0.0}; } auto eq = lbm::equilibrium(rho,vel); - for(saw::data i{0u}; i < {Descriptor::Q}; ++i){ - SAW_CHECK(eq(i) == dfi::weights[i.get()], "No velocity and normalized rho should be exactly the weights"); + for(saw::data i{0u}; i.get() < Descriptor::Q; ++i){ + SAW_EXPECT(eq.at(i).get() == dfi::weights[i.get()], std::string{"No velocity and normalized rho should be exactly the weights: "} + std::to_string(eq.at(i).get()) + std::string{" "} + std::to_string(dfi::weights[i.get()])); } } @@ -27,4 +27,14 @@ SAW_TEST("Equilibrium at rest D1Q3"){ using namespace kel; check_equilibrium>(); } + +SAW_TEST("Equilibrium at rest D2Q5"){ + using namespace kel; + check_equilibrium>(); +} + +SAW_TEST("Equilibrium at rest D2Q9"){ + using namespace kel; + check_equilibrium>(); +} } -- cgit v1.2.3