<div class="gmail_quote">On Mon, Feb 27, 2012 at 11:00, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">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 class="gmail_quote"><div>I don't see why this is a dependency loop.</div></div></blockquote><div><br></div><div>1. The callback interface is duplicated.</div><div><br></div><div>2. DM callbacks should provide a way for the called code to get access to the TS or DM so that users aren't prevented from doing hacky things.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>As a related matter, I'm stuck with a reference counting loop where I want to attach special Vecs to a DM. I can wrap them in a PetscContainer to circumvent the code that checks for reference cycles, but that makes freeing them delicate. We could make a named cache similar to DM work vectors, but where restored Vecs are not available for reuse.</div>


</blockquote></div></div><br>I know that rationale for having Vecs know about a DM (output), which I don't like. What is the rationale for having DMs know about a certain Vec?</blockquote></div><br><div>A TS wants to solve a nonlinear problem using FAS, so it needs to implement a callback on levels. So it coarsens the grid, but it also needs to coarsen the affine vectors so that it can define the finite-step problem on coarse levels.</div>
<div><br></div><div>Same issue for lots of cases where a user needs to save grid setup, coefficient fields, etc on levels so that it is available in a callback. It's natural to compose those vectors with the DM, but that creates a reference loop.</div>