[firedrake] absolute value of gradient
Lawrence Mitchell
lawrence.mitchell at imperial.ac.uk
Wed Nov 18 16:21:34 GMT 2015
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20151118/b76efd3b/attachment.sig>
More information about the firedrake
mailing list