## Re: [Libmesh-users] How would I obtain gradient of solution at an arbitrarily chosen point

 Re: [Libmesh-users] How would I obtain gradient of solution at an arbitrarily chosen point From: John Peterson - 2008-12-11 19:43:03 ```I'll second what Derek said, but I'd also like to ask if you are doing some kind of gradient recovery at the nodal points of a C^0 finite element discretization? There was a discussion about this particular topic a couple days ago... -- John On Thu, Dec 11, 2008 at 1:28 PM, Derek Gaston wrote: > MeshFunction can do this for you. Just initialize it with your > solution vector and then you can ask for the gradient at arbitrary > physical points. > > Now... just FYI.... if you just want to search you can use a > PointLocator class... which returns an Elem based on a physical point. > > Derek > > On Dec 11, 2008, at 12:15 PM, bkraczek wrote: > >> Hi. >> >> I'm looking for a way to obtain the gradient of my 3d FE solution at a >> specified point or points. I imagine this entails two parts, neither >> of >> which I know how to do: >> >> 1. Figure out which element a point lies inside >> 2. Determine the gradient of the basis functions inside that element. >> >> For the first part, if there is a way to do this already in the >> code, how >> do you go about it? If there isn't a way to do this already in the >> code, I >> think I could generate a way to do this from the coordinates of the >> nodes. >> How do I obtain these within a program? >> >> For the second part, once I know which element the point lies inside >> I need >> to calculate the gradient at that point. I was trying to figure out >> how to >> do this based on how dphi is calculated, but I cannot find where >> that is >> actually done in the code. I can find its declaration in fe_base.h, >> but not >> where it is calculated. -- John ```

### Thread view

 [Libmesh-users] How would I obtain gradient of solution at an arbitrarily chosen point From: bkraczek - 2008-12-11 19:15:44 ```Hi. I'm looking for a way to obtain the gradient of my 3d FE solution at a specified point or points. I imagine this entails two parts, neither of which I know how to do: 1. Figure out which element a point lies inside 2. Determine the gradient of the basis functions inside that element. For the first part, if there is a way to do this already in the code, how do you go about it? If there isn't a way to do this already in the code, I think I could generate a way to do this from the coordinates of the nodes. How do I obtain these within a program? For the second part, once I know which element the point lies inside I need to calculate the gradient at that point. I was trying to figure out how to do this based on how dphi is calculated, but I cannot find where that is actually done in the code. I can find its declaration in fe_base.h, but not where it is calculated. Thanks for your help, Brent ```
 Re: [Libmesh-users] How would I obtain gradient of solution at an arbitrarily chosen point From: Derek Gaston - 2008-12-11 19:29:47 ```MeshFunction can do this for you. Just initialize it with your solution vector and then you can ask for the gradient at arbitrary physical points. Now... just FYI.... if you just want to search you can use a PointLocator class... which returns an Elem based on a physical point. Derek On Dec 11, 2008, at 12:15 PM, bkraczek wrote: > Hi. > > I'm looking for a way to obtain the gradient of my 3d FE solution at a > specified point or points. I imagine this entails two parts, neither > of > which I know how to do: > > 1. Figure out which element a point lies inside > 2. Determine the gradient of the basis functions inside that element. > > For the first part, if there is a way to do this already in the > code, how > do you go about it? If there isn't a way to do this already in the > code, I > think I could generate a way to do this from the coordinates of the > nodes. > How do I obtain these within a program? > > For the second part, once I know which element the point lies inside > I need > to calculate the gradient at that point. I was trying to figure out > how to > do this based on how dphi is calculated, but I cannot find where > that is > actually done in the code. I can find its declaration in fe_base.h, > but not > where it is calculated. > > Thanks for your help, > Brent > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, > Nevada. > The future of the web can't happen without you. Join us at MIX09 to > help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users ```
 Re: [Libmesh-users] How would I obtain gradient of solution at an arbitrarily chosen point From: John Peterson - 2008-12-11 19:43:03 ```I'll second what Derek said, but I'd also like to ask if you are doing some kind of gradient recovery at the nodal points of a C^0 finite element discretization? There was a discussion about this particular topic a couple days ago... -- John On Thu, Dec 11, 2008 at 1:28 PM, Derek Gaston wrote: > MeshFunction can do this for you. Just initialize it with your > solution vector and then you can ask for the gradient at arbitrary > physical points. > > Now... just FYI.... if you just want to search you can use a > PointLocator class... which returns an Elem based on a physical point. > > Derek > > On Dec 11, 2008, at 12:15 PM, bkraczek wrote: > >> Hi. >> >> I'm looking for a way to obtain the gradient of my 3d FE solution at a >> specified point or points. I imagine this entails two parts, neither >> of >> which I know how to do: >> >> 1. Figure out which element a point lies inside >> 2. Determine the gradient of the basis functions inside that element. >> >> For the first part, if there is a way to do this already in the >> code, how >> do you go about it? If there isn't a way to do this already in the >> code, I >> think I could generate a way to do this from the coordinates of the >> nodes. >> How do I obtain these within a program? >> >> For the second part, once I know which element the point lies inside >> I need >> to calculate the gradient at that point. I was trying to figure out >> how to >> do this based on how dphi is calculated, but I cannot find where >> that is >> actually done in the code. I can find its declaration in fe_base.h, >> but not >> where it is calculated. -- John ```