<div style="white-space:pre-wrap">For collocated variables, I recommend you use the function DMDAGetReducedDMDA()<br><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDAGetReducedDMDA.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDAGetReducedDMDA.html</a><br><br>That's the simplest option.<br><br><br>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.<br><br>You can confirm they overlap using the returned values from DMDAGetCorners() and DMDAGetGhostCorners().<br><br>Alternatively you can specify the layout yourself when you create the DMDAs using the lx[] ly[] lz[] arrays. See <br><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDACreate3d.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDACreate3d.html</a><br><br><br>Thanks<br> Dave</div><br><div class="gmail_quote"><div dir="ltr">On Tue, 29 Nov 2016 at 07:58, Clark C Pederson <<a href="mailto:clarkp@utexas.edu">clarkp@utexas.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">Dear all,<br class="gmail_msg"><br class="gmail_msg"></div>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.<br class="gmail_msg"><br class="gmail_msg"></div>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?<br class="gmail_msg"><br class="gmail_msg"></div>The suggestion here: (<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/2013-October/019022.html" class="gmail_msg" target="_blank">http://lists.mcs.anl.gov/pipermail/petsc-users/2013-October/019022.html</a>) 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?<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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.<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div>Thanks,<br class="gmail_msg"></div>Clark Pederson<br class="gmail_msg"></div>
</blockquote></div>