Orthogonality of partials constraint

I am trying to solve for a function u: R^2 \rightarrow R^3.

How can I implement a constraint of the form u_x\cdot u_y = 0 (i.e. the partials of u are orthogonal)?

I have not been able to find anything immediately related in the documentation.

Thank you!

I am fairly new to Fenics, so take this with a pinch of salt, but why not consider your initial equation to be solved, and this constraint as a system of equations? Then you just need to find the variational form of u_x \cdot u_y=0 with respect to some test function (different to the one you formulated your original problem with) and solve them both. Here is a link to a tutorial which covers systems of pde’s (pages 73 onwards).

Thanks Morgan_Robson, I’m also new to Fenics so thank you!

Could you say a bit more about what you mean? When I look at the documented example for a system of PDEs they are solving for multiple functions {u_1, u_2, ...} where each u_i is a different function, but in my case I only have one unknown function u. (Just to be totally clear on the notation I used in my original post u_x = \frac{\partial u}{\partial x})

Hi,
so first you will have a non-linear variational problem with such a constraint.
I would add to the system a scalar Lagrange multiplier so that the FunctionSpace now becomes mixed:

Ue = VectorElement("CG", mesh.ufl_cell(), 1, dim=3)
We = FiniteElement("DG", mesh.ufl_cell(), 0)
V = FunctionSpace(mesh, MixedElement([Ue, We]))
u_, w_ = TestFunctions(V)
u, w = split(Function(V))
F = your_unconstrainted_nonlinear_form + w_*dot(u.dx(0), u.dx(1))*dx