[petsc-users] DMDA Question

Barry Smith bsmith at mcs.anl.gov
Fri Dec 2 13:12:54 CST 2011


   Tim,

    Unfortunately the DMDA was not designed with the idea of staggered grids (or mixed discretizations) in mind so they are not straightforward like we would like them to be.

    Do I understand you want two DMDA 

1) one that has locations for cell vertices (or face centers)?

2) and one that locations for cell centers?

   Once we understand what you want we may be able to make a suggestion.

   Barry


On Dec 2, 2011, at 1:08 PM, Tim Gallagher wrote:

> Hi,
> 
> I'm trying to create some grids for a finite volume simulation and am a little stuck on the best way to tackle it. The approach now is to use DMDACreate3d with known number of I, J, K points and PETSC_DECIDE for the processors. Then I am trying to create another DMDA with the same distribution to store the cell centers and actual solution vector. The problem with is is the following:
> 
> Consider 9 points and two processors. Processor one gets points [1,5] with point 6 as a ghost and processor two gets points [6,9] with point 5 as a ghost. But now to create/store cell centers, processor two needs point 4 to construct a cell center for it's ghost. 
> 
> I can certainly fetch that point and do the calculation, but I feel like there is a more elegant way to do this out there. Has anybody used a DMDA to create a dual DMDA? 
> 
> Any advice would be appreciated,
> 
> Tim



More information about the petsc-users mailing list