def run(discrete_velocities_prev):
    for i in tqdm(range(N_ITERATIONS)):
        discrete_velocities_next = update(discrete_velocities_prev)
        discrete_velocities_prev = discrete_velocities_next
        if (((i % PLOT_EVERY_N_STEPS) == 0) and (i > (SKIP_FIRS_N_ITERATIONS - PLOT_EVERY_N_STEPS))):
            density = get_density(discrete_velocities_next)
            macroscopic_velocities = get_macroscopic_velocities(discrete_velocities_next, density)
            print('\n', jnp.max(macroscopic_velocities))
            velocity_magnitude = jnp.linalg.norm(macroscopic_velocities, axis=(- 1), ord=2)
            fig = plt.figure(figsize=(15, 3))
            cont = plt.contourf(X[:, :, (nz // 2)], Y[:, :, (nz // 2)], jnp.flip(velocity_magnitude[:, :, (nz // 2)], axis=1), alpha=0.8, cmap=cmr.iceburn)
            plt.axis('scaled')
            plt.axis('off')
            plt.show()
    return
def run(discrete_velocities_prev):
    for i in tqdm(range(N_ITERATIONS)):
        discrete_velocities_next = update(discrete_velocities_prev)
        discrete_velocities_prev = discrete_velocities_next
        if (((i % PLOT_EVERY_N_STEPS) == 0) and (i > (SKIP_FIRS_N_ITERATIONS - PLOT_EVERY_N_STEPS))):
            density = get_density(discrete_velocities_next)
            macroscopic_velocities = get_macroscopic_velocities(discrete_velocities_next, density)
            print('\n', jnp.max(macroscopic_velocities))
            velocity_magnitude = jnp.linalg.norm(macroscopic_velocities, axis=(- 1), ord=2)
            fig = plt.figure(figsize=(15, 3))
            cont = plt.contourf(X[:, :, (nz // 2)], Y[:, :, (nz // 2)], jnp.flip(velocity_magnitude[:, :, (nz // 2)], axis=1), alpha=0.8, cmap=cmr.iceburn)
            plt.axis('scaled')
            plt.axis('off')
            plt.show()
    return