diff --git a/tests/field/codegen/JacobiKernel.py b/tests/field/codegen/JacobiKernel.py index b375d5447c4009a0527580853c242c545a6a2e71..b2da5369dddee8223a3035bff10174d27f52fe70 100644 --- a/tests/field/codegen/JacobiKernel.py +++ b/tests/field/codegen/JacobiKernel.py @@ -7,11 +7,11 @@ with CodeGeneration() as ctx: h = sp.symbols("h") # ----- Jacobi 2D - created by specifying weights in nested list -------------------------- - src, dst = ps.fields("src, src_tmp: [2D]") - stencil = [[0, -1, 0], - [-1, 4, -1], - [0, -1, 0]] - assignments = ps.assignment_from_stencil(stencil, src, dst, normalization_factor=4 * h**2) + src, dst = ps.fields("src, src_tmp: [2D]", layout='fzyx') + stencil = [[0, 1, 0], + [1, 0, 1], + [0, 1, 0]] + assignments = ps.assignment_from_stencil(stencil, src, dst, normalization_factor=1 / (4 * h ** 2)) generate_sweep(ctx, 'JacobiKernel2D', assignments, field_swaps=[(src, dst)]) # ----- Jacobi 3D - created by using kernel_decorator with assignments in '@=' format ----- @@ -21,6 +21,6 @@ with CodeGeneration() as ctx: def kernel_func(): dst[0, 0, 0] @= (src[1, 0, 0] + src[-1, 0, 0] + src[0, 1, 0] + src[0, -1, 0] + - src[0, 0, 1] + src[0, 0, -1]) / (6 * h ** 2) + src[0, 0, 1] + src[0, 0, -1]) / (h ** 2 * 6) generate_sweep(ctx, 'JacobiKernel3D', kernel_func, field_swaps=[(src, dst)])