Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HHJ construction on tetrahedra and fix map #267

Merged
merged 4 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions symfem/elements/hhj.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

For an alternative construction see (Sinwel, 2009) and sections 4.4.2.2 and 4.4.3.2
https://numa.jku.at/media/filer_public/b7/42/b74263c9-f723-4076-b1b2-c2726126bf32/phd-sinwel.pdf
or (Pechstein, Schöberl, 2018) for a more recent version for tetrahedra
https://doi.org/10.1007/s00211-017-0933-3
"""

import typing
Expand Down Expand Up @@ -47,10 +49,10 @@ def __init__(self, reference: Reference, order: int, variant: str = "equispaced"
if reference.tdim == 3:
poly = [((p[0], p[1], p[2]), (p[1], p[3], p[4]), (p[2], p[4], p[5]))
for p in polynomial_set_vector(reference.tdim, 6, order)]
directions = [((-2, 1, 0), (1, 0, 0), (0, 0, 0)),
((0, 1, -1), (1, -2, 1), (-1, 1, 0)),
((0, 0, 0), (0, 0, -1), (0, -1, 2)),
((0, 0, 1), (0, 0, 0), (1, 0, 0))]
directions = [((0, 1, 1), (1, 0, 1), (1, 1, 0)),
((-6, 1, 1), (1, 0, 1), (1, 1, 0)),
((0, 1, 1), (1, -6, 1), (1, 1, 0)),
((0, 1, 1), (1, 0, 1), (1, 1, -6))]
directions_extra = [((0, 0, -1), (0, 0, 1), (-1, 1, 0)),
((0, -1, 0), (-1, 0, 1), (0, 1, 0))]

Expand All @@ -68,15 +70,15 @@ def __init__(self, reference: Reference, order: int, variant: str = "equispaced"
for d in directions:
dofs.append(IntegralMoment(
reference, p * MatrixFunction(d), dof, entity=(reference.tdim, 0),
mapping="double_covariant"))
mapping="double_contravariant"))
# cell functions extra
space_extra = Lagrange(reference, order, variant)
basis_extra = space_extra.get_basis_functions()
for p, dof in zip(basis_extra, space_extra.dofs):
for d in directions_extra:
dofs.append(IntegralMoment(
reference, p * MatrixFunction(d), dof, entity=(reference.tdim, 0),
mapping="double_covariant"))
mapping="double_contravariant"))

self.variant = variant

Expand All @@ -95,4 +97,4 @@ def init_kwargs(self) -> typing.Dict[str, typing.Any]:
references = ["triangle", "tetrahedron"]
min_order = 0
continuity = "inner H(div)"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

H(div div)?

last_updated = "2023.08"
last_updated = "2024.02"
Loading