Subject: [FFC-dev] facet normal

From: Shawn Walker <[email-masked]>
Date: Mon, 13 Apr 2009 09:51:09 -0400 (EDT)

I was just wondering if the FacetNormal will be coming back to FFC any 
time soon?

- Shawn

---

From: Harish Narayanan <[email-masked]>
Date: Mon, 13 Apr 2009 15:57:38 +0200

> I was just wondering if the FacetNormal will be coming back to FFC any 

I'm not sure it's gone anywhere (unless something changed really
recently). The earlier syntax, FacetNormal(shape, mesh), is now
FacetNormal(mesh).

Harish

---

From: Shawn Walker <[email-masked]>
Date: Mon, 13 Apr 2009 10:05:21 -0400 (EDT)

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.

- Shawn

---

From: Harish Narayanan <[email-masked]>
Date: Mon, 13 Apr 2009 16:14:48 +0200

Shawn Walker wrote:
> 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