Hey guys,
I am working in C++ and having trouble to write the correct ufl-file for the following variational inequality:
Find y \in V s.t.
\int_\Omega (y-u)(v-u)dx+\int_\Omega (u+p)(v-u)dx \geq 0\quad \forall v \in V.
I tried the following,but it doesn’t work because of an arity mismatch.
element = FiniteElement("Lagrange", triangle, 1)
v = TestFunction(element)
y = Coefficient(element)
dy = TrialFunction(element)
u = Coefficient(element)
p = Coefficient(element)
F = 0.5*(u-y)*(v-y)*dx+ (u+p)*(v-y)*dx
G = derivative(F,y,dy)