Optimize facet normals on axiparallel grids
On axiparallel grids, facet normals have but one non-zero component. Steffen exploits that already. I have not seen a way to do so in UFL so far, but now I had an idea. It is actually straight forward:
On a UFL basis:
- Unroll any index that indexes into
FacetNormal
- Do replacement of all the unrolled components with 0 except for the non-zero one
Propagation of zeroes will hopefully do the rest. Note, that this UFL transformation needs to be done at a later stage than our current ones, as it needs to have a notion of the facet orientation.