aboutsummaryrefslogtreecommitdiff
path: root/boltzgen.py
diff options
context:
space:
mode:
Diffstat (limited to 'boltzgen.py')
-rw-r--r--boltzgen.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/boltzgen.py b/boltzgen.py
new file mode 100644
index 0000000..6d410c3
--- /dev/null
+++ b/boltzgen.py
@@ -0,0 +1,24 @@
+import argparse
+import string
+
+from boltzgen import *
+
+argparser = argparse.ArgumentParser(description='Generate LBM kernels in various languages using a symbolic description.')
+argparser.add_argument('language', help = 'Target language (currently either "opencl" or "cpp")')
+
+args = argparser.parse_args()
+
+lbm = LBM(D2Q9)
+geometry = Geometry(32,32)
+
+src = source(
+ args.language,
+ D2Q9,
+ lbm.moments(),
+ lbm.bgk(f_eq = lbm.equilibrium(), tau = 0.6),
+ "",
+ 'float',
+ geometry
+)
+
+print(src)