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

FDM solver for the de Rham complex #2801

Merged
merged 86 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
2921f7d
Sparse FDM preconditioner for the de Rham complex
pbrubeck Mar 7, 2023
283fbc5
DROP BEFORE MERGE
pbrubeck Mar 7, 2023
aa38d80
replace apostrophe with quotes on test
pbrubeck Mar 7, 2023
8554c49
fix tests, support more general TP elements in BLAS prolongation kernels
pbrubeck Mar 7, 2023
d0a7b01
pfas tests now passing, but need to create the transpose of injection
pbrubeck Mar 8, 2023
5c5d861
fix tests
pbrubeck Mar 8, 2023
d9a743c
fix docs
pbrubeck Mar 8, 2023
49a34f0
add FDM tests for H(curl) and H(div)
pbrubeck Mar 8, 2023
7397677
fix serendipity p1pc test
pbrubeck Mar 9, 2023
da2c6b5
remove print statement
pbrubeck Mar 9, 2023
81a92f9
Merge branch 'master' into pbrubeck/fdm-de-rham
pbrubeck Mar 9, 2023
379341b
Merge branch 'master' into pbrubeck/fdm-de-rham
pbrubeck Mar 9, 2023
8b2a415
fix typo in ValueError
pbrubeck Mar 9, 2023
1503435
address review comments
pbrubeck Mar 9, 2023
93088e6
add facetsplit tests
pbrubeck Mar 9, 2023
4f95d7d
test statically-condensed star-relaxation
pbrubeck Mar 10, 2023
9a548e5
attempt to write restricted NCE prolongator
pbrubeck Mar 13, 2023
8fab008
expand FInAT elements
pbrubeck Mar 14, 2023
e512293
Merge branch 'master' into pbrubeck/fdm-de-rham
pbrubeck Mar 14, 2023
6e18b85
Merge branch 'master' into pbrubeck/fdm-de-rham
pbrubeck Mar 15, 2023
fc88b9a
fix BLAS kernels for FacetElement(NCE)
pbrubeck Mar 15, 2023
8df4c25
clean up
pbrubeck Mar 15, 2023
f33456f
fix H(div) IPDG solver, use more elegant caching
pbrubeck Mar 15, 2023
0f2e808
add comments
pbrubeck Mar 16, 2023
d1ae080
more comments
pbrubeck Mar 16, 2023
3928302
glonum_fun -> extrude_node_map, do not coarsen residual of linear p-MG
pbrubeck Mar 16, 2023
213a55b
update citations
pbrubeck Mar 16, 2023
b6dff72
add some comments
pbrubeck Mar 16, 2023
415881c
comments explaining reference tensor and coefficients
pbrubeck Mar 16, 2023
8176489
deterministic sort keys of point_dicts
pbrubeck Mar 16, 2023
42ed1bf
construct block diagonal mass matrix from a nest Mat
pbrubeck Mar 16, 2023
9c0ccbf
fix docstrings
pbrubeck Mar 16, 2023
b954a8a
prolongation arguments ordered now as coarse, fine
pbrubeck Mar 20, 2023
7489e90
Merge branch 'pbrubeck/fdm-de-rham' of github.com:firedrakeproject/fi…
pbrubeck Mar 20, 2023
4b5f7b7
address some more review comments
pbrubeck Mar 20, 2023
dd7d855
change API of exterior derivative in hiptmair.py
pbrubeck Mar 20, 2023
fa6da0e
new prolongator API in hypre
pbrubeck Mar 20, 2023
e7622d9
typos
pbrubeck Mar 20, 2023
823c306
dual evaluation direclty through FIAT
pbrubeck Mar 21, 2023
67d56e9
test HiptmairPC on hexes
pbrubeck Mar 21, 2023
fa966ff
lint
pbrubeck Mar 21, 2023
b108044
add option fdm_static_condensation
pbrubeck Mar 21, 2023
4149dce
more elegant caching, remove interpolation of nullspace, comments add…
pbrubeck Mar 22, 2023
43429f8
create fewer intermidiate Mats
pbrubeck Mar 22, 2023
c42d208
Merge branch 'master' into pbrubeck/fdm-de-rham
pbrubeck Mar 22, 2023
a7b1e95
move imports to the top
pbrubeck Mar 22, 2023
a2cd50c
use any instead of sum
pbrubeck Mar 23, 2023
b6f3153
address some of Connor's comments format docstrings, dict() -> {}
pbrubeck Mar 23, 2023
1d754e5
more careful imports from firedrake
pbrubeck Mar 23, 2023
a9dbd8a
mantain old code
pbrubeck Mar 23, 2023
ab144a2
use OneFormAssembler, compute reference tensor via dual evaluation
pbrubeck Mar 25, 2023
bfcdbb8
optimise assembly
pbrubeck Mar 25, 2023
1ff8901
compute Schur compelment via block QR and block SVD
pbrubeck Mar 26, 2023
dd7b2de
use triple matrix product
pbrubeck Mar 28, 2023
20f2db5
remove unnecessary lru_caches in fdm.py
pbrubeck Mar 28, 2023
cb9de37
remove repeated import
pbrubeck Mar 29, 2023
24c8b80
cleanup
pbrubeck Mar 29, 2023
1ace1b8
use numpy.take in extrude_node_map
pbrubeck Mar 29, 2023
9f95e2b
optimise FDMGetIndices
pbrubeck Mar 29, 2023
a42d76a
fix typo
pbrubeck Mar 29, 2023
da6899d
fuse prealloaction and assembly loops, more elegant handling of eleme…
pbrubeck Mar 30, 2023
031e950
homogenize IPDG 3D tests
pbrubeck Apr 3, 2023
24dbf06
cast bool to int
pbrubeck Apr 3, 2023
2747d63
SchurComplementBuilder class
pbrubeck Apr 3, 2023
2ad64a5
small change
pbrubeck Apr 3, 2023
6fce996
style
pbrubeck Apr 4, 2023
e5dfbc8
cleanup
pbrubeck Apr 5, 2023
596a8f1
Merge remote-tracking branch 'origin/master' into pbrubeck/fdm-de-rham
pbrubeck Apr 5, 2023
6b70174
list of assembly callables for matrix blocks
pbrubeck Apr 5, 2023
63b82ec
use ElementKernel and SparseAssembler classes
pbrubeck Apr 8, 2023
49302eb
avoid createSubMatrices in static condensation
pbrubeck Apr 10, 2023
ce7cae1
extract finite elements from coefficient spaces, exploit symmetry in …
pbrubeck Apr 17, 2023
65690d0
Fix caching
pbrubeck Apr 21, 2023
8954fdf
lint
pbrubeck Apr 21, 2023
d393d53
fix merge conflict
pbrubeck Apr 26, 2023
56e2f8b
do not create rscale Vec
pbrubeck Apr 26, 2023
649ceed
do not change venv name
pbrubeck Apr 26, 2023
0c3f5dd
define H(d)
pbrubeck Apr 26, 2023
35ba3e6
use weakref for coarsening and transfer operators
pbrubeck Apr 30, 2023
82c618d
Merge branch 'master' into pbrubeck/fdm-de-rham
pbrubeck May 2, 2023
3c55699
fix typo in absolute tolerance
pbrubeck May 2, 2023
2854be9
Merge branch 'master' into pbrubeck/fdm-de-rham
pbrubeck May 3, 2023
8792bc3
test that weakref caches are parallel safe
pbrubeck May 3, 2023
7d40f36
small typo
pbrubeck May 3, 2023
7d925d8
Merge branch 'master' into pbrubeck/fdm-de-rham
dham May 10, 2023
da35c07
Drop build changes
dham May 10, 2023
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
1 change: 0 additions & 1 deletion firedrake/matrix_free/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ def view(self, mat, viewer=None):
type(self).__name__)

def getInfo(self, mat, info=None):
from mpi4py import MPI
memory = self._x.dat.nbytes + self._y.dat.nbytes
if hasattr(self, "_xbc"):
memory += self._xbc.dat.nbytes
Expand Down
1,915 changes: 1,511 additions & 404 deletions firedrake/preconditioners/fdm.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions firedrake/preconditioners/gtmg.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def initialize(self, pc):
if ctx is None:
raise ValueError("No context found.")
if not isinstance(ctx, _SNESContext):
raise ValueError("Don't know how to get form from %r", ctx)
raise ValueError("Don't know how to get form from %r" % ctx)

prefix = pc.getOptionsPrefix()
options_prefix = prefix + self._prefix
Expand All @@ -41,7 +41,7 @@ def initialize(self, pc):
if ictx is None:
raise ValueError("No context found on matrix")
if not isinstance(ictx, ImplicitMatrixContext):
raise ValueError("Don't know how to get form from %r", ictx)
raise ValueError("Don't know how to get form from %r" % ictx)

fine_operator = ictx.a
fine_bcs = ictx.row_bcs
Expand Down Expand Up @@ -70,7 +70,7 @@ def initialize(self, pc):
fine_petscmat.setTransposeNullSpace(fine_transpose_nullspace)

# Handle the coarse operator
coarse_options_prefix = options_prefix + "mg_coarse"
coarse_options_prefix = options_prefix + "mg_coarse_"
coarse_mat_type = opts.getString(coarse_options_prefix + "mat_type",
parameters["default_matrix_type"])

Expand Down
2 changes: 1 addition & 1 deletion firedrake/preconditioners/hiptmair.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def coarsen(self, pc):
if G_callback is None:
interp_petscmat = chop(Interpolator(dminus(test), V, bcs=bcs + coarse_space_bcs).callable().handle)
else:
interp_petscmat = G_callback(V, coarse_space, bcs, coarse_space_bcs)
interp_petscmat = G_callback(coarse_space, V, coarse_space_bcs, bcs)

return coarse_operator, coarse_space_bcs, interp_petscmat

Expand Down
4 changes: 2 additions & 2 deletions firedrake/preconditioners/hypre_ads.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def initialize(self, obj):
if G_callback is None:
G = chop(Interpolator(grad(TestFunction(P1)), NC1).callable().handle)
else:
G = G_callback(NC1, P1)
G = G_callback(P1, NC1)
C_callback = appctx.get("get_curl", None)
if C_callback is None:
C = chop(Interpolator(curl(TestFunction(NC1)), V).callable().handle)
else:
C = C_callback(V, NC1)
C = C_callback(NC1, V)

pc = PETSc.PC().create(comm=obj.comm)
pc.incrementTabLevel(1, parent=obj)
Expand Down
2 changes: 1 addition & 1 deletion firedrake/preconditioners/hypre_ams.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def initialize(self, obj):
if G_callback is None:
G = chop(Interpolator(grad(TestFunction(P1)), V).callable().handle)
else:
G = G_callback(V, P1)
G = G_callback(P1, V)

pc = PETSc.PC().create(comm=obj.comm)
pc.incrementTabLevel(1, parent=obj)
Expand Down
4 changes: 2 additions & 2 deletions firedrake/preconditioners/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,14 +748,14 @@ def initialize(self, obj):
if ctx is None:
raise ValueError("No context found on form")
if not isinstance(ctx, _SNESContext):
raise ValueError("Don't know how to get form from %r", ctx)
raise ValueError("Don't know how to get form from %r" % ctx)

if P.getType() == "python":
ictx = P.getPythonContext()
if ictx is None:
raise ValueError("No context found on matrix")
if not isinstance(ictx, ImplicitMatrixContext):
raise ValueError("Don't know how to get form from %r", ictx)
raise ValueError("Don't know how to get form from %r" % ictx)
J = ictx.a
bcs = ictx.row_bcs
if bcs != ictx.col_bcs:
Expand Down
Loading