← Back to team overview

ffc team mailing list archive

Re: UFL cell normal implementation

 

On Tue, Sep 15, 2009 at 12:49:48AM +0200, Marie Rognes wrote:
> Shawn Walker wrote:
> >
> > On Mon, 14 Sep 2009, Peter Brune wrote:
> >
> >>
> >>
> >> On Mon, Sep 14, 2009 at 3:47 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> >> On Fri, Sep 11, 2009 at 12:56:26PM -0500, Peter Brune wrote:
> >> > 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
> >>
> >> Nice. I'm just wondering how the facet normal is defined here. Is it
> >> consistent with the UFC numbering?
> >>
> >>
> >> 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...
>
> 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.

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

Attachment: signature.asc
Description: Digital signature


Follow ups

References