Skip to content
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

Add pgstar decorator to mark solver progress in Trho profiles + Kippenhahn diagrams #636

Open
Debraheem opened this issue Mar 25, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Debraheem
Copy link
Contributor

In an effort to make MESA's solver struggles more transparent to normal users, I think it would be appropriate to add 1, 2, or 3 dots using a pgstar Decorator to the TRho_profile in pgstar to mark the top 1, 2, or 3 locations where the solver has spent most if its iterations, or where the residuals are largest. These dots would be similar to the current function of 'show_TRho_Profile_mass_locs'

A first step would probably involve looking at https://docs.mesastar.org/en/release-r24.03.1/reference/pgstar.html#trho-profile-window to see what current decorators are implemented.

With the goal of implementing a decorator for solver iterations similar to show_TRho_Profile_mass_locs, we can then look closer at how this is done.

We probably should check out and modify:
$MESA_DIR/star/private/pgstar_ctrls_io.f90, where this is toggled
$MESA_DIR/star/private/pgstar_trho_profile.f90, where this would be called from the the show_profile_line subroutine.

And we would need to modify the implementation of the subroutine show_profile_line in $MESA_DIR/star/private/pgstar_support.f90 to achieve this.

Information on solver progress is typically printed out to the terminal when "report_solver_progress =.true.", which sets dbg_msg = .true. in $MESA_DIR/star/private/star_solver.f90, so we want to pipe some of this information into pgstar if possible to inform the user where the solver is struggling or where the residuals are highest in a given timestep.

Bonus points for implementing this in the Kippenhahn diagrams as well

@Debraheem Debraheem added enhancement New feature or request good first issue Good for newcomers labels Mar 25, 2024
@wmwolf
Copy link
Contributor

wmwolf commented Mar 26, 2024

I've been wanting this feature lately, so thanks for suggesting it. It'd also be nice to be able to include this any profile plot panel, either as a vertical line or as a marker along the x-axis (like how we can show mixing summaries on the x-axis). I haven't done a similar amount of background searching to see how feasible that would be, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants