<div class="gmail_quote">On Tue, Nov 23, 2010 at 00:27, Sean Farley <span dir="ltr"><<a href="mailto:sean@mcs.anl.gov">sean@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>2) Change your function declaration back to what you had:</div><div class="im">
<div><br></div><div>PetscErrorCode ComputeRho(DMMG dmmg, Vec rho)</div></div><div>{...}</div><div><br></div><div>and then pass the object to your function as so:</div><div><br></div><div>ComputeRho(*dmmg, b);</div><div><br>
</div>
<div>Do you need your dmmg to be a pointer in your 'main' function? It looks like your declaration could just be:</div></blockquote></div><br><div>DMMG is simultaneously an array representing a full hierarchy and the individual levels in the hierarchy. If you have</div>
<div><br></div><div> DMMG *dmmg;</div><div><br></div><div>then dmmg[0] (same as *dmmg) represents the coarsest level. If your function only works on one level, then you should just pass in a DMMG (not a DMMG*). If your function only needs the dmmg->dm field, then just make your function use a DA, then make that the argument of your function and call it as</div>
<div><br></div><div>DMMG *dmmg;</div><div>// dmmg is initialized somehow ...</div><div>MyFunc(DMMGGetDA(dmmg),bvec);</div><div><br></div><div>This passes in the DA on the finest level.</div><div><br></div><div>DMMG is a weird beast. Once its functionality has been migrated to SNES and KSP (underway in petsc-dev), it will be removed.</div>
<div><br></div><div>Jed</div><div><br></div><div>Jed</div>