<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="">Hi Matt, <div class="">thanks for the reply, but I didn’t catch exactly your point. What do you mean with “first bin the points into cells, and then use the</div><div class="">interpolant from the discretization” ? To me it sounds like my “naive” approach, but maybe I missed something in your suggestion. </div><div class=""><br class=""></div><div class="">My problem comes from the solution of a 1D time evolving pde coupled with a hand-made mesh adapting algorithm. Therefore I’m already using a DMDA to manage all the communication issues among processors. Every n timesteps I move the grid and then I need to evaluate the old solution on the new grid points, this is why I need an efficient way to do it. Is it feasible to let DMDA’s objects speak with DMPlexes, in order to keep the previous code structure unaltered and use DMPlex only for the interpolation routine?</div><div class=""><br class=""></div><div class="">Thanks</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">Il giorno 06/nov/2018, alle ore 15:14, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> ha scritto:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Nov 6, 2018 at 5:11 AM Francesco Magaletti via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Dear all,<span class="Apple-converted-space"> </span><br class=""><br class="">I would like to ask you if is there an easy and efficient way in parallel (by using PetsC functions) to interpolate a DMDA vector associated with a nonuniform 1D grid to another DMDA vector with the same length but associated with a different nonuniform grid.<span class="Apple-converted-space"> </span><br class=""><br class="">Let me rephrase it to be as clearer as I can:<br class=""><br class="">I have two structured nonuniform 1D grids with coordinate vectors x[i] and y[i]. Both the domains have been discretized with the same number of points, but the coordinate vectors x and y are different. I have a discretized field u[i] = u(x[i]) and I would like to use these point values to evaluate the values u(y[i]) in the points of the second grid.<br class=""><br class="">I read on the manual pages that functions like DMCreateInterpolation or similar work only with different but uniform DMDAs. Did I understand correctly?<span class="Apple-converted-space"> </span><br class=""><br class="">A naive approach, with a serial code, could be to find the points x[i] and x[i+1] that surround the point y[j] for every j and then simply linear interpolating the values u[i] and u[i+1]. I suspect that this is not the most efficient way to do it. Moreover it won’t work in parallel since, in principle, I do not know beforehand how many ghost nodes could be necessary to perform all the interpolations.<span class="Apple-converted-space"> </span><br class=""><br class="">Thank you in advance for your help!<br class=""></blockquote><div class=""><br class=""></div><div class="">This has not been written, but is not that hard. You would first bin the points into cells, and then use the</div><div class="">interpolant from the discretization. This is how we do it in the unstructured case. Actually, if you wrote</div><div class="">your nonuniform 1D meshes as DMPlexes, I think it would work right now (have not tested).</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: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Francesco</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" 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 class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></div></div></body></html>