From d9385e15b88eb76a1a2b36973aa872d5d867534c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 12 Aug 2014 20:53:21 +0000 Subject: [PATCH] simple full bounce-back borders --- lb/esrc/d2q9.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lb/esrc/d2q9.c b/lb/esrc/d2q9.c index c4ada9d..7a9d0b5 100644 --- a/lb/esrc/d2q9.c +++ b/lb/esrc/d2q9.c @@ -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; -- 2.30.2