Hi Tuomas, Thanks for your quick answer. The issue in our case is that we need to solve the equations for phi_2d and phi_3d simultaneously, as a coupled system. So if we use a 2D and a 3D functions, we need to find a way to copy the nodal values of phi_2d to phi_3d while solving the equations, which I'm not sure we can do with this method... Thanks, Floriane ________________________________ De : firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> de la part de Tuomas Karna <tuomas.karna@gmail.com> Envoyé : jeudi 10 décembre 2015 17:40 À : firedrake@imperial.ac.uk Objet : Re: [firedrake] 2D to 3D function Hi Onno and Floriane, I've done this by defining two functions, phi_2d and phi_3d, living in the 2d and 3d meshes. First you solve phi_2d, and then you copy it's nodal values to phi_3d using a custom pyop2 kernel (see the attached file). Naturally the horizontal function space of phi_2d and phi_3d must be the same. This works fine for common Pn, PnDG function spaces. If you are using more exotic function spaces, this is not sufficient (for example in RT spaces the nodal values depend on the jacobian, which will be different in 2d and 3d). Cheers, Tuomas On 12/10/2015 09:16 AM, Onno Bokhove wrote: To rephrase that: The 2D function: phis(x,y) should become a 3D function: phis_extended(x,y,z) independent of z, i.e., its value does not vary in the z-direction but can vary in the horizontal and time. How does one do that in FD? ________________________________ From: firedrake-bounces@imperial.ac.uk<mailto:firedrake-bounces@imperial.ac.uk> <firedrake-bounces@imperial.ac.uk><mailto:firedrake-bounces@imperial.ac.uk> on behalf of Floriane Gidel [RPG] <mmfg@leeds.ac.uk><mailto:mmfg@leeds.ac.uk> Sent: Thursday, December 10, 2015 4:53 PM To: firedrake@imperial.ac.uk<mailto:firedrake@imperial.ac.uk> Subject: [firedrake] 2D to 3D function Dear all, First of all, thanks a lot for your time last Friday, and your help both for the implementation and for the installation of Firedrake. I am now trying to implement the equations we discussed on Friday, for the 3D potential flow equations. As a reminder, I solve the equations for phi, h, but also phi_s which is a 3D function, but is only updated at the free surface. However, I would like to update the interior nodes of phi_s as well, by copying the value of its surface nodes, as soon as they are updated (that is, simultaneously with solving the coupled equations). Is there a way to do this? I attach a short pdf summarising the equations, the current implementation and the issue I get. Thank you very much, Floriane _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk<mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake