On 18/11/15 15:42, George Ovchinnikov wrote:
Hello folks,
I have a scalar field in 2D, $w$, say:
V = FunctionSpace(mesh, "CG", 1) w = Function(V) w.interpolate(Expression("1"))
and I need too find an norm of grad(w) in every point of the given area, i.e. get a scalar field back.
I've found no way to iterate through individual elements of grad(w) to be able to do in manually, neither abs(grad(w)) or something similar works. Any ideas? Do I need to solve some variational problem for this, too?
You can't do this pointwise because the strong gradient doesn't exist. What do you later want to use this for. If you need |grad(w)| in a form, you can just write it in directly. When you say norm grad(w), do you mean: sqrt(dot(grad(w), grad(w))) ? Lawrence