Max between two fenics objects

hello all,
I would like to ask how to evaluate the maximum between to fenics objects ?
thank you!

What kind of FEniCS objects are we talking about ? Functions, expressions? And under what norm ? L_infinity, L_2, l_2,L_1,l_1?

Hi @dokken , I am talking about Function objects under the L^{2} norm. thanks!

If you are taking the max value under L2 norm, wouldn’t that just be taking the max value of two numbers?
Ie

val= mesh.comm.allreduce( dolfinx.fem.assemble_scalar(dolfinx.fem.form(u**2*ufl.dx)), op=MPI.SUM)
val2 =….
Max_val = np.max(val, val2)

Or are you thinking of the maximum value of u^2 or v^2 within \Omega?