-
Notifications
You must be signed in to change notification settings - Fork 317
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
[LinearSystem] Introduce components to map matrices #4490
Merged
Merged
Conversation
This file contains 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
fad592e
to
04e5910
Compare
Finally, the optimization in 1b04773 allows the following timing:
Speed up x2 compared to before this PR |
9e03f23
to
6274dae
Compare
[ci-build][with-all-tests] |
bakpaul
approved these changes
Feb 14, 2024
alxbilger
commented
Feb 14, 2024
@@ -80,6 +80,10 @@ | |||
<MechanicalObject template="Vec3d" name="DOFs"/> | |||
<SubsetMapping input="@../DOFs" output="@DOFs" indices="@box.indices"/> | |||
</Node> | |||
<MatrixProjectionMethod areJacobiansConstant="true" mechanicalStates="@/rigidSections/green/a/DOFs @/rigidSections/green/a/DOFs"/> |
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.
@damienmarchal I was not able to move this component in a header part because of links towards mechanical states that don't exist yet.
f381e78
to
699b2bf
Compare
699b2bf
to
a3f276c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
About a possible enhancement
pr: highlighted in next release
Highlight this contribution in the notes of the upcoming release
pr: status ready
Approved a pull-request, ready to be squashed
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.
In some simulations relying on mappings, a computation intensive task is the product
J^T * K * J
(including the computation ofJ
). To offer the user a choice of strategy regarding the way to compute this product, I introduce a componentMatrixMapping
. This component is optional in a scene. If not present, it will be created automatically with a generic-purpose strategy, i.e. the one already implemented.In order to illustrate the options given to the user, I already added a Data to consider the mapping Jacobians to be constant. For example, it is true for
ModelOrderReductionMapping
. In the future, maybe this property can be defined automatically. I benchmarked the reduced diamond robot over 1000 time steps (the previous benchmark is in #4443):Before
After (with
areJacobiansConstant=True
)Speed up x1.5 on the matrix mapping.
Note that using a
ConstantSparsityPatternSystem
instead of aMatrixLinearSystem
is slightly faster (but it is not in the scope of this PR):Plans for the future:
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if