diff --git a/cashocs/nonlinear_solvers/snes.py b/cashocs/nonlinear_solvers/snes.py index ab2241c8..826c2501 100644 --- a/cashocs/nonlinear_solvers/snes.py +++ b/cashocs/nonlinear_solvers/snes.py @@ -235,6 +235,7 @@ def solve(self) -> fenics.Function: self.assemble_jacobian( snes, self.u.vector().vec(), self.A_petsc, self.P_petsc ) + self.assemble_function(snes, self.u.vector().vec(), self.residual_petsc) self.is_preassembled = True _utils.setup_petsc_options([snes], [self.petsc_options])