Subject: [FIAT-dev] Ordering of dofs on edges

From: Anders Logg <[email-masked]>
Date: Sat, 9 Jun 2007 09:20:38 +0200

We're having problems with getting higher order Lagrange converge in
3D and I think we've tracked it down to FFC/DOLFIN and FIAT not
agreeing on the numbering of edges on the reference tetrahedron.

Here's the numbering that FIAT seems to use (listed as the incident
vertices of each edge):

  e0 = (1, 2)
  e1 = (0, 2)
  e2 = (0, 1)
  e3 = (0, 3)
  e4 = (1, 3)
  e5 = (2, 3)

The UFC convention wants the edges sorted by their non-incident
vertices so we would like to have

  e0 = (2, 3)    non-incident to (0, 1)
  e1 = (1, 3)    non-incident to (0, 2)
  e2 = (1, 2)    non-incident to (0, 3)
  e3 = (0, 3)    non-incident to (1, 2)
  e4 = (0, 2)    non-incident to (1, 3)
  e5 = (0, 1)    non-incident to (2, 3)

The ordering convention is described in detail in the FFC, DOLFIN and
UFC manuals and it's based on what Arnold, Falk, Winther use for
numbering sub simplices in arbitrary dimensions.

The basic principle is that for each entity, you look at its
*non-incident* vertices and sort the entities lexicographically by
those (sorted) tuples of non-incident vertices. So the first edge
of a tetrahedron would then be the edge that is non-incident to
vertices 0 and 1. This is pretty neat since it also specialized to the
familiar numbering of edges in 2D and faces in 3D, so that edge (or
face) i is the edge (or face) opposite to vertex i.

Would it be possible to change the edge numbering for tets in FIAT to
follow this convention?

(Ideally, I'd also like to have the vertices at (0, 0, 0) - (1, 0, 0)
- (0, 1, 0) - (0, 0, 1) rather than (-1, -1, 0) etc but we already
handle this in FFC by scaling all the basis functions and
derivatives.)

/Anders

---

From: "Robert Kirby" <[email-masked]>
Date: Sat, 9 Jun 2007 20:36:24 +0200

I don't mind it being something different that makes sense, except that I
thought we had agreed on what is there a year or two ago and changing would
also require some small changes in Sundance also.

Rob

On 6/9/07, Anders Logg <[email-masked]> wrote:
> _______________________________________________
> FIAT-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/fiat-dev
>

---

From: Anders Logg <[email-masked]>
Date: Sun, 10 Jun 2007 01:23:38 +0200

Yes, and I'm sorry for the inconvenience. I did suggest to use what we
had before (as the common convention for FFC and SyFi) but something
else came up which was simply better. It's less ad hoc and it extends
to numbering of entities on n-D simplices, quads and hex elements.

It looks like one would only need to make the following updates in
shapes.py in FIAT:

triangle_edges = { 0 : ( 1 , 2 ) , \
                   1 : ( 0 , 2 ) , \
                   2 : ( 0 , 1 ) }

tetrahedron_edges = { 0 : ( 2 , 3 ) , \
                      1 : ( 1 , 3 ) , \
                      2 : ( 1 , 2 ) , \
                      3 : ( 0 , 3 ) , \
                      4 : ( 0 , 2 ) , \
                      5 : ( 0 , 1 ) }

tetrahedron_faces = { 0 : ( 1 , 2 , 3 ) , \
                      1 : ( 0 , 2 , 3 ) , \
                      2 : ( 0 , 1 , 3 ) , \
                      3 : ( 0 , 1 , 2 ) }

If I make these changes in FIAT, everything works fine. I get
convergence for q = 1, 2, 3 in both 2D and 3D. (Didn't try higher
degree but I'm sure it works.)

If changing this in FIAT will be problematic for Sundance, perhaps you
could add a little hook for setting the values listed above?

I could live with an extra call to set the values until you've talked
Kevin into making the corresponding updates to Sundance... :-)

/Anders