Beispiel #1
0
def initialize():
    # Things start out immobile.
    directions[:, :, 4] = 10

    # Compute dependent quantities.
    cuda.compute_density(density, directions, w, h)
    cuda.compute_velocity(velocity, density, directions, w, h)
    cuda.equilibriate(equilibrium, density, velocity, w, h)
Beispiel #2
0
def initialize():
    # Things start out immobile.
    directions[:, :, 4] = 10

    # Compute dependent quantities.
    cuda.compute_density(density, directions, w, h)
    cuda.compute_velocity(velocity, density, directions, w, h)
    cuda.equilibriate(equilibrium, density, velocity, w, h)
Beispiel #3
0
def update(i):
    boundary_conditions(directions, i)
    cuda.stream(directions_next, directions, w, h)
    cuda.compute_density(density, directions_next, w, h)
    cuda.compute_velocity(velocity, density, directions_next, w, h)
    cuda.equilibriate(equilibrium, density, velocity, w, h)
    cuda.compute_velocity(velocity, density, directions_next, w, h)

    cuda.update_distribution(directions, equilibrium, directions_next, w, h)
Beispiel #4
0
def update(i):
    boundary_conditions(directions, i)
    cuda.stream(directions_next, directions, w, h)
    cuda.compute_density(density, directions_next, w, h)
    cuda.compute_velocity(velocity, density, directions_next, w, h)
    cuda.equilibriate(equilibrium, density, velocity, w, h)
    cuda.compute_velocity(velocity, density, directions_next, w, h)

    cuda.update_distribution(directions, equilibrium, directions_next, w, h)