diff options
Diffstat (limited to 'boltzgen.py')
-rw-r--r-- | boltzgen.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/boltzgen.py b/boltzgen.py index b487b07..6f8f20c 100644 --- a/boltzgen.py +++ b/boltzgen.py @@ -3,16 +3,22 @@ import string from boltzgen import * -argparser = argparse.ArgumentParser(description='Generate LBM kernels in various languages using a symbolic description.') +argparser = argparse.ArgumentParser( + description = 'Generate LBM kernels in various languages using a symbolic description.') + argparser.add_argument('language', help = 'Target language (currently either "cl" or "cpp")') -argparser.add_argument('--layout', dest = 'layout', help = 'Memory layout ("AOS" or "SOA")', required = True) -argparser.add_argument('--precision', dest = 'precision', help = 'Floating precision ("single" or "double")', required = True) + +argparser.add_argument('--lattice', dest = 'lattice', required = True, help = 'Lattice type (D2Q9, D3Q7, D3Q19, D3Q27)') +argparser.add_argument('--layout', dest = 'layout', required = True, help = 'Memory layout ("AOS" or "SOA")') +argparser.add_argument('--precision', dest = 'precision', required = True, help = 'Floating precision ("single" or "double")') args = argparser.parse_args() -lbm = LBM(D2Q9) +lattice = eval("lbm.model.%s" % args.lattice) + +lbm = LBM(lattice) generator = Generator( - descriptor = D2Q9, + descriptor = lattice, moments = lbm.moments(), collision = lbm.bgk(f_eq = lbm.equilibrium(), tau = 0.6)) |