dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #15340
Re: [Blueprint solver-interfaces] Redesign of solver interfaces
On Sun, Sep 13, 2009 at 10:23:01PM +0200, Johan Hake wrote:
> On Sunday 13 September 2009 20:32:18 Anders Logg wrote:
> > On Fri, Sep 11, 2009 at 07:49:36AM -0000, Johan Hake wrote:
> > > Blueprint changed by Johan Hake:
> > >
> > > Whiteboard changed to:
> > >
> > > Might also want LinearSystem and VariationalProblem as placeholders for
> > > A, b and a, L, bcs. There would then be three ways to solve a problem:
> > >
> > > x = solve(A, b)
> > > x = solver.solve(A, b)
> > > x = LinearSystem(A, b).solve()
> > >
> > > Johan Hake:
> > > Why cannot LinearSolver and VariationalSolver act as this place holder?
> >
> > Since (A, b) defines a linear system but not a linear solver. The
> > solver attributes should be things like preconditioner, iterative
> > method, tolerances etc.
> >
> > I'm not sure we really need LinearSystem and VariationalProblem. It's
> > something Marie requested. Let's discuss it further.
>
> Ok, but if not VariationalSolver could act as a placeholder we would not need
> to distinguish between this and a LinearSolver. Then we could just overload
> the solve method for LinearSolver to also take a variational problem.
I don't think a solver should be associated with any particular system.
> Would it make sense to have a LinearSystem and a VaritionalProblem, each
> having a LinearSolver? The LinearSolver has a solve method which overloads for
> both A,b and a,L?
That makes more sense, but I think we should keep it as simple as possible:
1. LinearSolver::solve(x, A, b)
2. solve(x, A, b, parameters={})
3. LinearSystem::solve(x, parameters={})
(3) would be implemented by calling (2).
So in the simplest case one can do
x = solve(A, b) # Python
solve(x, A, b) // C++
Or send parameters to control the solver. If one needs more control or
don't like recreating the solver object in each solve, one can create
a solver object.
--
Anders
Attachment:
signature.asc
Description: Digital signature
References