6.4.5. Shell Preconditioners

Up: Contents Next: Combining Preconditioners Previous: Block Jacobi and Overlapping Additive Schwarz Preconditioners

The shell preconditioner simply uses an application-provided routine to implement the preconditioner. To set this routine, one uses the command

   ierr = PCShellSetApply(PC pc,int (*apply)(void *ctx,Vec,Vec),void *ctx); 
The final argument ctx is a pointer to the application-provided data structure needed by the preconditioner routine. The three routine arguments of apply() are this context, the input vector, and the output vector, respectively.

For a preconditioner that requires some sort of ``setup'' before being used, that requires a new setup everytime the operator is changed, one can provide a ``setup'' routine that is called everytime the operator is changed (usually via SLESSetOperators()).

   ierr = PCShellSetSetUp(PC pc,int (*setup)(void *ctx)); 
The argument to the ``setup'' routine is the same application-provided data structure passed in with the PCShellSetApply() routine.


Up: Contents Next: Combining Preconditioners Previous: Block Jacobi and Overlapping Additive Schwarz Preconditioners