aboutsummaryrefslogtreecommitdiff
path: root/boltzgen.py
blob: 6d410c39ec201aa06b54c376adec4b8820cf0abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)