Skip to content

Commit b9ce504

Browse files
orloxevbauerjschwabadamjermynwarrickball
authored
Adopt auto_diff for new rotation equations (#335)
* [ci skip] Fix wind_fed_bhhmxb * [ci skip] few changes to fix restart issues - mdot was not being saved in photos which broke the mdot timestep limit on restart - read_model was setting m_grav before setting vars, which lead to FPE errors * fix issue with ST when using AM mixing but no element mixing * [ci skip] work on dev_ppisn * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * star: remove modification to read_model setting of m_grav * Update code and documentation to consistently present energy equation options (#311) The implementation of the energy equation underwent many cleanups and improvements over the past few years. This updates the code and docs so that they agree about the meaning of the available options and the equations being solved. This removes the "use_always_*" controls in favor of a single string option energy_eqn_option that selects which version of the energy equation to use. Valid values are 'dedt' and 'eps_grav'. New documentation more thoroughly describes each form. This also adds the ctrls_io routine check_controls to catch errors. This is analogous to the routine introduced for star_job in SVN r14836 and provides a common location to check for incompatible options after the controls namelist is read. * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * TDC improvements (#318) * Disabled falling back on MLT except in cases of mdot. * [ci optional] Fixed up TDC line search. Just needed a limiter out front. * [ci optional] Hacky handling of stationary points in TDC solver. * Fixed merge. * [ci skip] Some improvements to TDC root find. * [ci optional] Augmented TDC with a bisection search stage to avoid stationary points. * [ci optional] Fixed a bug where TDC could terminate without filling derivative information. * [ci skip] Minor cleanup * [ci skip] Minor cleanup * [ci optional] Increased max TDC Z. Improved debug output. * [ci skip] Make cepheid sticky. * [ci skip] Added fxt’s pgstar output to ns_he. * [ci skip] Tightened ns_he tolerances and regenerated starting model. Also removed some PC cruft. * [ci optional] Forced TDC to take at least one Newton iteration to ensure that we get derivatives. * [ci skip] Refactored a magic number in TDC. * [ci skip] Minor TDC cleanup. * [ci skip] Fixed compilation error. * [ci skip] Removed some comments that weren’t helpful. * [ci skip] Cleaned up TDC call signature. * [ci skip] Improved TDC debug output. * [ci skip] Minor documenting and refactoring of TDC. * [ci optional] Decreased minZ. * [ci skip] Improved ns_h inlist. * [ci optional] Added TDC comment. * [ci optional] Gave TDC the ability to bail to bracket search for one iteration. * [ci optional] Improved mixing in make_o_ne_wd inlists. Also tightened tolerances. * [ci optional] Added more output to cburn_inward. * [ci skip] Minor formatting change in cburn_inward * [ci skip] Homogenized cburn_inward overshooting controls. * [ci skip] Made cburn_inward iterations sticky. * [ci optional] Improved cburn_inward pgstar output and trigger a full optional run. * [ci optional] Fixed a compilation bug. * [ci skip] Fixed comment in cburn_inward * [ci optional] Fixed ordering of mixing calls. * [ci skip] Some cleanup in mlt_get_results. * [ci skip] More cleanup in mlt_get_results. * [ci skip] Removed old TDC output. * [ci skip] Removed an unused call to MLT. * [ci skip] eliminated some unused variables. * [ci skip] Reenabled first MLT call and removed some old arrays * [ci skip] Removed using_TDC variable. * [ci skip] Caught another using_TDC. * [ci skip] Refactored semiconvection to be a proper subroutine call with explicit inputs/outputs. * [ci skip] Formatting. * [ci optional] Refactored set_MLT to be a subroutine call with explicit inputs and outputs. * [ci optional] Removed debug output. * [ci skip] Minor refactoring. * [ci skip] Factored out set_thermohaline. * [ci skip] Refactored set_TDC to have explicit in/out. * [ci skip] Factored away set_no_mixing calls. * [ci skip] Split off thermohaline, semiconvection, mlt, and TDC routines into their own files. mlt_get_results now just puts the results together. * [ci skip] Minor refactoring. * [ci skip] Refactored mlt reporting. * Fixed a bug in TDC with composition terms. * [ci optional] Fixed a bug where TDC was returning MLT’s mixing coefficient. Also removed a redundant MLT call. * [ci skip] Eliminated some redundancies. * [ci skip] Minor refactoring. * [ci skip] Removed old comment. * [ci optional] Removed some old TDC debugging code. * [ci skip] Cleanup * [ci optional] Performance improvements in TDC. * [ci skip] Very minor performance improvement in TDC. * [ci skip] Stash * [ci skip] Fixed a bug introduced in refactoring. * [ci optional] Enabled TDC to return the radiative answer as a performance enhancement when it’s easy to tell the system is radiative. * [ci optional] rsp_gyre columns cleanup * [ci optional] I think this restores the option to turn off Ledoux. * [ci optional] Disabled TDC radiative bailing. * [ci skip] TDC improved variable names. * [ci skip] Sanity edits to MLT. * [ci optional] Bug fix in MLT_get_results. * [ci optional] Disabled TDC in relax_composition_j_entropy. Simplified inlists. * [ci skip] Simplified MLT handling in relax. * [ci skip] Removed an unused import. * [ci skip] Refactored and commented semiconvection. * [ci optional] Turned off semiconvection, loosened timestep controls, and increased thermohaline mixing in make_co_wd. * [ci skip] Switched ns_he to Cox. Also added debug options to inlist and added mixing window to default pgstar. * [ci optional] Loosened tolerances on make_o_ne_wd and bumped initial mass up to 11. * [ci skip] Tightened tolerances on gyre_in_mesa_wd and removed MLT++ controls (which were never actually used). * [ci skip] Organized some ccsn_IIp controls and tightened initial infall tolerances. * [ci skip] ccsn_IIp ignore equL residuals in infall and end_infall. * [ci skip] Inlist formatting and disabled nuclear reactions in inlist_end_infall in ccsn_IIp. * [ci optional] Speed up ccsn_IIp dramatically by increasing max_timestep in edep. * [ci optional] Fixed immediate issue with simplex calibration by turning TDC off during pre-ZAMS evolution. * [ci optional] Tightened control on T_center in dev_to_cc_12. * [ci optional] Applied tight timesteps just to lgTmax inlist in dev_to_cc_12. * [ci optional] Fetched Warrick’s changes. * [ci optional] Added option steps_before_use_TDC. Seems to help on example_astero, 5M_cepheid, and solar_simplex_calibration. * [ci optional] Improved inlist_to_cc in dev_to_cc_12. * [ci optional] Increased max model number in dev_to_cc_12. * [ci optional] Temporarily turned off all but dev_to_ppisn_100. Improved inlist for same. * [ci optional] Restored do1_test_source. Updated dev_to_ppisn_100 standard models. * Improved TDC error handling. * Added tests that dropped off by mistake * [ci optional] Updated standard models in dev_to_cc_12. * [ci skip] Minor refactoring of MLT. * [ci optional] Added some more precision to a numerical constant. * [ci optional] Change MLT alpha in example_astero and simplex_solar_calibration to pass * [ci skip] Removed commented out control. * [ci optional] Restored less precise version of sqrt[2/3] which for some reason does better. Co-authored-by: Warrick Ball <[email protected]> * [ci skip] work on dev_ppisn * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * Update code and documentation to consistently present energy equation options (#311) The implementation of the energy equation underwent many cleanups and improvements over the past few years. This updates the code and docs so that they agree about the meaning of the available options and the equations being solved. This removes the "use_always_*" controls in favor of a single string option energy_eqn_option that selects which version of the energy equation to use. Valid values are 'dedt' and 'eps_grav'. New documentation more thoroughly describes each form. This also adds the ctrls_io routine check_controls to catch errors. This is analogous to the routine introduced for star_job in SVN r14836 and provides a common location to check for incompatible options after the controls namelist is read. * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci skip] work on dev_ppisn * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * TDC improvements (#318) * Disabled falling back on MLT except in cases of mdot. * [ci optional] Fixed up TDC line search. Just needed a limiter out front. * [ci optional] Hacky handling of stationary points in TDC solver. * Fixed merge. * [ci skip] Some improvements to TDC root find. * [ci optional] Augmented TDC with a bisection search stage to avoid stationary points. * [ci optional] Fixed a bug where TDC could terminate without filling derivative information. * [ci skip] Minor cleanup * [ci skip] Minor cleanup * [ci optional] Increased max TDC Z. Improved debug output. * [ci skip] Make cepheid sticky. * [ci skip] Added fxt’s pgstar output to ns_he. * [ci skip] Tightened ns_he tolerances and regenerated starting model. Also removed some PC cruft. * [ci optional] Forced TDC to take at least one Newton iteration to ensure that we get derivatives. * [ci skip] Refactored a magic number in TDC. * [ci skip] Minor TDC cleanup. * [ci skip] Fixed compilation error. * [ci skip] Removed some comments that weren’t helpful. * [ci skip] Cleaned up TDC call signature. * [ci skip] Improved TDC debug output. * [ci skip] Minor documenting and refactoring of TDC. * [ci optional] Decreased minZ. * [ci skip] Improved ns_h inlist. * [ci optional] Added TDC comment. * [ci optional] Gave TDC the ability to bail to bracket search for one iteration. * [ci optional] Improved mixing in make_o_ne_wd inlists. Also tightened tolerances. * [ci optional] Added more output to cburn_inward. * [ci skip] Minor formatting change in cburn_inward * [ci skip] Homogenized cburn_inward overshooting controls. * [ci skip] Made cburn_inward iterations sticky. * [ci optional] Improved cburn_inward pgstar output and trigger a full optional run. * [ci optional] Fixed a compilation bug. * [ci skip] Fixed comment in cburn_inward * [ci optional] Fixed ordering of mixing calls. * [ci skip] Some cleanup in mlt_get_results. * [ci skip] More cleanup in mlt_get_results. * [ci skip] Removed old TDC output. * [ci skip] Removed an unused call to MLT. * [ci skip] eliminated some unused variables. * [ci skip] Reenabled first MLT call and removed some old arrays * [ci skip] Removed using_TDC variable. * [ci skip] Caught another using_TDC. * [ci skip] Refactored semiconvection to be a proper subroutine call with explicit inputs/outputs. * [ci skip] Formatting. * [ci optional] Refactored set_MLT to be a subroutine call with explicit inputs and outputs. * [ci optional] Removed debug output. * [ci skip] Minor refactoring. * [ci skip] Factored out set_thermohaline. * [ci skip] Refactored set_TDC to have explicit in/out. * [ci skip] Factored away set_no_mixing calls. * [ci skip] Split off thermohaline, semiconvection, mlt, and TDC routines into their own files. mlt_get_results now just puts the results together. * [ci skip] Minor refactoring. * [ci skip] Refactored mlt reporting. * Fixed a bug in TDC with composition terms. * [ci optional] Fixed a bug where TDC was returning MLT’s mixing coefficient. Also removed a redundant MLT call. * [ci skip] Eliminated some redundancies. * [ci skip] Minor refactoring. * [ci skip] Removed old comment. * [ci optional] Removed some old TDC debugging code. * [ci skip] Cleanup * [ci optional] Performance improvements in TDC. * [ci skip] Very minor performance improvement in TDC. * [ci skip] Stash * [ci skip] Fixed a bug introduced in refactoring. * [ci optional] Enabled TDC to return the radiative answer as a performance enhancement when it’s easy to tell the system is radiative. * [ci optional] rsp_gyre columns cleanup * [ci optional] I think this restores the option to turn off Ledoux. * [ci optional] Disabled TDC radiative bailing. * [ci skip] TDC improved variable names. * [ci skip] Sanity edits to MLT. * [ci optional] Bug fix in MLT_get_results. * [ci optional] Disabled TDC in relax_composition_j_entropy. Simplified inlists. * [ci skip] Simplified MLT handling in relax. * [ci skip] Removed an unused import. * [ci skip] Refactored and commented semiconvection. * [ci optional] Turned off semiconvection, loosened timestep controls, and increased thermohaline mixing in make_co_wd. * [ci skip] Switched ns_he to Cox. Also added debug options to inlist and added mixing window to default pgstar. * [ci optional] Loosened tolerances on make_o_ne_wd and bumped initial mass up to 11. * [ci skip] Tightened tolerances on gyre_in_mesa_wd and removed MLT++ controls (which were never actually used). * [ci skip] Organized some ccsn_IIp controls and tightened initial infall tolerances. * [ci skip] ccsn_IIp ignore equL residuals in infall and end_infall. * [ci skip] Inlist formatting and disabled nuclear reactions in inlist_end_infall in ccsn_IIp. * [ci optional] Speed up ccsn_IIp dramatically by increasing max_timestep in edep. * [ci optional] Fixed immediate issue with simplex calibration by turning TDC off during pre-ZAMS evolution. * [ci optional] Tightened control on T_center in dev_to_cc_12. * [ci optional] Applied tight timesteps just to lgTmax inlist in dev_to_cc_12. * [ci optional] Fetched Warrick’s changes. * [ci optional] Added option steps_before_use_TDC. Seems to help on example_astero, 5M_cepheid, and solar_simplex_calibration. * [ci optional] Improved inlist_to_cc in dev_to_cc_12. * [ci optional] Increased max model number in dev_to_cc_12. * [ci optional] Temporarily turned off all but dev_to_ppisn_100. Improved inlist for same. * [ci optional] Restored do1_test_source. Updated dev_to_ppisn_100 standard models. * Improved TDC error handling. * Added tests that dropped off by mistake * [ci optional] Updated standard models in dev_to_cc_12. * [ci skip] Minor refactoring of MLT. * [ci optional] Added some more precision to a numerical constant. * [ci optional] Change MLT alpha in example_astero and simplex_solar_calibration to pass * [ci skip] Removed commented out control. * [ci optional] Restored less precise version of sqrt[2/3] which for some reason does better. Co-authored-by: Warrick Ball <[email protected]> * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci skip] Add pablo to test cases * [ci skip] Fixed a comment in auto_diff * Moved local turbulent theories into a new `turb` module. (#322) * [ci skip] Broke out mlt/tdc/thermohaline/semiconvection into their own module. * [ci skip] Compilation fix. * [ci skip] Various compilation fixes. * [ci skip] Compilation bug fix. * [ci optional] Fixed compilation bug. * [ci skip] Comments. * [ci skip] Comments in TDC. * [ci skip] Removed some unused variables. * [ci skip] Updated codeowners * [ci skip] Updated copyright notices * [ci optional] Removed unused function. * [ci optional] Added a unit test and did some refactoring in turb. * [ci optional] Restored get_result_reason (had a call in binary that I missed) * [ci optional] Use explicit formats in turb tester's write statements for consistency across compilers Co-authored-by: Warrick Ball <[email protected]> * Resolved some of Rob's comments re: turb (#324) Refactored to provide a public interface. Removed mkb. Fixed makefile. * [ci skip] Improved the turb interface and added comments. * [ci skip] More comments. * [ci skip] TDC comments. * [ci skip] Removed an unused variable. * Remove unused functions (#325) * [ci skip] Removed unused import of median_smoothing in rotation_mix_info. * [ci skip] Removed unused functions from star_utils. * [ci skip] Removed more functions. * [ci skip] Removed more functions. * [ci skip] Keep the old markdown to rst scripts In case we ever try to convert the old defaults into rst for sphinx I beleive these were all Josiah's orginally. * [ci skip] Link to the new turb documentation * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * [ci fpe] check fpe status * [ci fpe] check for [ci optional] fpes * double_bh does not like TDC, switching to Cox * [ci skip] remove unrelated changes on the inlist of 12M_pre_ms_to_core_collapse * fix for high_rot_darkening * restore jrot equation * Further adopt auto diff into rotation fp, ft and i_rot are now stored as auto_diff variables * fix compile error on binary * fix magnetic braking, move high_rot_darkening out of dev space * [ci skip] working on ppisn Co-authored-by: evbauer <[email protected]> Co-authored-by: Josiah Schwab <[email protected]> Co-authored-by: Adam Jermyn <[email protected]> Co-authored-by: Warrick Ball <[email protected]> Co-authored-by: Robert Farmer <[email protected]> Co-authored-by: Robert Farmer <[email protected]>
1 parent 5f2edda commit b9ce504

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+997
-809
lines changed

auto_diff/config/star_order1.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ name: auto_diff_real_star_order1
22
orders: [[1]]
33
array: True
44
fixed_length: True
5-
array_length: 27
5+
array_length: 33

auto_diff/config/tdc.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ name: auto_diff_real_tdc
22
orders: [[1,1]]
33
array: True
44
fixed_length: True
5-
array_length: 27
5+
array_length: 33

0 commit comments

Comments
 (0)