<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 11, 2015 at 8:15 AM, Gideon Simpson <span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@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 style="word-wrap:break-word">Ok, so here’s some behavior I don’t understand.  I am working with a DMComposite structure, and I do the following,<div><br></div><div><div>    SNESComputeFunction(snes,U_refine,r);</div><div>    SNESGetDM(snes, &dm_refine);</div><div><br></div><div>    DMCompositeGetLocalVectors(dm_refine, &rp, &rQ);</div><div>    DMCompositeScatter(dm_refine, r, rp, rQ);</div><div>      </div><div>    VecNorm(r, NORM_2, &r_norm);</div><div>    VecNorm(rp, NORM_2, &rp_norm);</div><div>    VecNorm(rQ, NORM_2, &rQ_norm);</div><div><br></div><div>    VecGetSize(r,&r_size);</div><div>    VecGetSize(rp, &rp_size);</div><div>    VecGetSize(rQ, &rQ_size);</div><div><br></div><div>    DMCompositeRestoreLocalVectors(dm_refine, &rp, &rQ);</div><div>    VecDestroy(&r);</div><div><br></div><div>    PetscPrintf(PETSC_COMM_WORLD," ||r|| = %g, %i entries\n",r_norm,r_size);</div><div>    PetscPrintf(PETSC_COMM_WORLD," ||rp|| = %g, %i entries\n",rp_norm,rp_size);</div><div>    PetscPrintf(PETSC_COMM_WORLD," ||rQ|| = %g, %i entries\n",rQ_norm,rQ_size);</div></div><div><br></div><div>and my output is:</div><div><br></div><div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> ||r|| = 225.31, 7999 entries</span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> ||rp|| = 140.021, 3 entries</span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> ||rQ|| = 176.56, 8004 entries</span></div></div><div><br></div><div><br></div><div>The arithmetic, is off, no?</div></div></blockquote><div><br></div><div>I think you want Global vectors for this, not Local vectors.</div><div><br></div><div>  Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>
<span style="border-collapse:separate;border-spacing:0px">-gideon</span>

</div>
<br><div><blockquote type="cite"><div>On Sep 10, 2015, at 5:28 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:</div><br><div><br>  SNESGetDM()  this will return not the original DM you set but the refined one.<br><br><blockquote type="cite">On Sep 10, 2015, at 3:47 PM, Gideon Simpson <<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>> wrote:<br><br>I’m using a DMCompsosite along with grid sequencing and here’s what I’m trying to accomplish.  After running the SNES solve, I’d like to evaluate the residual on the refined grid, on each piece of the DMComposite.  How do I get a DM for the refined grid which I can then use with DMCompositeGetLocalVectors in order to get each piece of the problem?  Or is there a better way?<br><br>-gideon<br><br></blockquote><br></div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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></div>