diff --git a/firedrake/adjoint_utils/blocks/function.py b/firedrake/adjoint_utils/blocks/function.py index 62b63108d9..26c3fef85c 100644 --- a/firedrake/adjoint_utils/blocks/function.py +++ b/firedrake/adjoint_utils/blocks/function.py @@ -139,7 +139,7 @@ def solve_tlm(self): tlm_dep = block_variable.tlm_value if tlm_dep is not None: tlm_rhs = tlm_rhs + ufl.derivative(expr, dep, tlm_dep) - + x.tlm_value = None if isinstance(tlm_rhs, int) and tlm_rhs == 0: return diff --git a/firedrake/adjoint_utils/blocks/solving.py b/firedrake/adjoint_utils/blocks/solving.py index 3790a83860..2ca1c86c92 100644 --- a/firedrake/adjoint_utils/blocks/solving.py +++ b/firedrake/adjoint_utils/blocks/solving.py @@ -326,7 +326,7 @@ def solve_tlm(self): tlm_rhs = 0 tlm_bcs = [] - for block_variable in self.get_dependencies(): + for block_variable in self.get_dependencies(): dep = block_variable.output if dep == x.output: continue