I am currently trying to solve the Monge-Ampere equation in FEniCS, by implementing a non standard boundary condition.
The boundary condition, requires that the gradient of the solution must map the boundary of the original domain to another prescribed domain.
When the target domain is prescribed to be the unit circle, the implementation is quite simple, and I have tackled it by putting the following into my system:
+(dot(grad(uh),grad(uh))-1)*vh*ds\
where uh, is a trial function, and vh is a test function.
When considering a more complex target space, such as the square $[−1,1]\times[−1,1]$ things become more difficult, since it is not so simple to solve by hand, so my idea is to use the distance function.
To do this I have solved a stabilized version of the Eikonal Equation, who's solution is the signed distance function, then my idea was to replace (1) with:
+E(grad(uh))*vh*ds
Where E is the solution of the Eikonal equation, but when I try to implement this, I get an error, stating that the function expected scalar arguments,
Is there a way to programme the solution to accept grad(uh) as an input, in a second differential form?
Thank you all for your time!