Thread Previous • Date Previous • Date Next • Thread Next |
Anders Logg wrote:
On Tue, Aug 15, 2006 at 01:38:42PM +0200, Garth N. Wells wrote:Anders Logg wrote:I'd like to change the behaviour of classes LU and GMRES so that one may do Matrix A; Vector x, b; GMRES::solve(A, x, b); or GMRES::solve(A, x, b, Preconditioner::ilu); and LU::solve(A, x, b); LU and GMRES would thus not be subclasses or typedefs of PETSc/uBlasLU/KrylovSolver but instead simple classes with static functions for simple solution of linear systems. This would then be the fast and easy way to solve a linear system. For more advanced usage, one would create a KrylovSolver or PETScKrylovSolver and then call solver.solve(). But often, one only wants to solve one linear system and not many and then it's convenient to skip the extra step of creating the solver.OK with me.ok. I can fix this (if it works out with the preconditioners).I don't that think we settled on the design of the preconiditoners. It would be nice to have just one enum list of preconditioners in Preconditioner.h, but I haven't had time to look at it yet.This connects to the design of preconditioners. I think we decided to put the list of preconditioners in Preconditioner so this should be ok. What's the status of the redesign of preconditioners?ok. Would it be enough to have a class Preconditioner which just lists all available preconditioners by name (ilu etc) in an enum type? And then the solvers just return a run-time error if the preconditioner is not implemented.
I was thinking more along the lines of Preconditioner being a typedef for PETScPreconditioner or uBlasPreconditioner. Would it work to have
enum Preconditioner { // List of preconditioners } typedef PETScPreconidtioner Preconditioner;Also, I wouldn't return a run-time error. It would be better to use a default preconditioner and print a warning message.
Garth
/Anders _______________________________________________ DOLFIN-dev mailing list DOLFIN-dev@xxxxxxxxxx http://www.fenics.org/mailman/listinfo/dolfin-dev
Thread Previous • Date Previous • Date Next • Thread Next |