From: Sebastian Date: Tue, 12 Aug 2014 20:53:21 +0000 (+0000) Subject: simple full bounce-back borders X-Git-Url: http://sraa.de/git/%3CTMPL_VAR%20NAME=ALBUMCOVER%3E?a=commitdiff_plain;h=d9385e15b88eb76a1a2b36973aa872d5d867534c;p=lattice-boltzmann-epiphany.git simple full bounce-back borders --- 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;