Hi all,
I am currently solving a PDE problem, where I seek a solution as a combination of a function u on the domain and a vector U of R, say of dimension 4. My problem is the following: If i define the function space as follows:
no_of_electrodes = 4
mesh = UnitSquareMesh(nx, ny)
V = FunctionSpace(mesh, 'Lagrange', 1)
R1 = FunctionSpace(mesh, "R", 0)
R = R1
for i in range(no_of_electrodes-1):
R = MixedFunctionSpace([R,R1])
W = V*R
Now when defining my variational problem, I construct trial and test-function as follows:
ut = TrialFunction(W)
vt = TestFunctions(W)
Now ut should consist of a function u on the space V and a vector U on R⁴, right? So lets say i want to construct the following:
a = (inner(grad(u), grad(v)))dx + sum((u-U(i))(v-V(i))*ds(i),i=0..3)
My problem is that I cannot figure out how to extract u and U(i) from ut and v and V(i) from vt, such that i can compute a. Should I define my function-space differently? Here, ds(i) is a part of the boundary for all i.