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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/MatGetSchurComplement.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>MatGetSchurComplement</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.10.3 2018-12-18</b></div>
<div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.10.3 v3.10.3 docs/manualpages/KSP/MatGetSchurComplement.html "><small>Report Typos and Errors</small></a></div>
<A NAME="MatGetSchurComplement"><H1>MatGetSchurComplement</H1></A>
Obtain the Schur complement from eliminating part of the matrix in another part.
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscksp.h"
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../KSP/MatGetSchurComplement.html#MatGetSchurComplement">MatGetSchurComplement</A>(<A HREF="../Mat/Mat.html#Mat">Mat</A> A,<A HREF="../IS/IS.html#IS">IS</A> isrow0,<A HREF="../IS/IS.html#IS">IS</A> iscol0,<A HREF="../IS/IS.html#IS">IS</A> isrow1,<A HREF="../IS/IS.html#IS">IS</A> iscol1,<A HREF="../Mat/MatReuse.html#MatReuse">MatReuse</A> mreuse,<A HREF="../Mat/Mat.html#Mat">Mat</A> *S,<A HREF="../KSP/MatSchurComplementAinvType.html#MatSchurComplementAinvType">MatSchurComplementAinvType</A> ainvtype,<A HREF="../Mat/MatReuse.html#MatReuse">MatReuse</A> preuse,<A HREF="../Mat/Mat.html#Mat">Mat</A> *Sp)
</PRE>
Collective on <A HREF="../Mat/Mat.html#Mat">Mat</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>A </B></TD><TD>- matrix in which the complement is to be taken
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>isrow0 </B></TD><TD>- rows to eliminate
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>iscol0 </B></TD><TD>- columns to eliminate, (isrow0,iscol0) should be square and nonsingular
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>isrow1 </B></TD><TD>- rows in which the Schur complement is formed
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>iscol1 </B></TD><TD>- columns in which the Schur complement is formed
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>mreuse </B></TD><TD>- <A HREF="../Mat/MatReuse.html#MatReuse">MAT_INITIAL_MATRIX</A> or <A HREF="../Mat/MatReuse.html#MatReuse">MAT_REUSE_MATRIX</A>, use <A HREF="../Mat/MatReuse.html#MatReuse">MAT_IGNORE_MATRIX</A> to put nothing in S
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ainvtype </B></TD><TD>- the type of approximation used for the inverse of the (0,0) block used in forming Sp:
<A HREF="../KSP/MatSchurComplementAinvType.html#MatSchurComplementAinvType">MAT_SCHUR_COMPLEMENT_AINV_DIAG</A>, <A HREF="../KSP/MatSchurComplementAinvType.html#MatSchurComplementAinvType">MAT_SCHUR_COMPLEMENT_AINV_BLOCK_DIAG</A>, or <A HREF="../KSP/MatSchurComplementAinvType.html#MatSchurComplementAinvType">MAT_SCHUR_COMPLEMENT_AINV_LUMP</A>
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>preuse </B></TD><TD>- <A HREF="../Mat/MatReuse.html#MatReuse">MAT_INITIAL_MATRIX</A> or <A HREF="../Mat/MatReuse.html#MatReuse">MAT_REUSE_MATRIX</A>, use <A HREF="../Mat/MatReuse.html#MatReuse">MAT_IGNORE_MATRIX</A> to put nothing in Sp
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>S </B></TD><TD>- exact Schur complement, often of type MATSCHURCOMPLEMENT which is difficult to use for preconditioning
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>Sp </B></TD><TD>- approximate Schur complement from which a preconditioner can be built
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Note</FONT></H3>
Since the real Schur complement is usually dense, providing a good approximation to newpmat usually requires
application-specific information. The default for assembled matrices is to use the inverse of the diagonal of
the (0,0) block A00 in place of A00^{-1}. This rarely produce a scalable algorithm. Optionally, A00 can be lumped
before forming inv(diag(A00)).
<P>
Sometimes users would like to provide problem-specific data in the Schur complement, usually only for special row
and column index sets. In that case, the user should call <A HREF="../Sys/PetscObjectComposeFunction.html#PetscObjectComposeFunction">PetscObjectComposeFunction</A>() on the *S matrix and pass mreuse of <A HREF="../Mat/MatReuse.html#MatReuse">MAT_REUSE_MATRIX</A> to set
"MatGetSchurComplement_C" to their function. If their function needs to fall back to the default implementation, it
should call MatGetSchurComplement_Basic().
<P>
<A HREF="../KSP/MatCreateSchurComplement.html#MatCreateSchurComplement">MatCreateSchurComplement</A>() takes as arguments the four submatrices and returns the virtual Schur complement (what this returns in S).
<P>
<A HREF="../KSP/MatSchurComplementGetPmat.html#MatSchurComplementGetPmat">MatSchurComplementGetPmat</A>() takes the virtual Schur complement and returns an explicit approximate Schur complement (what this returns in Sp).
<P>
In other words calling <A HREF="../KSP/MatCreateSchurComplement.html#MatCreateSchurComplement">MatCreateSchurComplement</A>() followed by <A HREF="../KSP/MatSchurComplementGetPmat.html#MatSchurComplementGetPmat">MatSchurComplementGetPmat</A>() produces the same output as this function but with slightly different
inputs. The actually submatrices of the original block matrix instead of index sets to the submatrices.
<P>
<H3><FONT COLOR="#CC3333">Developer Notes</FONT></H3>
The API that includes <A HREF="../KSP/MatGetSchurComplement.html#MatGetSchurComplement">MatGetSchurComplement</A>(), <A HREF="../KSP/MatCreateSchurComplement.html#MatCreateSchurComplement">MatCreateSchurComplement</A>(), <A HREF="../KSP/MatSchurComplementGetPmat.html#MatSchurComplementGetPmat">MatSchurComplementGetPmat</A>() should be refactored to
remove redundancy and be clearer and simplier.
<P>
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../Mat/MatCreateSubMatrix.html#MatCreateSubMatrix">MatCreateSubMatrix</A>(), <A HREF="../PC/PCFIELDSPLIT.html#PCFIELDSPLIT">PCFIELDSPLIT</A>, <A HREF="../KSP/MatCreateSchurComplement.html#MatCreateSchurComplement">MatCreateSchurComplement</A>(), <A HREF="../KSP/MatSchurComplementAinvType.html#MatSchurComplementAinvType">MatSchurComplementAinvType</A>
<BR><P><B></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>advanced<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../src/ksp/ksp/utils/schurm/schurm.c.html#MatGetSchurComplement">src/ksp/ksp/utils/schurm/schurm.c</A>
<BR><A HREF="./index.html">Index of all KSP routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>
|