On 3 June 2013 19:49, Nico Schlömer <[email protected]> wrote:
> Hi all,
>
> when solving nonlinear problems, I simply went with
>
> # define F
> J = derivative(F, u)
> solve(F1 == 0, u, bcs, J)
>
> for now (which uses Newton's method).
> I noticed, however, that the computation of the Jacobian,
>
> nonlinear_problem.J(*_A, x);
>
> takes by the most time in the computation.
> Is there some caching I could employ? I need to solve a similar nonlinear
> system in each time step.
>

Use the lower-level NewtonSolver class. You then have complete control
over how J is computed/supplied/cached.

The Cahn-Hilliard demo illustrates use of the NewtonSolver class.

Garth


> --Nico
>
> _______________________________________________
> fenics-support mailing list
> [email protected]
> http://fenicsproject.org/mailman/listinfo/fenics-support
>
_______________________________________________
fenics-support mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics-support

Reply via email to