aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-11-02 17:57:23 +0100
committerAdrian Kummerlaender2019-11-02 17:57:23 +0100
commitb708361bf722b2c19f47699ceb931c6efeb8c9d9 (patch)
treebc23429a7915aaea020df70f159eabc992cdb7f8
parentd540b701836dbcdef727947f52a0ca01430968a6 (diff)
downloadboltzgen_examples-b708361bf722b2c19f47699ceb931c6efeb8c9d9.tar
boltzgen_examples-b708361bf722b2c19f47699ceb931c6efeb8c9d9.tar.gz
boltzgen_examples-b708361bf722b2c19f47699ceb931c6efeb8c9d9.tar.bz2
boltzgen_examples-b708361bf722b2c19f47699ceb931c6efeb8c9d9.tar.lz
boltzgen_examples-b708361bf722b2c19f47699ceb931c6efeb8c9d9.tar.xz
boltzgen_examples-b708361bf722b2c19f47699ceb931c6efeb8c9d9.tar.zst
boltzgen_examples-b708361bf722b2c19f47699ceb931c6efeb8c9d9.zip
Adapt to upstream changes
-rw-r--r--lid_driven_cavity/cpp/config.py4
-rwxr-xr-xlid_driven_cavity/cpp/generate.py17
-rw-r--r--lid_driven_cavity/opencl/ldc_2d.py20
-rw-r--r--shell.nix4
4 files changed, 20 insertions, 25 deletions
diff --git a/lid_driven_cavity/cpp/config.py b/lid_driven_cavity/cpp/config.py
index 3ed8bd5..2759ebf 100644
--- a/lid_driven_cavity/cpp/config.py
+++ b/lid_driven_cavity/cpp/config.py
@@ -1,8 +1,8 @@
-from boltzgen.lbm.model import *
+from boltzgen.lbm.lattice import *
from boltzgen import Geometry
descriptor = D2Q9
-geometry = Geometry(512, 512)
+geometry = Geometry(256, 256)
tau = 0.52
precision = 'single'
diff --git a/lid_driven_cavity/cpp/generate.py b/lid_driven_cavity/cpp/generate.py
index 4222e98..27c7997 100755
--- a/lid_driven_cavity/cpp/generate.py
+++ b/lid_driven_cavity/cpp/generate.py
@@ -2,8 +2,8 @@
import argparse
-from boltzgen import LBM, Generator, Geometry
-from boltzgen.lbm.model import D2Q9
+from boltzgen import Generator, Geometry
+from boltzgen.lbm.model import BGK
import config
@@ -14,15 +14,12 @@ argparser.add_argument(
args = argparser.parse_args()
-lbm = LBM(config.descriptor)
generator = Generator(
- descriptor = config.descriptor,
- moments = lbm.moments(),
- collision = lbm.bgk(f_eq = lbm.equilibrium(), tau = config.tau),
- target = 'cpp',
- precision = config.precision,
- index = 'XYZ',
- layout = 'AOS')
+ model = BGK(config.descriptor, tau = config.tau),
+ target = 'cpp',
+ precision = config.precision,
+ index = 'XYZ',
+ layout = 'AOS')
if args.output is None:
args.output = '.'
diff --git a/lid_driven_cavity/opencl/ldc_2d.py b/lid_driven_cavity/opencl/ldc_2d.py
index 7ca7252..755ace0 100644
--- a/lid_driven_cavity/opencl/ldc_2d.py
+++ b/lid_driven_cavity/opencl/ldc_2d.py
@@ -5,8 +5,9 @@ import matplotlib
matplotlib.use('AGG')
import matplotlib.pyplot as plt
-from boltzgen import LBM, Generator, Geometry
-from boltzgen.lbm.model import D2Q9
+from boltzgen import Generator, Geometry
+from boltzgen.lbm.lattice import D2Q9
+from boltzgen.lbm.model import BGK
from simulation import Lattice, CellList
@@ -29,7 +30,7 @@ def generate_moment_plots(lattice, moments):
nUpdates = 100000
nStat = 10000
-geometry = Geometry(512, 512)
+geometry = Geometry(256, 256)
print("Generating kernel using boltzgen...\n")
@@ -38,15 +39,12 @@ extras = ['cell_list_dispatch']
precision = 'single'
-lbm = LBM(D2Q9)
generator = Generator(
- descriptor = D2Q9,
- moments = lbm.moments(),
- collision = lbm.bgk(f_eq = lbm.equilibrium(), tau = 0.6),
- target = 'cl',
- precision = precision,
- index = 'ZYX',
- layout = 'SOA')
+ model = BGK(D2Q9, tau = 0.6),
+ target = 'cl',
+ precision = precision,
+ index = 'ZYX',
+ layout = 'SOA')
kernel_src = generator.kernel(geometry, functions, extras)
kernel_src += generator.custom(geometry, """
diff --git a/shell.nix b/shell.nix
index 0ccedfa..b229e2e 100644
--- a/shell.nix
+++ b/shell.nix
@@ -12,8 +12,8 @@ pkgs.stdenvNoCC.mkDerivation rec {
src = pkgs.fetchFromGitHub {
owner = "KnairdA";
repo = "boltzgen";
- rev = "v0.1.1";
- sha256 = "03fv7krhgc43gfjill8wb4aafr8xi69i2yh9zr68knnmrkrb8vpi";
+ rev = "v0.1.2";
+ sha256 = "1amsp45iq36vn63x7xqzj498hr5k9c4yj40wjccylwp9m2w14s8f";
};
propagatedBuildInputs = with pkgs.python37Packages; [