From 30e032897f02e0c3c394445d94939d2af0d6816b Mon Sep 17 00:00:00 2001 From: Jeff Riley Date: Wed, 20 Aug 2025 16:48:09 +1000 Subject: [PATCH 1/2] Corrected calculations for Hurley A(n) and B(n) coefficients (see Hurley et al. 2000, appendix) --- src/BaseStar.cpp | 11 +++++++---- src/changelog.h | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/BaseStar.cpp b/src/BaseStar.cpp index a4949407b..a635a9b4b 100755 --- a/src/BaseStar.cpp +++ b/src/BaseStar.cpp @@ -533,13 +533,16 @@ void BaseStar::CalculateAnCoefficients(DBL_VECTOR &p_AnCoefficients, a[19] *= a[20]; a[29] = PPOW(a[29], (a[32])); a[33] = min(1.4, 1.5135 + (0.3769 * xi)); + a[33] = max(0.6355 - (0.4192 * xi), max(1.25, a[33])); a[42] = min(1.25, max(1.1, a[42])); a[44] = min(1.3, max(0.45, a[44])); a[49] = max(a[49], 0.145); a[50] = min(a[50], (0.306 + (0.053 * xi))); a[51] = min(a[51], (0.3625 + (0.062 * xi))); - a[52] = (utils::Compare(Z, 0.01) > 0) ? min(a[52], 1.0) : max(a[52], 0.9); - a[53] = (utils::Compare(Z, 0.01) > 0) ? min(a[53], 1.1) : max(a[53], 1.0); + a[52] = max(a[52], 0.9); + a[52] = (utils::Compare(Z, 0.01) > 0) ? min(a[52], 1.0) : a[52]; + a[53] = max(a[53], 1.0); + a[53] = (utils::Compare(Z, 0.01) > 0) ? min(a[53], 1.1) : a[53]; a[57] = min(1.4, a[57]); a[57] = max((0.6355 - (0.4192 * xi)), max(1.25, a[57])); a[62] = max(0.065, a[62]); @@ -633,8 +636,8 @@ void BaseStar::CalculateBnCoefficients(DBL_VECTOR &p_BnCoefficients) { b[1] = min(0.54, b[1]); b[2] = PPOW(10.0, (-4.6739 - (0.9394 * sigma))); b[2] = min(max(b[2], (-0.04167 + (55.67 * Z))), (0.4771 - (9329.21 * PPOW(Z, 2.94)))); - b[3] = max(-0.1451, (-2.2794 - (1.5175 * sigma) - (0.254 * sigma * sigma))); - b[3] = (utils::Compare(Z, 0.004) > 0) ? max(b[3], 0.7307 + (14265.1 * PPOW(Z, 3.395))) : PPOW(10.0, b[3]); + b[3] = PPOW(10.0, max(-0.1451, (-2.2794 - (1.5175 * sigma) - (0.254 * sigma * sigma)))); + b[3] = (utils::Compare(Z, 0.004) > 0) ? max(b[3], 0.7307 + (14265.1 * PPOW(Z, 3.395))) : b[3]; b[4] += 0.1231572 * xi_5; b[6] += 0.01640687 * xi_5; b[11] = b[11] * b[11]; diff --git a/src/changelog.h b/src/changelog.h index a862ee4c7..b42137af5 100644 --- a/src/changelog.h +++ b/src/changelog.h @@ -1655,7 +1655,8 @@ // fallback option, fixed remnant mass, and added lum and teff as attributes of RLOFProperties // 03.25.00 RTW - August 18, 2025 - Enhancement: // - Added KLENCKI_LINEAR AM loss, which is linear in the specific AM gamma instead of the orbital separation (as in MACLEOD_LINEAR) -// +// 03.25.01 JR - August 20, 2025 - Defect repairs: +// - Corrected calculations for Hurley A(n) and B(n) coefficients (see Hurley et al. 2000, appendix) // // Version string format is MM.mm.rr, where // @@ -1666,7 +1667,7 @@ // if MM is incremented, set mm and rr to 00, even if defect repairs and minor enhancements were also made // if mm is incremented, set rr to 00, even if defect repairs were also made -const std::string VERSION_STRING = "03.25.00"; +const std::string VERSION_STRING = "03.25.01"; # endif // __changelog_h__ From bab97edef28b137f089aeab75c471ff32e95c21c Mon Sep 17 00:00:00 2001 From: Jeff Riley Date: Wed, 20 Aug 2025 17:12:19 +1000 Subject: [PATCH 2/2] =?UTF-8?q?Corrected=20calculations=20for=20Hurley=20A?= =?UTF-8?q?(n)=20and=20B(n)=20coefficients=20(see=20Hurley=20et=20al.=2020?= =?UTF-8?q?00,=20appendix);=20Changed=20utils::GetGSLVersion()=20to=20avoi?= =?UTF-8?q?d=20compiler=20warning=20'warning:=20ignoring=20attributes=20on?= =?UTF-8?q?=20template=20argument=20=E2=80=98int=20(*)(FILE*)=E2=80=99=20[?= =?UTF-8?q?-Wignored-attributes]';=20Reverted=20Makefile=20line=20'SOURCES?= =?UTF-8?q?=20:=3D=20'=20to=20listing=20actual=20source=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Makefile | 51 ++++++++++++++++++++++++++++++++++++++++++++++++- src/changelog.h | 2 ++ src/utils.cpp | 2 +- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index b990e039d..7703335fa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,7 +19,56 @@ endif # Common variables for both builds EXE := $(BDIR)/COMPAS -SOURCES := $(wildcard *.cpp) + +SOURCES := \ + profiling.cpp \ + utils.cpp \ + yaml.cpp \ + vector3d.cpp \ + \ + Rand.cpp \ + Options.cpp \ + Log.cpp \ + Errors.cpp \ + \ + BaseStar.cpp \ + \ + Star.cpp \ + \ + MainSequence.cpp \ + MS_lte_07.cpp \ + MS_gt_07.cpp \ + \ + CH.cpp \ + \ + GiantBranch.cpp \ + HG.cpp \ + FGB.cpp \ + CHeB.cpp \ + EAGB.cpp \ + TPAGB.cpp \ + \ + HeMS.cpp \ + HeHG.cpp \ + HeGB.cpp \ + \ + Remnants.cpp \ + \ + WhiteDwarfs.cpp \ + HeWD.cpp \ + COWD.cpp \ + ONeWD.cpp \ + \ + NS.cpp \ + BH.cpp \ + MR.cpp \ + \ + BinaryConstituentStar.cpp \ + BaseBinaryStar.cpp \ + BinaryStar.cpp \ + \ + main.cpp + OBJS := $(patsubst %.cpp,$(ODIR)/%.o,$(SOURCES)) # GSL, Boost, and HDF5 directories diff --git a/src/changelog.h b/src/changelog.h index b42137af5..175768c45 100644 --- a/src/changelog.h +++ b/src/changelog.h @@ -1657,6 +1657,8 @@ // - Added KLENCKI_LINEAR AM loss, which is linear in the specific AM gamma instead of the orbital separation (as in MACLEOD_LINEAR) // 03.25.01 JR - August 20, 2025 - Defect repairs: // - Corrected calculations for Hurley A(n) and B(n) coefficients (see Hurley et al. 2000, appendix) +// - Changed utils::GetGSLVersion() to avoid compiler warning "warning: ignoring attributes on template argument ‘int (*)(FILE*)’ [-Wignored-attributes]" +// - Reverted Makefile line "SOURCES := $(wildcard *.cpp)" to listing actual source files // // Version string format is MM.mm.rr, where // diff --git a/src/utils.cpp b/src/utils.cpp index 05e895d59..536ec934e 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1836,7 +1836,7 @@ namespace utils { std::string versionStr = "Not available"; // default return value char buffer[128]; // command return buffer - std::unique_ptr pipe(popen("gsl-config --version", "r"), pclose); // open pipe for command + std::unique_ptr pipe(popen("gsl-config --version", "r"), &pclose); // open pipe for command if (pipe) { // ok? versionStr = ""; // yes while (fgets(buffer, sizeof(buffer), pipe.get()) != nullptr) versionStr += buffer; // copy buffer