Dear all,
I would like to compute the following sum over i : phi(x,y,z,t) = psi_i(x,y,t)varphi_i(z), where :
- each psi_i (x,y,t) is a Firedrake function defined on a horizontal plane,
-varphi_i is defined by a lagrange expansion of order n, that is: varphi_i(z) = product( (z-z_k)/(z_i - z_k) ) for k = 0:n , and k different from i. Each z_k can be computed analytically and denotes the discretised z coordinate. For instance, z_k can be defined as z_k = (n-k)H0/n , for z in [0,H0].
How can I define varphi_i so that I can compute the dot product dot(psi,varphi) on Firedrake ? I tried two options:
- use the symbpy package to compute the expression of varphi_i with the 'product' function. But in that case the expression of varphi_i depends on z as a symbol, and I did not manage to use it correctly on Firedrake afterwards,
- define varphi_i(z) as a Firedrake function in z, but in that case, how can I compute the product ? I would normally use an expression, but is there a 'product expression' that I could interpolate ? Something like : varphi[i].interpolate(Expression( "product((x[2]-z[k]) / (z[i]-z[k]) )", z=z, i=i, for k=0:n))
Thank you for your help,
Floriane