MESAHub / MESAHub/mesa

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

Open
#636 1 comment 1 reaction 0 assignees View on GitHub
enhancement good first issue
Dominant language
Fortran
Stars
249
Forks
82
Avg merge
1d 3h
Merged PRs (30d)
3

Description

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](https://docs.mesastar.org/en/release-r24.03.1/reference/pgstar.html#mass-location-markers), 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](https://github.com/MESAHub/mesa/blob/5992b8ed6c3033a560ee4361f4cc86335c2bb6f4/star/private/pgstar_trho_profile.f90#L192).

And we would need to modify the implementation of the [subroutine show_profile_line in $MESA_DIR/star/private/pgstar_support.f90](https://github.com/MESAHub/mesa/blob/5992b8ed6c3033a560ee4361f4cc86335c2bb6f4/star/private/pgstar_support.f90#L1516) 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](https://github.com/MESAHub/mesa/blob/5992b8ed6c3033a560ee4361f4cc86335c2bb6f4/star/private/star_solver.f90#L201), 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**

Contributor guide

Open the contributing guide

Research direction

Start with the pgstar TRho Profile Window and mass-location marker documentation, then inspect star/private/pgstar_ctrls_io.f90, pgstar_trho_profile.f90, and pgstar_support.f90. Trace show_profile_line and review star/private/star_solver.f90 for the solver-progress information exposed when report_solver_progress is enabled. Done means a configurable decorator marks the requested solver-iteration or residual locations in TRho profiles; Kippenhahn support is a bonus.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.