How to constructe a expression from an array.
Here is the problem. I want to solve a Poisson equation:
where ρ is the charge distribution. The charge distribution is given by a 2D array.
I want to solve this equation in this way:
rho = interpolateFunction(rhoArray) #Pseudo code a = inner(nabla_grad(u), nabla_grad(v))*dx L = f*v*dx # Compute solution u = Function(V) solve(a == L, u, bc)
So how to implement the interpolateFunction?