Hi, Hong and Barry,<br>Thanks a lot. <br>Have a nice day.<br><br>Zhengyong <br><br><div class="gmail_quote">On Tue, May 31, 2011 at 9:48 PM, Barry Smith <span dir="ltr">&lt;<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
   With petsc-dev <a href="http://www.mcs.anl.gov/petsc/petsc-as/developers/index.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/developers/index.html</a> there are very easy ways to solve the Schur complement systems using PCFIELDSPLIT see <a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/PC/PCFIELDSPLIT.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/PC/PCFIELDSPLIT.html</a><br>

<font color="#888888"><br>
<br>
   Barry<br>
</font><div><div></div><div class="h5"><br>
<br>
On May 31, 2011, at 2:41 PM, Hong Zhang wrote:<br>
<br>
&gt; This is virtually SCHUR complement. You may take a look at<br>
&gt; petsc-dev/src/ksp/ksp/examples/tests/ex11.c and<br>
&gt; petsc-dev/src/ksp/ksp/examples/tests/makefile: runex11<br>
&gt;<br>
&gt; Hong<br>
&gt;<br>
&gt; On Tue, May 31, 2011 at 8:29 AM, RenZhengYong &lt;<a href="mailto:renzhengyong@gmail.com">renzhengyong@gmail.com</a>&gt; wrote:<br>
&gt;&gt; I have a linear system of equation like<br>
&gt;&gt;  [A  B]  [E]= [C]<br>
&gt;&gt;  [F  G]  [S]= [D],<br>
&gt;&gt; where size of matrix A is NxN, B is NxNs, F is Ns_N, G is Ns_Ns; size of<br>
&gt;&gt; vector E is N, S is Ns, C is N and D is N.<br>
&gt;&gt; Instead of solving them together, I prefer to solve it by:<br>
&gt;&gt; (1) AX=B, AY=C;<br>
&gt;&gt; (2) QS=P, Q= G-FX, P=D-FY,<br>
&gt;&gt; due to the dense property of G.<br>
&gt;&gt;<br>
&gt;&gt; In step (1), I need to extract a new &quot;vec&quot; Bi from &quot;mat&quot; B, according to the<br>
&gt;&gt; way of PETSc telling me. My question is that could I do it as follows,<br>
&gt;&gt; for a given sparse matrix B, first get transpose of B by &quot;MatTranspose(B,<br>
&gt;&gt; MatReuse, B_t); then, form a new &quot;vec&quot; Bi by &quot;MatGetRow(...)&quot;?<br>
&gt;&gt; If answer is yes, is it expensive?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Zhengyong Ren<br>
&gt;&gt; AUG Group, Institute of Geophysics<br>
&gt;&gt; Department of Geosciences, ETH Zurich<br>
&gt;&gt; NO H 47 Sonneggstrasse 5<br>
&gt;&gt; CH-8092, Zürich, Switzerland<br>
&gt;&gt; Tel: +41 44 633 37561<br>
&gt;&gt; e-mail: <a href="mailto:zhengyong.ren@aug.ig.erdw.ethz.ch">zhengyong.ren@aug.ig.erdw.ethz.ch</a><br>
&gt;&gt; Gmail: <a href="mailto:renzhengyong@gmail.com">renzhengyong@gmail.com</a><br>
&gt;&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Zhengyong Ren<br>AUG Group, Institute of Geophysics<br>Department of Geosciences, ETH Zurich<br>NO H 47 Sonneggstrasse 5<br>CH-8092, Zürich, Switzerland<br>Tel: +41 44 633 37561<br>
e-mail: <a href="mailto:zhengyong.ren@aug.ig.erdw.ethz.ch">zhengyong.ren@aug.ig.erdw.ethz.ch</a><br>Gmail: <a href="mailto:renzhengyong@gmail.com">renzhengyong@gmail.com</a><br>