I’m solving the heat transport equation. I have a source term of the form:

```
f = alpha*Io*ufl.exp(-(alpha+beta)*(0.01-x[1])) #W/m3
```

It seems to work properly. However, I’m trying to define a source wich could be interpolated from x,y data resulting from experimental data or another solver. I tested if I could make f as a function

```
coords= V.tabulate_dof_coordinates()
f = Function(V)
f.x.array[:] = alpha.x.array[:]*Io*np.exp(-(alpha.x.array[:]+beta.x.array[:])*(0.01-coords[:,1])
```

However, although the function is the same, I get different results. I tried to define f as a Function to have the freedom to evaluate numpy or scipy interpolants with the dofs coordinates. The idea was something like

```
f.x.array[:] = alpha.x.array[:]*Io*MC.MC(0.01-coords[:,1])
```

Being MC the interpolation module wich recieves dofs coordinates and returns any data interpolated from a dataset

This is my variational problem. It’s axisymmetrical.

```
a = ((rho*cp*u*v*x[0]
+ dt*k*inner(grad(u), grad(v))*x[0])*dx #laplacian
+ dt*h*u*v*x[0]* ds(14) #Convection bundary
+ dt*u*cp_b*rho_b*w_b*v*x[0]*dx #Blood perfusion
)
L = (rho*cp*u_n*v*x[0]*dx
+ dt*inner(f, v)*x[0]* dx(10) #Laser
+ dt*h*Tref*v*x[0]*ds(14) #Convection bundary
+ dt*T_b*cp_b*rho_b*w_b*v*x[0]*dx#Blood perfusion
+ dt*Qm*v*x[0]*dx #Metabolic heat
)
```

Any help will be greatly appreciated.

Thanks.