<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div><br>
</div>
Hi Philipp,
<div><br>
</div>
<div>Your approach sounds correct.</div>
<div><br>
</div>
<div>Nek automatically migrates particles to wherever the geometry is.  This is done using a relatively</div>
<div>efficient generalized all-to-all (that requires only log P message exchanges).  Point identification is</div>
<div>done through a combination of a hash table, to identify candidate elements, and a very robust </div>
<div>Newton iteration to identify the computational point in r,s,t, space that corresponds to x,y,z.</div>
<div><br>
</div>
<div>Of these processes, findpts is the most expensive.  Subsequent interpolation onto multiple </div>
<div>fields is relatively cheap.</div>
<div><br>
</div>
<div>I have some code developed by another user that will interpolate many fields in a single go ---</div>
<div>there are computational advantages for doing so --- but it is not yet general purpose (by</div>
<div>the author's own admission).  My hope is to get this into the repo soon but I could provide</div>
<div>it off-list if you are keen to dig into some C code -- only if you are keen.   Otherwise, I think</div>
<div>there are other optimizations that could be tackled, and we will indeed be working on these</div>
<div>over the next few weeks.</div>
<div><br>
</div>
<div>Paul</div>
<div><br>
</div>
<div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF867407" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> nek5000-users-bounces@lists.mcs.anl.gov [nek5000-users-bounces@lists.mcs.anl.gov] on behalf of nek5000-users@lists.mcs.anl.gov [nek5000-users@lists.mcs.anl.gov]<br>
<b>Sent:</b> Monday, June 29, 2015 12:58 PM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> [Nek5000-users] Spectral interpolation of velocity gradients<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt"><span style="font-family:Calibri,sans-serif"><font size="2">Hi Neks,</font></span>
<div style="font-family:Calibri,sans-serif"><font size="2"><br>
</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">I study particles in a turbulent flow and need to know velocity gradients dvi_dxj at particle positions x_p. </font></div>
<div style="font-family:Calibri,sans-serif"><font size="2"><br>
</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">In order to do this, I modified the subroutine interp_v(uvw,xyz,n) from the particle tracking example ''hemi''. First, I calculate the velocity gradients with the subroutine gradm1():</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2"><br>
</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">                 <span style="white-space:pre-wrap; background-color:rgb(255,255,255)">call gradm1(vxx,vxy,vxz,vx)</span>         </font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">                 <span style="white-space:pre-wrap; background-color:rgb(255,255,255)">call gradm1(vyx,vzy,vzz,vy)</span> </font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">                 <span style="white-space:pre-wrap; background-color:rgb(255,255,255)">call gradm1(vzx,vzy,vzz,vz)</span>         </font></div>
<div style="font-family:Calibri,sans-serif"><font size="2"><br>
</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">Second, I interpolate the velocity gradients to the particle positions with the subroutine intpts():</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2"><br>
</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">                 call opcopy(wrk(1,1),wrk(1,2),wrk(1,3),vxx,vyx,vzx)</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">                 call intpts(wrk,ndm,pts,npart,outint,ifjac,ifpts,ihandle)</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2"><br>
</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">I have a few questions regarding this approach: </font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">1. Is intpts() capable of interpolating derived fields like the velocity gradient field? </font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">2. Do you have a good explanatory reference where the mathematical principles behind intpts() are explained?</font></div>
<div style="font-family:Calibri,sans-serif"><font size="2">3. As far as I understand, the fields vx, vy, vz and consequently the derived fields vxx, vxy, vxz, ... are local and defined on the local coordinate fields xm1, ym1, zm1. What is happens if an interpolation
 point is on a different processor and outside the coordinates stored in xm1, ym1, zm1?</font></div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<div style="font-family:Calibri,sans-serif"><font size="2">Best regards, Philipp Weiss</font></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>