                            N((xiz - current_node_locationz) * inv_bin_edge) * device_settings.mass;
 
             atomicAdd(&grid_mass[current_node], weight);  //
-            atomicAdd(&grid_vel[current_node + device_settings.num_mpm_nodes * 0], weight * vix);
-            atomicAdd(&grid_vel[current_node + device_settings.num_mpm_nodes * 1], weight * viy);
-            atomicAdd(&grid_vel[current_node + device_settings.num_mpm_nodes * 2], weight * viz);)
+            atomicAdd(&grid_vel[current_node * 3 + 0], weight * vix);
+            atomicAdd(&grid_vel[current_node * 3 + 1], weight * viy);
+            atomicAdd(&grid_vel[current_node * 3 + 2], weight * viz);)
     }
 }
 CUDA_GLOBAL void kRasterize(const float* sorted_pos,  // input


            float mass = node_mass[current_node];  //
            if (mass > 0) {
                atomicAdd(&grid_vel[current_node + device_settings.num_mpm_nodes * 0], -fx / mass);  //
                atomicAdd(&grid_vel[current_node + device_settings.num_mpm_nodes * 1], -fy / mass);  //
                atomicAdd(&grid_vel[current_node + device_settings.num_mpm_nodes * 2], -fz / mass);  //
            })
    }
}


        LOOP_TWO_RING_GPUSP(

            float vnx = grid_vel[current_node * 3 + 0];  //
            float vny = grid_vel[current_node * 3 + 1];  //
            float vnz = grid_vel[current_node * 3 + 2];

            float Tx = (xix - current_node_locationx) * inv_bin_edge;  //
            float Ty = (xiy - current_node_locationy) * inv_bin_edge;  //
