<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 31, 2020, at 7:31 PM, Raju Mandhapati <<a href="mailto:mandhapati.raju@convergecfd.com" class="">mandhapati.raju@convergecfd.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">Barry,<div class=""><br class=""></div><div class="">Thank you for the reply. I am a beginner. I was confused with the following statement in the manual</div><div class=""><br class=""></div><div class="">" If the matrices are
stored as interlaced then PCFieldSplitSetFields() can be called repeatedly to indicate which
fields belong to each block. " <br class=""></div><div class=""><br class=""></div><div class="">Does it mean that we need to set each row number which field does it belong to? </div><div class=""><br class=""></div><div class="">If I set the block size to 3 and set</div><div class=""> -pc_fieldsplit_0_fields 0,1<br class="">
-pc_fieldsplit_1_fields 2<br class="">
<br class=""></div><div class="">In what format is Petsc expecting for the matrix to be assembled? In other words, how does Petsc know where the entries of A00, A01, A10 and A11 are located?</div></div></div></div></blockquote><div><br class=""></div> The use of PCFieldSplitSetFields() or the command line options -pc_fieldsplit_0_fields assumes and requires that the variables are stored interlaced. </div><div><br class=""></div><div> Generally for each interlaced variable you want to make sure that it is included in at least one fieldplit (yes, the same interlaced variable can go into multiple fields but this is uncommon). </div><div><br class=""></div><div> All you need to define the split in your case is -pc_fieldsplit_0_fields 0,1 -pc_fieldsplit_1_fields 2</div><div><br class=""></div><div><br class=""></div><div> Barry</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">thanks,</div><div class="">Raju.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 31, 2020 at 7:21 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" class="">bsmith@petsc.dev</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br class="">
-pc_fieldsplit_block_size 3 (you may not need this if the code sets the block size to 3).<br class="">
<br class="">
-pc_fieldsplit_0_fields 0,1<br class="">
-pc_fieldsplit_1_fields 2<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
> On Jul 31, 2020, at 7:05 PM, Raju Mandhapati via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank" class="">petsc-users@mcs.anl.gov</a>> wrote:<br class="">
> <br class="">
> Hello,<br class="">
> <br class="">
> I have a matrix assembled in interlaced format. I am not able to follow how to use fieldsplit. Is there a good example to show how to do this. My variable are in this format [ {u1,v1,p1}, {u2,v2,p2}, ....,{un,vn,pn}], where n is the number of grid points and u,v,p are the velocity and pressure components. The matrix is assembled as<br class="">
> <br class="">
> [ uu11 uv11 up11 uu12 uv12 up12 ......<br class="">
> vu11 vv11 vp11 vu12 vv12 vp12 .......<br class="">
> pu11 pv11 pp11 pu12 pv12 pp12 ......<br class="">
> <br class="">
> uu21 uv21 up21 uu22 uv22 up22 ......<br class="">
> vu21 vv21 vp21 vu22 vv22 vp22 .......<br class="">
> pu21 pv21 pp21 pu22 pv22 pp22 ......<br class="">
> <br class="">
> .<br class="">
> .<br class="">
> <br class="">
> ]<br class="">
> <br class="">
> I want to split u and v fields as one block and p field as another block.<br class="">
> <br class="">
> Any help would be appreciated.<br class="">
> <br class="">
> Raju.<br class="">
> <br class="">
> <br class="">
> <br class="">
<br class="">
</blockquote></div></div>
</div></blockquote></div><br class=""></body></html>