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?