How to calculate the absolute value of a form in the weak form


I’m solving the Maxwell equations, in Maxwell equations, there is a Gauss law:
Screenshot from 2024-04-10 17-33-53
so I need to calculate the error regarding the Gauss law, in DOLFINX, I can easily do:


but the term E is usually defined in some curl space, so div(E) is not well-posed and I can not calculate it in the strong form, then I would like to calculate the gauss error in the weak form, like:

where v is the test function.

But it seems like the function abs can not be used when I have the test function in the form, and I got the error:

raise ArityMismatch("Applying nonlinear operator {0} to expression depending on form argument {1}.".format(o._ufl_class_.__name__, t))
ufl.algorithms.check_arities.ArityMismatch: Applying nonlinear operator Abs to expression depending on form argument v_0.

Does anyone know what I could do in this case?