I have a little problem.
As indicated in subject I am having a problem getting the exponential of a product of a float and interpolation. Below is just a construction for my problem.
from dolfin import *
import numpy
mesh = IntervalMesh(20, 0, 2)
V = FunctionSpace(mesh, 'CG', 2)
theta_k = interpolate(Constant(0.0), V)
def fun(y):
alpha = 0.01
return numpy.exp(-alpha*y)
# I have to call this fun for theta_k.
fun(theta_k) # Attribute error : exp
I know why I am getting this error, since I am trying to multiply alpha with theta_k(which is not float). How can I achieve this multiplication and then the exponential of the product.
Any help would be greatly appreciated.