<div class="gmail_quote">On Tue, Jun 7, 2011 at 20:24, Philip, Bobby <span dir="ltr"><<a href="mailto:philipb@ornl.gov">philipb@ornl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":15h">The overhead of constructing a native PETSc vector across all refinement levels would involve writing a global ordering<br>
scheme that numbers nodes/cells/edges etc (depending on the data centering) and then doing maps back and forth. For my larger simulations<br>
the cost for this would be too high because this would not be a one time cost.</div></blockquote><div><br></div><div>Did you profile this? The cost seems very dependent on the implementation. The fundamental part is basically a copy from contiguous to discontiguous data. That memcpy for each patch might not be very expensive compared to e.g. the traversal.</div>
<div><br></div><div>Is this whole hierarchy manipulated directly by the user, or is there an iterator for patches? Could an iterator be made to extract the patch with ghosts from a contiguous PETSc vector?</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":15h"> I would have to do this each time PETSc KSP made a call to<br>
one of my multilevel preconditioners such as FAC.</div></blockquote></div><br><div>It seems to me that setup should only need to happen when the mesh adapts. Are you adapting the mesh inside of a KSPSolve? (I think that would be strange.)</div>