4
$\begingroup$

Given a vector-valued Dolfin function u from the function space V*V with V=FunctionSpace(mesh, 'CG', 2), how do I extract $$ \max_{x\in\Omega} \|u(x)\| $$ ? An approximation works, too.

$\endgroup$

1 Answer 1

2
$\begingroup$
u1, u2 = u.split()
unorm = project((u1**2 + u2**2)**0.5, V, form_compiler_parameters={'quadrature_degree': 4})
unorm = norm(unorm.vector(), 'linf')

Note that quadrature degree is set explicitly to twice the degree of V because UFL does not handle well degree estimation of power with non-integer exponent.

Last line is aproximative unless u is piecewise linear.

$\endgroup$
2
  • $\begingroup$ Isn't only for linear elements? $\endgroup$ May 10, 2013 at 20:58
  • $\begingroup$ Actually projection part is approximative too as square root of polynomial can't be exactly integrated with none degree. But ommiting square root in projection part and taking square root from final number could make it exact for piecewise linear u. $\endgroup$ May 11, 2013 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.