def option_simulation(f):
def default_list(ctx, param, value):
return list(value if len(value) > 0 else (2, ))
options = [
click.option('-P', '--problem', type=click.Choice(['acoustic', 'tti']),
help='Number of grid points along each axis'),
click.option('-d', '--shape', default=(50, 50, 50),
help='Number of grid points along each axis'),
click.option('-s', '--spacing', default=(20., 20., 20.),
help='Spacing between grid sizes in meters'),
click.option('-n', '--nbpml', default=10,
help='Number of PML layers'),
click.option('-so', '--space-order', type=int, multiple=True,
callback=default_list, help='Space order of the simulation'),
click.option('-to', '--time-order', type=int, multiple=True,
callback=default_list, help='Time order of the simulation'),
click.option('-t', '--tn', default=250,
help='End time of the simulation in ms'),
]
for option in reversed(options):
f = option(f)
return f
评论列表
文章目录