Skip to content

refactor: BLT sort equations and variables in tearing #3681

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

Merged
merged 11 commits into from
Jun 3, 2025

Conversation

AayushSabharwal
Copy link
Member

This turned out to be more work than I thought, but it works!

@@ -182,7 +183,7 @@ end
prob = ODEProblem(sys, [], (0.0, 1.0))
sol = solve(prob)
@test SciMLBase.successful_retcode(sol)
@test sol.u[1] ≈ [1.0, 1.0, 0.5, 0.5]
@test sol[x, 1] ≈ [1.0, 1.0, 0.5, 0.5]
Copy link
Member

Choose a reason for hiding this comment

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

This would be scalar?

Copy link
Member Author

Choose a reason for hiding this comment

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

x is an array symbolic

@variables x(t)[1:4] y(t)[1:2]

@hersle
Copy link
Contributor

hersle commented Jun 2, 2025

Does this apply to all system types, e.g. ODEs?

@AayushSabharwal
Copy link
Member Author

Yes, all system types will have their equations sorted in BLT order.

@ChrisRackauckas
Copy link
Member

well there is only one system type 😅

@AayushSabharwal
Copy link
Member Author

Yeah, I guess better phrasing is "all types of systems"

@hersle
Copy link
Contributor

hersle commented Jun 2, 2025

Ok, that was what I hoped and suspected, great! 😃

Are there any current plans to extend the strongly coupled logic to other problems as well, such as ODEProblems?
Or is it easy to manually break a System into independent BLT blocks, to solve it as a sequence of smaller *Problems?

@AayushSabharwal
Copy link
Member Author

The FMI test fails because it relies on variable order. I have a fix locally and verified that it works. Will let the rest of CI run, and if it passes I'll just push and merge.

@AayushSabharwal AayushSabharwal force-pushed the as/better-sccs branch 2 times, most recently from ac2da4b to e45ae8a Compare June 2, 2025 15:13
@AayushSabharwal AayushSabharwal merged commit b1e09a6 into SciML:master Jun 3, 2025
24 of 47 checks passed
@AayushSabharwal AayushSabharwal deleted the as/better-sccs branch June 3, 2025 11:02
@AayushSabharwal AayushSabharwal restored the as/better-sccs branch June 3, 2025 11:09
@AayushSabharwal AayushSabharwal deleted the as/better-sccs branch June 3, 2025 11:21
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.

3 participants