Skip to content

Commit

Permalink
Test H(curl div) element
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Oct 25, 2024
1 parent 2888162 commit dc987c8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ jobs:
--install defcon \
--install gadopt \
--install asQ \
--package-branch fiat pbrubeck/h1curl \
--package-branch finat pbrubeck/hhj \
--package-branch tsfc pbrubeck/hhj \
--package-branch fiat pbrubeck/hcurldiv \
--package-branch finat pbrubeck/hcurldiv \
--package-branch tsfc pbrubeck/hcurldiv \
--package-branch ufl pbrubeck/hcurldiv \
|| (cat firedrake-install.log && /bin/false)
- name: Install test dependencies
run: |
Expand Down
26 changes: 19 additions & 7 deletions tests/regression/test_tensor_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,37 @@ def mesh(request):
raise ValueError("Unrecognized mesh type")


@pytest.mark.parametrize("degree", (0, 1, 2))
@pytest.mark.parametrize("family", ("Regge", "HHJ"))
@pytest.mark.parametrize("family, degree", [
("Regge", 0),
("Regge", 1),
("Regge", 2),
("HHJ", 0),
("HHJ", 1),
("HHJ", 2),
("GLS", 1),
("GLS", 2),
])
def test_tensor_continuity(mesh, family, degree):
V = FunctionSpace(mesh, family, degree)
u = rg.beta(V, 1.0, 2.0)

dim = mesh.topological_dimension()
n = FacetNormal(mesh)

space = V.ufl_element().sobolev_space
if space == HDivDiv:
utrace = dot(n, dot(u, n))
elif space == HEin:
if dim == 2:
t = dot(as_matrix([[0, -1], [1, 0]]), n)
utrace = dot(t, dot(u, t))
if mesh.topological_dimension() == 2:
t = perp(n)
else:
t = as_matrix([[0, n[2], -n[1]], [-n[2], 0, n[0]], [n[1], -n[0], 0]])
utrace = dot(t, dot(u, t.T))
utrace = dot(t, dot(u, t))
else:
if mesh.topological_dimension() == 2:
t = perp(n)
utrace = dot(t, dot(u, n))
else:
utrace = cross(n, dot(u, n))

ujump = utrace('+') - utrace('-')
assert assemble(inner(ujump, ujump)*dS) < 1E-10

0 comments on commit dc987c8

Please sign in to comment.