diff options
Diffstat (limited to 'relax_test.c')
-rw-r--r-- | relax_test.c | 18 |
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]); } |