Define the function possitive part

https://jsdokken.com/dolfinx-tutorial/
http://jsdokken.com/FEniCS23-tutorial/README.html
https://docs.fenicsproject.org/dolfinx/v0.7.2/python/demos.html
to mention a few.

You can use a ufl.conditional, ufl.conditional(ufl.gt(u, 0), u, 0). See for instance: Using Conditional function inside a Project function - #4 by dokken

1 Like