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