aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boltzgen.py24
-rw-r--r--test.py16
2 files changed, 24 insertions, 16 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)
diff --git a/test.py b/test.py
deleted file mode 100644
index 0eec050..0000000
--- a/test.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from boltzgen import *
-
-lbm = LBM(D2Q9)
-geometry = Geometry(32,32)
-
-src = source(
- 'opencl',
- D2Q9,
- lbm.moments(),
- lbm.bgk(f_eq = lbm.equilibrium(), tau = 0.6),
- "",
- 'float',
- geometry
-)
-
-print(src)