From 52033eeec131fe862ad85dcb52e961b5904330eb Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 9 Nov 2019 23:47:58 +0100 Subject: Fix SSS population padding D2Q9 and D3Q27 worked by coincidence, should now work for all lattices. --- lid_driven_cavity/cpp/config.py | 2 +- lid_driven_cavity/cpp/ldc.cpp.SSS.mako | 2 +- shell.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lid_driven_cavity/cpp/config.py b/lid_driven_cavity/cpp/config.py index 0ea626b..63386f6 100644 --- a/lid_driven_cavity/cpp/config.py +++ b/lid_driven_cavity/cpp/config.py @@ -8,7 +8,7 @@ precision = 'double' streaming = 'SSS' ## 3D LDC -#descriptor = D3Q27 +#descriptor = D3Q19 #geometry = Geometry(64, 64, 64) #tau = 0.6 #precision = 'double' diff --git a/lid_driven_cavity/cpp/ldc.cpp.SSS.mako b/lid_driven_cavity/cpp/ldc.cpp.SSS.mako index ed2f938..eb041e5 100644 --- a/lid_driven_cavity/cpp/ldc.cpp.SSS.mako +++ b/lid_driven_cavity/cpp/ldc.cpp.SSS.mako @@ -98,7 +98,7 @@ padding = (max(geometry.size_x,geometry.size_y,geometry.size_z)+1)**(descriptor. ${float_type}* f[${descriptor.q}]; % for i, c_i in enumerate(descriptor.c): - f[${i}] = f_aa.get() + ${layout.pop_offset(i) + padding}; + f[${i}] = f_aa.get() + ${padding + layout.pop_offset(i, 2*padding)}; % endfor std::vector ghost; diff --git a/shell.nix b/shell.nix index 45805fb..cdca488 100644 --- a/shell.nix +++ b/shell.nix @@ -27,7 +27,7 @@ pkgs.stdenvNoCC.mkDerivation rec { src = builtins.fetchGit { url = "https://code.kummerlaender.eu/boltzgen/"; - rev = "27ce855378a80dff680c2989800af1f4e69975fe"; + rev = "d136bb30bc8a9393372ec905aea500a0b61000e3"; }; propagatedBuildInputs = with pkgs.python37Packages; [ -- cgit v1.2.3