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] finding the 3D field associated with a potential (solution) From: Karen Lee - 2010-04-03 05:01:44 ```Dear all, I'm wondering if anyone knows how I might calculate the gradient of my solution (an electric potential) in 3D. Basically I would like to have the electric field vector associated at the nodes for which I have the potential value... Does anyone know how I might do that? Either doing that with the output I already have or doing it in the solver itself would be awesome. The potential was obtained from a Poisson's equation. Thanks, Karen ```
 Re: [Libmesh-users] finding the 3D field associated with a potential (solution) From: John Peterson - 2010-04-04 05:03:15 ```On Fri, Apr 2, 2010 at 11:01 PM, Karen Lee wrote: > Dear all, > > I'm wondering if anyone knows how I might calculate the gradient of my > solution (an electric potential) in 3D. Basically I would like to have the > electric field vector associated at the nodes for which I have the potential > value... Does anyone know how I might do that? Either doing that with the > output I already have or doing it in the solver itself would be awesome. The > potential was obtained from a Poisson's equation. Check out one of the nonlinear examples like ex13. For each element we need to recompute the velocity gradient from the old timestep and current Newton step, and we do it by looping over the element dofs and adding up the contributions grad_u = sum_i u_i dphi_i In the examples this is done at interior (Gauss) quadrature points but you could follow the same procedure using a nodal quadrature rule instead. -- John ```
 Re: [Libmesh-users] finding the 3D field associated with a potential (solution) From: David Knezevic - 2010-04-04 19:38:25 ```John Peterson wrote: > On Fri, Apr 2, 2010 at 11:01 PM, Karen Lee wrote: >> Dear all, >> >> I'm wondering if anyone knows how I might calculate the gradient of my >> solution (an electric potential) in 3D. Basically I would like to have the >> electric field vector associated at the nodes for which I have the potential >> value... Does anyone know how I might do that? Either doing that with the >> output I already have or doing it in the solver itself would be awesome. The >> potential was obtained from a Poisson's equation. > > Check out one of the nonlinear examples like ex13. For each element > we need to recompute the velocity gradient from the old timestep and > current Newton step, and we do it by looping over the element dofs and > adding up the contributions > > grad_u = sum_i u_i dphi_i > > In the examples this is done at interior (Gauss) quadrature points but > you could follow the same procedure using a nodal quadrature rule > instead. For more details on this you could look up the thread on libmesh-users with subject line "Getting access to gradients at node points", from 2008-09-27 in the mailing list archives. ```