<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Nov 6, 2018 at 5:11 AM Francesco Magaletti via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all, <br>
<br>
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. <br>
<br>
Let me rephrase it to be as clearer as I can:<br>
<br>
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>
<br>
I read on the manual pages that functions like DMCreateInterpolation or similar work only with different but uniform DMDAs. Did I understand correctly? <br>
<br>
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. <br>
<br>
Thank you in advance for your help!<br></blockquote><div><br></div><div>This has not been written, but is not that hard. You would first bin the points into cells, and then use the</div><div>interpolant from the discretization. This is how we do it in the unstructured case. Actually, if you wrote</div><div>your nonuniform 1D meshes as DMPlexes, I think it would work right now (have not tested).</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Francesco</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>