Dear Peter,

 

We don’t have nodal evaluation for arbitrary finite elements. The interpolation operator (both interpolate and Function.at) works for spaces with point evaluation nodes i.e. CG and DG so you can rig up a hack by interpolating the RT field into the spanning DG field (which is lossless), interpolating that into a spanning DG field on the new mesh (you can get the coordinates to interpolate at by interpolating the coordinate field into the corresponding vector DG space), and then finally projecting from the DG space down to RT. This is effectively a variant on: https://www.firedrakeproject.org/interpolation.html#interpolation-from-external-data

 

However a nicer approach is probably to use Patrick Farrell’s pefarrell/supermesh-mixed-mass-matrix branch which makes project work between different meshes of the same domain.

 

Finally, I notice you are using C string expressions. We’re about to drop that functionality because it’s superceded by UFL expressions. E.g.

 

x = SpatialCoordinate(mesh)

interpolate(u, as_vector(x[0] + 1, x[1])

 

Regards,

 

David

 

 

From: <firedrake-bounces@imperial.ac.uk> on behalf of "Sentz, Peter" <sentz2@illinois.edu>
Date: Thursday, 31 January 2019 at 22:41
To: firedrake <firedrake@imperial.ac.uk>
Subject: [firedrake] Interpolating/projecting between meshes

 

Hello,

 

In Fenics/Dolfin, I can interpolate between different meshes, even with less basic elements like Raviart-Thomas.  For example:

 

from fenics import *

mesh1 = UnitSquareMesh(1,1)

mesh2 = UnitSquareMesh(2,2)

V1 = FunctionSpace(mesh1,'RT',1)

V2 = FunctionSpace(mesh2,'RT',1)

u = Expression(('x[0] + 1','x[1]'),degree = 1)

U = interpolate(u,V1)

Uf = interpolate(U,V2)

 

Interpolating the function 'U' that is defined on one mesh can be moved to another in a fairly simple matter.

 

Trying something similar in Firedrake with 'project' instead of 'interpolate' results in an error message.  A different error appears for nodal FE functions as well, when using 'interpolate'.  However, in that case, I have developed a work-around using mesh.coordinates.dat.data.  However, I can't see how to extend this to nodal DG or Raviart-Thomas FE functions.  

 

Can you access the coordinates of the degrees of freedom of an arbitrary function space?  Barring that, is there some mechanism to move between meshes if I use a MeshHierarchy, for example?

 

Thanks,

 

Peter Sentz