aboutsummaryrefslogtreecommitdiff
path: root/boltzgen.py
blob: 27a34fadc0ab9f21c4523b0349c41441d4a73858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
generator = Generator(
    descriptor = D2Q9,
    moments    = lbm.moments(),
    collision  = lbm.bgk(f_eq = lbm.equilibrium(), tau = 0.6))

geometry = Geometry(32,32)

src = generator.kernel(args.language, 'float', geometry)
print(src)