<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 17, 2015 at 11:04 AM, Chris Eldred <span dir="ltr"><<a href="mailto:chris.eldred@gmail.com" target="_blank">chris.eldred@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hey petsc-dev,<br>
<br>
As the title suggests, I would like to use DMDA to manage a structured<br>
but staggered grid (initially in 2D, but eventually in 3D). I would<br>
like to have dofs at cells, vertices and edges (also faces in 3D). I<br>
would use DMPlex for this, but I need access to larger stencils than<br>
closure/star, and it seems difficult get those in a consistent<br>
(properly numbered/ordered) way using Plex (with DMDA the<br>
numbering/ordering is built into the indexing, so it is trivial). If<br>
this is a mistaken assumption, and it is in fact easy to get<br>
consistent larger stencils in Plex, I am more than happy to use it<br>
instead.<br>
<br>
What is the best way to do this?<br>
<br>
Looking around, it seems like DMDACreateSection might be a good place<br>
to start, but the implementation doesn't seem to match the<br>
documentation- in particular there is no argument for numFields. Is<br>
there an example using DMDACreateSection to actually manage a<br>
staggered grid discretization?<br>
<br>
The other option seems to be using a normal DMDA and dealing with the<br>
multiple dofs per geometric entity myself - ie something like SNES<br>
example 30.<br>
<br>
Any insight or advice on the optimal way to do this would be appreciated!<br></blockquote><div><br></div><div>I see two ways to do this:</div><div><br></div><div>  a) Imagine that you have shifted copies of the DMDA and use buffer vertices near the boundaries.  </div><div><br></div><div>      This is really easy in 2D, or for cells-vertices only. I have never seen anyone do this for all pieces in 3D.</div><div><br></div><div>  b) Use a canonical numbering for all structured mesh pieces and PetscSection for variable numbering/communication</div><div><br></div><div>       I tried to implement this (you see the remnants in the code), but no one cared because they thought</div><div>       that a) was much easier.</div><div><br></div><div>You can see the canonical numbering I was using</div><div><br></div><div>  <a href="https://bitbucket.org/petsc/petsc/src/eb7a356d4fd856a1604e75817172000df0c758b7/src/dm/impls/da/dalocal.c?at=master&fileviewer=file-view-default#dalocal.c-391">https://bitbucket.org/petsc/petsc/src/eb7a356d4fd856a1604e75817172000df0c758b7/src/dm/impls/da/dalocal.c?at=master&fileviewer=file-view-default#dalocal.c-391</a></div><div><br></div><div>I don't know which method makes more sense for you.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Thanks,<br>
Chris Eldred<br>
<span class=""><font color="#888888"><br>
--<br>
Chris Eldred<br>
Postdoctoral Fellow, LAGA, University of Paris 13<br>
PhD, Atmospheric Science, Colorado State University, 2015<br>
DOE Computational Science Graduate Fellow (Alumni)<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><div class="gmail_signature">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></div>