Hi Floriane, It looks rather like you are trying to express the basis function expansion at the Firedrake level. This is something which is likely to be quite hard because you're operating at the wrong abstraction level. Can you post at a weak form (i.e. PDEs and function spaces) level what it is you are trying to achieve? Many thanks, David On Mon, 1 Aug 2016 at 16:29 Floriane Gidel [RPG] <mmfg@leeds.ac.uk> wrote:
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