<div dir="ltr">On Wed, Feb 13, 2013 at 8:40 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Regardless of exactly how this shakes out I think you both have to agree that PetscSection is a bit of an oddball and it should be more "integrated" with the "IS stuff" in that we have a single source code location (directory) and set of concepts related to indexing things. And don't have some in the Vec directory.<br>
<br>
So, for now, I won't change names or functionality but would like permission to move source around. Who knows, maybe in the end the is directory will get a more suitable name.<br></blockquote><div><br></div><div style>
Yes, I completely agree with the move. There is really only one file right now.</div><div style><br></div><div style> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Barry<br>
<br>
As you know I really really like having names that convey connections left to right, KSPGMRES, PC_ILU etc. I think this helps make the learning and understanding curve lower. Now people see IS and PetscSection and they are two completely unrelated things to their eyes but in fact they are not unrelated and I would like to convey that somehow in the future.<br>
<br>
BTW: I consider it a terrible tragedy that in (for example C++ and Java) one can define a subclass of a class and just use a completely arbitrary ASCII name for the subclass completely unrelated to the class it is derived from, talk about losing information.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Feb 13, 2013, at 6:40 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
<br>
> On Wed, Feb 13, 2013 at 12:45 AM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> wrote:<br>
><br>
> On Tue, Feb 12, 2013 at 11:34 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
> Is it? Maybe a more general definition of PetscSection would be better as map from (int) -> IS Matt's current usage is very restricted to only contiguous blocks of elements in a group. Need that be it? Should that be it?<br>
><br>
> There is some hackery to ascribe "field" structure to the output of the map, but I'm skeptical of whether it belongs at this level.<br>
><br>
> The granularity is normally very small so we certainly don't want to pay the memory or performance overhead of an IS for each output. Although I'm sure we can think up scenarios where that flexibility would be useful, I think generality in the outputs here would add significant complexity with limited practical return.<br>
><br>
> Note that PetscSection is currently accessed using function calls in inner loops. This already accounts for a noticeable amount of time for a CFD application. So we either need a coarser grained access API or we need a non-polymorphic accessor for use in hot access sites. (This is a rare case where indirect function call overhead matters.)<br>
><br>
> I think its helpful to look at the one universal use case right now:<br>
><br>
> You would like to describe a function over a mesh, so<br>
> associate functions with each part of the mesh and<br>
> store coefficients of these functions.<br>
> This happens for:<br>
> mesh geometry<br>
> PDE solutions and auxiliary fields (like viscosity)<br>
> the mesh itself (the adjacency is a field over the points)<br>
><br>
> The inner loops Jed is referring to are structured like this<br>
><br>
> VecGetArray(sol, &solArray);<br>
> Loop over pieces (like cell, face, etc.)<br>
> Get solution on this piece:<br>
> PetscSectionGetDof(solSection, piece, &dof), PetscSectionGetOffset(solSection, piece, &off)<br>
> pieceArray = &solArray[off];<br>
> Jed condenses this to DMPlexPointLocalRead(solDM, piece, solArray, &pieceArray)<br>
><br>
> Thus this adds structure to the Vec sol by breaking it into irregular pieces. The lower level<br>
> function Dof/Offset() are definitely necessary so you can reason about the operations. I think<br>
> you could get away with only the array offsetting being fast, but I don't see how you make that<br>
> fast and those slow.<br>
><br>
> Barry: > Is it? Maybe a more general definition of PetscSection would be better as map from (int) -> IS Matt's current usage is very restricted to only contiguous blocks of elements in a group. Need that be it? Should that be it?<br>
><br>
> I think you are missing the point here. I use this all over the place. This is PetscSection+IS. You put your<br>
> non-contiguous indices in the IS and index into it using PetscSection. PetscSection is the composable part<br>
> of this indexing-by-groups. It can be combined with IS or Vec or anything. I think it is the right building block.<br>
><br>
> Matt<br>
> --<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>
<br>
</div></div></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
</div></div>