simple full bounce-back borders
authorSebastian <git@sraa.de>
Tue, 12 Aug 2014 20:53:21 +0000 (20:53 +0000)
committerSebastian <git@sraa.de>
Tue, 12 Aug 2014 20:53:21 +0000 (20:53 +0000)
lb/esrc/d2q9.c

index c4ada9d2bccd9bb6a6cf9304109eb00da6283094..7a9d0b5de2dabaf372bfb5c93bbcaef4ee52ee8c 100644 (file)
@@ -76,11 +76,19 @@ void d2q9_stream(d2q9_block_t f, int x, int y)
                if(next_y < 0)             { next_row--; next_y += BLOCK_Y; }
                else if(next_y >= BLOCK_Y) { next_row++; next_y -= BLOCK_Y; }
 
+#if 0
                /* outer borders (wrap around) */
                if(next_col < 0)             { next_col += CORES_X; }
                else if(next_col >= CORES_X) { next_col -= CORES_X; }
                if(next_row < 0)             { next_row += CORES_Y; }
                else if(next_row >= CORES_Y) { next_row -= CORES_Y; }
+#else
+               /* full bounce-back on all sides */
+               if(next_col < 0)             { return; }
+               else if(next_col >= CORES_X) { return; }
+               if(next_row < 0)             { return; }
+               else if(next_row >= CORES_Y) { return; }
+#endif
 
                /* f: local block, g: local or remote block */
                d2q9_block_t *g = (void*)f;