Hi Andrew,

 

Interpolating facet expressions doesn’t work as the interpolation code works cell-wise.

 

However, can I ask more generally what you are attempting to do? I think dot(nu,nu)=1 on the boundary so I don’t quite understand what you are trying to achieve.

 

It is possible to project expressions defined only on the boundary, or to use them directly in boundary conditions, but I think we’d need to see what maths you are attempting to achieve in order to be able to say how to do it.

 

Cheers,

 

David

 

From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Andrew Hicks <ahick17@lsu.edu>
Date: Sunday, 14 March 2021 at 04:59
To: firedrake <firedrake@imperial.ac.uk>
Subject: [firedrake] Interpolate function only on the boundary

Dear all,

 

I am wanting to interpolate an expression involving the FacetNormal, but when I execute the following code:

 

V = FunctionSpace(mesh,’CG’,1)

nu = FacetNormal(mesh)

g = interpolate(dot(nu,nu),V)

 

Of course I get an AssertionError because the FacetNormal is only defined on the exterior facets of the mesh, and not the interior. My question is, is there perhaps a way to make “g” to be defined as “dot(nu,nu)” on the boundary, and 0 everywhere else? I bet this would work well. Or maybe there is a way to define “g” only on the boundary?

 

Andrew Hicks