On this topic, we should become much more adamant, at least in documentation and maybe also in naming about which arguments are scale-free and which are scale-dependent. Internally, we (Peter and I) have a system that is being followed carefully, including in the examples that we write. Things compose well when these unwritten guidelines are followed.<br>
<br><div class="gmail_quote">On Thu, Jul 19, 2012 at 1:25 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@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 class="im"><div class="gmail_quote">On Thu, Jul 19, 2012 at 1:19 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@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>  Why not implement it using PetscObjectQuery()/PetscObjectCompose()? and not have to introduce a whole new datatype DMNamedVecLink linked list and other crap?</div></blockquote></div><br></div><div>The only reason this thing has to exist, and it really has to exist in some form, is that we have a reference loop. For example, the SNES Vec X is obtained from the DM (thus X references the DM), but must be made available to the KSP callback that uses the DM. If we attached X to the DM, then we would have a loop X -> DM -> X. Same for the TS vector needed in SNESComputeFunction.</div>

<div><br></div><div>The general form of PetscObjectCompose allowing reference loops is terribly dangerous and imprecise (you end up implementing a sort of limited garbage collector that periodically looks for loops, but that is super dangerous in parallel because you need determinism in destruction).</div>

</blockquote></div><br>