← Back to team overview

ffc team mailing list archive

Re: ordering of P2 nodes

 

I've almost got this working. When I compare the stiffness matrix from my code to the one from dolfin the max difference in the entries is machine precision. This is when the mesh is straight (no curves). If I have a slightly curved mesh, the error is 0.0162, but I think this is because the quad rule that FFC generated only has 4 points and I only have two triangles with diameter approx 0.5 (not small enough resolve the error).

Is there a way to tell FFC to use more quad points than it `should'? That way I can verify that I am computing this properly.

- Shawn

On Tue, 23 Jun 2009, Anders Logg wrote:

DOLFIN assumes that the mesh is ordered locally so that the local
vertices on each triangle are ordered increasingly. Take a look at the
XML files in data/meshes in DOLFIN and you'll see what I mean.

--
Anders


On Tue, Jun 23, 2009 at 12:11:13PM -0400, Shawn Walker wrote:
ok.  But I have one more question.

Is there any kind of re-ordering of nodes that dolfin does internally?  I
thought I remembered seeing this.  I have been trying to compare two
matrices, and it looks like the entries are the same, except the ordering
is a little different.

- Shawn

On Tue, 23 Jun 2009, Kristian Oelgaard wrote:

Quoting Shawn Walker <walker@xxxxxxxxxxxxxxx>:

Hello.  I need to know how FFC orders P2 Lagrange nodes.  I need to know
this in order to compare a FEM matrix that I created in another program.

For example, say you have one triangle with the following nodes:

[0 1 2 3 4 5]

Where is the #3 node in relation to the #0, #1, and #2 nodes?  Is #3
opposite the #0 node?

Yes.

I usually look at the tabulate_dofs() function, for the P2 case:

dofs[0] = c.entity_indices[0][0];
dofs[1] = c.entity_indices[0][1];
dofs[2] = c.entity_indices[0][2];
unsigned int offset = m.num_entities[0];
dofs[3] = offset + c.entity_indices[1][0];
dofs[4] = offset + c.entity_indices[1][1];
dofs[5] = offset + c.entity_indices[1][2];

So you see that the first 3 dofs are the vertices, the next 3 are the midpoints
of the edges. Then you need to know the UFC ordering of edges to figure out
that e0 is the edge which does not contain vertex 0 (opposite to v0) etc.

Kristian

- Shawn
_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev




_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev



Follow ups

References