I need to solve the following equation in FEniCS: $$ \boldsymbol{\nabla} \cdot \begin{pmatrix} f(y)\frac{\partial u}{\partial x} - g(x,y)\frac{\partial u}{\partial y} \\ - g(x,y)\frac{\partial u}{\partial x}+f(x)\frac{\partial u}{\partial y} \end{pmatrix}=0. $$ As far as I understand, the weak form will look like: $$ \int_{\Omega} \begin{pmatrix} f(y)\frac{\partial u}{\partial x} - g(x,y)\frac{\partial u}{\partial y} \\ - g(x,y)\frac{\partial u}{\partial x}+f(x)\frac{\partial u}{\partial y} \end{pmatrix} \cdot \nabla v \, \mathrm{d}x = 0 \quad \forall v \in V. $$ I have problems expressing this equation in FEniCS. I figured I need something like this:
u = TrialFunction(V)
v = TestFunction(V)
g = as_vector((u.dx(0), u.dx(1))) # <-- modify here?
a = dot(g, grad(v))*dx
u = Function(V)
solve(a == Constant(0) * v * dx, u, bc)
How to add something that depends on coordinates $x$, $y$ to the variable g
above?
Also do I have to write Constant(0) * v * dx
as the right part? Can it be just 0?