Skip to content

Commit 573e9bc

Browse files
committed
Issue 1211 + minor fixes
1 parent 9e04db7 commit 573e9bc

File tree

8 files changed

+46
-22
lines changed

8 files changed

+46
-22
lines changed

online-docs/pages/User guide/Program options/program-options-list-defaults.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ Default = Sampled from the mass ratio distribution specified by ``--mass-ratio-d
518518
**--initial-mass-function [ -i ]** |br|
519519
Initial mass function. |br|
520520
Options: { SALPETER, POWERLAW, UNIFORM, KROUPA } |br|
521-
``SALPETER`` and ``KROUPA`` use the IMFs of Salpeter 1955 and Kroupa 2001 |br|
521+
``SALPETER`` and ``KROUPA`` use the IMFs of Salpeter 1955 and Kroupa 2001, bounded by ``--initial-mass-function-min`` and ``--initial-mass-function-max`` |br|
522522
``POWERLAW`` is a single power law with slope ``--initial-mass-function-power`` |br|
523523
``UNIFORM`` is a uniform distribution between ``--initial-mass-function-min`` and ``--initial-mass-function-max`` |br|
524524
Default = KROUPA
@@ -1495,7 +1495,7 @@ Go to :ref:`the top of this page <options-props-top>` for the full alphabetical
14951495

14961496
**Initial conditions**
14971497

1498-
--initial-mass-function, --initial-mass, --initial-mass-1, --initial-mass-2, --initial-mass-function-min, --initial-mass-function-max, --initial-mass-power
1498+
--initial-mass-function, --initial-mass, --initial-mass-1, --initial-mass-2, --initial-mass-function-min, --initial-mass-function-max, --initial-mass-function-power
14991499

15001500
--mass-ratio-distribution, --mass-ratio, --mass-ratio-min, --mass-ratio-max, --minimum-sampled-secondary-mass
15011501

online-docs/pages/whats-new.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ What's new
33

44
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``.
55

6+
**03.23.00 August 09, 2025**
7+
8+
* The following option is now deprecated, and will be removed in 1 year:
9+
10+
* ``--use-mass-loss`` in favour of ``--mass-loss-prescription``
11+
12+
Instead of using ``--use-mass-loss`` or ``--use-mass-loss true`` to enable mass loss, then specifying the mass loss prescription to be used with
13+
``--mass-loss-prescription``, mass loss can be enabled using ``--mass-loss-prescription`` with any valid prescription (that is not ``zero``), and
14+
disabled with ``--mass-loss-prescription zero`` instead of ``use-mass-loss false``.
15+
616
**03.22.02 August 08, 2025**
717

818
* The following options are now deprecated, and will be removed in 1 year:

src/BaseBinaryStar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,8 +1987,8 @@ void BaseBinaryStar::CalculateWindsMassLoss(double p_Dt) {
19871987
m_Star2->HaltWinds();
19881988
}
19891989
else {
1990-
if (OPTIONS->UseMassLoss()) { // mass loss enabled?
1991-
1990+
if (OPTIONS->MassLossPrescription() != MASS_LOSS_PRESCRIPTION::ZERO) { // mass loss enabled?
1991+
// yes
19921992
double mWinds1 = m_Star1->CalculateMassLossValues(p_Dt, true); // calculate new values assuming mass loss applied
19931993
double mWinds2 = m_Star2->CalculateMassLossValues(p_Dt, true); // calculate new values assuming mass loss applied
19941994

src/BaseStar.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ double BaseStar::CalculateMassLossRate() {
25262526

25272527
double mDot = 0.0; // default return value
25282528

2529-
if (OPTIONS->UseMassLoss()) { // mass loss enabled?
2529+
if (OPTIONS->MassLossPrescription() != MASS_LOSS_PRESCRIPTION::ZERO) { // mass loss enabled?
25302530
// yes
25312531
double LBVRate;
25322532
double otherWindsRate;
@@ -2565,7 +2565,7 @@ double BaseStar::CalculateMassLossRate() {
25652565
THROW_ERROR(ERROR::UNKNOWN_MASS_LOSS_PRESCRIPTION); // throw error
25662566
}
25672567

2568-
mDot = mDot * OPTIONS->OverallWindMassLossMultiplier(); // apply overall wind mass loss multiplier
2568+
mDot *= OPTIONS->OverallWindMassLossMultiplier(); // apply overall wind mass loss multiplier
25692569
}
25702570

25712571
mDot = min(mDot, MAXIMUM_WIND_MASS_LOSS_RATE); // cap winds at a maximum mass loss rate (typically 0.1 solar masses per year) to avoid convergence issues
@@ -2598,8 +2598,8 @@ double BaseStar::CalculateMassLossValues(double p_Dt, const bool p_UpdateMDot) {
25982598

25992599
double mass = m_Mass;
26002600

2601-
if (OPTIONS->UseMassLoss()) { // only if using mass loss (program option)
2602-
2601+
if (OPTIONS->MassLossPrescription() != MASS_LOSS_PRESCRIPTION::ZERO) { // mass loss enabled?
2602+
// yes
26032603
double mDot = CalculateMassLossRate(); // calculate mass loss rate
26042604
double massLoss = max(0.0, mDot * p_Dt * 1.0E6); // calculate mass loss; mass loss rate given in Msol per year, times are in Myr so need to multiply by 10^6
26052605
if (p_UpdateMDot) m_Mdot = mDot; // update class member variable if necessary
@@ -2634,8 +2634,8 @@ double BaseStar::CalculateMassLossValues(double p_Dt, const bool p_UpdateMDot) {
26342634
*/
26352635
void BaseStar::ResolveMassLoss(double p_Dt) {
26362636

2637-
if (OPTIONS->UseMassLoss()) {
2638-
2637+
if (OPTIONS->MassLossPrescription() != MASS_LOSS_PRESCRIPTION::ZERO) { // mass loss enabled?
2638+
// yes
26392639
double mass = CalculateMassLossValues(p_Dt, true); // calculate new values assuming mass loss applied
26402640

26412641
double angularMomentumChange = (2.0 / 3.0) * (mass - m_Mass) * m_Radius * RSOL_TO_AU * m_Radius * RSOL_TO_AU * Omega();

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ifneq ($(filter staticfast,$(MAKECMDGOALS)),)
4040
endif
4141

4242

43-
CXXFLAGS := -std=c++17 -g -fnon-call-exceptions -Wall -Woverloaded-virtual $(OPTFLAGS)
43+
CXXFLAGS := -std=c++17 -g -fnon-call-exceptions -Wall -Woverloaded-virtual -Wno-vla-cxx-extension $(OPTFLAGS)
4444
ICFLAGS := -I$(GSLINCDIR) -I$(BOOSTINCDIR) -I$(HDF5INCDIR) -I.
4545

4646
LIBS := -lm -lz -ldl -lpthread

src/Options.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ void Options::OptionValues::Initialise() {
418418

419419

420420
// Mass loss options
421-
m_UseMassLoss = true;
422421
m_CheckPhotonTiringLimit = false;
423422

424423
m_EnableRotationallyEnhancedMassLoss = false;
@@ -1019,11 +1018,6 @@ bool Options::AddOptions(OptionValues *p_Options, po::options_description *p_Opt
10191018
po::value<bool>(&p_Options->m_ScaleCHEMassLossWithSurfaceHeliumAbundance)->default_value(p_Options->m_ScaleCHEMassLossWithSurfaceHeliumAbundance)->implicit_value(true),
10201019
("Whether to transition mass loss rates for chemically homogeneously evolving (CHE) stars between OB mass loss rates and Wolf-Rayet (WR) mass loss rates as a function of the surface helium abundance (Ys) as described by Yoon et al. 2006 (default = " + std::string(p_Options->m_ScaleCHEMassLossWithSurfaceHeliumAbundance ? "TRUE" : "FALSE") + ")").c_str()
10211020
)
1022-
(
1023-
"use-mass-loss",
1024-
po::value<bool>(&p_Options->m_UseMassLoss)->default_value(p_Options->m_UseMassLoss)->implicit_value(true),
1025-
("Enable mass loss (default = " + std::string(p_Options->m_UseMassLoss ? "TRUE" : "FALSE") + ")").c_str()
1026-
)
10271021
(
10281022
"use-mass-transfer",
10291023
po::value<bool>(&p_Options->m_UseMassTransfer)->default_value(p_Options->m_UseMassTransfer)->implicit_value(true),

src/Options.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ class Options {
228228
{ "minimum-secondary-mass", "minimum-sampled-secondary-mass", false, "20250808" },
229229
{ "initial-mass-max", "initial-mass-function-max", false, "20250808" },
230230
{ "initial-mass-min", "initial-mass-function-min", false, "20250808" },
231-
{ "initial-mass-power", "initial-mass-function-power", false, "20250808" }
231+
{ "initial-mass-power", "initial-mass-function-power", false, "20250808" },
232+
{ "use-mass-loss", "mass-loss-prescription", false, "20250809" }
232233
};
233234

234235
std::vector<std::tuple<std::string, std::string, std::string, bool, std::string>> deprecatedOptionValues = {
@@ -237,7 +238,15 @@ class Options {
237238
{ "pulsational-pair-instability-prescription", "COMPAS", "WOOSLEY", false, "20250208" },
238239
{ "pulsar-birth-spin-period-distribution", "ZERO", "NOSPIN", false, "20250303" },
239240
{ "tides-prescription", "KAPIL2024", "KAPIL2025", false, "20250525" },
240-
{ "mass-loss-prescription", "MERRITT2024", "MERRITT2025", false, "20250717" }
241+
{ "mass-loss-prescription", "MERRITT2024", "MERRITT2025", false, "20250717" },
242+
{ "use-mass-loss", "TRUE", "MERRITT2025", true, "20250809" },
243+
{ "use-mass-loss", "ON", "MERRITT2025", true, "20250809" },
244+
{ "use-mass-loss", "YES", "MERRITT2025", true, "20250809" },
245+
{ "use-mass-loss", "1", "MERRITT2025", true, "20250809" },
246+
{ "use-mass-loss", "FALSE", "ZERO", true, "20250809" },
247+
{ "use-mass-loss", "OFF", "ZERO", true, "20250809" },
248+
{ "use-mass-loss", "NO", "ZERO", true, "20250809" },
249+
{ "use-mass-loss", "0", "ZERO", true, "20250809" }
241250
};
242251

243252
// the following vector is used to replace deprecated options in the logfile-definitions file
@@ -1003,7 +1012,6 @@ class Options {
10031012
std::string m_OutputContainerName; // Name of output container (directory)
10041013

10051014
// Mass loss options
1006-
bool m_UseMassLoss; // Whether to activate mass loss (default = True)
10071015
bool m_CheckPhotonTiringLimit; // Whether to check the photon tiring limit for wind mass loss
10081016

10091017
// Can also have options for modifying strength of winds etc here
@@ -1748,7 +1756,6 @@ class Options {
17481756
DBL_VECTOR TimestepMultipliers() const { return OPT_VALUE("timestep-multipliers", m_TimestepMultipliers, true); }
17491757

17501758
bool UseFixedUK() const { return (m_GridLine.optionValues.m_UseFixedUK || m_CmdLine.optionValues.m_UseFixedUK); }
1751-
bool UseMassLoss() const { return OPT_VALUE("use-mass-loss", m_UseMassLoss, true); }
17521759
bool UseMassTransfer() const { return OPT_VALUE("use-mass-transfer", m_UseMassTransfer, true); }
17531760
bool UsePairInstabilitySupernovae() const { return OPT_VALUE("pair-instability-supernovae", m_UsePairInstabilitySupernovae, true); }
17541761
bool UsePulsationalPairInstability() const { return OPT_VALUE("pulsational-pair-instability", m_UsePulsationalPairInstability, true); }

src/changelog.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,19 @@
16351635
// - Changed default record types for:
16361636
// - SSE and BSE detailed output files to include only record types 1, 4, & 5 (INITIAL_STATE, TIMESTEP_COMPLETED, and FINAL_STATE)
16371637
// - SSE and BSE pulsar evolution files to include only record type 3 ((pulsar) TIMESTEP_COMPLETED)
1638+
// - Fixed random kick draw for MULLERMANDEL prescription
1639+
// 03.23.00 JR - August 09, 2025 - Enhancement:
1640+
// - Deprecated option
1641+
// - "--use-mass-loss" in favour of "--mass-loss-prescription"
1642+
//
1643+
// Instead of using ``--use-mass-loss`` or ``--use-mass-loss true`` to enable mass loss, then specifying the mass loss
1644+
// prescription to be used with ``--mass-loss-prescription``, mass loss can be enabled using ``--mass-loss-prescription``
1645+
// with any valid prescription (that is not ``zero``), and disabled with ``--mass-loss-prescription zero`` instead of
1646+
// ``use-mass-loss false``.
1647+
// - Added compiler flag "-Wno-vla-cxx-extension" to "CXXFLAGS" in Makefile to suppress compiler extension warning
1648+
// - Fixed online docs for ommisssions in v03.22.02:
1649+
// - fixed description for "--initial-mass-function" in "program-options-list-defaults.rst", and
1650+
// - changed "--initial-mass-power" to "--initial-mass-function-power" in "program-options-list-defaults.rst"
16381651
//
16391652
//
16401653
// Version string format is MM.mm.rr, where
@@ -1646,7 +1659,7 @@
16461659
// if MM is incremented, set mm and rr to 00, even if defect repairs and minor enhancements were also made
16471660
// if mm is incremented, set rr to 00, even if defect repairs were also made
16481661

1649-
const std::string VERSION_STRING = "03.22.02";
1662+
const std::string VERSION_STRING = "03.23.00";
16501663

16511664

16521665
# endif // __changelog_h__

0 commit comments

Comments
 (0)