diff --git a/src/BaseBinaryStar.cpp b/src/BaseBinaryStar.cpp index 93f4a033e..3ffbfeb96 100644 --- a/src/BaseBinaryStar.cpp +++ b/src/BaseBinaryStar.cpp @@ -2908,8 +2908,8 @@ void BaseBinaryStar::EvaluateBinary(const double p_Dt) { } } - if (!StellarMerger()) { // stellar merger? - // no - continue evolution + if (!StellarMerger() || (HasOneOf({ STELLAR_TYPE::MASSLESS_REMNANT }) && OPTIONS->EvolveMainSequenceMergers())) { // check stellar merger or evolving MS mergers + // continue evolution if ((m_Star1->IsSNevent() || m_Star2->IsSNevent())) { EvaluateSupernovae(); // evaluate supernovae (both stars) if mass changes are responsible for a supernova (void)PrintDetailedOutput(m_Id, BSE_DETAILED_RECORD_TYPE::POST_SN); // print (log) detailed output @@ -3163,23 +3163,25 @@ EVOLUTION_STATUS BaseBinaryStar::Evolve() { } } - (void)PrintDetailedOutput(m_Id, BSE_DETAILED_RECORD_TYPE::PRE_STELLAR_TIMESTEP); // print (log) detailed output - if (evolutionStatus == EVOLUTION_STATUS::CONTINUE) { // continue evolution? // yes + (void)PrintDetailedOutput(m_Id, BSE_DETAILED_RECORD_TYPE::PRE_STELLAR_TIMESTEP); // print (log) detailed output + error = EvolveOneTimestep(dt); // evolve the binary system one timestep if (error != ERROR::NONE) { // SSE error for either constituent star? evolutionStatus = EVOLUTION_STATUS::SSE_ERROR; // yes - stop evolution } - else { // continue evolution + } - (void)PrintDetailedOutput(m_Id, BSE_DETAILED_RECORD_TYPE::TIMESTEP_COMPLETED); // print (log) detailed output: this is after all changes made in the timestep + (void)PrintDetailedOutput(m_Id, BSE_DETAILED_RECORD_TYPE::TIMESTEP_COMPLETED); // print (log) detailed output: this is after all changes made in the timestep - if (stepNum >= OPTIONS->MaxNumberOfTimestepIterations()) evolutionStatus = EVOLUTION_STATUS::STEPS_UP; // number of timesteps for evolution exceeds maximum - else if (evolutionStatus == EVOLUTION_STATUS::CONTINUE && usingProvidedTimesteps && stepNum >= timesteps.size()) { // using user-provided timesteps and all consumed - evolutionStatus = EVOLUTION_STATUS::TIMESTEPS_EXHAUSTED; // yes - set status - SHOW_WARN(ERROR::TIMESTEPS_EXHAUSTED); // show warning - } + + if (evolutionStatus == EVOLUTION_STATUS::CONTINUE) { // continue evolution? + // yes + if (stepNum >= OPTIONS->MaxNumberOfTimestepIterations()) evolutionStatus = EVOLUTION_STATUS::STEPS_UP; // number of timesteps for evolution exceeds maximum + else if (evolutionStatus == EVOLUTION_STATUS::CONTINUE && usingProvidedTimesteps && stepNum >= timesteps.size()) { // using user-provided timesteps and all consumed + evolutionStatus = EVOLUTION_STATUS::TIMESTEPS_EXHAUSTED; // yes - set status + SHOW_WARN(ERROR::TIMESTEPS_EXHAUSTED); // show warning } if (evolutionStatus == EVOLUTION_STATUS::CONTINUE) { // continue evolution? diff --git a/src/changelog.h b/src/changelog.h index fc9d05f50..e9c911028 100644 --- a/src/changelog.h +++ b/src/changelog.h @@ -1423,7 +1423,11 @@ // - fix for issue #1310 - run terminates prematurely if error in grid file // 03.10.04 RTW - Nov 27, 2024 - Defect repair: // - fix for issue #1247 - SN Euler angles had incomplete logic, leading to a div by zero in some cases +// 03.10.05 JR - Jan 08, 2025 - Defect repair: +// - fix for issue #1317 - SN events not always logged in BSE SN file when evolving MS merger products +// - added code to ensure final BSE detailed output file TIMESTEP_COMPLETED record is always logged +// (may duplicate FINAL_STATE record, but logging TIMESTEP_COMPLETED is consistent, and it's what most people look for) -const std::string VERSION_STRING = "03.10.04"; +const std::string VERSION_STRING = "03.10.05"; # endif // __changelog_h__