Hi, I am trying to solve the following pde with neumann condition. And I defined v as “n = FacetNormal(mesh)” to let the right hand side equal to “dot(Constant((1,0)),n)vds” for i = 1. But I got the error “Adding expressions with non-matching form arguments (‘v_1’,) vs ()”. Is anyone know the reason about this? Thanks in advance!
mesh = UnitSquareMesh(4, 6)
Ve = FiniteElement('Lagrange', mesh.ufl_cell(), 1)
Re = FiniteElement('Real', mesh.ufl_cell(), 0)
X = FunctionSpace(mesh, MixedElement([Ve, Re]))
dx = Measure('dx')(subdomain_data=subdomains)
n = FacetNormal(mesh)
u, m = TrialFunctions(X)
v, r = TestFunctions(X)
a1 = inner(nabla_grad(u) + Constant((1,0)), k*nabla_grad(v))*dx + u*r*dx + m*v*dx
l1 = dot(Constant((1,0)),n)*v*ds
x = Function(X)
solve(a1 == l1, x)