John Peterson wrote:
> On Fri, Apr 2, 2010 at 11:01 PM, Karen Lee <kylkaren@...> 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 libmeshusers
with subject line "Getting access to gradients at node points", from
20080927 in the mailing list archives.
