How to use the accelerate.fluid.fluid-gui.FluidGUI function in accelerate

To help you get started, we’ve selected a few accelerate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github diku-dk / futhark-benchmarks / accelerate / fluid / fluid-gui.py View on Github external
def main(args):
    try:
        grid_resolution = int(args[0])
    except IndexError:
        print('Usage: ./fluid-gui.py GRID_RESOLUTION')
        print()
        print('Add particles with right click.')
        print('Add forces with left click.')
        print('Press C to clear all particles and forces.')
        print('Press Q/A and W/S to modify diffusion rate and viscosity.')
        print()
        print('Example: Create a 256x256 fluid simulation.')
        print('  ./fluid-gui.py 256')
        return 1
    f = FluidGUI(grid_resolution=grid_resolution)
    f.run()
    return 0