STSetPreconditionerMat — SLEPc 3.25.0 documentation

Skip to main content
`Ctrl`+`K`

# STSetPreconditionerMat

Sets the matrix to be used to build the preconditioner.

## Synopsis

    #include "slepcst.h"
    PetscErrorCode STSetPreconditionerMat(ST st,Mat mat)

Collective

## Input Parameters

- st - the spectral transformation context

- mat - the matrix that will be used in constructing the preconditioner

## Notes

This matrix will be passed to the internal `KSP` object (via the last argument of `KSPSetOperators()`) as the matrix to be used when constructing the preconditioner. If no matrix is set or `mat` is set to `NULL`, then \(A-\sigma B\) will be used to build the preconditioner, being \(\sigma\) the value set by `STSetShift()`.

More precisely, this is relevant for spectral transformations that represent a rational matrix function, and use a `KSP` object for the denominator, called \(K\) in the description of `STGetOperator()`. It includes also the `STPRECOND` case. If the user has a good approximation to matrix \(K\) that can be used to build a cheap preconditioner, it can be passed with this function. Note that it affects only the `Pmat` argument of `KSPSetOperators()`, not the `Amat` argument.

If a preconditioner matrix is set, the default is to use an iterative `KSP` rather than a direct method.

An alternative to pass an approximation of \(A-\sigma B\) with this function is to provide approximations of \(A\) and \(B\) via `STSetSplitPreconditioner()`. The difference is that when \(\sigma\) changes the preconditioner is recomputed.

Use `NULL` to remove a previously set matrix.

## See Also

ST: Spectral Transformation, `STGetPreconditionerMat()`, `STSetShift()`, `STGetOperator()`, `STSetSplitPreconditioner()`

## Level

advanced

## Location

src/sys/classes/st/interface/stfunc.c

## Examples

src/eps/tutorials/ex24.c
src/eps/tutorials/ex34.c
src/eps/tutorials/ex46.c

Index of all ST routines Table of Contents for all manual pages Index of all manual pages