Skip to content

PETSc nonlinear solve not producing correct solution for transient problems  #101

@tamaratambyah

Description

@tamaratambyah

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.

@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

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions