dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #23918
Re: New interface for solving variational problems
-
To:
DOLFIN Mailing List <dolfin@xxxxxxxxxxxxxxxxxxx>
-
From:
Anders Logg <logg@xxxxxxxxx>
-
Date:
Thu, 23 Jun 2011 00:26:14 +0200
-
In-reply-to:
<20110622204252.GF1876@smaug>
-
User-agent:
Mutt/1.5.21 (2010-09-15)
On Wed, Jun 22, 2011 at 10:42:53PM +0200, Anders Logg wrote:
> Dear all,
>
> I have now implemented the discussed changes (in the dolfin/logg
> branch). Problems can now be solved in one of two ways. The interfaces
> look very similar in C++ and Python and very similar for linear and
> nonlinear problems (same number of arguments etc). Here's what it
> looks like now.
>
> 1. Short option
>
> solve(a == L, u, bc)
> solve(F == 0, u, bc, J=J)
>
> * The bc argument is optional and can be either a single bc or a list.
>
> * The J=J argument is not yet handled.
>
> 2. Long (advanced) option
>
> problem = LinearVariationalProblem(a, L, u, bc)
> solver = LinearVariationalSolver(problem)
> solver.parameters[...] = ...
> solver.parameters[...] = ...
> solver.solve()
>
> problem = NonlinearVariationalProblem(a, L, u, bc)
It should be
problem = NonlinearVariationalProblem(F, 0, u, bc)
here.
--
Anders
> solver = NoninearVariationalSolver(problem)
> problem.set_jacobian(J)
> solver.parameters[...] = ...
> solver.parameters[...] = ...
> solver.solve()
>
> * The reason for the separate set_jacobian function is that this is
> not necessary for all nonlinear solvers. We could add other solvers
> that don't require it.
>
> Let me know if this looks good. It may have implications on the code
> examples in the FEniCS book.
>
> The old VariationalProblem class is still there and gives an
> informative error message.
>
References