This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Right hand side of Poisson Equation as array

+1 vote

In the demo, the right hand side of the poisson equation is given as expression.
f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")

which leads to
L = fvdx
in the equation system.

In my case the right hand side f is is given as a two dimensional array on each point on the
mesh. For example
f = array([[1,1,2,3], [1,2,2,3], [0,0,3,3], [4,4,4,4]])

How do I have to formulate my f such that L can be computed as above?

Thanks for any help

asked Nov 2, 2015 by smilla17 FEniCS Novice (130 points)
...