Open
Conversation
e97f118 to
4874c71
Compare
4874c71 to
f7a8460
Compare
pbrubeck
commented
Mar 26, 2026
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
pbrubeck
commented
Mar 27, 2026
| finat.JohnsonMercier, | ||
| finat.Morley, | ||
| ]) | ||
| def test_piola_manifold(ref_to_phys, element): |
Author
There was a problem hiding this comment.
Suggested change
| def test_piola_manifold(ref_to_phys, element): | |
| def test_manifold(ref_to_phys, element): |
pbrubeck
commented
Mar 27, 2026
Comment on lines
-1614
to
-1615
| dim_x = len(xs[0]) | ||
| dim_y = len(ys[0]) |
Author
There was a problem hiding this comment.
How does the old code handle different topological dimensions? It seems to work fine going from low dimension to a higher one, but I think you need least-squares in order to go the other way around. This code always builds a square matrix mat, but it might be singular.
The new code builds a possibly rectangular matrix DX if xs defines a simplex with tdim != gdim. If tdim == gdim, DX is square it inverts it with numpy.linalg.solve, and uses numpy.linalg.lstsq otherwise.
pbrubeck
commented
Mar 27, 2026
Comment on lines
-1617
to
-1618
| if len(xs) != len(ys): | ||
| raise Exception("") |
Author
There was a problem hiding this comment.
Should this exception be considered in the new code?
pbrubeck
commented
Mar 27, 2026
| if DX.shape[0] == DX.shape[1]: | ||
| AT = numpy.linalg.solve(DX, DY) | ||
| else: | ||
| AT, *_ = numpy.linalg.lstsq(DX, DY) |
Author
There was a problem hiding this comment.
Should we check for a small residual in the least-squares case?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables FIAT to handle physical cells with higher codimension, and is by no means required to support manifolds in Firedrake (which we already do for some elements, including Johnson-Mercier). This is ONLY to allow testing the basis transformation in FIAT.