Skip to content

Commit 501e1f9

Browse files
committed
tests: Fix petsc test
1 parent cde2198 commit 501e1f9

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

tests/test_petsc.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,16 @@ def test_petsc_solve():
153153
action_expr = FindNodes(Expression).visit(matvec_efunc[0])
154154
rhs_expr = FindNodes(Expression).visit(b_efunc[0])
155155

156+
# TODO: Investigate why there are double brackets here
157+
# TODO: The output is technically "correct" but there are redundant operations that
158+
# have not been cancelled out / simplified
156159
assert str(action_expr[-1].expr.rhs) == (
157-
'(x_f[x + 1, y + 2]/ctx0->h_x**2'
158-
' - 2.0*x_f[x + 2, y + 2]/ctx0->h_x**2'
159-
' + x_f[x + 3, y + 2]/ctx0->h_x**2'
160-
' + x_f[x + 2, y + 1]/ctx0->h_y**2'
161-
' - 2.0*x_f[x + 2, y + 2]/ctx0->h_y**2'
162-
' + x_f[x + 2, y + 3]/ctx0->h_y**2)*ctx0->h_x*ctx0->h_y'
160+
'(x_f[x + 1, y + 2]/((ctx0->h_x*ctx0->h_x))'
161+
' - 2.0*x_f[x + 2, y + 2]/(ctx0->h_x*ctx0->h_x)'
162+
' + x_f[x + 3, y + 2]/((ctx0->h_x*ctx0->h_x))'
163+
' + x_f[x + 2, y + 1]/((ctx0->h_y*ctx0->h_y))'
164+
' - 2.0*x_f[x + 2, y + 2]/(ctx0->h_y*ctx0->h_y)'
165+
' + x_f[x + 2, y + 3]/((ctx0->h_y*ctx0->h_y)))*ctx0->h_x*ctx0->h_y'
163166
)
164167

165168
assert str(rhs_expr[-1].expr.rhs) == 'ctx0->h_x*ctx0->h_y*g[x + 2, y + 2]'

0 commit comments

Comments
 (0)