← Back to team overview

dolfin team mailing list archive

Re: Linear algebra

 

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



Follow ups

References