Refactor FieldMatrix indexing, add scalar_field_matrix - #2346
Merged
Conversation
imreddyTeja
commented
Jun 11, 2025
imreddyTeja
force-pushed
the
tr/refactor-fm-internal-index
branch
from
June 18, 2025 23:20
39ee021 to
14c7eed
Compare
imreddyTeja
force-pushed
the
tr/refactor-fm-internal-index
branch
2 times, most recently
from
July 9, 2025 00:01
c8572ee to
6de72eb
Compare
dennisYatunin
approved these changes
Jul 10, 2025
dennisYatunin
left a comment
Member
There was a problem hiding this comment.
Thank you for all the new documentation! And the recursive implementations of get_internal_entry and field_offset_and_type are much clearer now.
Couple of minor suggestions for the docs, but overall this is good to merge in. This will be the last change to ClimaCore required for sparse autodiff, so we can make a new release after it's merged.
imreddyTeja
force-pushed
the
tr/refactor-fm-internal-index
branch
3 times, most recently
from
July 14, 2025 16:20
ee915f7 to
a1a38fb
Compare
Add scalar_fieldmatrix Add a function to convert a FieldMatrix where each matrix entry has an eltype of some struct into a FieldMatrix where each entry has an eltype of a scalar. Add additional tests for scalar_matrixfields Use @test_all in tests Make suggested changes to tests and field_name_dict.jl Revert unrolled_findfirst Clean up field matrix tests and add support for DiagonalMatrixRows CamelCase struct name Clean up tests and get_scalar_keys wip backup Minimal working with allocs WIP1 WIP more allocs fix Assorted cleanup Fix dx/dx case reduce code duplication; fix example Add gpu test further cleanup, extend diagonalrow fix names test and comments Add docs docs bugfix remvoe bad refs fix docs formatting WIP Y fields pre-switch to type space should work fix broken tests bugfix fix implicit tensor rep tests WIPP1 working state Improve readability at cost of concise code update docs further cleanup propgate full key vs keyerror propogate name_tree scalar_fielmatrix to scalar_field_matrix
Also add support for tensor slicing and improved docs wip finish docs minor formatting fix another minor docs formatting fix Make suggested docs changes
imreddyTeja
force-pushed
the
tr/refactor-fm-internal-index
branch
from
July 15, 2025 16:50
a1a38fb to
633a291
Compare
imreddyTeja
enabled auto-merge (rebase)
July 15, 2025 16:51
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 refactors the internal indexing of
FieldMatrixblocks to use a generic recursive implementation, and it defines thescalar_field_matrixfunction for obtaining views of scalar block components.