Hi everyone,

I’m trying to use Fenics to solve the diffusion equation: **grad(*k**grad(u)) = 0**

In my situation, *k* is a scalar field defined from a given numpy matrix M as following:

k = Expression(‘M[int(x[0]*nx/l),int(x[1]*ny/h)’, M=M, nx=nx, ny=ny, l=l, h=h)

This is not working as M is not recognized by C++ I guess.

Can anyone help me to solve this issue?

Kind regards