<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p> </p>
<p style="line-height: 100%; margin-bottom: 0in">
Hi guys,</p>
<p style="line-height: 100%; margin-bottom: 0in">I have a custom
multigrid preconditioner that uses Galerkin coarsening for the
staggered grid finite difference. Now I want to replace a few top
level operators with the matrix-free shell matrices.</p>
<p style="line-height: 100%; margin-bottom: 0in">Here is my plan:</p>
<p style="line-height: 100%; margin-bottom: 0in">1. Set
PC_MG_GALERKIN_NONE</p>
<p style="line-height: 100%; margin-bottom: 0in">2. Call
PCMGSetRestriction and PCMGSetInterpolation on all levels as I do
it
already</p>
<p style="line-height: 100%; margin-bottom: 0in">3. Use a
combination
of PCMGGetSmoother and KSPSetOperators to communicate my operators
with PCMG</p>
<p style="line-height: 100%; margin-bottom: 0in"> a. On the top
levels just set the shell matrices minimalistically equipped with
<span style="font-variant: normal"><font color="#000000"><span
style="letter-spacing: normal"><span
style="font-style: normal"><span
style="font-weight: normal">MATOP_GET_DIAGONAL
</span></span></span></font></span><span
style="font-variant: normal"><font color="#000000"><span
style="letter-spacing: normal"><span
style="font-style: normal"><span
style="font-weight: normal">and
MATOP_MULT.</span></span></span></font></span></p>
<p style="line-height: 100%; margin-bottom: 0in"> b. On the
bottom
levels generate the operators by explicitly calling MatMatMatMult
(R
is not the same as P in my case).</p>
<p style="line-height: 100%; margin-bottom: 0in"> </p>
<p style="line-height: 100%; margin-bottom: 0in"> Use
MAT_INITIAL_MATRIX for the first time </p>
<p style="line-height: 100%; margin-bottom: 0in"> Use
MAT_REUSE_MATRIX for the subsequent calls</p>
<p style="line-height: 100%; margin-bottom: 0in"> </p>
<p style="line-height: 100%; margin-bottom: 0in">Is this a proper
way to do it, or there is something wrong? </p>
<p style="line-height: 100%; margin-bottom: 0in">If I want the
restriction/interpolation matrices to be matrix-free on the top
levels as well, I would need to set <span
style="font-variant: normal"><font color="#000000"><span
style="letter-spacing: normal"><span
style="font-style: normal"><span
style="font-weight: normal">MATOP_MULT_ADD
</span></span></span></font></span><span
style="font-variant: normal"><font color="#000000"><span
style="letter-spacing: normal"><span
style="font-style: normal"><span
style="font-weight: normal">for
them. Is this enough, or do I need something else?</span></span></span></font></span></p>
<p
style="font-weight: normal; font-variant: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in; font-style: normal">
<font color="#000000">Thanks!</font></p>
<p
style="letter-spacing: normal; font-variant: normal; font-style: normal; margin-bottom: 0in; line-height: 100%; font-weight: normal">
<font color="#000000">Anton</font></p>
<p>
<style type="text/css">p { margin-bottom: 0.1in; line-height: 115%; background: transparent }a:link { color: #000080; text-decoration: underline }</style></p>
</body>
</html>