aboutsummaryrefslogtreecommitdiff
path: root/relax_test.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-01-25 16:06:17 +0100
committerAnton Khirnov <anton@khirnov.net>2019-01-25 16:06:17 +0100
commitc570c02ea4a427ed6dbf74652ba4f7936cb371e8 (patch)
tree645056c97302b46ce9740ede7797674ff8bae9e5 /relax_test.c
parent30ca9d8f0fa8dcaab5606d03e4cdf4082db9baae (diff)
Stop duplicating some constants between ell_relax and mg2d.
Diffstat (limited to 'relax_test.c')
-rw-r--r--relax_test.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/relax_test.c b/relax_test.c
index b750aba..1994201 100644
--- a/relax_test.c
+++ b/relax_test.c
@@ -6,6 +6,7 @@
#include "ell_relax.h"
#include "log.h"
+#include "mg2d_constants.h"
#if 1
static double sol(double x, double y)
@@ -83,9 +84,9 @@ int main(int argc, char **argv)
ctx->fd_stencil = 2;
{
- EllRelaxBoundary *bnd = &ctx->boundaries[ELL_RELAX_BOUNDARY_0L];
+ EllRelaxBoundary *bnd = &ctx->boundaries[MG2D_BOUNDARY_0L];
- bnd->type = ELL_RELAX_BC_TYPE_FIXVAL;
+ bnd->type = MG2D_BC_TYPE_FIXVAL;
memset(bnd->val, 0, N * sizeof(*bnd->val));
@@ -97,9 +98,9 @@ int main(int argc, char **argv)
}
}
{
- EllRelaxBoundary *bnd = &ctx->boundaries[ELL_RELAX_BOUNDARY_0U];
+ EllRelaxBoundary *bnd = &ctx->boundaries[MG2D_BOUNDARY_0U];
- bnd->type = ELL_RELAX_BC_TYPE_FIXVAL;
+ bnd->type = MG2D_BC_TYPE_FIXVAL;
memset(bnd->val, 0, N * sizeof(*bnd->val));
@@ -111,9 +112,9 @@ int main(int argc, char **argv)
}
}
{
- EllRelaxBoundary *bnd = &ctx->boundaries[ELL_RELAX_BOUNDARY_1L];
+ EllRelaxBoundary *bnd = &ctx->boundaries[MG2D_BOUNDARY_1L];
- bnd->type = ELL_RELAX_BC_TYPE_FIXVAL;
+ bnd->type = MG2D_BC_TYPE_FIXVAL;
memset(bnd->val, 0, N * sizeof(*bnd->val));
@@ -125,9 +126,9 @@ int main(int argc, char **argv)
}
}
{
- EllRelaxBoundary *bnd = &ctx->boundaries[ELL_RELAX_BOUNDARY_1U];
+ EllRelaxBoundary *bnd = &ctx->boundaries[MG2D_BOUNDARY_1U];
- bnd->type = ELL_RELAX_BC_TYPE_FIXVAL;
+ bnd->type = MG2D_BC_TYPE_FIXVAL;
memset(bnd->val, 0, N * sizeof(*bnd->val));
@@ -147,18 +148,18 @@ int main(int argc, char **argv)
for (size_t x = 0; x < ctx->domain_size[0]; x++) {
const double x_coord = x * ctx->step[0];
- ctx->diff_coeffs[ELL_RELAX_DIFF_COEFF_02][ctx->diff_coeffs_stride * y + x] = 1.0;
- ctx->diff_coeffs[ELL_RELAX_DIFF_COEFF_20][ctx->diff_coeffs_stride * y + x] = 1.0;
- ctx->diff_coeffs[ELL_RELAX_DIFF_COEFF_11][ctx->diff_coeffs_stride * y + x] = 1.0;
+ ctx->diff_coeffs[MG2D_DIFF_COEFF_02][ctx->diff_coeffs_stride * y + x] = 1.0;
+ ctx->diff_coeffs[MG2D_DIFF_COEFF_20][ctx->diff_coeffs_stride * y + x] = 1.0;
+ ctx->diff_coeffs[MG2D_DIFF_COEFF_11][ctx->diff_coeffs_stride * y + x] = 1.0;
ctx->rhs[y * ctx->rhs_stride + x] = sol_dxx(x_coord, y_coord) + sol_dyy(x_coord, y_coord) + sol_dxy(x_coord, y_coord);
}
- memset(ctx->diff_coeffs[ELL_RELAX_DIFF_COEFF_00] + y * ctx->diff_coeffs_stride, 0,
+ memset(ctx->diff_coeffs[MG2D_DIFF_COEFF_00] + y * ctx->diff_coeffs_stride, 0,
sizeof(*ctx->diff_coeffs[0]) * ctx->domain_size[0]);
- memset(ctx->diff_coeffs[ELL_RELAX_DIFF_COEFF_01] + y * ctx->diff_coeffs_stride, 0,
+ memset(ctx->diff_coeffs[MG2D_DIFF_COEFF_01] + y * ctx->diff_coeffs_stride, 0,
sizeof(*ctx->diff_coeffs[0]) * ctx->domain_size[0]);
- memset(ctx->diff_coeffs[ELL_RELAX_DIFF_COEFF_10] + y * ctx->diff_coeffs_stride, 0,
+ memset(ctx->diff_coeffs[MG2D_DIFF_COEFF_10] + y * ctx->diff_coeffs_stride, 0,
sizeof(*ctx->diff_coeffs[0]) * ctx->domain_size[0]);
}