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

Clark C Pederson clarkp at utexas.edu
Tue Nov 29 00:57:26 CST 2016


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/02ab707d/attachment.html>


More information about the petsc-users mailing list