Restrictions are propagated incorrectly to ReferenceNormal nodes

Issue #71 resolved
Lawrence Mitchell created an issue

92eb99014e introduced this code in RestrictionPropagator:

    def reference_normal(self, o):
        D = o.ufl_domain()
        e = D.ufl_coordinate_element()
        f = e.family()
        d = e.degree()
        gd = D.geometric_dimension()
        td = D.topological_dimension()

        return self._require_restriction(o)
        if f == "Lagrange" and d == 1 and gd == td:
            # For meshes with a continuous linear non-manifold coordinate field,
            # the facet normal from side - points in the opposite direction of the one from side +.
            # We must still require a side to be chosen by the user but rewrite n- -> n+.
            # This is an optimization, possibly premature, however it's more difficult to do at a later stage.
            return self._opposite(o)
        else:
            # For other meshes, we require a side to be chosen by the user and respect that
            return self._require_restriction(o)

I believe this is not correct. Although the /physical/ normal points in the opposite direction on the + and - facets, this is not true in reference space. Consider the following two-element mesh:

    3---0
    |\  |
    | \ |
    |  \|
    2---1

When transformed to reference triangles we get, for the bottom left triangle:

3
|\
| \
1--2

While for the top right triangle we get:

3
|\
| \
0--1

So the shared facet 1-3 has a different reference space normal depending on which side we view it from.

I think the fix is just to propagate the current restriction in all cases.

Comments (4)

  1. Log in to comment