Skip to content

Commit

Permalink
Fix for issue TeamCOMPAS#1012
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffriley committed Dec 11, 2023
1 parent ea0a788 commit 1e3f58b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/BaseStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,8 @@ double BaseStar::InterpolateGe20QCrit( const QCRIT_PRESCRIPTION p_qCritPrescript
upperMassInd = 0;
}
else if (upperMassInd == -1) {
lowerMassInd = massesFromGe20.size() - 1;
upperMassInd = massesFromGe20.size() - 1;
lowerMassInd = massesFromGe20.size() - 1; // use last array entry
upperMassInd = massesFromGe20.size() - 1; // use last array entry
}

// Get vector of radii from GE20_QCRIT_AND_ZETA for the lower and upper mass indices
Expand Down Expand Up @@ -1416,8 +1416,8 @@ double BaseStar::InterpolateGe20QCrit( const QCRIT_PRESCRIPTION p_qCritPrescript
upperRadiusLowerMassInd = 0;
}
else if (upperRadiusLowerMassInd == -1) {
lowerRadiusLowerMassInd = logRadiusVectorLowerMass.size() - 1;
upperRadiusLowerMassInd = logRadiusVectorLowerMass.size() - 1;
lowerRadiusLowerMassInd = logRadiusVectorLowerMass.size() - 1; // use last array entry
upperRadiusLowerMassInd = logRadiusVectorLowerMass.size() - 1; // use last array entry
}

std::vector<int> indR1 = utils::binarySearch(logRadiusVectorUpperMass, log10(m_Radius));
Expand All @@ -1429,8 +1429,8 @@ double BaseStar::InterpolateGe20QCrit( const QCRIT_PRESCRIPTION p_qCritPrescript
upperRadiusUpperMassInd = 0;
}
else if (upperRadiusUpperMassInd == -1) {
lowerRadiusUpperMassInd = logRadiusVectorUpperMass.size() - 1;
upperRadiusUpperMassInd = logRadiusVectorUpperMass.size() - 1;
lowerRadiusUpperMassInd = logRadiusVectorUpperMass.size() - 1; // use last array entry
upperRadiusUpperMassInd = logRadiusVectorUpperMass.size() - 1; // use last array entry
}

// Set the 4 boundary points for the 2D interpolation
Expand Down
2 changes: 1 addition & 1 deletion src/changelog.h
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@
// - Added links to online documentation to splash string
// - Constants 'G1' and 'G_SN' renamed to 'G_AU_Msol_yr' and 'G_km_Msol_s' respectively
//
// 02.41.01 JR - Dec 11, 2023 - Defect repair:
// 02.41.01 JR - Dec 11, 2023 - Defect repair:
// - Fix for issue #1022 - incorrect value being used for last entry in array in BaseStar::InterpolateGe20QCrit()

const std::string VERSION_STRING = "02.41.01";
Expand Down

0 comments on commit 1e3f58b

Please sign in to comment.