## [Libmesh-users] Averaging element fields to the nodes.

 [Libmesh-users] Averaging element fields to the nodes. From: Subramanya Gautam Sadasiva - 2012-10-29 08:41:37 ```Hi, I need to extrapolate element fields to the nodes in order to compute approximate gradients for some quantities defined at the quadrature points. What is the easiest way to accomplish this? I saw meshtools has a nodes to elem map function.Does this work for parallel meshes? Thanks. Subramanya ```

### Thread view

 [Libmesh-users] Averaging element fields to the nodes. From: Subramanya Gautam Sadasiva - 2012-10-29 08:41:37 ```Hi, I need to extrapolate element fields to the nodes in order to compute approximate gradients for some quantities defined at the quadrature points. What is the easiest way to accomplish this? I saw meshtools has a nodes to elem map function.Does this work for parallel meshes? Thanks. Subramanya ```
 Re: [Libmesh-users] Averaging element fields to the nodes. From: Kirk, Benjamin (JSC-EG311) - 2012-10-29 11:06:25 ```That method lets you conveniently access all the elements sharing a given node, which is not what you want in this case. The usual way to do this is by solving an L2 projection onto a continuous field - think of this as finding the continuous gradient field that best approximates your discontinuous field in a least-squares sense. I don't think there are any examples that currently show this - I'll try to add one after the next release. Given that it is a common-enough post processing task, we might start a discussion on the development list as to how to best provide this as a core library service... -Ben On Oct 29, 2012, at 3:41 AM, "Subramanya Gautam Sadasiva" wrote: > Hi, > I need to extrapolate element fields to the nodes in order to compute approximate gradients for some quantities defined at the quadrature points. What is the easiest way to accomplish this? > I saw meshtools has a nodes to elem map function.Does this work for parallel meshes? > Thanks. > Subramanya > > ------------------------------------------------------------------------------ > The Windows 8 Center - In partnership with Sourceforge > Your idea - your app - 30 days. > Get started! > http://windows8center.sourceforge.net/ > what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/ > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users ```
 Re: [Libmesh-users] [Libmesh-devel] Averaging element fields to the nodes. From: Roy Stogner - 2012-10-29 12:43:52 Attachments: meshgradplot.C ```On Mon, 29 Oct 2012, Kirk, Benjamin (JSC-EG311) wrote: > I don't think there are any examples that currently show this - I'll > try to add one after the next release. See the attached ~300 lines of code. It reads a mesh and solution, L2 projects and then plots all gradient components of all solution variables. It needs to be changed to have more than just Tecplot-or-GMV output, and as you may have guessed this implies I haven't tested it in a couple years, but other than that it ought to be ready to drop in as fem_system_ex2. --- Roy```