Skip to content

Commit

Permalink
Allow Christiansen-Hu in 2D
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Oct 5, 2024
1 parent bde8583 commit 4248d62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions FIAT/christiansen_hu.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ class ChristiansenHu(finite_element.CiarletElement):
"""The Christiansen-Hu C^0(Worsey-Farin) linear macroelement with divergence in P0.
This element belongs to a Stokes complex, and is paired with unsplit DG0."""
def __init__(self, ref_el, degree=1):
if ref_el.get_shape() != TETRAHEDRON:
raise ValueError("Christiansen-Hu only defined on tetrahedra")
if degree != 1:
raise ValueError("Christiansen-Hu only defined for degree = 1")
poly_set = ChristiansenHuSpace(ref_el, degree)
Expand Down
1 change: 1 addition & 0 deletions test/unit/test_fiat.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ def __init__(self, a, b):
"AlfeldSorokina(T)",
"AlfeldSorokina(S)",
"ArnoldQin(T)",
"ChristiansenHu(T)",
"ChristiansenHu(S)",
"GuzmanNeilan(T)",
"GuzmanNeilan(S)",
Expand Down
12 changes: 7 additions & 5 deletions test/unit/test_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def test_AlfeldSorokinaSpace(cell, degree):
assert numpy.allclose(residual, 0)


@pytest.mark.parametrize("family", ("CH", "GN"))
@pytest.mark.parametrize("family", ("AQ", "CH", "GN"))
def test_minimal_stokes_space(cell, family):
# Test that the C0 Stokes space is spanned by a C0 basis
# Also test that its divergence is constant
Expand All @@ -396,12 +396,14 @@ def test_minimal_stokes_space(cell, family):
if family == "GN":
degree = sd
space = ExtendedGuzmanNeilanSpace
elif sd == 2:
degree = 2
space = ArnoldQinSpace
elif sd == 3:
elif family == "CH":
degree = 1
space = ChristiansenHuSpace
elif family == "AQ":
if sd != 2:
return
degree = 2
space = ArnoldQinSpace

W = space(cell, degree)
V = space(cell, degree, reduced=True)
Expand Down

0 comments on commit 4248d62

Please sign in to comment.