-
Notifications
You must be signed in to change notification settings - Fork 13
Description
For all transient problems in GridapODEs, the stage operator (linear or non-linear) is recreated at each time step. This causes issues in GridapPETSc when using a non-linear solver as described in Issue#81.
GridapPETSc.jl/src/PETScNonlinearSolvers.jl
Line 161 in 35b678d
@assert cache.op === op |
The hack to comment out this line or set cache.op=op
does not work for all problems. @JordiManyer and I found the only solution was to set sysslvrcache=nothing
prior to solving the NonlinearStageOperator
within ode_march!
.
This is not a long term solution as destroying sysslvrcache
means the residual and jacobian are allocated every time step in
GridapPETSc.jl/src/PETScNonlinearSolvers.jl
Line 168 in 35b678d
cache=_setup_cache(x,nls,op) |
An alternative is to use the non-linear solvers within GridapSolvers. Additionally, we tested using a PETSc linear solver within a GridapSolvers nonlinear solver and this recovered the correct behaviour. This isolates the problem to PETSc nonlinearsolvers, in particular:
GridapPETSc.jl/src/PETScNonlinearSolvers.jl
Line 156 in 35b678d
function Algebra.solve!(x::T, |
We believe this function should be changed to pass a new jacobian and residual function rather than cached objects for transient problems requiring a non-linear solver. @JordiManyer will try to create a reproducible example for testing.