Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions python/firedrake/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ def project(v, V, bcs=None, mesh=None,
shape = v.shape()
# Build a function space that supports PointEvaluation so that
# we can interpolate into it.
if isinstance(V.ufl_element().degree(), tuple):
deg = max(V.ufl_element().degree())
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

maybe I should be using the exact tuple values, rather than (max, max)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess so. It's only a temporary field, but we may as well do it right.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@dorugeber Are you still planning to amend the commit and make that change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, I don't think so. It's not obviously better.

else:
deg = V.ufl_element().degree()

if v.rank() == 0:
fs = FunctionSpace(V.mesh(), 'CG', V.ufl_element().degree()+1)
fs = FunctionSpace(V.mesh(), 'CG', deg+1)
elif v.rank() == 1:
fs = VectorFunctionSpace(V.mesh(), 'CG',
V.ufl_element().degree()+1,
deg+1,
dim=shape[0])
else:
raise NotImplementedError(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_extrusion_3_galerkinproj.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


@pytest.mark.parametrize(('testcase', 'convrate'),
[(("CG", 1), 1.95), (("CG", 2), 2.7),
[(("CG", 1), 1.9), (("CG", 2), 2.6),
(("DG", 0), 0.9), (("DG", 1), 1.98)])
def test_scalar_convergence(testcase, convrate):
family, degree = testcase
Expand Down
2 changes: 1 addition & 1 deletion tests/test_extrusion_5_helmholtz_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@pytest.mark.parametrize(('testcase', 'convrate'),
[(("RT", 1, "DG", 0, "h", "DG", 0, (2, 5)), 0.9),
(("RT", 2, "DG", 0, "h", "DG", 1, (2, 4)), 1.65),
(("RT", 3, "DG", 0, "h", "DG", 2, (2, 4)), 2.6),
(("RT", 3, "DG", 0, "h", "DG", 2, (2, 4)), 2.55),
(("BDM", 1, "DG", 0, "h", "DG", 0, (2, 5)), 0.9),
(("DG", 0, "CG", 1, "v", "DG", 0, (2, 5)), 0.9),
(("DG", 0, "CG", 2, "v", "DG", 1, (2, 5)), 1.9)])
Expand Down