<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 2, 2017 at 8:55 AM, Sonia Pozzi <span dir="ltr"><<a href="mailto:sonia.pozzi@usi.ch" target="_blank">sonia.pozzi@usi.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Dear Barry, <div><br></div><div>At the moment I’m dealing with the following problem.</div><div><br></div><div>Suppose I want to solve Sx=b, where is a product of matrices. In particular inside it contains also an inverse of a matrix.</div><div>To compute the action of S I have created a shell matrix, but know I would like to apply the ASM as preconditioner.</div></div></blockquote><div><br></div><div>Are you using a Schur complement? Have you looked at</div><div><br></div><div>  <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/MatCreateSchurComplement.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/MatCreateSchurComplement.html</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>Citing your words as answer to a previous similar question:</div><div><br></div><div><i style="font-family:-webkit-standard;background-color:rgb(255,255,255)">Thu Jan 13 13:14:47 CST 2011</i></div><div><i style="font-family:times">Is it possible use ASM and/or FieldSplit with a matrix-free method?</i></div><div><pre style="background-color:rgb(255,255,255)"><pre><font face="Times">"Yes, BUT the algorithms are coded around MatGetSubMatrix() and or MatGetSubMatrices() so to do matrix free you need to have code that applies "part" of the operator at a time (that is you cannot just have a matrix vector product that applies the entire operator to the entire vector. Once you have the ability to apply "part" of the operator at a time you need to code up a MATSHELL that responds appropriately to MatGetSubMatrix() and or MatGetSubMatrices() and returns new matrix-free shell matrices that apply only "their" part of the operator. This is non-trivial for many people but possible."</font>
</pre><div><br></div><div><font face="Helvetica">Could you be so kind to explain me better how, or do you have some code that is doing something similar?</font></div></pre></div></div></blockquote><div>ASM says "I will take a block of your operator and invert it", but we do not know how to take a block of your MATSHELL</div><div>because it only provides the action on a vector. You could</div><div><br></div><div>  a) Also provide MatGetSubmatrix() or MAtGetSubmatrices() for your MATSHELL as Barry says</div><div><br></div><div>  b) Make a matrix M that is an approximation to your MATSHELL, perhaps using the block diagonal portions of the inverse</div><div>      so that you can explicitly give the values. Then pass M in as the preconditioner matrix for the solver.</div><div><br></div><div>  c) Use Chebyshev or some matrix-free preconditioner instead of ASM</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><pre style="background-color:rgb(255,255,255)"><div><font face="Helvetica">Regards,</font></div><div><font face="Helvetica"><br></font></div><div><font face="Helvetica">Sonia</font></div></pre></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>