  * Initial velocity profile: almost zero, with a slight perturbation to trigger
  * the instability.
  */
-static void initVelocity(lbm_vars* vars)
-{
-    for (int d = 0; d < 2; d++) {
-        for (int x = 0; x < NX; x++) {
-            for (int y = 0; y < NY; y++) {
-                vars->vel[x][y][d] = (1-d) * ULB * (1 + 0.0001 * sin( y / (double)LY * 2 * M_PI) );
-            }
-        }
+static void initVelocity(double* vel)
+{
+    for (int y = 0; y < NY; y++) {
+        vel[y] = ULB * (1 + 0.0001 * sin( y / (double)LY * 2 * M_PI) );
     }
 }
 

    size_t opp[9];
    ssize_t v[2][9];
    double t[9];
} lbm_consts;

__constant__ lbm_consts d_consts;

        
    lbm_vars *h_vars = (lbm_vars*)malloc(sizeof(lbm_vars));
    initObstacles(h_vars);
    
    // Initialization of the populations at equilibrium with the given velocity.
    for (int y = 0; y < NY; y++) {
        for (int x = 0; x < NX; x++) {
            h_equilibrium(h_vars->fin[x][y], 1.0, h_consts->vel[y]);
        }
    }
    
