-
Notifications
You must be signed in to change notification settings - Fork 173
refactor interpolation #4595
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
Draft
leo-collins
wants to merge
126
commits into
main
Choose a base branch
from
leo/refactor_interpolate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
refactor interpolation #4595
Changes from all commits
Commits
Show all changes
126 commits
Select commit
Hold shift + click to select a range
e956adb
Matfree adjoint interpolation
pbrubeck 29a410d
Update interpolation.py
pbrubeck a33cfb3
Fixup, cleanup
pbrubeck d51db25
Reverse indices for dual_arg
pbrubeck afe0256
gem cofunction
pbrubeck 7aa048e
More fixups
pbrubeck 9826f0d
More fixup
pbrubeck 4ce9f8e
Fixup
pbrubeck ae80c0f
cleanup
pbrubeck 7fa72d6
Fix Real adjoint
pbrubeck 3f5ca71
Fixup
pbrubeck 42f848c
Fix multiindices
pbrubeck 08dba92
Remove interpolate(Function(DG0), CG2) from test
pbrubeck d1a0710
Do not sum_factorise
pbrubeck 9329d1a
Fix complex conjugate
pbrubeck 44a98ed
Suggestions from review
pbrubeck 120a2a3
Reusable Interpolator
pbrubeck af77aac
Allow interpolate(..., BaseForm)
pbrubeck 820038c
Merge branch 'main' into pbrubeck/interp-adjoint
pbrubeck ea5c07b
Update firedrake/assemble.py
pbrubeck 62fa31e
Explicitly assemble the interpolate adjoint matrix
pbrubeck ef0b10c
Fix up
pbrubeck 34ea5f3
Move renumbering logic to Interpolator
pbrubeck f82b140
Fix up
pbrubeck be0f779
Enhacements for interpolation into VOM
pbrubeck 6407f4e
SameMeshInterpolator: support matfree/explcit adjoint on Submesh
pbrubeck 449420f
Update tsfc/driver.py
pbrubeck f614764
Test submesh in parallel
pbrubeck ea997ea
VOM onto other VOM still needs renumbering
pbrubeck eee77d6
Clarify insane interface
pbrubeck 806d60b
Update firedrake/interpolation.py
pbrubeck 5c6e911
Update firedrake/interpolation.py
pbrubeck e303940
Update firedrake/interpolation.py
pbrubeck cc18063
Apply suggestions from code review
pbrubeck fd9a3f6
Update firedrake/interpolation.py
pbrubeck 1fad893
Merge branch 'pbrubeck/interp-adjoint' into pbrubeck/interp-adjoint-e…
pbrubeck b9f8088
Merge branch 'main' into pbrubeck/interp-adjoint
pbrubeck 89f97d5
add dataclass
leo-collins 613f630
use kwargs; dataclass
leo-collins 0ee1e2e
`interpolate` docstring; simplify function
leo-collins be3b6b6
simplify `Interpolate`
leo-collins dd6770a
add _get_interpolator function
leo-collins 21dea34
fix `_get_interpolator`
leo-collins 8ed2151
fixes for `test_interpolate_cross_mesh`
leo-collins c180374
remove parameters from Interpolator
leo-collins a2d1166
remove `freeze_expr` and logic
leo-collins 29b9d25
remove parameters
leo-collins 5e0853e
remove interp_data dict
leo-collins e8125e7
simplify logic
leo-collins df935f8
remove default_missing_val argument
leo-collins ce2659a
tidy
leo-collins 9c37277
refactor crossmeshinterpolator
leo-collins 3146105
fix
leo-collins f90f6fc
tidy
leo-collins 4097207
io -> input_ordering
leo-collins f895423
`make_interpolator` -> `_get_callable`
leo-collins 4a843ae
remove comment
leo-collins f43b2c0
remove properties
leo-collins 9e33ce2
suggestions from review
pbrubeck 960e7b0
Merge branch 'main' into pbrubeck/interp-adjoint
pbrubeck ee99351
Merge branch 'pbrubeck/interp-adjoint' into pbrubeck/interp-adjoint-e…
pbrubeck 687aa02
Merge branch 'pbrubeck/interp-adjoint-explicit' into leo/refactor_int…
leo-collins cce10bd
tidy / add comments
leo-collins 6b39062
Test -> Trial inside `CrossMeshInterpolator._mixed_function_space`
leo-collins 899a0ec
lint
leo-collins 733da2d
create `_get_tensor` method
leo-collins d893488
tidy
leo-collins 05237c9
simplify
leo-collins c7426b2
simplify
leo-collins 106ea87
tidy function interpolate
leo-collins 91caf94
create Coargument in Firedrake
leo-collins 91e4500
Change `Interpolate` to `interpolate`
leo-collins f661be2
update `test_interp_dual.py`
leo-collins bc4e48b
DROP BEFORE MERGE: use UFL branch
leo-collins ac252dc
move FunctionSpace check into `Interpolate`
leo-collins 79d6c83
lint
leo-collins 4a509f7
test -> trial
leo-collins 812f5d8
tidy function.interpolate
leo-collins e50cf4e
tidy cofunction.interpolate
leo-collins 5d9c81e
tidy type hints in function.py
leo-collins fddcb79
remove UFL branch
leo-collins 1bc83d4
lint
leo-collins 8ce32ae
fix typing
leo-collins 78dac92
runtimeerror -> valueerror
leo-collins 62aff37
add check for shape mismatch to `Interpolate`
leo-collins 68e5527
use ufl.as_expr
leo-collins d782365
update expr arg check
leo-collins f6f4a11
lint
leo-collins 3a59ff1
fix check
leo-collins 5b57198
Merge branch 'leo/simplify-interpolate' into leo/refactor_interpolate
leo-collins c8ffb2b
tidy
leo-collins 8ffb3fc
review suggestions
leo-collins a73e23f
Squashed commit of the following:
leo-collins 37b9cac
tidy
leo-collins 90a0fa5
remove `V` argument
leo-collins 72bd29e
assemble cross-mesh interpolation matrix; add test
leo-collins a8e7d30
assemble adjoint cross-mesh interpolation matrix
leo-collins 40c23da
changes
leo-collins fcdb7c5
remove repeated checks
leo-collins e7fe358
progress on adjoint cross-mesh / vom-to-vom
leo-collins efc45c7
tidy
leo-collins f71dd47
tidy
leo-collins 17469c5
fixes
leo-collins 21d1068
fixes
leo-collins 19187a5
fixed zero-form cross mesh
leo-collins d17d049
remove vomontovomwrapper
leo-collins 4c4cf49
fixes
leo-collins 58326de
tidy import
leo-collins a78b652
lint
leo-collins 387ad5e
attempt fix for bc
leo-collins 7f1d509
fix
leo-collins 78b058a
make `_get_interpolator` public
leo-collins c9f4ac0
change bcs
leo-collins 2340cea
fixes
leo-collins 7979355
updates
leo-collins b3ce8f3
remove _interpolate WIP
leo-collins ca93fbd
fixes
leo-collins 39aef14
add `get_interpolator` to `__all__`
leo-collins 3658338
lint; type hints and docstrings
leo-collins b9ab2e0
fix
leo-collins 93476e4
suggestions
leo-collins 0934e61
fixes
leo-collins 6b87a6b
lint
leo-collins 15bdd53
pass bcs to `interpolate`, zero cofunction fix
leo-collins 8667567
add zero form optimisation back in
leo-collins 59bcb4d
conjugate test function
leo-collins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,7 +318,7 @@ def interpolate(self, | |
Parameters | ||
---------- | ||
expression | ||
A dual UFL expression to interpolate. | ||
A UFL BaseForm to adjoint interpolate. | ||
ad_block_tag | ||
An optional string for tagging the resulting assemble | ||
block on the Pyadjoint tape. | ||
|
@@ -331,9 +331,9 @@ def interpolate(self, | |
firedrake.cofunction.Cofunction | ||
Returns `self` | ||
""" | ||
from firedrake import interpolation, assemble | ||
from firedrake import interpolate, assemble | ||
v, = self.arguments() | ||
interp = interpolation.Interpolate(v, expression, **kwargs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was necessary to keep adjoint tests happy, does this cause issues still? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is fixed by #4582, which is included in this PR |
||
interp = interpolate(v, expression, **kwargs) | ||
return assemble(interp, tensor=self, ad_block_tag=ad_block_tag) | ||
|
||
@property | ||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Why is this
ValueError
showing up? We might want to change it toNotImplementedError