Skip to content

Assembly of matfree interpolation operator#4778

Open
leo-collins wants to merge 28 commits intomainfrom
leo/assemble-matfree-interpolate
Open

Assembly of matfree interpolation operator#4778
leo-collins wants to merge 28 commits intomainfrom
leo/assemble-matfree-interpolate

Conversation

@leo-collins
Copy link
Copy Markdown
Contributor

@leo-collins leo-collins commented Dec 12, 2025

Allow assembly of matfree interpolation operators by passing mat_type="matfree".

Also changes the interfaces to the matrix classes and ImplicitMatrixContext to make them simpler.

@leo-collins leo-collins force-pushed the leo/assemble-matfree-interpolate branch from 57e5d2d to 5019974 Compare December 12, 2025 14:46
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/formmanipulation.py
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/matrix_free/operators.py Outdated
Comment thread tests/firedrake/regression/test_interpolator_types.py Outdated
Comment thread firedrake/matrix.py
Comment thread tests/firedrake/regression/test_interpolation_operators.py
@leo-collins leo-collins force-pushed the leo/assemble-matfree-interpolate branch from 75de8e2 to 5464cce Compare December 19, 2025 15:30
@leo-collins leo-collins marked this pull request as ready for review December 19, 2025 15:40
Copy link
Copy Markdown
Contributor

@connorjward connorjward left a comment

Choose a reason for hiding this comment

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

I'm only reviewing this from a high level, but this seems pretty much fine.

Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/formmanipulation.py
@leo-collins
Copy link
Copy Markdown
Contributor Author

@connorjward Thanks for the review. I'm at a workshop this week and then on holiday again next week so I'll take a look after these. Thanks!

@leo-collins leo-collins force-pushed the leo/assemble-matfree-interpolate branch from d25e1f2 to 9a9af0f Compare January 19, 2026 18:10
Comment thread firedrake/bcs.py Outdated
Comment thread firedrake/bcs.py Outdated
Comment thread firedrake/function.py Outdated
Comment thread firedrake/interpolation.py
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/matrix_free/operators.py Outdated
Comment thread firedrake/matrix.py Outdated
Comment thread firedrake/matrix.py
Comment thread firedrake/matrix.py Outdated
@leo-collins leo-collins force-pushed the leo/assemble-matfree-interpolate branch from 63bd9e1 to 0c16219 Compare February 3, 2026 12:01
Comment thread docs/source/conf.py
Comment thread firedrake/matrix.py Outdated
@leo-collins leo-collins force-pushed the leo/assemble-matfree-interpolate branch 2 times, most recently from 3336b12 to f6cdeb2 Compare February 10, 2026 15:33
@leo-collins leo-collins force-pushed the leo/assemble-matfree-interpolate branch from ef522b2 to 4283a70 Compare April 20, 2026 11:47
Copy link
Copy Markdown
Contributor

@connorjward connorjward left a comment

Choose a reason for hiding this comment

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

I think this is 99.9% there. I think I'm happy to merge after these tiny points are addressed.

Comment thread firedrake/matrix.py Outdated
test, trial = a
arguments = a
else:
assert isinstance(a, ufl.BaseForm | slate.TensorBase)
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.

Assertions should only ever be encountered in non-user facing code. This should raise a TypeError instead.

Comment thread firedrake/matrix.py Outdated
):
"""Initialise a :class:`MatrixBase`.

Parameters
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.

Nitpick: the arguments to __init__ are supposed to be documented in the class docstring (https://numpydoc.readthedocs.io/en/latest/format.html#class-docstring)

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