-
Notifications
You must be signed in to change notification settings - Fork 161
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Umberto Zerbinati <[email protected]>
|
|
Signed-off-by: Umberto Zerbinati <[email protected]>
Signed-off-by: Umberto Zerbinati <[email protected]>
Signed-off-by: Umberto Zerbinati <[email protected]>
faa6e24
to
fe9643f
Compare
firedrake/trefftz.py
Outdated
Assemble the embedding, compute the SVD and return the embedding matrix | ||
""" | ||
self.B = assemble(self.b).M.handle | ||
if self.backend == "scipy": |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
tests/regression/test_trefftz.py
Outdated
|
||
@pytest.mark.skipcomplex | ||
def test_trefftz_aggregation(): | ||
from netgen.occ import WorkPlane, OCCGeometry |
There was a problem hiding this comment.
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
firedrake/trefftz.py
Outdated
""" | ||
This class computes the Trefftz embedding of a given function space | ||
Parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""" | |
This class computes the Trefftz embedding of a given function space | |
Parameters | |
"""Compute the Trefftz embedding of a given function space. | |
Parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly for other docstrings
firedrake/trefftz.py
Outdated
This class computes the Trefftz embedding of a given function space | ||
Parameters | ||
---------- | ||
V : :class:`.FunctionSpace` |
There was a problem hiding this comment.
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.
firedrake/trefftz.py
Outdated
Assemble the embedding, compute the SVD and return the embedding matrix | ||
""" | ||
self.B = assemble(self.b).M.handle | ||
if self.backend == "scipy": |
There was a problem hiding this comment.
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...
firedrake/trefftz.py
Outdated
return QTpsc, sig | ||
|
||
|
||
class trefftz_ksp(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class trefftz_ksp(object): | |
class TrefftzKSP: |
firedrake/trefftz.py
Outdated
import scipy.sparse as sp | ||
|
||
|
||
class TrefftzEmbedding(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class TrefftzEmbedding(object): | |
class TrefftzEmbedding: |
Hi Umberto! Are you going to put this PR up on screen during your talk by any chance? |
Signed-off-by: Umberto Zerbinati <[email protected]>
from ufl import dx, dS, inner, jump, grad, dot, CellDiameter, FacetNormal | ||
import scipy.sparse as sp | ||
|
||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
Signed-off-by: Umberto Zerbinati <[email protected]>
Signed-off-by: Umberto Zerbinati <[email protected]>
Signed-off-by: Umberto Zerbinati <[email protected]>
No description provided.