On Fri, Aug 17, 2012 at 1:21 PM, Chris Eldred <span dir="ltr"><<a href="mailto:chris.eldred@gmail.com" target="_blank">chris.eldred@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I was wondering how ghost values were handled when creating a<br>
distributed (global) vector from a specific PetscSection over a<br>
DMComplex object- ie what defines the stencils used to figure out<br>
which values need to be ghosted? What about local vs. global indexes?</blockquote><div><br></div><div>This answer will have to be long because the question is mixing levels in</div><div>the interface.</div><div><br></div>
<div>A PetscSection is only an offset structure, so it has no designated fields</div><div>for overlap information. What I do for DM is to create 2 sections: one</div><div>describing the layout of the local vector, and one describing the global</div>
<div>vector and ghosts. The global section can be created automatically given</div><div>the local section and a PetscSF (successor to VecScatter).</div><div><br></div><div>The PetscSF describes the parallel overlap, and also has scatters and reductions.</div>
<div>This is created by the DMComplex instead of a scatter since it can handle</div><div>arbitrary types, and has a better query interface. DMComplex creates a</div><div>(non-overlapping) partition of some stratum of points, usually cells for FEM.</div>
<div>Then the closure(p) U star(p) for each point is added to that partition, and</div><div>the dofs on any shared point are ghosted.</div><div><br></div><div>This is all now done using the vanilla DM interface, so DMGlobalToLocal()</div>
<div>and LocalToGlobal() and cousins work as normal.</div><div><br></div><div>Does that make sense?</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">
<span class="HOEnZb"><font color="#888888"><br>
-Chris<br>
<br>
--<br>
Chris Eldred<br>
DOE Computational Science Graduate Fellow<br>
Graduate Student, Atmospheric Science, Colorado State University<br>
B.S. Applied Computational Physics, Carnegie Mellon University, 2009<br>
<a href="mailto:chris.eldred@gmail.com">chris.eldred@gmail.com</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>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<br>