[petsc-users] How do I Ensure that Two DMDA Objects Are Coupled Correctly?

Dave May dave.mayhem23 at gmail.com
Tue Nov 29 02:37:13 CST 2016


For collocated variables, I recommend you use the function
DMDAGetReducedDMDA()

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDAGetReducedDMDA.html

That's the simplest option.


In general, if the 2 dmdas have the same number of points in each
direction, and you let petsc determine the partitions when you called
DMDACreate3d(), they will have the same layout in parallel.

You can confirm they overlap using the returned values from
DMDAGetCorners() and DMDAGetGhostCorners().

Alternatively you can specify the layout yourself when you create the DMDAs
using the lx[] ly[] lz[] arrays. See

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDACreate3d.html


Thanks
Dave

On Tue, 29 Nov 2016 at 07:58, Clark C Pederson <clarkp at utexas.edu> wrote:

> Dear all,
>
> I'm writing a simple solver for the time-dependent incompressible
> Navier-Stokes equations, using a structured grid and a fractional step
> approach.  Specifically, I'm following the approach of Kim and Moin, from
> their 1985 paper. To those who are unfamiliar with fractional step methods,
> you separate out the equation solving process into multiple steps.  In the
> first step, you advance your velocity fields in time to obtain an
> "uncorrected" velocity.  In the second step, you compute a pressure-like
> term using the uncorrected velocities.  In the third step, you compute the
> correct velocities using the pressure-like term.
>
> This lead me to my question: There's two types of data I need to work with
> in different ways.  The first is the velocity field (u,v,w), which needs to
> be updated using time-stepping routines.  The second is the pressure-like
> term, which is solved for in a Poisson equation.  What is the best way to
> couple these two fields, using distributed arrays?
>
> The suggestion here: (
> http://lists.mcs.anl.gov/pipermail/petsc-users/2013-October/019022.html)
> is to use two DMDAs, one for the velocities with 3 DoF and one for the
> pressures with 1 DoF.  This seems like the simplest way to work with the
> problem, aside from one problem: when the two arrays need to interface, how
> do I ensure that the local processes align?  In other words, how do I make
> sure that my local array p[k][j][i] can pull the correct information from
> the local vel[k][j][i].u etc. array locations? The points would be
> identical or neighboring points on the structured grid, but they would be
> part of two different DMDA objects.  How do I make sure that each processor
> has the data it needs?
>
> I've looked in the manual, examples, and the mailing list, but I couldn't
> find anything that answered this question.  The answer may be very simple,
> so any help is appreciated.
>
> Thanks,
> Clark Pederson
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161129/61b4fc42/attachment.html>


More information about the petsc-users mailing list