Skip to content

Commit

Permalink
Fix unit test failures
Browse files Browse the repository at this point in the history
- Migrate adjoint.py to newer interpolate API
- Set max SNES failures to make TS retry steps
  • Loading branch information
vojtamolda committed Dec 5, 2024
1 parent 9874bac commit 66387cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/adjoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

x = ufl.SpatialCoordinate(mesh)
expr = ufl.as_vector([ufl.sin(2 * ufl.pi * x[0]), ufl.cos(2 * ufl.pi * x[1])])
u = fd.interpolate(expr, V)
u = fd.Function(V)
u.interpolate(expr)

u_dot = fd.Function(V)
v = fd.TestFunction(V)
Expand Down
1 change: 1 addition & 0 deletions firedrake_ts/ts_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def update_diffusivity(current_solution, current_time_derivative):
# Mixed problem, use jacobi pc if user has not supplied
# one.
self.set_default_parameter("pc_type", "jacobi")
self.set_default_parameter("ts_max_snes_failures", -1)

self.ts = PETSc.TS().create(comm=problem.dm.comm)
self.snes = self.ts.getSNES()
Expand Down

0 comments on commit 66387cd

Please sign in to comment.