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"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></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>
> This is virtually SCHUR complement. You may take a look at<br>
> petsc-dev/src/ksp/ksp/examples/tests/ex11.c and<br>
> petsc-dev/src/ksp/ksp/examples/tests/makefile: runex11<br>
><br>
> Hong<br>
><br>
> On Tue, May 31, 2011 at 8:29 AM, RenZhengYong <<a href="mailto:renzhengyong@gmail.com">renzhengyong@gmail.com</a>> wrote:<br>
>> I have a linear system of equation like<br>
>> [A B] [E]= [C]<br>
>> [F G] [S]= [D],<br>
>> where size of matrix A is NxN, B is NxNs, F is Ns_N, G is Ns_Ns; size of<br>
>> vector E is N, S is Ns, C is N and D is N.<br>
>> Instead of solving them together, I prefer to solve it by:<br>
>> (1) AX=B, AY=C;<br>
>> (2) QS=P, Q= G-FX, P=D-FY,<br>
>> due to the dense property of G.<br>
>><br>
>> In step (1), I need to extract a new "vec" Bi from "mat" B, according to the<br>
>> way of PETSc telling me. My question is that could I do it as follows,<br>
>> for a given sparse matrix B, first get transpose of B by "MatTranspose(B,<br>
>> MatReuse, B_t); then, form a new "vec" Bi by "MatGetRow(...)"?<br>
>> If answer is yes, is it expensive?<br>
>><br>
>><br>
>><br>
>><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>
>><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>