Ok - I wasn't quite enamored with John's last diagram... so I've attached my own. In particular the multiple inheritance from UserShellMatrixBase to the Petsc / Epetra MatrixBases made me feel icky.

The idea is similar to the structure we have for NonlinearSolver... where there is a PetscNonlinearSolver and a NoxNonlinearSolver... but you just attach a residual() or jacobian() function to whichever nonlinear solver gets built with build().... not caring if it's from Trilinos or Petsc.

I tweaked this idea slightly though... by attaching a class instead (UserShellMatrix).... just to encapsulate things a little bit. We could, instead, just attach functions with a specific signature that implement things like mult()... but I think it will be nicer to have UserShellMatrix objects. Either way it's the same thing.

Now... if you want to add a PetscMatrixBase and an EpetraMatrixBase to this... you can do that... and just have PetscMatrix and PetscShellMatrix inherit from it.

The nice thing about this design is that user code doesn't need to know which solver package you are using... at the same time a ShellMatrix can be passed into routines that require a NumericMatrix... etc.

Derek



<<inline: mats.png>>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to