# Modify uflacs to support quadhex elements

#77 Merged at 2aadf3f
Repository
Branch
Repository
Branch
master
Reviewers
Description

Modifications so that dofmap is generated not based on topological dimension but based on the cell shape. This PR together with https://bitbucket.org/fenics-project/ffc/pull-requests/73 https://bitbucket.org/fenics-project/fiat/pull-requests/38 makes following code work correctly

```from dolfin import *
mesh_hex = UnitHexMesh(mpi_comm_world(), 10, 10, 10)
assemble(Expression('x', degree = 1) * dx(mesh_hex))  # Returns 0.5
assemble(Expression('x', degree = 1) * dx(mesh_hex))  # Returns 0.5
assemble(Expression('x', degree = 1) * dx(mesh_hex))  # Returns 0.5
```

`interpolate(Expression('...', degree = ...), V)` works correctly both for quadrilateral and hexahedron case. Can be checked by

```from dolfin import *
parameters["form_compiler"]["representation"] = "uflacs"
mesh = UnitHexMesh(mpi_comm_world(), 1, 1, 1)
V = FunctionSpace(mesh, "Lagrange", 2)
u = interpolate(Expression('x*x + 2*x*x + 3*x*x', degree=2), V)
vertex_values = u.compute_vertex_values()

for i, x in enumerate(mesh.coordinates()):
print('vertex %d: vertex_values[%d] = %g \t point(%s)' %
(i, i, vertex_values[i], x))
```

It returns

```vertex 0: vertex_values = 0   point([ 0.  0.  0.])
vertex 1: vertex_values = 1   point([ 1.  0.  0.])
vertex 2: vertex_values = 2   point([ 0.  1.  0.])
vertex 3: vertex_values = 3   point([ 1.  1.  0.])
vertex 4: vertex_values = 3   point([ 0.  0.  1.])
vertex 5: vertex_values = 4   point([ 1.  0.  1.])
vertex 6: vertex_values = 5   point([ 0.  1.  1.])
vertex 7: vertex_values = 6   point([ 1.  1.  1.])
```

Which is correct for the given function.

• Commit status