ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #02395
Re: facet normal
Shawn Walker wrote:
> Actually, I meant how do I use the normal vector of the boundary in an
> FFC.form file?
>
> for example, I would like to have this (in my .form file):
>
> n = FacetNormal("triangle")
> a = dot(v, u)*dx + dot(grad(v), grad(u))*dx + dot(v, n)*dot(u, n)*ds
>
> It compiles fine in FFC, and the dolfin code also compiles. But when I
> run it, it crashes and says that some coefficient is not set. It seems
> to not know what `n' is.
The syntax I gave you was for the Python interface.
Take a look at Drag.form and main.cpp in the
dolfin/demo/pde/lift-drag/cpp directory for an example involving the use
of FacetNormal.
In essence, you need to do a FacetNormal n; in your C++ file and pass n
to the form via the constructor.
Harish
References