Skip to content

add banded solver, TDC Y-face seed, skip cox if include_mlt_corr is F#991

Merged
VincentVanlaer merged 3 commits into
mainfrom
EbF/improve_solver_performance
May 14, 2026
Merged

add banded solver, TDC Y-face seed, skip cox if include_mlt_corr is F#991
VincentVanlaer merged 3 commits into
mainfrom
EbF/improve_solver_performance

Conversation

@Debraheem
Copy link
Copy Markdown
Member

This pr adds:

  1. a matrix solver option with hydro_matrix_solver = 'banded' support and solver plumbing. This is the same banded solver RSP uses, just repurposed for star. It is significantly faster than bcyclic for pulsation models, or really anything that is on a smaller mesh. Bcyclic can parallelize more and remains a better all purpose generalized solver for MESA.

  2. use_TDC_Y_face_seeded_newton plus the Y-face start/previous-iteration seed path.
    Small supporting TDC plumbing. use_TDC_Y_face_seeded_newton let's TDC skip the bisection logic and newton iterate to get a solution faster if the solution hasn't moved very far. This is helpful for zones where convection is not changing very much and another full root bisection can be wasteful. This control in my testing reduced the number of iterations in most TDC zones in half. This should be tested further, but this option should reduce the time spent in TDC ~ 1/2 . I have seen 5-10% speed up in some models during testing, but the speed up only becomes important when the timestep is limited by tdc/mlt and not eos/kap or other evolve step related overhead.

  3. along with 2, when include_mlt_corr_to_TDC = .false., we now skip the call to Cox inside TDC, since we don't need mlt Gamma. This is one less extra mlt call inside tdc per zone per iteration.

Copy link
Copy Markdown
Member

@VincentVanlaer VincentVanlaer left a comment

Choose a reason for hiding this comment

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

Is there a test case you could enable this in? That way we don't break this option.

Comment thread star/private/star_solver.f90 Outdated
Comment thread star/private/star_solver.f90 Outdated
Comment thread star/private/star_solver.f90 Outdated
Comment thread star/private/star_solver.f90 Outdated
Comment thread turb/private/tdc.f90 Outdated
Comment thread star/private/turb_support.f90 Outdated
@Debraheem
Copy link
Copy Markdown
Member Author

Is there a test case you could enable this in? That way we don't break this option.

Yes, I will be using this in the pulsation models I introduce to the test suite for TDC.

@Debraheem
Copy link
Copy Markdown
Member Author

Debraheem commented May 14, 2026

RSP2 will likely use it as well, once it's up and running (the banded solver). The TDC_Y_face_seeded_newton can be turned on in any test case we want.

@VincentVanlaer VincentVanlaer merged commit 3db154e into main May 14, 2026
5 checks passed
@VincentVanlaer VincentVanlaer deleted the EbF/improve_solver_performance branch May 15, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants