summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ell_relax.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ell_relax.c b/ell_relax.c
index e0eadd4..679f340 100644
--- a/ell_relax.c
+++ b/ell_relax.c
@@ -118,8 +118,12 @@ static void boundaries_apply_fixval(double *dst, ptrdiff_t dst_stride,
size_t boundary_size, ptrdiff_t boundary_stride,
int is_upper)
{
+ if (!is_upper)
+ boundary_stride *= -1;
+
for (size_t i = 0; i < boundary_size; i++) {
- *dst = *src;
+ for (int j = 0; j <= FD_STENCIL_MAX; j++)
+ dst[j * boundary_stride] = *src;
dst += dst_stride;
src++;
}