<div dir="ltr"><div class="gmail_quote"><br><div dir="ltr"><div><div>Thanks, Barry!<br><br></div>Do you have any suggestions on solving the B^tB matrix? I noticed the solver option LSQR but haven't tried it yet. <br><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Luis<br></div><div><br></div> <br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2018-01-26 11:25 GMT-08:00 Smith, Barry F. <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
<br>
> On Jan 26, 2018, at 1:18 PM, saturday luis <<a href="mailto:luis.saturday@gmail.com" target="_blank">luis.saturday@gmail.com</a>> wrote:<br>
><br>
> Hi PETSc team:<br>
><br>
> I want to consult for a good way of doing an approximated Schur complement matrix. So I just want to handle a matrix in the format C + B^t B, or sometimes B^t B.<br>
><br>
> An easy way is to run with the MatCreateSchurComplement to create C + B^t inv A B, wherein A is an identity matrix. The downside is that the matrix free style does not allow for algebraic preconditioners.<br>
><br>
> Another way is to generate the matrix B^t B. For my case, I checked the sparsity of the resulting matrix from MatMatMult and it is pretty sparse still. I found a similar approach in<br>
> <a href="http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/snes/examples<wbr>/tutorials/ex70.c.html</a><br>
> where the B^t B matrix is created explicitly (line 367-388). However, there is a line of comment saying " in real life this matrix would be build directly without MatMatMult". So I just want to ask the best way of assemblying and solving the B^t B matrix.<br>
<br>
</span> Using the product is best. You can ignore the comment.<br>
<br>
The comment is attempting to indicate that one can build the matrix from which the preconditioner is to be constructed by explicitly forming a matrix based on the specific problem at hand.<br>
<br>
Barry<br>
<br>
<br>
><br>
> Thanks,<br>
><br>
> Luis<br>
<br>
</blockquote></div><br></div>
</div></div></div><br></div>