<div class="gmail_quote">On Sat, Feb 11, 2012 at 00:00, recrusader <span dir="ltr"><<a href="mailto:recrusader@gmail.com">recrusader@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":b6">in <a href="http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex43.c.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex43.c.html</a><br><br><a name="1356b0015b149048_line1468">Why are two matrices set to MATAIJ? if I set MATAIJCUSP, is them changed? <br>
<br>1468: </a> <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateMatrix.html#DMCreateMatrix" target="_blank">DMCreateMatrix</a>(da_Stokes,<a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MATAIJ.html#MATAIJ" target="_blank">MATAIJ</a>,&A);<br>
<pre width="80"><a name="1356b0015b149048_line1469">1469: </a> <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateMatrix.html#DMCreateMatrix" target="_blank">DMCreateMatrix</a>(da_Stokes,<a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MATAIJ.html#MATAIJ" target="_blank">MATAIJ</a>,&B);</pre>
</div></blockquote></div><br><div>You have to follow the code down to where those matrices are used.</div><div><br></div><div><div>1478: AssembleA_Stokes(A,da_Stokes,da_prop,properties);</div><div>1479: AssembleA_PCStokes(B,da_Stokes,da_prop,properties);</div>
</div><div><br></div><div>This uses a "block preconditioner", the B matrix is intentionally different from the A matrix in order to handle the saddle point.</div>