I'd like to compute the maximum of $\|u\|$ across a domain for a Function
from a VectorFunctionSpace
. Up until now, what I do is projecting the $\|u\|$ into an appropriate space Q
,
unorm = project(norm(u_1), Q)
unorm = norm(unorm.vector(), 'linf')
The project()
ion step takes quite some time though, and I thought one can be better.
The easiest thing to do would be to add the vectors associated with u[0]
, u[1]
, u[2]
,
vec = u0.vector() * u0.vector()
+ u1.vector() * u1.vector()
+ u2.vector() * u2.vector()
and then compute
sqrt(norm(vec, 'linf'))
It doesn't seem to be possible to extract the vectors belonging to the individual components of u
though. Any other suggestions?