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

Trefftz support for Firedrake #3775

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Trefftz support for Firedrake #3775

wants to merge 13 commits into from

Conversation

UZerbinati
Copy link
Contributor

No description provided.

Signed-off-by: Umberto Zerbinati <[email protected]>
Copy link

github-actions bot commented Sep 18, 2024

TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake complex8055 ran6471 passed1584 skipped0 failed

Copy link

github-actions bot commented Sep 18, 2024

TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake real8061 ran7275 passed786 skipped0 failed

Umberto Zerbinati added 4 commits September 18, 2024 13:52
Signed-off-by: Umberto Zerbinati <[email protected]>
Signed-off-by: Umberto Zerbinati <[email protected]>
Signed-off-by: Umberto Zerbinati <[email protected]>
Assemble the embedding, compute the SVD and return the embedding matrix
"""
self.B = assemble(self.b).M.handle
if self.backend == "scipy":
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work in parallel? We should have a parallel test.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure having a backend way we want to do this either...


@pytest.mark.skipcomplex
def test_trefftz_aggregation():
from netgen.occ import WorkPlane, OCCGeometry
Copy link
Member

Choose a reason for hiding this comment

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

This test needs to be skipped if ngsPETSc is not installed

Comment on lines 18 to 20
"""
This class computes the Trefftz embedding of a given function space
Parameters
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"""
This class computes the Trefftz embedding of a given function space
Parameters
"""Compute the Trefftz embedding of a given function space.
Parameters

Copy link
Member

Choose a reason for hiding this comment

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

Similarly for other docstrings

This class computes the Trefftz embedding of a given function space
Parameters
----------
V : :class:`.FunctionSpace`
Copy link
Member

Choose a reason for hiding this comment

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

Please remove types from here and add type-hinting, see policy.

Assemble the embedding, compute the SVD and return the embedding matrix
"""
self.B = assemble(self.b).M.handle
if self.backend == "scipy":
Copy link
Member

Choose a reason for hiding this comment

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

Not sure having a backend way we want to do this either...

return QTpsc, sig


class trefftz_ksp(object):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class trefftz_ksp(object):
class TrefftzKSP:

import scipy.sparse as sp


class TrefftzEmbedding(object):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class TrefftzEmbedding(object):
class TrefftzEmbedding:

@JDBetteridge
Copy link
Member

Hi Umberto! Are you going to put this PR up on screen during your talk by any chance?

Umberto Zerbinati added 2 commits September 22, 2024 11:20
from ufl import dx, dS, inner, jump, grad, dot, CellDiameter, FacetNormal
import scipy.sparse as sp


Copy link
Contributor

Choose a reason for hiding this comment

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

Please define __all__ to avoid pollution of the namespace

Copy link
Contributor

Choose a reason for hiding this comment

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

Or equivalently you can replace from firedrake.trefftz import * with from firedrake.trefftz import OnlyWhatIWant inside __init__.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants