Skip to content

Commit 4941c41

Browse files
authored
Merge pull request #1431 from TeamCOMPAS/coeffs
Defect repairs
2 parents fe1e5ff + bab97ed commit 4941c41

File tree

4 files changed

+63
-8
lines changed

4 files changed

+63
-8
lines changed

src/BaseStar.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,16 @@ void BaseStar::CalculateAnCoefficients(DBL_VECTOR &p_AnCoefficients,
533533
a[19] *= a[20];
534534
a[29] = PPOW(a[29], (a[32]));
535535
a[33] = min(1.4, 1.5135 + (0.3769 * xi));
536+
a[33] = max(0.6355 - (0.4192 * xi), max(1.25, a[33]));
536537
a[42] = min(1.25, max(1.1, a[42]));
537538
a[44] = min(1.3, max(0.45, a[44]));
538539
a[49] = max(a[49], 0.145);
539540
a[50] = min(a[50], (0.306 + (0.053 * xi)));
540541
a[51] = min(a[51], (0.3625 + (0.062 * xi)));
541-
a[52] = (utils::Compare(Z, 0.01) > 0) ? min(a[52], 1.0) : max(a[52], 0.9);
542-
a[53] = (utils::Compare(Z, 0.01) > 0) ? min(a[53], 1.1) : max(a[53], 1.0);
542+
a[52] = max(a[52], 0.9);
543+
a[52] = (utils::Compare(Z, 0.01) > 0) ? min(a[52], 1.0) : a[52];
544+
a[53] = max(a[53], 1.0);
545+
a[53] = (utils::Compare(Z, 0.01) > 0) ? min(a[53], 1.1) : a[53];
543546
a[57] = min(1.4, a[57]);
544547
a[57] = max((0.6355 - (0.4192 * xi)), max(1.25, a[57]));
545548
a[62] = max(0.065, a[62]);
@@ -633,8 +636,8 @@ void BaseStar::CalculateBnCoefficients(DBL_VECTOR &p_BnCoefficients) {
633636
b[1] = min(0.54, b[1]);
634637
b[2] = PPOW(10.0, (-4.6739 - (0.9394 * sigma)));
635638
b[2] = min(max(b[2], (-0.04167 + (55.67 * Z))), (0.4771 - (9329.21 * PPOW(Z, 2.94))));
636-
b[3] = max(-0.1451, (-2.2794 - (1.5175 * sigma) - (0.254 * sigma * sigma)));
637-
b[3] = (utils::Compare(Z, 0.004) > 0) ? max(b[3], 0.7307 + (14265.1 * PPOW(Z, 3.395))) : PPOW(10.0, b[3]);
639+
b[3] = PPOW(10.0, max(-0.1451, (-2.2794 - (1.5175 * sigma) - (0.254 * sigma * sigma))));
640+
b[3] = (utils::Compare(Z, 0.004) > 0) ? max(b[3], 0.7307 + (14265.1 * PPOW(Z, 3.395))) : b[3];
638641
b[4] += 0.1231572 * xi_5;
639642
b[6] += 0.01640687 * xi_5;
640643
b[11] = b[11] * b[11];

src/Makefile

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,56 @@ endif
1919

2020
# Common variables for both builds
2121
EXE := $(BDIR)/COMPAS
22-
SOURCES := $(wildcard *.cpp)
22+
23+
SOURCES := \
24+
profiling.cpp \
25+
utils.cpp \
26+
yaml.cpp \
27+
vector3d.cpp \
28+
\
29+
Rand.cpp \
30+
Options.cpp \
31+
Log.cpp \
32+
Errors.cpp \
33+
\
34+
BaseStar.cpp \
35+
\
36+
Star.cpp \
37+
\
38+
MainSequence.cpp \
39+
MS_lte_07.cpp \
40+
MS_gt_07.cpp \
41+
\
42+
CH.cpp \
43+
\
44+
GiantBranch.cpp \
45+
HG.cpp \
46+
FGB.cpp \
47+
CHeB.cpp \
48+
EAGB.cpp \
49+
TPAGB.cpp \
50+
\
51+
HeMS.cpp \
52+
HeHG.cpp \
53+
HeGB.cpp \
54+
\
55+
Remnants.cpp \
56+
\
57+
WhiteDwarfs.cpp \
58+
HeWD.cpp \
59+
COWD.cpp \
60+
ONeWD.cpp \
61+
\
62+
NS.cpp \
63+
BH.cpp \
64+
MR.cpp \
65+
\
66+
BinaryConstituentStar.cpp \
67+
BaseBinaryStar.cpp \
68+
BinaryStar.cpp \
69+
\
70+
main.cpp
71+
2372
OBJS := $(patsubst %.cpp,$(ODIR)/%.o,$(SOURCES))
2473

2574
# GSL, Boost, and HDF5 directories

src/changelog.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,10 @@
16551655
// fallback option, fixed remnant mass, and added lum and teff as attributes of RLOFProperties
16561656
// 03.25.00 RTW - August 18, 2025 - Enhancement:
16571657
// - Added KLENCKI_LINEAR AM loss, which is linear in the specific AM gamma instead of the orbital separation (as in MACLEOD_LINEAR)
1658-
//
1658+
// 03.25.01 JR - August 20, 2025 - Defect repairs:
1659+
// - Corrected calculations for Hurley A(n) and B(n) coefficients (see Hurley et al. 2000, appendix)
1660+
// - Changed utils::GetGSLVersion() to avoid compiler warning "warning: ignoring attributes on template argument ‘int (*)(FILE*)’ [-Wignored-attributes]"
1661+
// - Reverted Makefile line "SOURCES := $(wildcard *.cpp)" to listing actual source files
16591662
//
16601663
// Version string format is MM.mm.rr, where
16611664
//
@@ -1666,7 +1669,7 @@
16661669
// if MM is incremented, set mm and rr to 00, even if defect repairs and minor enhancements were also made
16671670
// if mm is incremented, set rr to 00, even if defect repairs were also made
16681671

1669-
const std::string VERSION_STRING = "03.25.00";
1672+
const std::string VERSION_STRING = "03.25.01";
16701673

16711674

16721675
# endif // __changelog_h__

src/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ namespace utils {
18361836
std::string versionStr = "Not available"; // default return value
18371837

18381838
char buffer[128]; // command return buffer
1839-
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen("gsl-config --version", "r"), pclose); // open pipe for command
1839+
std::unique_ptr<FILE, int(*)(FILE*)> pipe(popen("gsl-config --version", "r"), &pclose); // open pipe for command
18401840
if (pipe) { // ok?
18411841
versionStr = ""; // yes
18421842
while (fgets(buffer, sizeof(buffer), pipe.get()) != nullptr) versionStr += buffer; // copy buffer

0 commit comments

Comments
 (0)