<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 11, 2013 at 3:13 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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 dir="ltr"><div class="im">On Fri, Oct 11, 2013 at 8:09 AM, Bishesh Khanal <span dir="ltr"><<a href="mailto:bisheshkh@gmail.com" target="_blank">bisheshkh@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<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="ltr"><div><div>Dear all,<br></div>By default, dmda puts all dof at a given node logically in consecutive order. The corresponding vectors and matrices created also follow this order. What should I do to change it so that it puts all the grid nodes for a 1st dof consecutively, then do the same for 2nd dof and so on. I also want the same behavior for the matrix it creates so that the rows corresponding to a particular dof are put in a consecutive manner instead of interleaving different dofs.<br>

</div></div></blockquote><div><br></div></div><div>What do you really want to accomplish? This ordering is disastrous for cache architectures.</div></div></div></div></blockquote><div><br></div><div>Thanks Matt, but I was trying to check if there is any problem in a matrix I created. I had my old prototype code in MATLAB where I created a matrix by having a block of rows for each dof. So as a quick test, I wanted to write the matrix I created in Petsc to a file and read it with matlab and compare the two matrices, taking a difference would help me spot errors quickly. <br>
</div><div>Please let me know if there is a quick way to do that. And if there are better ways to track down possible errors in the matrix creation by having better visualization of elements of the matrix created in petsc (without going to matlab), I'd be happy to learn that too.<br>
 <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>1) If you want segregated solves, use PCFIELDSPLIT.</div>
<div>
<br></div><div>2) If you want to mess around with a single field, use VecStrideGather/Scatter(): <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecStrideGather.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecStrideGather.html</a></div>

<div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div><br></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="ltr"><div></div>Thanks,<br>Bishesh<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><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
</font></span></div></div>
</blockquote></div><br></div></div>