1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="https://slepc.upv.es/documentation/current/docs/manualpages/ST/STSetPreconditionerMat.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<link rel="stylesheet" href="/slepc.css" type="text/css">
<TITLE>STSetPreconditionerMat</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>slepc-3.22.2 2024-12-02</b></div>
<div id="bugreport" align=right><a href="mailto:slepc-maint@upv.es?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: slepc-3.22.2 v3.22.2 docs/manualpages/ST/STSetPreconditionerMat.html "><small>Report Typos and Errors</small></a></div>
<H1>STSetPreconditionerMat</H1>
Sets the matrix to be used to build the preconditioner.
<H3><FONT COLOR="#883300">Synopsis</FONT></H3>
<PRE>
#include "slepcst.h"
<A HREF="https://petsc.org/release/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../ST/STSetPreconditionerMat.html#STSetPreconditionerMat">STSetPreconditionerMat</A>(<A HREF="../ST/ST.html#ST">ST</A> st,<A HREF="https://petsc.org/release/manualpages/Mat/Mat.html#Mat">Mat</A> mat)
</PRE>
Collective
<P>
<H3><FONT COLOR="#883300">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>st </B></TD><TD> - the spectral transformation context
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>mat </B></TD><TD> - the matrix that will be used in constructing the preconditioner
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#883300">Notes</FONT></H3>
This matrix will be passed to the internal <A HREF="https://petsc.org/release/manualpages/KSP/KSP.html#KSP">KSP</A> object (via the last argument
of <A HREF="https://petsc.org/release/manualpages/KSP/KSPSetOperators.html#KSPSetOperators">KSPSetOperators</A>()) as the matrix to be used when constructing the preconditioner.
If no matrix is set or mat is set to NULL, A-sigma*B will be used
to build the preconditioner, being sigma the value set by <A HREF="../ST/STSetShift.html#STSetShift">STSetShift</A>().
<P>
More precisely, this is relevant for spectral transformations that represent
a rational matrix function, and use a <A HREF="https://petsc.org/release/manualpages/KSP/KSP.html#KSP">KSP</A> object for the denominator, called
K in the description of <A HREF="../ST/STGetOperator.html#STGetOperator">STGetOperator</A>(). 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 <A HREF="https://petsc.org/release/manualpages/KSP/KSPSetOperators.html#KSPSetOperators">KSPSetOperators</A>(), not the Amat argument.
<P>
If a preconditioner matrix is set, the default is to use an iterative <A HREF="https://petsc.org/release/manualpages/KSP/KSP.html#KSP">KSP</A>
rather than a direct method.
<P>
An alternative to pass an approximation of A-sigma*B with this function is
to provide approximations of A and B via <A HREF="../ST/STSetSplitPreconditioner.html#STSetSplitPreconditioner">STSetSplitPreconditioner</A>(). The
difference is that when sigma changes the preconditioner is recomputed.
<P>
Use NULL to remove a previously set matrix.
<P>
<P>
<H3><FONT COLOR="#883300">See Also</FONT></H3>
<A HREF="../ST/STGetPreconditionerMat.html#STGetPreconditionerMat">STGetPreconditionerMat</A>(), <A HREF="../ST/STSetShift.html#STSetShift">STSetShift</A>(), <A HREF="../ST/STGetOperator.html#STGetOperator">STGetOperator</A>(), <A HREF="../ST/STSetSplitPreconditioner.html#STSetSplitPreconditioner">STSetSplitPreconditioner</A>()
<BR><P><B></B><H3><FONT COLOR="#883300">Level</FONT></H3>advanced<BR>
<H3><FONT COLOR="#883300">Location</FONT></H3>
</B><A HREF="../../../src/sys/classes/st/interface/stfunc.c.html#STSetPreconditionerMat">src/sys/classes/st/interface/stfunc.c</A>
<P><H3><FONT COLOR="#883300">Examples</FONT></H3>
<A HREF="../../../src/eps/tutorials/ex24.c.html">src/eps/tutorials/ex24.c</A><BR>
<A HREF="../../../src/eps/tutorials/ex34.c.html">src/eps/tutorials/ex34.c</A><BR>
<A HREF="../../../src/eps/tutorials/ex46.c.html">src/eps/tutorials/ex46.c</A><BR>
<BR><BR><A HREF="./index.html">Index of all ST routines</A>
<BR><A HREF="../../../docs/manual.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>
|