Wiki

Clone wiki

phist / User_Guide / 028 Preconditioning Interface

WikiHome

Using Preconditioners with PHIST

The simple C struct linearOp is used to provide a preconditioning operation to an iterative solver. Thus the user can easily provide his own preconditioner depending on application and kernel library. Inside the apply function, he or she can simply cast the given void pointers to the kernel library's multi-vector class and work directly with the data if needed.

To support construction of new preconditioners from within phist, we have additionally introduced the precon interface, a set of functions to construct and update a number of preconditioners for the kernel libraries we support. This interface is by far not complete (e.g. we did not include any PETSc preconditinoers) but can be extended on demand. Preconditioners available via the precon interface include Ifpack and ML (for Epetra), and Ifpack2 (for Tpetra). The function *precon\_create* accepts two strings, one to dispatch to the correct class (e.g. "Ifpack" for Ifpack and Ifpack2), and the second to pass in parameters (e.g. a filename for a parameter list).

extending the precon interface with a user-defined preconditioner

Using C++ it is possible to teach phist to construct and update your own preconditioner type. In order to do this, specialize the class phist::PreconTraits<phist_USER_PRECON> for your own class, and pass the string "USER_DEFINED" to the precon_create function.

Updated