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

Fix for issue 1317 #1320

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/BaseBinaryStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down
6 changes: 5 additions & 1 deletion src/changelog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Loading