[petsc-dev] Use of DMDA to manage structured but staggered grid

Chris Eldred chris.eldred at gmail.com
Wed Nov 18 05:09:16 CST 2015


Hey Matt,

Thanks for the quick reply. It sounds like option a) is probably going to
be best for us. Our primary interest is in geophysical fluid flow, and we
will probably end up doing something special/different for the vertical
direction so a solution for 2D should be fine.

Regards,
-Chris

On Tue, Nov 17, 2015 at 6:22 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Tue, Nov 17, 2015 at 11:04 AM, Chris Eldred <chris.eldred at gmail.com>
> wrote:
>
>> Hey petsc-dev,
>>
>> As the title suggests, I would like to use DMDA to manage a structured
>> but staggered grid (initially in 2D, but eventually in 3D). I would
>> like to have dofs at cells, vertices and edges (also faces in 3D). I
>> would use DMPlex for this, but I need access to larger stencils than
>> closure/star, and it seems difficult get those in a consistent
>> (properly numbered/ordered) way using Plex (with DMDA the
>> numbering/ordering is built into the indexing, so it is trivial). If
>> this is a mistaken assumption, and it is in fact easy to get
>> consistent larger stencils in Plex, I am more than happy to use it
>> instead.
>>
>> What is the best way to do this?
>>
>> Looking around, it seems like DMDACreateSection might be a good place
>> to start, but the implementation doesn't seem to match the
>> documentation- in particular there is no argument for numFields. Is
>> there an example using DMDACreateSection to actually manage a
>> staggered grid discretization?
>>
>> The other option seems to be using a normal DMDA and dealing with the
>> multiple dofs per geometric entity myself - ie something like SNES
>> example 30.
>>
>> Any insight or advice on the optimal way to do this would be appreciated!
>>
>
> I see two ways to do this:
>
>   a) Imagine that you have shifted copies of the DMDA and use buffer
> vertices near the boundaries.
>
>       This is really easy in 2D, or for cells-vertices only. I have never
> seen anyone do this for all pieces in 3D.
>
>   b) Use a canonical numbering for all structured mesh pieces and
> PetscSection for variable numbering/communication
>
>        I tried to implement this (you see the remnants in the code), but
> no one cared because they thought
>        that a) was much easier.
>
> You can see the canonical numbering I was using
>
>
> https://bitbucket.org/petsc/petsc/src/eb7a356d4fd856a1604e75817172000df0c758b7/src/dm/impls/da/dalocal.c?at=master&fileviewer=file-view-default#dalocal.c-391
>
> I don't know which method makes more sense for you.
>
>   Thanks,
>
>      Matt
>
>
>> Thanks,
>> Chris Eldred
>>
>> --
>> Chris Eldred
>> Postdoctoral Fellow, LAGA, University of Paris 13
>> PhD, Atmospheric Science, Colorado State University, 2015
>> DOE Computational Science Graduate Fellow (Alumni)
>> B.S. Applied Computational Physics, Carnegie Mellon University, 2009
>> chris.eldred at gmail.com
>>
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>



-- 
Chris Eldred
Postdoctoral Fellow, LAGA, University of Paris 13
PhD, Atmospheric Science, Colorado State University, 2015
DOE Computational Science Graduate Fellow (Alumni)
B.S. Applied Computational Physics, Carnegie Mellon University, 2009
chris.eldred at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20151118/c0812b0c/attachment.html>


More information about the petsc-dev mailing list