Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Commit

Permalink
Merged in mapdes/fiat/ref_el (pull request #26)
Browse files Browse the repository at this point in the history
Use ref_el which was already defined,
  • Loading branch information
miklos1 committed Aug 24, 2016
2 parents 33bde23 + 7dcc69a commit f787216
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FIAT/finite_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ def entity_support_dofs(elem, entity_dim):
ref_el = elem.get_reference_element()
dim = ref_el.get_spatial_dimension()

entity_cell = elem.ref_el.construct_subelement(entity_dim)
entity_cell = ref_el.construct_subelement(entity_dim)
quad = create_quadrature(entity_cell, max(2*elem.degree(), 1))
weights = quad.get_weights()

eps = 1.e-8 # Is this a safe value?

result = {}
for f in elem.entity_dofs()[entity_dim].keys():
entity_transform = elem.ref_el.get_entity_transform(entity_dim, f)
entity_transform = ref_el.get_entity_transform(entity_dim, f)
points = list(map(entity_transform, quad.get_points()))

# Integrate the square of the basis functions on the facet.
Expand Down
7 changes: 7 additions & 0 deletions test/unit/test_facet_support_dofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ def test_prism_hcurl(space, degree, horiz_expected, vert_expected):
assert vert_expected == entity_support_dofs(elem, (1, 1))


def test_discontinuous_element():
elem = FIAT.DiscontinuousElement(FIAT.Lagrange(UFCTriangle(), 3))
assert entity_support_dofs(elem, 1) == {0: [1, 2, 3, 4],
1: [0, 2, 5, 6],
2: [0, 1, 7, 8]}


if __name__ == '__main__':
import os
pytest.main(os.path.abspath(__file__))

0 comments on commit f787216

Please sign in to comment.