<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 28, 2014 at 3:30 PM, Lawrence Mitchell <span dir="ltr"><<a href="mailto:lawrence.mitchell@imperial.ac.uk" target="_blank">lawrence.mitchell@imperial.ac.uk</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="auto"><div class=""><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
So in this case, I would have a monolithic (interleaved) matrix which I<br>
assemble into by doing MatGetLocalSubMatrix to get a block.  Rather than<br>
having a Nest for which I do MatNestGetSubMat to get a block.  Is that<br>
right?  So in this case I just need to arrange to create my monolithic<br>
matrices and the ISes to pass to MatGetLocalSubMatrix (note I can't let<br>
the DM create the Mat because in some cases I'm lying to it about the<br>
connectivity so the sparsity pattern it would give is wrong, even if the<br>
number of dofs and offsets are right).  However, is it intended that<br>
this kind of setup ever work with DMSetMatType(..., MATNEST)?  If so, I<br>
think I'll be back at square one with this approach.</blockquote><div><br></div><div>Yes, exactly. You would just use your ISes from the section to pull out the</div><div>submatrix, </div></div></div></div></blockquote>
<div><br></div></div>Do I have to build these from the global section I've pulled from the dm by hand or is there a utility function to do so? If the former, I run over all the points in the chart, how do I determine which dofs belong to each field (it sort of feels like I'm recreating something that the dm just do already).</div>
</blockquote><div><br></div><div>I sounds like you want <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateSubDM.html">http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateSubDM.html</a></div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div><div class=""><blockquote type="cite">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>and it should then function exactly as the one from MatNestGetSubMat().</div>
<div>I don't think square one here, because the approach is more flexible. </div></div></div></div></blockquote><div><br></div></div><div>So with that part I was referring to matgetsubmatrix_nest only being able to pull out single blocks, which sort of defeats recursive fieldsplit, since you can't ask for a 2x2 block to split again. Perhaps, however this is a small smop.</div>
</div></div></blockquote><div><br></div><div>This is another reason I am not a big fan of Nest, but since its just a matrix implementation, I don't</div><div>think its a big deal. The code should be written to use the generic Mat interface.</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div><div class=""><blockquote type="cite">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If the IS</div><div>matches the IS for a Nest block, then the submatrix can just be returned wholesale.</div><div>If the Mat is not a Nest, or the IS is interleaved, then the interface is the same.</div>

<div>I think this approach can do what you want.</div></div></div></div>
</blockquote><div><br></div></div>I'll have to do something similar with the vecs I build, since they're currently built separately and then shoved together with a vecscatter as needed, but I guess that's more similar index fiddling.</div>
</div></blockquote><div><br></div><div>Yep, you can also set an l2g here.</div><div><br></div><div>  Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="auto"><span class=""><font color="#888888"><div>Lawrence</div></font></span></div></blockquote></div><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>