aboutsummaryrefslogtreecommitdiff
path: root/relax_test.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-06-25 20:51:02 +0200
committerAnton Khirnov <anton@khirnov.net>2020-06-25 20:51:02 +0200
commitab72ad7bb19f08d78218d3558545f9f58e5b36e7 (patch)
tree7f010e85d58e5b40e0304600d1ec2a48aeaba300 /relax_test.c
parent62c92eea4ec4859fff5002931e2d7d562b3deb5d (diff)
Switch to external ndarray library.
Diffstat (limited to 'relax_test.c')
-rw-r--r--relax_test.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/relax_test.c b/relax_test.c
index c2dd468..3d2fab2 100644
--- a/relax_test.c
+++ b/relax_test.c
@@ -3,12 +3,12 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
+#include <ndarray.h>
#include "ell_grid_solve.h"
#include "log.h"
#include "mg2d_boundary.h"
#include "mg2d_constants.h"
-#include "ndarray.h"
#define ARRAY_ELEMS(x) (sizeof(x) / sizeof(*x))
#define DOMAIN_SIZE 1.0
@@ -103,23 +103,23 @@ int main(int argc, char **argv)
for (size_t y = 0; y < ctx->domain_size[1]; y++) {
const double y_coord = y * ctx->step[1];
- memset(NDPTR2D(ctx->u, 0, y), 0, sizeof(*ctx->u->data) * ctx->domain_size[0]);
+ memset(NDA_PTR2D(ctx->u, 0, y), 0, sizeof(*ctx->u->data) * ctx->domain_size[0]);
for (size_t x = 0; x < ctx->domain_size[0]; x++) {
const double x_coord = x * ctx->step[0];
- *NDPTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_02], x, y) = 1.0;
- *NDPTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_20], x, y) = 1.0;
- *NDPTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_11], x, y) = 1.0;
+ *NDA_PTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_02], x, y) = 1.0;
+ *NDA_PTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_20], x, y) = 1.0;
+ *NDA_PTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_11], x, y) = 1.0;
- *NDPTR2D(ctx->rhs, x, y) = sol_dxx(x_coord, y_coord) + sol_dyy(x_coord, y_coord) + sol_dxy(x_coord, y_coord);
+ *NDA_PTR2D(ctx->rhs, x, y) = sol_dxx(x_coord, y_coord) + sol_dyy(x_coord, y_coord) + sol_dxy(x_coord, y_coord);
}
- memset(NDPTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_00], 0, y), 0,
+ memset(NDA_PTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_00], 0, y), 0,
sizeof(*ctx->diff_coeffs[0]->data) * ctx->domain_size[0]);
- memset(NDPTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_01], 0, y), 0,
+ memset(NDA_PTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_01], 0, y), 0,
sizeof(*ctx->diff_coeffs[0]->data) * ctx->domain_size[0]);
- memset(NDPTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_10], 0, y), 0,
+ memset(NDA_PTR2D(ctx->diff_coeffs[MG2D_DIFF_COEFF_10], 0, y), 0,
sizeof(*ctx->diff_coeffs[0]->data) * ctx->domain_size[0]);
}