← Back to team overview

dolfin team mailing list archive

Re: New interface for solving variational problems

 

On 06/22/11 22:42, 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)
   solver = NoninearVariationalSolver(problem)
   problem.set_jacobian(J)
   solver.parameters[...] = ...
   solver.parameters[...] = ...
   solver.solve()


Is calling NonlinearVariationalSolver with a LinearVariationalProblem and vice versa allowed? If yes, what happens then?

--
Marie

* 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.

--
Anders

_______________________________________________
Mailing list: https://launchpad.net/~dolfin
Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp



Follow ups

References