From 66387cdf6977efc286e43a50e188aad24e8214d3 Mon Sep 17 00:00:00 2001 From: Vojtech Molda Date: Thu, 5 Dec 2024 17:12:33 -0600 Subject: [PATCH] Fix unit test failures - Migrate adjoint.py to newer interpolate API - Set max SNES failures to make TS retry steps --- examples/adjoint.py | 3 ++- firedrake_ts/ts_solver.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/adjoint.py b/examples/adjoint.py index 4b7ddce..81390d6 100644 --- a/examples/adjoint.py +++ b/examples/adjoint.py @@ -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) diff --git a/firedrake_ts/ts_solver.py b/firedrake_ts/ts_solver.py index 99e34a1..c5d9d45 100644 --- a/firedrake_ts/ts_solver.py +++ b/firedrake_ts/ts_solver.py @@ -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()