dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #07044
Re: Linear algebra
I don't see what's the point of that. The only reasons for
Matrix/Vector are related to having a single LA backend in each
application run, but a variety of solvers may be used in the same
application.
I suggest we take a look at similar solver interfaces in Trilinos, to
see if they've thought of some detail we're missing here.
Also, should the solver interface include a consistent parameter
interface? I.e. setting all parameters of a solver using a single
dict-like object, and defining consistent names for common parameters.
This should of course be seen in relation with the existing parameter
system in dolfin.
class Solver {
virtual void setParameters(const ParameterSet & params) = 0;
...
}
--
Martin
2008/4/1, Kent-Andre Mardal <kent-and@xxxxxxxxx>:
>
> To be consistent with the Matrix, GenericMatrix (++) design already in
> Dolfin one could have:
>
> class GenericSolver {
> virtual uint solve(const GenericPreconditioner& B,
>
> const GenericMatrix& A,
> GenericVector& x,
> const GenericVector& b) = 0;
> };
>
>
> And the corresponding:
>
> class Solver {
> virtual uint solve(const Preconditioner& B,
> const Matrix& A,
> Vector& x,
> const Vector& b)
>
> {
> solver->solve(B,A,x,b);
> }
> };
>
>
>
>
>
> tir, 01.04.2008 kl. 09.49 +0200, skrev Ola Skavhaug:
>
> > Hi,
> >
> > Should be make a generic solver base class:
> >
> > class Solver {
> >
> > virtual uint solve(const GenericMatrix& A, GenericVector& x, const GenericVector& b) = 0;
> >
> > };
> >
> > The class LinearSolver is using Matrix and Vector now, and I think it should
> > be safe to change this to a more generic interface. Alternatively, the Solver
> > class could be named:
> >
> > GenericLinearSolver
> > LinearSolver
> > GenericSolver
> >
> > Similarly, we could have GenericPreconditioner:
> >
> > class GenericPreconditioner {
> > virtual void update(const GenericMatrix& A) = 0;
> > virtual void apply(GenericVector& x, const GenericVector& b) const = 0;
> > };
> >
> > Implementing these interfaces in DOLFIN should be simple; simply add the
> > methods and use dynamic_cast to call existing functionality.
> >
> > Ola
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
Follow ups
References