Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## libmesh-users

 [Libmesh-users] interpolation From: Paulo Correia - 2007-03-20 16:57:22 ```Hi all, Is there any function to interpolate the solution on a given point (say in = an element basis)? Thank you, Paulo Correia Mathematics Department University of =C9vora Portugal ```
 [Libmesh-users] interpolation From: li pan - 2007-07-09 07:22:34 ```Dear all, I have two 2d QUAD4 meshes, A and B of different size. The value (i.e. pressure or temperature, etc.) on each node of A is known. I want to calculate the value on each node of B. First I have to transform B to A. The transformation is calcualted as U(i,j). 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? thanx pan ____________________________________________________________________________________ Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. http://farechase.yahoo.com/ ```
 Re: [Libmesh-users] interpolation From: Roy Stogner - 2007-07-09 15:50:06 ```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 ```
 Re: [Libmesh-users] interpolation From: - 2007-03-21 07:20:27 ```Dear Paulo, On Tue, 20 Mar 2007, Paulo Correia wrote: > Is there any function to interpolate the solution on a given point (say in an element basis)? Have a look at the MeshFunction class. Best Regards, Tim ```
 Re: [Libmesh-users] interpolation From: Roy Stogner - 2007-03-21 07:39:41 ```On Wed, 21 Mar 2007, Tim Kröger wrote: > On Tue, 20 Mar 2007, Paulo Correia wrote: > >> Is there any function to interpolate the solution on a given point (say in an element basis)? > > Have a look at the MeshFunction class. Beware: the MeshFunction class is currently fragile. I think it was originally written before we had parallel or adaptive code, and it's only been recently that it's bugs in each case have been addressed. Even in the libMesh CVS, whenever you do any mesh refinement or coarsening it's necessary to throw away your old MeshFunction objects and create new ones to ensure correct code. MeshFunction is also inefficient for many applications - unless you don't know a priori what element contains your point, MeshFunction has a lot of unnecessary overhead. In most cases you just want to evaluate the solution at quadrature points. See example 13 for how to do so in general. If you want to evaluate the solution at an arbitrary point in physical space in the current element, use FEInterface::inverse_map to get it's location in reference space, then FEInterface::shape to evaluate each basis function at that location. See the implementation of FEMSystem::point_value() for an example. If you need solution derivatives at an arbitrary point as well, the best thing to do is just create an FEBase object of the appropriate type and initialize it with a one-point quadrature rule. --- Roy```
 Re: [Libmesh-users] interpolation From: li pan - 2007-03-21 08:21:33 ```I'm using tetrahedron. The variable is displacement. I interpolate the point displacement in two steps: first, figure out the element which contains this point. Second, using linear interpolation u=shape1*u1+shape2*u2+shape3*u3+shape4*u4. Shape(number) are the shape functions, u(number) are the node displacements. best pan --- Paulo Correia wrote: > Hi all, > > Is there any function to interpolate the solution on > a given point (say in an element basis)? > > Thank you, > > Paulo Correia > Mathematics Department > University of Évora > Portugal > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get > the chance to share your > opinions on IT & business topics through brief > surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > ____________________________________________________________________________________ Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091 ```
 Re: [Libmesh-users] interpolation From: Derek Gaston - 2007-03-21 17:04:10 ```If you're going to be finding which element contains the point and then trying to get a value at that point... you really are best off to use MeshFunction. That's pretty much what it was meant to do, and will do a fairly efficient search (well, better than linear in most cases)... But it does come with the caveats that Roy mentioned... Derek On 3/21/07, li pan wrote: > I'm using tetrahedron. The variable is displacement. I > interpolate the point displacement in two steps: > first, figure out the element which contains this > point. Second, using linear interpolation > u=3Dshape1*u1+shape2*u2+shape3*u3+shape4*u4. > Shape(number) are the shape functions, u(number) are > the node displacements. > > best > > pan > > > --- Paulo Correia wrote: > > > Hi all, > > > > Is there any function to interpolate the solution on > > a given point (say in an element basis)? > > > > Thank you, > > > > Paulo Correia > > Mathematics Department > > University of =C9vora > > Portugal > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get > > the chance to share your > > opinions on IT & business topics through brief > > surveys-and earn cash > > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > > _______________________________________________ > > Libmesh-users mailing list > > Libmesh-users@... > > > https://lists.sourceforge.net/lists/listinfo/libmesh-users > > > > > > > > _________________________________________________________________________= ___________ > Need Mail bonding? > Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. > http://answers.yahoo.com/dir/?link=3Dlist&sid=3D396546091 > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > ```
 Re: [Libmesh-users] interpolation From: li pan - 2007-03-21 17:40:39 ```It's easy to find which element contains this point. I just go over all the elements and call elem.contains_point(p). pan --- Derek Gaston wrote: > If you're going to be finding which element contains > the point and > then trying to get a value at that point... you > really are best off to > use MeshFunction. That's pretty much what it was > meant to do, and > will do a fairly efficient search (well, better than > linear in most > cases)... > > But it does come with the caveats that Roy > mentioned... > > Derek > > On 3/21/07, li pan wrote: > > I'm using tetrahedron. The variable is > displacement. I > > interpolate the point displacement in two steps: > > first, figure out the element which contains this > > point. Second, using linear interpolation > > u=shape1*u1+shape2*u2+shape3*u3+shape4*u4. > > Shape(number) are the shape functions, u(number) > are > > the node displacements. > > > > best > > > > pan > > > > > > --- Paulo Correia wrote: > > > > > Hi all, > > > > > > Is there any function to interpolate the > solution on > > > a given point (say in an element basis)? > > > > > > Thank you, > > > > > > Paulo Correia > > > Mathematics Department > > > University of Évora > > > Portugal > > > > > > > > > ------------------------------------------------------------------------- > > > Take Surveys. Earn Cash. Influence the Future of > IT > > > Join SourceForge.net's Techsay panel and you'll > get > > > the chance to share your > > > opinions on IT & business topics through brief > > > surveys-and earn cash > > > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > _______________________________________________ > > > Libmesh-users mailing list > > > Libmesh-users@... > > > > > > https://lists.sourceforge.net/lists/listinfo/libmesh-users > > > > > > > > > > > > > > > > ____________________________________________________________________________________ > > Need Mail bonding? > > Go to the Yahoo! Mail Q&A for great tips from > Yahoo! Answers users. > > > http://answers.yahoo.com/dir/?link=list&sid=396546091 > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of > IT > > Join SourceForge.net's Techsay panel and you'll > get the chance to share your > > opinions on IT & business topics through brief > surveys-and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Libmesh-users mailing list > > Libmesh-users@... > > > https://lists.sourceforge.net/lists/listinfo/libmesh-users > > > ____________________________________________________________________________________ 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: Derek Gaston - 2007-03-21 17:46:10 ```Yes... but that's a linear search. My point was that MeshFunction should be faster in most circumstances... Derek On 3/21/07, li pan wrote: > It's easy to find which element contains this point. I > just go over all the elements and call > elem.contains_point(p). > > pan > > > --- Derek Gaston wrote: > > > If you're going to be finding which element contains > > the point and > > then trying to get a value at that point... you > > really are best off to > > use MeshFunction. That's pretty much what it was > > meant to do, and > > will do a fairly efficient search (well, better than > > linear in most > > cases)... > > > > But it does come with the caveats that Roy > > mentioned... > > > > Derek > > > > On 3/21/07, li pan wrote: > > > I'm using tetrahedron. The variable is > > displacement. I > > > interpolate the point displacement in two steps: > > > first, figure out the element which contains this > > > point. Second, using linear interpolation > > > u=3Dshape1*u1+shape2*u2+shape3*u3+shape4*u4. > > > Shape(number) are the shape functions, u(number) > > are > > > the node displacements. > > > > > > best > > > > > > pan > > > > > > > > > --- Paulo Correia wrote: > > > > > > > Hi all, > > > > > > > > Is there any function to interpolate the > > solution on > > > > a given point (say in an element basis)? > > > > > > > > Thank you, > > > > > > > > Paulo Correia > > > > Mathematics Department > > > > University of =C9vora > > > > Portugal > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > Take Surveys. Earn Cash. Influence the Future of > > IT > > > > Join SourceForge.net's Techsay panel and you'll > > get > > > > the chance to share your > > > > opinions on IT & business topics through brief > > > > surveys-and earn cash > > > > > > > > > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > > > > _______________________________________________ > > > > Libmesh-users mailing list > > > > Libmesh-users@... > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/libmesh-users > > > > > > > > > > > > > > > > > > > > > > > > > _________________________________________________________________________= ___________ > > > Need Mail bonding? > > > Go to the Yahoo! Mail Q&A for great tips from > > Yahoo! Answers users. > > > > > > http://answers.yahoo.com/dir/?link=3Dlist&sid=3D396546091 > > > > > > > > > ------------------------------------------------------------------------- > > > Take Surveys. Earn Cash. Influence the Future of > > IT > > > Join SourceForge.net's Techsay panel and you'll > > get the chance to share your > > > opinions on IT & business topics through brief > > surveys-and earn cash > > > > > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > > > _______________________________________________ > > > Libmesh-users mailing list > > > Libmesh-users@... > > > > > > https://lists.sourceforge.net/lists/listinfo/libmesh-users > > > > > > > > > > _________________________________________________________________________= ___________ > Food fight? Enjoy some healthy debate > in the Yahoo! Answers Food & Drink Q&A. > http://answers.yahoo.com/dir/?link=3Dlist&sid=3D396545367 > ```
 Re: [Libmesh-users] interpolation From: John Peterson - 2007-03-21 17:47:23 ```That is a linear search. MeshFunction has logarithmic search performance because it uses a quad/octtree, which is exactly what Derek was talking about. -John li pan writes: > It's easy to find which element contains this point. I > just go over all the elements and call > elem.contains=5Fpoint(p). >=20 > pan >=20 >=20 > --- Derek Gaston wrote: >=20 > > If you're going to be finding which element contains > > the point and > > then trying to get a value at that point... you > > really are best off to > > use MeshFunction. That's pretty much what it was > > meant to do, and > > will do a fairly efficient search (well, better than > > linear in most > > cases)... > >=20 > > But it does come with the caveats that Roy > > mentioned... > >=20 > > Derek > >=20 > > On 3/21/07, li pan wrote: > > > I'm using tetrahedron. The variable is > > displacement. I > > > interpolate the point displacement in two steps: > > > first, figure out the element which contains this > > > point. Second, using linear interpolation > > > u=3Dshape1*u1+shape2*u2+shape3*u3+shape4*u4. > > > Shape(number) are the shape functions, u(number) > > are > > > the node displacements. > > > > > > best > > > > > > pan > > > > > > > > > --- Paulo Correia wrote: > > > > > > > Hi all, > > > > > > > > Is there any function to interpolate the > > solution on > > > > a given point (say in an element basis)=3F > > > > > > > > Thank you, > > > > > > > > Paulo Correia > > > > Mathematics Department > > > > University of =C9vora > > > > Portugal ```
 Re: [Libmesh-users] interpolation From: Roy Stogner - 2007-03-21 17:49:13 ```On Wed, 21 Mar 2007, li pan wrote: > It's easy to find which element contains this point. I > just go over all the elements and call > elem.contains_point(p). I ran across this old but worthwhile article just a day or two ago. You might also find it helpful: http://www.joelonsoftware.com/articles/fog0000000319.html Looping over all elements is an O(N) operation. That's fine if you do it infrequently, but if you need to find a lot of points then you may be hurting your runtime by not using a tree structure and a cache test like the PointLocatorTree class does. --- Roy ```