Skip to content

Commit

Permalink
dmats with embedded_degree, add more NodalEnriched tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Nov 13, 2023
1 parent 669d179 commit 2bce251
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion FIAT/polynomial_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
18 changes: 11 additions & 7 deletions test/unit/test_fiat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2bce251

Please sign in to comment.