Skip to content

Commit

Permalink
Add test that wcoeffs are orthonormal
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Sep 6, 2023
1 parent ebd7bf8 commit 1ff2c8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_wcoeffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@
@pytest.mark.parametrize("variant", variants)
def test_create_element(cell, degree, family, variant):
"""Check that either the element is created or a RuntimeError is thrown."""
print(cell, degree, family, variant)
try:
element = basix.create_element(family, cell, degree, *variant)
except RuntimeError:
pytest.xfail("Element not supported")

wcoeffs = element.wcoeffs
print(wcoeffs)
for i, rowi in enumerate(wcoeffs):
print([np.dot(rowi, rowj) for j, rowj in enumerate(wcoeffs)])
for i, rowi in enumerate(wcoeffs):
for j, rowj in enumerate(wcoeffs):
assert np.isclose(np.dot(rowi, rowj), int(i == j))

0 comments on commit 1ff2c8e

Please sign in to comment.