← Back to team overview

dolfin team mailing list archive

Re: Updates to nls demos. [...]

 

>
> Quoting Anders Logg <logg@xxxxxxxxx>:
>
>> I'm not very familiar with the Newton solvers in PETSc.
>>
>> If the speedup is only 10% and you have to sacrifice a lot of
>> flexibility, maybe we may as well do it ourselves. In particular since
>> your hand-coded Newton is about 20 lines of code and just the wrapper
>> code for calling the PETSc Newton solver is much longer.
>
> This is my feeling too. The PETSc solver requires a number of pointers to
> functions to be passed around, rather than just passing objects, which
> makes
> things more complex. Also, using our own Newton solver would allow
> settings for
> the linear solver to be set through the usual DOLFIN linear solver class,
> avoiding duplication in the nonlinear solver.
>
> Garth
>

Me neither is very familiar with the PETSc non-linear solvers. But if what
you say is true, then I agree that it seems more reasonable at this point
to wrap the linear algebra of PETSc rather than the non-linear solvers.

Apart from the difference in speed (10%), is there any additional
functionality in the PETSc non-linear solvers that you miss in your Newton
solver of 20 lines of code?

/Johan



>>
>> /Anders
>>
>>
>> On Fri, Dec 02, 2005 at 05:14:11PM +0100, dolfin@xxxxxxxxxx wrote:
>> > Commit from garth (2005-12-02 17:14 CET)
>> > -----------------
>> >
>> > Updates to nls demos.
>> >
>> > The nonlinear solver demos solve using both the class NonlinearSolver
>> (which exploits the PETSc Newton solvers) and a hand programmed Newton
>> procedure. The PETSc solvers are typically about 10% faster for the
>> tests
>> I've done. However, the NonlinearSolver class and the interface to it
>> would
>> be simpler if I programmed the NewtonSolver, and just relied on the
>> existing
>> linear algerbra wrappers for PETSc vectors, matrices and linear solvers.
>> I
>> think that this would be better given that the speed-up using the PETSc
>> solver is not so large, we could probably equal it with some with some
>> optimisations. Also, we then restrict PETSc to the linear algerbra
>> classes,
>> limiting the intrusion of PETSc into DOLFIN. Are there reasons to stick
>> with
>> the PETSc Newton solvers that I might be missing?
>> >
>> > Garth
>> >
>> >   dolfin  src/demo/nls/nonlinearpoisson/main.cpp  1.2
>> >   dolfin  src/demo/nls/poisson/main.cpp           1.2
>> >
>> > _______________________________________________
>> > DOLFIN-dev mailing list
>> > DOLFIN-dev@xxxxxxxxxx
>> > http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
>> >
>>
>> --
>> Anders Logg
>> Research Assistant Professor
>> Toyota Technological Institute at Chicago
>> http://www.tti-c.org/logg/
>>
>> _______________________________________________
>> DOLFIN-dev mailing list
>> DOLFIN-dev@xxxxxxxxxx
>> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
>>
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
>


-- 
Johan Hoffman, PhD
Assistant Professor
School of Computer Science and Communication
Royal Institute of Technology KTH
SE-100 44 Stockholm
Sweden

Email: jhoffman@xxxxxxxxxxx
URL: www.nada.kth.se/~jhoffman




Follow ups

References