<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I think I see what you’re saying, I’m just not used to thinking of interpolation methods in terms of linear systems (too much MATLAB for my own good). I had been preoccupied with trying to do this as a local + ghost points, matrix free computation.</div><div class=""><br class=""></div><div class="">Thanks Matt.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 18, 2015, at 10:16 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 17, 2015 at 9:41 AM, Gideon Simpson <span dir="ltr" class=""><<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">This warrants a deeper description. I was thinking about trying to use petsc to solve a 1D PDE problem using the equidistribution principle for adaptive meshing. Briefly, the idea is that given a function u(x), where x is the physical coordinate, a monitor function, w[u(x)]>0, is introduced such that <div class=""><br class=""></div><div class="">y(x) = \int_{0}^x w[u(s)] ds /\int_{0}^{xmax} w[u(s)] ds </div><div class=""><br class=""></div><div class="">where C is a constant, and y is the computational coordinate in [0,1]. essentially, you want to pick the physical mesh points, x_i such that</div><div class=""><br class=""><div class="">\int_{x_i}^{x_{i+1}} w[u(s)] ds = constant</div><div class=""><br class=""></div><div class="">then the computational mesh points are uniformly spaced. Solving this can be posed as a nonlinear elliptic equation, in general dimension, though it simplifies further in 1D. In a paper by Gavish and Ditkowski, for the 1D problem, they came up with the idea that you could do the following:</div><div class=""><br class=""></div><div class="">Given a starting guess on where the physical coordinates should be, let</div><div class=""><br class=""></div><div class=""> F_i = \int_0^{x_i} w[u(s)]ds/\int_0^{x_N} w[u(s)]ds</div><div class=""><br class=""></div><div class="">Then 0= F_0 < F_1 <… <F_N=1. Rather than try to solve the nonlinear system for the x_i such that the successive differences of F_{i+1} - F_i are uniformly spaced, they propose to do:</div><div class=""><br class=""></div><div class="">interpolate (F_i, x_i) onto the uniform mesh for y, and the interpolated x_i’s should approximately satisfy the equidistribution principle. This can be iterated, to improve the equidistribution. </div><div class=""><br class=""></div><div class="">Doing the quadrature with distributed vectors is not too hard. The question then becomes how to do the interpolation in parallel. As I was suggesting in the earlier example, if y_i = i * h, is the uniform mesh, it may be that y_i could be on proc 0, but the values of {F_j} that this lies between are on proc 1. There is monotonicity at work here, but I’m not sure I can really say, when defining ghost points, how things will spread out.</div></div></div></blockquote><div class=""><br class=""></div><div class="">I think I am slowly understanding the problem. Tell me where I go wrong.</div><div class=""><br class=""></div><div class="">You have a set of (x, y) points (you label them (F_i, x_i)), which you want to interpolate, and then</div><div class="">evaluate on a regular grid. The interpolation is not specified, so to be concrete lets say that you</div><div class="">choose cubic splines, which produces a tridiagonal system, so there is only communication between</div><div class="">neighbors.</div><div class=""><br class=""></div><div class="">It seems like the right thing to do is partition the domain in parallel such that y is evenly divided. Then the</div><div class="">communication pattern for your actual PDE is the same as for the interpolation system, although the</div><div class="">interpolation can be unbalanced. I don't think this will matter compared to the PDE system. If it does,</div><div class="">then you can redistribute, interpolate, and distribute back.</div><div class=""><br class=""></div><div class="">Does this make sense?</div><div class=""><br class=""></div><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 17, 2015, at 10:11 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 17, 2015 at 8:15 AM, Gideon Simpson <span dir="ltr" class=""><<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">I’m gathering from your suggestions that I would need, a priori, knowledge of how many ghost points I would need, is that right?</div></blockquote><div class=""><br class=""></div><div class="">We have to be more precise about a priori. You can certainly create a VecScatter on the fly every time</div><div class="">if your communication pattern is changing. However, how will you know what needs to be communicated.</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class="">
<span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">-gideon</span>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 17, 2015, at 9:10 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 17, 2015 at 7:46 AM, Gideon Simpson <span dir="ltr" class=""><<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Suppose I have data in Vec x and Vec y, and I want to interpolate this onto Vec xx, storing the values in Vec yy. All vectors have the same layout. The problem is that, for example, some of the values in xx on processor 0 may need the values of x and y on processor 1, and so on. Aside from just using sequential vectors, so that everything is local, is there a reasonable way to make this computation?</div></blockquote><div class=""><br class=""></div><div class="">At the most basic linear algebra level, you would construct a VecScatter which mapped the pieces you need from other processes into a local vector along with the local portion, and you would use that to calculate values, which you then put back into your owned portion of a global vector. Thus local vectors have halos and global vectors do not.</div><div class=""><br class=""></div><div class="">If you halo regions (values you need from other processes) have a common topology, then we have simpler</div><div class="">support that will make the VecScatter for you. For example, if your values lie on a Cartesian grid and you</div><div class="">just need neighbors within distance k, you can use a DMDA to express this and automatically make the</div><div class="">VecScatter. Likewise, if you values lie on an unstructured mesh and you need a distance k adjacency,</div><div class="">DMPlex can create the scatter for you.</div><div class=""><br class=""></div><div class="">If you are creating the VecScatter yourself, it might be easier to use the new PetscSF instead since it only needs one-sided information, and performs the same job. This is what DMPlex uses to do the communication.</div><div class=""><br class=""></div><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><span class=""><font color="#888888" class="">
-gideon
<br class=""></font></span></div></blockquote></div><br class=""><br clear="all" class=""><span class=""><font color="#888888" class=""><span class=""><font color="#888888" class=""><div class=""><br class=""></div>-- <br class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div>
</font></span></font></span></div></div><span class=""><font color="#888888" class="">
</font></span></div></blockquote></div><span class=""><font color="#888888" class=""><br class=""></font></span></div></div></blockquote></div><span class=""><font color="#888888" class=""><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div>
</font></span></div></div>
</div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div>
</div></div>
</div></blockquote></div><br class=""></body></html>