diff --git a/compas_python_utils/preprocessing/compasConfigDefault.yaml b/compas_python_utils/preprocessing/compasConfigDefault.yaml index ea765ebb9..5d750753c 100644 --- a/compas_python_utils/preprocessing/compasConfigDefault.yaml +++ b/compas_python_utils/preprocessing/compasConfigDefault.yaml @@ -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 @@ -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'] diff --git a/online-docs/pages/User guide/Program options/program-options-list-defaults.rst b/online-docs/pages/User guide/Program options/program-options-list-defaults.rst index 60c7fca74..7c45d2e9f 100644 --- a/online-docs/pages/User guide/Program options/program-options-list-defaults.rst +++ b/online-docs/pages/User guide/Program options/program-options-list-defaults.rst @@ -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| diff --git a/online-docs/pages/whats-new.rst b/online-docs/pages/whats-new.rst index 8ee274d9b..8d69d92e4 100644 --- a/online-docs/pages/whats-new.rst +++ b/online-docs/pages/whats-new.rst @@ -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 diff --git a/src/BaseStar.cpp b/src/BaseStar.cpp index ddb060fd6..b60e23838 100755 --- a/src/BaseStar.cpp +++ b/src/BaseStar.cpp @@ -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; @@ -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 diff --git a/src/BaseStar.h b/src/BaseStar.h index ab214b77e..eee3b6bbc 100644 --- a/src/BaseStar.h +++ b/src/BaseStar.h @@ -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; diff --git a/src/CH.cpp b/src/CH.cpp index 7506b25ca..fa01bf707 100755 --- a/src/CH.cpp +++ b/src/CH.cpp @@ -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; @@ -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(*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 diff --git a/src/CH.h b/src/CH.h index ebf8ffa54..dd6ad1cb5 100755 --- a/src/CH.h +++ b/src/CH.h @@ -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 diff --git a/src/HeMS.cpp b/src/HeMS.cpp index e68e13263..a7420e3ab 100755 --- a/src/HeMS.cpp +++ b/src/HeMS.cpp @@ -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; diff --git a/src/HeMS.h b/src/HeMS.h index d813084bd..08a4786f3 100644 --- a/src/HeMS.h +++ b/src/HeMS.h @@ -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); diff --git a/src/Options.cpp b/src/Options.cpp index 5e23a18ed..11b387f7f 100644 --- a/src/Options.cpp +++ b/src/Options.cpp @@ -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; diff --git a/src/Options.h b/src/Options.h index bf697c764..14c79c7ff 100755 --- a/src/Options.h +++ b/src/Options.h @@ -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 @@ -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> deprecatedOptionStrings = { - { "retain-core-mass-during-caseA-mass-transfer", "", false } + std::vector> deprecatedOptionStrings = { + { "retain-core-mass-during-caseA-mass-transfer", "", false, "20250116" } }; - std::vector> 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> 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> deprecatedOptionProperties = { - { "black_hole_kicks", "black_hole_kicks_mode", false }, - { "lbv_prescription", "LBV-mass-loss-prescription", false } + std::vector> deprecatedOptionProperties = { + { "black_hole_kicks", "black_hole_kicks_mode", false, "20241030" }, + { "lbv_prescription", "LBV_mass_loss_prescription", false, "20241030" } }; diff --git a/src/Remnants.h b/src/Remnants.h index 61de3b109..d028a881a 100644 --- a/src/Remnants.h +++ b/src/Remnants.h @@ -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 diff --git a/src/changelog.h b/src/changelog.h index a9d09b764..76bd00e7c 100644 --- a/src/changelog.h +++ b/src/changelog.h @@ -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__ diff --git a/src/typedefs.h b/src/typedefs.h index c5e1deea2..8be1c4c4c 100755 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -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_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 diff --git a/src/utils.cpp b/src/utils.cpp index 228ea8951..05e895d59 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -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" @@ -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 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; + } } diff --git a/src/utils.h b/src/utils.h index 410aa83eb..a5e3d1e5a 100755 --- a/src/utils.h +++ b/src/utils.h @@ -1,7 +1,11 @@ #ifndef __utils_h__ #define __utils_h__ +#include + +#include #include +#include "hdf5.h" #include "constants.h" #include "typedefs.h" @@ -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);