This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Ordering of basis functions

+1 vote

When genrating a square mesh (say 100 nodes), as far as I can tell, the nodes are numbered as follows:

mesh = UnitSquareMesh(9,9)

 |    |    |    |          |
11 - 12 - 13 - 14 - ... - 20
 |    |    |    |          |
 1 -  2 -  3 -  4 - ... - 10

However, when I create a function space on this mesh and take a function u in this space. The the index in the underlying vector for u are arranged like this:

V = FunctionSpace(mesh,'CG',1)
u = Function(V)
uv = u.vector().array()

 |    |    |
 6 -  9 - 13 -  .
 |    |    |    |          |
 3 -  5 -  8 - 12 - ... - 56
 |    |    |    |          |
 1 -  2 -  4 -  7 - ... - 46

This affects the structure of my mass and stiffness matrix. Is it possible to select a particular ordering of the basis function in the function space. For instance such that they are ordered as the nodes in the mesh?

asked Mar 3, 2016 by bcsj FEniCS Novice (280 points)

1 Answer

+1 vote
 
Best answer

do

parameters['reorder_dofs_serial'] = False
answered Mar 3, 2016 by KristianE FEniCS Expert (12,900 points)
selected Mar 3, 2016 by bcsj
...