← Back to team overview

fenics team mailing list archive

VariationalProblem interface(s)

 

A while back (in connection with the blueprint
https://blueprints.launchpad.net/dolfin/+spec/solver-interfaces) there
was a discussion regarding the interface to VariationalProblem. Anders
and Marie have discussed this a bit further, in particular with regard
to the adaptive solution of variational problems, and suggest the
interface outlined below. (This suggestion involves a change in the
interface, and hence the double post to both the dolfin and
fenics-mailinglists)

>From Marie's perspective, the main reasons for changing the interface are

    (a) The current "nonlinear=true" variable seems superfluous and
suboptimal
    (b) We should allow for automated computation of the Jacobian (when
needed).

For (nonlinear) variational problems, the interface should read

      pde = VariationalProblem(Form F, Form jacobian=None, ...)
      pde.solve(u)

where "F" is a Form of rank 1, "jacobian" is a Form of rank 2, and "u"
is a Function. Such a pde will be treated as a nonlinear variational
problem. The "jacobian" would be an optional argument. If not given,

    jacobian = derivative(F, u)

will be used for the nonlinear solve if needed (for instance as the
left-hand side of the Newton iteration).

Additionally, we have the interface for linear problems (as before)

      pde = VariationalProblem(Form a, Form L, ...)
      pde.solve(u) / u = pde.solve()

where "a" is a Form of rank 2 and "L" is a form of rank 1. Such as pde
will be treated as a linear variational problem.

Philosophical question: Should u be given as an argument to the
  VariationalProblem instead of to the call to solve?

Comments welcome!

--
Marie




Follow ups