<div dir="ltr"><span style="font-family:courier new,monospace"></span><br><div><div><div><div><div class="gmail_extra"><span style="font-family:courier new,monospace"></span><div class="gmail_quote"><span style="font-family:courier new,monospace">On 11 November 2013 19:59, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:courier new,monospace">That direction is fragile and/or expensive unless it is within the<br>
subdomain overlap/ghost region. Where are you getting this index from?<br></span></blockquote><div><br><div><div><div><div><span style="font-family:courier new,monospace"><br>Let me give a brief description of the problem I'm working on:<br>
<br></span></div><span style="font-family:courier new,monospace">I
use a structured staggered grid to store a fluid velocity field, and I
need to interpolate this field on to a set of points that represent an
immersed body present in the flow. These points can be arbitrarily
placed in the domain and need not conform to the grid. <br>
<br>Around each body point, I choose a small rectangular region of
velocity grid points and perform an interpolation with these values to
obtain the velocity at the body point. This can be represented as:<br></span></div>
<span style="font-family:courier new,monospace">[C][u] = [b]<br><br></span></div><div><span style="font-family:courier new,monospace">where
[C] contains the interpolation coefficients, [u] contains velocity
values from the small rectangular region and [b] is the velocity at the
body point. These matrices can be expanded to include the entire
velocity field and all the body points.<br>
</span></div><div><span style="font-family:courier new,monospace">
<br></span></div><span style="font-family:courier new,monospace">Currently,
I'm storing a copy of the body on every process. And since my grid is
structured and cartesian, it's easy to calculate the indices of the
velocity grid points around each body point. This is how I obtain the
Natural Ordering index.<br>
<br>I created the vector [b] using VecCreate, and PETSC_DECIDE for the
size on each process. The length of [b] is 2*nb, where nb is the number
of body points, and the first half of the vector stores the x-component
and the second stores the y-component of velocity. [u] is a DMComposite
of the U and V components of velocity.<br>
</span><span style="font-family:courier new,monospace"></span></div><span style="font-family:courier new,monospace"><br>Currently,
my fix is to loop over all the velocity grid points, check if they come
under the influence of any of the body points, and correspondingly set
the interpolation coefficient value in the matrix. But this procedure
requires a double loop.<br>
</span><br><span style="font-family:courier new,monospace">I haven't thought about parallelising the body storage yet.</span> <br></div></div><span style="font-family:courier new,monospace"><br></span></div></div></div>
</div></div></div>