Comment 3 for bug 826678

Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 826678] Re: Expression member variable automatic zero default value feature missing

On Mon, Aug 15, 2011 at 12:32:17PM -0000, Harish Narayanan wrote:
> There are two problems with changing API here. First is with the
> Expression class, and that is easily fixed.
>
> The second is, without the VariationalProblem class, how do I specify
> solver parameters to solve(a == L)? e.g., what does the following
> translate to?
>
> equation = VariationalProblem(L, a, bcu)
> equation.parameters["solver"]["newton_solver"]["absolute_tolerance"] = 1e-12
> equation.parameters["solver"]["newton_solver"]["relative_tolerance"] = 1e-16
> equation.parameters["solver"]["newton_solver"]["maximum_iterations"] = 100

solve(a == L) does not take any parameters.

So we need to use the more "advanced interface" which is

problem = NonlinearVariationalProblem(F, u, bcs)
solver = NonlinearVariationalSolver(problem)
solver.parameters["..."] = ...
solver.parameters["..."] = ...
solver.solve()

--
Anders