diff --git a/FIAT/polynomial_set.py b/FIAT/polynomial_set.py index 49314877b..3a8d376be 100644 --- a/FIAT/polynomial_set.py +++ b/FIAT/polynomial_set.py @@ -95,7 +95,7 @@ def get_embedded_degree(self): def get_dmats(self): if len(self.dmats) == 0: - self.dmats = self.expansion_set.get_dmats(self.degree) + self.dmats = self.expansion_set.get_dmats(self.embedded_degree) return self.dmats def get_reference_element(self): diff --git a/test/unit/test_fiat.py b/test/unit/test_fiat.py index 57c0ef5f7..58e2ec1b2 100644 --- a/test/unit/test_fiat.py +++ b/test/unit/test_fiat.py @@ -379,17 +379,21 @@ def test_empty_bubble(): Bubble(S, 3) -def test_nodal_enriched_implementation(): +@pytest.mark.parametrize('elements', [ + (Lagrange(I, 2), Lagrange(I, 1), Bubble(I, 2)), + (GaussLobattoLegendre(I, 3), Lagrange(I, 1), + RestrictedElement(GaussLobattoLegendre(I, 3), restriction_domain="interior")), + (RaviartThomas(T, 2), + RestrictedElement(RaviartThomas(T, 2), restriction_domain='facet'), + RestrictedElement(RaviartThomas(T, 2), restriction_domain='interior')), +]) +def test_nodal_enriched_implementation(elements): """Following element pair should be the same. This might be fragile to dof reordering but works now. """ - e0 = RaviartThomas(T, 2) - - e1 = NodalEnrichedElement( - RestrictedElement(RaviartThomas(T, 2), restriction_domain='facet'), - RestrictedElement(RaviartThomas(T, 2), restriction_domain='interior') - ) + e0 = elements[0] + e1 = NodalEnrichedElement(*elements[1:]) for attr in ["degree", "get_reference_element",