<div class="gmail_quote">On Fri, Aug 17, 2012 at 1:48 PM, John Fettig <span dir="ltr"><<a href="mailto:john.fettig@gmail.com" target="_blank">john.fettig@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 class="im">On Fri, Aug 17, 2012 at 2:33 PM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> wrote:<br>
> Why do you want raw access?<br>
<br>
</div>I'm trying to write my own RAP operator for AMG.<br>
<div class="im"><br>
> If you really need, you can either use MatMPIAIJGetSeqAIJ() or just include<br>
> the private header.<br>
<br>
</div>I presume you mean MatMPIAIJGetLocalMat.  This isn't quite what I<br>
want.  I don't want the local matrix, I want to scatter a vector<br>
according to the ghost values defined by the sparsity pattern of the<br>
parallel matrix.<br></blockquote><div><br></div><div>PetscErrorCode  MatMPIAIJGetSeqAIJ(Mat A,Mat *Ad,Mat *Ao,PetscInt **colmap);</div><div><br></div><div>But if you are writing an RAP, you should just include src/mat/impls/aij/mpi/mpiaij.h. You can set your implementation on an existing matrix using MatShellSetOperation(A, MATOP_PTAP, (void(*)(void))YourPtAPFunction).</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Could you give me a little more help with using the latter?  I see<br>
<br>
VecScatterBegin(a->Mvctx,xx,a->lvec,INSERT_VALUES,SCATTER_FORWARD);<br>
(*a->A->ops->mult)(a->A,xx,yy);<br>
VecScatterEnd(a->Mvctx,xx,a->lvec,INSERT_VALUES,SCATTER_FORWARD);<br>
(*a->B->ops->multadd)(a->B,a->lvec,yy,yy);<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
So I guess a->Mvctx is what I want.  How do I figure out the mapping<br>
of indices in a->lvec?<br></blockquote><div><br></div><div><div>a->garray. MatPtAP is not an easy operation to write. You'll have to get comfortable with diving into the source to understand what's happening.</div>
<div> </div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
John<br>
</font></span></blockquote></div><br>