# Use previous iteration in NonlinearVariationalProblem?

218

views

0

I need to solve a time-dependent nonlinear PDE using exclusively the

\[

\frac{\partial u}{\partial t} = \nabla \cdot q(u) \nabla u

\]

We can solve this in FeNiCs by

But suppose there exists some magical function \(c\) that makes convergence more stable when linearized:

\[

c(u_{n}) \frac{u_{n+1} - u_{old}}{\Delta t} = \nabla \cdot q(u_{n}) \nabla u_{n+1}

\]

Is there anyway to write the

`NonlinearVariationalProblem`

interface. I plan on using dolfin-adjoint, so I don't think a manual implementation of Picard or Newton is allowed. The best way to solve the PDE is to make special use of the previous iterated solution. For example, consider the following equation\[

\frac{\partial u}{\partial t} = \nabla \cdot q(u) \nabla u

\]

We can solve this in FeNiCs by

```
u = Function(V)
u_old = Function(V)
# Set u_old to some initial conditions...
v = TestFunction(V)
F = u*v*dx - u_old*v*dx - Dt*inner(q(u)*grad(u), grad(v))*dx
problem = NonlinearVariationalProblem(F, u, bcs, J)
solver = NonlinearVariationalSolver(problem)
solver.solve()
```

But suppose there exists some magical function \(c\) that makes convergence more stable when linearized:

\[

c(u_{n}) \frac{u_{n+1} - u_{old}}{\Delta t} = \nabla \cdot q(u_{n}) \nabla u_{n+1}

\]

Is there anyway to write the

`NonlinearVariationalProblem`

so that \(c\) will always be evaluated at the previous iterated solution?
Please login to add an answer/comment or follow this question.

`NonlinearVariationalProblem`

interface, none of the linearized solves within will be recorded. However, If I were to set up and solve the linearized problem manually, each linearized solve will need to be recorded.