Skip to content
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
4 changes: 2 additions & 2 deletions compas_python_utils/preprocessing/compasConfigDefault.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##~!!~## COMPAS option values
##~!!~## File Created Wed Jun 25 11:07:34 2025 by COMPAS v03.20.06
##~!!~## File Created Thu Jul 17 09:38:18 2025 by COMPAS v03.21.00
##~!!~##
##~!!~## The default COMPAS YAML file (``compasConfigDefault.yaml``), as distributed, has
##~!!~## all COMPAS option entries commented so that the COMPAS default value for the
Expand Down Expand Up @@ -243,7 +243,7 @@ stringChoices:
# --initial-mass-function: 'KROUPA' # Default: 'KROUPA' # Options: ['KROUPA','UNIFORM','POWERLAW','SALPETER']
# --LBV-mass-loss-prescription: 'HURLEY_ADD' # Default: 'HURLEY_ADD' # Options: ['BELCZYNSKI','HURLEY','HURLEY_ADD','ZERO']
# --main-sequence-core-mass-prescription: 'MANDEL' # Default: 'MANDEL' # Options: ['BRCEK','MANDEL','ZERO']
# --mass-loss-prescription: 'MERRITT2024' # Default: 'MERRITT2024' # Options: ['MERRITT2024','BELCZYNSKI2010','HURLEY','ZERO']
# --mass-loss-prescription: 'MERRITT2025' # Default: 'MERRITT2025' # Options: ['MERRITT2025','BELCZYNSKI2010','HURLEY','ZERO']
# --OB-mass-loss-prescription: 'VINK2021' # Default: 'VINK2021' # Options: ['KRTICKA2018','BJORKLUND2022','VINK2021','VINK2001','ZERO']
# --RSG-mass-loss-prescription: 'DECIN2023' # Default: 'DECIN2023' # Options: ['NJ90','KEE2021','YANG2023','DECIN2023','BEASOR2020','VINKSABHAHIT2023','ZERO']
# --VMS-mass-loss-prescription: 'SABHAHIT2023' # Default: 'SABHAHIT2023' # Options: ['SABHAHIT2023','BESTENLEHNER2020','VINK2011','ZERO']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -826,12 +826,12 @@ Default = 0.0

**--mass-loss-prescription** |br|
Mass loss prescription. |br|
Options: { ZERO, HURLEY, BELCZYNSKI2010, MERRITT2024 } |br|
Options: { ZERO, HURLEY, BELCZYNSKI2010, MERRITT2025 } |br|
``ZERO`` : No wind mass loss |br|
``HURLEY`` : Mass loss according to Hurley (2000) |br|
``BELCZYNSKI2010``: Mass loss as per Belczynski (2010), and the default prior to 2023 |br|
``MERRITT2024`` : Flexible mass loss with phase specific options: (OB, RSG, WR, VMS) |br|
Default = MERRITT2024 |br|
``MERRITT2025`` : Flexible mass loss with phase specific options: (OB, RSG, WR, VMS) |br|
Default = MERRITT2025 |br|

**--mass-ratio [ -q ]** |br|
Mass ratio :math:`\frac{m2}{m1}` used to determine secondary mass if not specified via ``--initial-mass-2``. |br|
Expand Down
5 changes: 5 additions & 0 deletions online-docs/pages/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ What's new

Following is a brief list of important updates to the COMPAS code. A complete record of changes can be found in the file ``changelog.h``.

**03.20=1.00 July 17, 2025**

* Deprecated mass loss prescription MERRITT2024 in favour of MERRITT2025
* Added version strings for gsl, boost, and HDF5 to COMPAS splashscreen

**03.20.06 June 25, 2025**

* The MAXWELLIAN NS CCSN kick changed from the Hobbs value of 265 km/s to 217 km/s based on 48 younger than 10 Myr pulsars with proper motions from Disberg & Mandel (2025) sample; corrects Hobbs+ 2005 missing Jacobian
Expand Down
8 changes: 4 additions & 4 deletions src/BaseStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2469,11 +2469,11 @@ double BaseStar::CalculateMassLossRateBelczynski2010() {
* or are added to other wind mass loss if LBV_MASS_LOSS_PRESCRIPTION::HURLEY_ADD is used.
*
*
* double CalculateMassLossRateMerritt2024()
* double CalculateMassLossRateMerritt2025()
*
* @return Mass loss rate in Msol per year
*/
double BaseStar::CalculateMassLossRateMerritt2024() {
double BaseStar::CalculateMassLossRateMerritt2025() {

m_DominantMassLossRate = MASS_LOSS_TYPE::NONE;

Expand Down Expand Up @@ -2550,8 +2550,8 @@ double BaseStar::CalculateMassLossRate() {
mDot = CalculateMassLossRateBelczynski2010();
break;

case MASS_LOSS_PRESCRIPTION::MERRITT2024:
mDot = CalculateMassLossRateMerritt2024();
case MASS_LOSS_PRESCRIPTION::MERRITT2025:
mDot = CalculateMassLossRateMerritt2025();
break;

default: // unknown prescription
Expand Down
2 changes: 1 addition & 1 deletion src/BaseStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ class BaseStar {
double CalculateMassLossRateVMSSabhahit2023();
double CalculateMassLossRateVMSVink2011() const;
virtual double CalculateMassLossRateBelczynski2010();
virtual double CalculateMassLossRateMerritt2024();
virtual double CalculateMassLossRateMerritt2025();
double CalculateMassLossRateWolfRayetZDependent(const double p_Mu) const;
double CalculateMassLossRateWolfRayet(const double p_Mu) const;
double CalculateMassLossRateWolfRayetSanderVink2020(const double p_Mu) const;
Expand Down
6 changes: 3 additions & 3 deletions src/CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ double CH::CalculateMassLossRateBelczynski2010() {
*
* Modifications for CH stars
*
* double CalculateMassLossRateMerritt2024()
* double CalculateMassLossRateMerritt2025()
*
* @return Mass loss rate in Msol per year
*/
double CH::CalculateMassLossRateMerritt2024() {
double CH::CalculateMassLossRateMerritt2025() {

// Define variables
double Mdot = 0.0;
Expand All @@ -396,7 +396,7 @@ double CH::CalculateMassLossRateMerritt2024() {
// cloning it, so that we can ask it what its mass loss rate would be if it were
// a HeMS star
HeMS *clone = HeMS::Clone((HeMS&)static_cast<const CH&>(*this), OBJECT_PERSISTENCE::EPHEMERAL, false); // Do not initialise so that we can use same mass, luminosity, radius etc
MdotWR = clone->CalculateMassLossRateMerritt2024(); // Calculate WR mass loss rate
MdotWR = clone->CalculateMassLossRateMerritt2025(); // Calculate WR mass loss rate
delete clone; clone = nullptr; // return the memory allocated for the clone

// Calculate weight for combining these into total mass-loss rate
Expand Down
2 changes: 1 addition & 1 deletion src/CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class CH: virtual public BaseStar, public MS_gt_07 {

// Mass loss rate
double CalculateMassLossRateBelczynski2010();
double CalculateMassLossRateMerritt2024();
double CalculateMassLossRateMerritt2025();
double CalculateMassLossRateWeightOB(const double p_HeliumAbundanceSurface);

// Radius
Expand Down
4 changes: 2 additions & 2 deletions src/HeMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ double HeMS::CalculateMassLossRateWolfRayetShenar2019() const {
* Calculate the mass loss rate for helium stars in the updated prescription
* Uses Sander & Vink 2020 for Wolf--Rayet stars
*
* double CalculateMassLossRateMerritt2024()
* double CalculateMassLossRateMerritt2025()
*
* @return Mass loss rate in Msol per year
*/
double HeMS::CalculateMassLossRateMerritt2024() {
double HeMS::CalculateMassLossRateMerritt2025() {

double MdotWR = 0.0;

Expand Down
2 changes: 1 addition & 1 deletion src/HeMS.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class HeMS: virtual public BaseStar, public TPAGB {
static double CalculateLuminosityAtPhaseEnd_Static(const double p_Mass);

double CalculateMassLossRateBelczynski2010();
double CalculateMassLossRateMerritt2024();
double CalculateMassLossRateMerritt2025();

static DBL_DBL CalculateRadiusAtPhaseEnd_Static(const double p_Mass, const double p_Luminosity);
static double CalculateRadiusAtZAMS_Static(const double p_Mass);
Expand Down
2 changes: 1 addition & 1 deletion src/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ void Options::OptionValues::Initialise() {
m_ExpelConvectiveEnvelopeAboveLuminosityThreshold = false;
m_LuminosityToMassThreshold = 4.2; // Podsiadlowski, private communication

m_MassLossPrescription.type = MASS_LOSS_PRESCRIPTION::MERRITT2024;
m_MassLossPrescription.type = MASS_LOSS_PRESCRIPTION::MERRITT2025;
m_MassLossPrescription.typeString = MASS_LOSS_PRESCRIPTION_LABEL.at(m_MassLossPrescription.type);

m_LBVMassLossPrescription.type = LBV_MASS_LOSS_PRESCRIPTION::HURLEY_ADD;
Expand Down
29 changes: 18 additions & 11 deletions src/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ class Options {
// be "false" in the vector, and will be set true if and when the deprecation notice for that
// option is shown the first time in a COMPAS run (a deprecation notice for a deprecated option
// is only shown once per COMPAS run).
// - datestring indicating the date the option string was deprecated. Deprecated option strings
// should be manually removed from the "deprecatedOptionStrings" vector 12 months (too long?)
// after the deprecation date. Datestring format is yyyymmdd (e.g.20251107 indicates November 07, 2025).
//
//
// "deprecatedOptionValues" vector
Expand All @@ -216,23 +219,27 @@ class Options {
// be "false" in the vector, and will be set true if and when the deprecation notice for that option
// value is shown the first time in a COMPAS run (a deprecation notice for a deprecated option value
// is only shown once per COMPAS run).
// - datestring indicating the date the option string was deprecated. Deprecated option values should
// be manually removed from the "deprecatedOptionValues" vector 12 months (too long?) after the
// deprecation date. Datestring format is yyyymmdd (e.g.20251107 indicates November 07, 2025).

std::vector<std::tuple<std::string, std::string, bool>> deprecatedOptionStrings = {
{ "retain-core-mass-during-caseA-mass-transfer", "", false }
std::vector<std::tuple<std::string, std::string, bool, std::string>> deprecatedOptionStrings = {
{ "retain-core-mass-during-caseA-mass-transfer", "", false, "20250116" }
};

std::vector<std::tuple<std::string, std::string, std::string, bool>> deprecatedOptionValues = {
{ "critical-mass-ratio-prescription", "GE20", "GE", false },
{ "critical-mass-ratio-prescription", "GE20_IC", "GE_IC", false },
{ "pulsational-pair-instability-prescription", "COMPAS", "WOOSLEY", false },
{ "pulsar-birth-spin-period-distribution", "ZERO", "NOSPIN", false },
{ "tides-prescription", "KAPIL2024", "KAPIL2025", false }
std::vector<std::tuple<std::string, std::string, std::string, bool, std::string>> deprecatedOptionValues = {
{ "critical-mass-ratio-prescription", "GE20", "GE", false, "20241118" },
{ "critical-mass-ratio-prescription", "GE20_IC", "GE_IC", false, "20241118" },
{ "pulsational-pair-instability-prescription", "COMPAS", "WOOSLEY", false, "20250208" },
{ "pulsar-birth-spin-period-distribution", "ZERO", "NOSPIN", false, "20250303" },
{ "tides-prescription", "KAPIL2024", "KAPIL2025", false, "20250525" },
{ "mass-loss-prescription", "MERRITT2024", "MERRITT2025", false, "20250717" }
};

// the following vector is used to replace deprecated options in the logfile-definitions file
std::vector<std::tuple<std::string, std::string, bool>> deprecatedOptionProperties = {
{ "black_hole_kicks", "black_hole_kicks_mode", false },
{ "lbv_prescription", "LBV-mass-loss-prescription", false }
std::vector<std::tuple<std::string, std::string, bool, std::string>> deprecatedOptionProperties = {
{ "black_hole_kicks", "black_hole_kicks_mode", false, "20241030" },
{ "lbv_prescription", "LBV_mass_loss_prescription", false, "20241030" }
};


Expand Down
2 changes: 1 addition & 1 deletion src/Remnants.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Remnants: virtual public BaseStar, public HeGB {

double CalculateMassLossRateHurley() { m_DominantMassLossRate = MASS_LOSS_TYPE::NONE ; return 0.0; }
double CalculateMassLossRateBelczynski2010() { m_DominantMassLossRate = MASS_LOSS_TYPE::NONE ; return 0.0; }
double CalculateMassLossRateMerritt2024() { m_DominantMassLossRate = MASS_LOSS_TYPE::NONE ; return 0.0; } //
double CalculateMassLossRateMerritt2025() { m_DominantMassLossRate = MASS_LOSS_TYPE::NONE ; return 0.0; } //

double CalculatePerturbationMuOnPhase() const { return m_Mu; } // NO-OP

Expand Down
16 changes: 15 additions & 1 deletion src/changelog.h
Original file line number Diff line number Diff line change
Expand Up @@ -1599,8 +1599,22 @@
// - Fixed error in MainSequence::CalculateInitialMainSequenceCoreMass()
// 03.20.09 RTW - Jun 30, 2025 - Enhancement:
// - Added individual velocity components for stars to the LogTypedefs file so they can be included in the output (as ANY_STAR_PROPERTY::VELOCITY_X, or Y, Z)
// 03.21.00 JR - Jun 30, 2025 - Enhancement:
// - Changed mass loss prescription MERRITT2024 to MERRIT2025; deprecated MERRIT2024
// - Added datestrings to vectors supporting deprecation in Options.h to allow timely removal
// - Added version strings for gsl, boost, and HDF5 to COMPAS splashscreen (for now, gsl & hdf5 are installed versions, boost is version compiled with COMPAS)

const std::string VERSION_STRING = "03.20.09";

// Version string format is MM.mm.rr, where
//
// MM is the MAJOR release number: this should be incremented whenever major new functionality is introduced
// mm is the MINOR release number: this should be incremented whenever minor new functionality (e.g. small enhancemet) is introduced
// rr is the fix RELEASE number: this should be incremented whenever a defect repair is made
//
// 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.21.00";


# endif // __changelog_h__
4 changes: 2 additions & 2 deletions src/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,12 +598,12 @@ enum class MASS_CUTOFF: int {
};

// mass loss prescriptions
enum class MASS_LOSS_PRESCRIPTION: int { ZERO, HURLEY, BELCZYNSKI2010, MERRITT2024 };
enum class MASS_LOSS_PRESCRIPTION: int { ZERO, HURLEY, BELCZYNSKI2010, MERRITT2025 };
const COMPASUnorderedMap<MASS_LOSS_PRESCRIPTION, std::string> MASS_LOSS_PRESCRIPTION_LABEL = {
{ MASS_LOSS_PRESCRIPTION::ZERO, "ZERO" },
{ MASS_LOSS_PRESCRIPTION::HURLEY, "HURLEY" },
{ MASS_LOSS_PRESCRIPTION::BELCZYNSKI2010, "BELCZYNSKI2010" },
{ MASS_LOSS_PRESCRIPTION::MERRITT2024, "MERRITT2024" }
{ MASS_LOSS_PRESCRIPTION::MERRITT2025, "MERRITT2025" }
};

// symbolic names for mass loss rate type
Expand Down
49 changes: 48 additions & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ namespace utils {

// Construct the splash string
std::string splashString = "\nCOMPAS v" +
VERSION_STRING +
VERSION_STRING + " (gsl v" + GetGSLVersion() + ", boost v" + GetBOOSTVersion() + ", HDF5 v" + GetHDF5Version() + ")" +
"\nCompact Object Mergers: Population Astrophysics and Statistics"
"\nby Team COMPAS (http://compas.science/index.html)"
"\nA binary star simulator\n"
Expand Down Expand Up @@ -1820,4 +1820,51 @@ namespace utils {
}
}
}


/*
* Returns gsl version string
*
*
* std::string GetGSLVersion()
*
* @return String containing GSL version in format MM.mm.rr
* Will be "Not available" if not able to retrieve the actual value
*/
std::string GetGSLVersion() {

std::string versionStr = "Not available"; // default return value

char buffer[128]; // command return buffer
std::unique_ptr<FILE, decltype(&pclose)> 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
if (!versionStr.empty() && versionStr[versionStr.length() - 1] == '\n') versionStr.pop_back(); // remove trailing newline if necessary
}

return versionStr;
}


/*
* Returns HDF5 library version string
*
*
* std::string GetHDF5Version()
*
* @return String containing HDF5 library version in format MM.mm.rr
* Will be "Not available" if not able to retrieve the actual value
*/
std::string GetHDF5Version() {

std::string versionStr = "Not available"; // default return value

unsigned majorNum, minorNum, releaseNum;
herr_t status = H5get_libversion(&majorNum, &minorNum, &releaseNum); // retrieve HDF5 library version
if (status >= 0) // ok?
versionStr = std::to_string(majorNum) + "." + std::to_string(minorNum) + "." + std::to_string(releaseNum); // yes - set version string

return versionStr;
}
}
8 changes: 8 additions & 0 deletions src/utils.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#ifndef __utils_h__
#define __utils_h__

#include <memory>

#include <boost/version.hpp>
#include <boost/filesystem.hpp>
#include "hdf5.h"

#include "constants.h"
#include "typedefs.h"
Expand Down Expand Up @@ -83,6 +87,10 @@ namespace utils {
return std::make_tuple(false, p_Default);
}

inline std::string GetBOOSTVersion() { return std::to_string(BOOST_VERSION / 100000) + "." + std::to_string(BOOST_VERSION / 100 % 1000) + "." + std::to_string(BOOST_VERSION % 100); }
std::string GetGSLVersion();
std::string GetHDF5Version();

double intPow(const double p_Base, const int p_Exponent);

double InverseSampleFromPowerLaw(const double p_Power, const double p_Xmax, const double p_Xmin);
Expand Down