Subject: [FFC-dev] UFL cell normal implementation

From: Peter Brune <[email-masked]>
Date: Fri, 11 Sep 2009 12:56:26 -0500

Hey -

Here's my bundle for the cell normals in FFC.  There are a couple issues:
When I was calculating the direction of the normal, remove_unused was
getting rid of the unused normal code, but not the unused boolean direction
variable.  Other than that, I've tested it on a few things, but not with
restriction; however; it should work just like the facet jacobian code
w.r.t. this and I wrote it so that it should theoretically work.

- Peter

---

From: Anders Logg <[email-masked]>
Date: Mon, 14 Sep 2009 10:47:27 +0200

On Fri, Sep 11, 2009 at 12:56:26PM -0500, Peter Brune wrote:
> When I was calculating the direction of the normal, remove_unused was getting
> rid of the unused normal code, but not the unused boolean direction variable.
> Other than that, I've tested it on a few things, but not with restriction;
> however; it should work just like the facet jacobian code w.r.t. this and I
> wrote it so that it should theoretically work.
>
> - Peter

Nice. I'm just wondering how the facet normal is defined here. Is it
consistent with the UFC numbering?

--
Anders

---

From: Peter Brune <[email-masked]>
Date: Mon, 14 Sep 2009 08:07:17 -0500

On Mon, Sep 14, 2009 at 3:47 AM, Anders Logg <[email-masked]> wrote:

> getting
It behaves like the FacetNormal in SpecialFunctions, so it doesn't orient a
particular facet.  Is there a particular reason to have it do that?

- Peter

---

From: Shawn Walker <[email-masked]>
Date: Mon, 14 Sep 2009 09:23:42 -0400 (EDT)

On Mon, 14 Sep 2009, Peter Brune wrote:

> It behaves like the FacetNormal in SpecialFunctions, so it doesn't orient a particular facet.  Is there a
> particular reason to have it do that?
> 
> - Peter

I think it may be important for H(div) elements, where there is a fixed 
orientation for each edge segment in the mesh (for 2-D triangulations). 
But I could be wrong...

- Shawn

---

From: Marie Rognes <[email-masked]>
Date: Tue, 15 Sep 2009 00:49:48 +0200

Shawn Walker wrote:
> I think it may be important for H(div) elements, where there is a 
> fixed orientation for each edge segment in the mesh (for 2-D 
> triangulations). But I could be wrong...

The implementation of the H(div) and H(curl) elements is based on having 
a consistent edge/normal orientation.
In particular, that two facets agree on the direction of the normal 
component.

So yes, it matters.

--
Marie

---

From: Anders Logg <[email-masked]>
Date: Mon, 14 Sep 2009 16:11:03 +0200

> In particular, that two facets agree on the direction of the normal

It doesn't really matter for the implementation of H(div) and H(curl)
elements since that is not based on having access to a FacetNormal
function.

And Peter is correct, it's the same implementation as we have now for
FacetNormal defined in SpecialFunctions.h (although I haven't compared
in detail). The actual implementation is in TetrahedronCell.cpp or
TriangleCell.cpp.

That code computes the outward pointing normal so two neighboring
cells will *not* agree on the direction of the facet. So this normal is
different from the normal we use to define dofs (which always points
in the same direction).

Anyway, this definition of FacetNormal (pointing outward) is the
natural to use in the definition of a variational problem and the same
as we have now so it looks ok.

--
Anders

---

From: Peter Brune <[email-masked]>
Date: Mon, 14 Sep 2009 11:13:31 -0500

Just realized that I had made a mistake in the computation of direction (and
that I should have tested with more than squares -- now the snake works
too!); small patch attached.

- Peter

---

From: Shawn Walker <[email-masked]>
Date: Sat, 19 Sep 2009 19:08:26 -0400 (EDT)

Hello, Peter.

Do you have any kind of demo on using this new higher order geometry 
stuff?

- Shawn

---

From: Peter Brune <[email-masked]>
Date: Mon, 21 Sep 2009 13:33:42 -0500

It's not totally integrated into FFC yet.  In the last two weeks I moved
transcontinentally, got sick, and got ready for the next school year.  I'll
be working on it this week though.

- Peter

On Sat, Sep 19, 2009 at 6:08 PM, Shawn Walker <[email-masked]>wrote:

>
> Hello, Peter.
>
> Do you have any kind of demo on using this new higher order geometry stuff?
>
> - Shawn
>