## libmesh-users

 Re: [Libmesh-users] Interpolation From: li pan - 2007-07-10 07:40:19 ```hi Roy, Both mesh A and are HEX8, built by build_cube function, and both could be probably refined. I used to do the interpolation with PointLocator, but it's still slow. I had an idea yesterday. The idea is very simple: to find the element with point coordinate. Because the numbering of element in HEX8 mesh is first x then y, then z, the element which contains that point is x+grid_dim*y+grid_dim*grid_dim*z. Then I only need to go over all the children of this element. pan On Mon, 9 Jul 2007, li pan wrote: > I can go over each node in B in a loop and find element in A which > contains this node, then interpolate value. But I feel it's not > efficient. Do you have an better idea? The MeshFunction class uses a PointLocatorTree structure to try to give you O(N log N) time for such mesh to mesh interpolations, but unless you have more detailed information about the relationship between A and B (e.g. if they're nested meshes) I don't know how you can get O(N) efficiency. --- Roy ____________________________________________________________________________________ Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. http://answers.yahoo.com/dir/?link=list&sid=396545367 ```
 Re: [Libmesh-users] Interpolation From: Roy Stogner - 2007-07-10 13:10:28 ```On Tue, 10 Jul 2007, li pan wrote: > Both mesh A and are HEX8, built by build_cube > function, and both could be probably refined. I used > to do the interpolation with PointLocator, but it's > still slow. I had an idea yesterday. The idea is very > simple: to find the element with point coordinate. > Because the numbering of element in HEX8 mesh is > first x then y, then z, the element which contains > that point is x+grid_dim*y+grid_dim*grid_dim*z. Then I > only need to go over all the children of this element. That's still technically O(N log N), but I'll bet it will be much faster than a PointLocatorTree. --- Roy ```