[firedrake] Interpolate function only on the boundary
Andrew Hicks
ahick17 at lsu.edu
Sun Mar 14 20:50:32 GMT 2021
Hi David,
That isn't actually what I'm attempting to do, it was an example (and now that you mention it, a pretty bad example) to show you more or less what I'm doing.
I have attached a PDF with a PDE as a better example to illustrate what I need to do (though the problem is still a bit contrived). If you go down to where "g" is defined, you will see my conundrum, because I need to use the interpolater to handle the trigonometric functions, and I don't want to needlessly separate everything into several expressions, but have it all just be "g", which I can then easily insert into my linear form (the main reason for this is because the actual problem I'm working on has a lot of automation in the code, and I don't want to needlessly complicate things).
Andrew
________________________________
From: Ham, David A <david.ham at imperial.ac.uk>
Sent: Sunday, March 14, 2021 4:15:38 AM
To: Andrew Hicks <ahick17 at lsu.edu>; firedrake <firedrake at imperial.ac.uk>
Subject: Re: Interpolate function only on the boundary
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 at imperial.ac.uk <firedrake-bounces at imperial.ac.uk> on behalf of Andrew Hicks <ahick17 at lsu.edu>
Date: Sunday, 14 March 2021 at 04:59
To: firedrake <firedrake at 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
-------------- next part --------------
HTML attachment scrubbed and removed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ex__Laplace_with_weak_anchoring.pdf
Type: application/pdf
Size: 85678 bytes
Desc: Ex__Laplace_with_weak_anchoring.pdf
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20210314/f0d75cdf/attachment.pdf>
More information about the firedrake
mailing list