Skip to content

Commit 6db4944

Browse files
committed
Changes for isuues 1413 and 1414
1 parent 5727822 commit 6db4944

File tree

13 files changed

+120
-89
lines changed

13 files changed

+120
-89
lines changed

compas_python_utils/preprocessing/compasConfigDefault.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##~!!~## COMPAS option values
2-
##~!!~## File Created Fri Jul 18 08:19:00 2025 by COMPAS v03.21.00
2+
##~!!~## File Created Fri Aug 8 15:57:19 2025 by COMPAS v03.22.02
33
##~!!~##
44
##~!!~## The default COMPAS YAML file (``compasConfigDefault.yaml``), as distributed, has
55
##~!!~## all COMPAS option entries commented so that the COMPAS default value for the
@@ -71,9 +71,9 @@ numericalChoices:
7171
### LOGISTICS
7272
# --debug-level: 0 # Default: 0
7373
# --logfile-common-envelopes-record-types: -1 # Default: -1
74-
# --logfile-detailed-output-record-types: -1 # Default: -1
74+
# --logfile-detailed-output-record-types: 25 # Default: 25
7575
# --logfile-double-compact-objects-record-types: -1 # Default: -1
76-
# --logfile-pulsar-evolution-record-types: -1 # Default: -1
76+
# --logfile-pulsar-evolution-record-types: 4 # Default: 4
7777
# --logfile-rlof-parameters-record-types: -1 # Default: -1
7878
# --logfile-supernovae-record-types: -1 # Default: -1
7979
# --logfile-system-snapshot-log-record-types: -1 # Default: -1
@@ -96,9 +96,9 @@ numericalChoices:
9696
### STELLAR PROPERTIES
9797
# --cool-wind-mass-loss-multiplier: 1.000000 # Default: 1.000000
9898
# --initial-mass: 5.000000 # Default: 5.000000 # initial mass for SSE
99-
# --initial-mass-min: 5.000000 # Default: 5.000000 # use 5.0 for DCOs [Msol]
100-
# --initial-mass-max: 150.00 # Default: 150.00 # stellar tracks extrapolated above 50 Msol (Hurley+2000) [Msol]
101-
# --initial-mass-power: 0.000000 # Default: 0.000000
99+
# --initial-mass-function-min: 5.000000 # Default: 5.000000 # use 5.0 for DCOs [Msol]
100+
# --initial-mass-function-max: 150.00 # Default: 150.00 # stellar tracks extrapolated above 50 Msol (Hurley+2000) [Msol]
101+
# --initial-mass-function-power: 0.000000 # Default: 0.000000
102102
# --luminosity-to-mass-threshold: 4.200000 # Default: 4.200000
103103
# --metallicity: 0.014200 # Default: 0.014200 # metallicity for both SSE and BSE - Solar metallicity Asplund+2010
104104
# --metallicity-min: 0.000100 # Default: 0.000100
@@ -121,7 +121,7 @@ numericalChoices:
121121
# --mass-ratio: 1.000000 # Default: 1.000000
122122
# --mass-ratio-min: 0.010000 # Default: 0.010000
123123
# --mass-ratio-max: 1.000000 # Default: 1.000000
124-
# --minimum-secondary-mass: 0.100000 # Default: 0.100000 # Brown dwarf limit [Msol]
124+
# --minimum-sampled-secondary-mass: 0.100000 # Default: 0.100000 # Brown dwarf limit [Msol]
125125
# --orbital-period: 0.100000 # Default: 0.100000 # orbital period for BSE
126126
# --orbital-period-min: 1.100000 # Default: 1.100000 # [days]
127127
# --orbital-period-max: 1000.00 # Default: 1000.00 # [days]

online-docs/pages/User guide/COMPAS output/standard-logfiles-record-specification-options.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ DEPRECATION NOTICE: property ``BLACK_HOLE_KICKS`` has been deprecated and will s
608608
* - COMPAS variable:
609609
- Options::m_InitialMassFunctionMax
610610
* - Description:
611-
- Value of program option ``--initial-mass-max``
611+
- Value of program option ``--initial-mass-function-max``
612612
* - Header String:
613613
- PO_Initial_Mass_Func_Max
614614

@@ -624,7 +624,7 @@ DEPRECATION NOTICE: property ``BLACK_HOLE_KICKS`` has been deprecated and will s
624624
* - COMPAS variable:
625625
- Options::m_InitialMassFunctionMin
626626
* - Description:
627-
- Value of program option ``--initial-mass-min``
627+
- Value of program option ``--initial-mass-function-min``
628628
* - Header String:
629629
- PO_Initial_Mass_Func_Min
630630

@@ -1293,14 +1293,14 @@ DEPRECATION NOTICE: property ``LBV_PRESCRIPTION`` has been deprecated and will s
12931293
:header-rows: 0
12941294
:class: aligned-text
12951295

1296-
* - :cspan:`2` **MINIMUM_MASS_SECONDARY**
1296+
* - :cspan:`2` **MINIMUM_SAMPLED_SECONDARY_MASS**
12971297
-
12981298
* - Data type:
12991299
- DOUBLE
13001300
* - COMPAS variable:
1301-
- Options::m_MinimumMassSecondary
1301+
- Options::m_MinimumSampledSecondaryMass
13021302
* - Description:
1303-
- Value of program option ``--minimum-secondary-mass``
1303+
- Value of program option ``--minimum-sampled-secondary-mass``
13041304
* - Header String:
13051305
- PO_Min_Secondary_Mass
13061306

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -513,26 +513,26 @@ Default = Sampled from IMF
513513

514514
**--initial-mass-2** |br|
515515
Initial mass for the secondary star when evolving in BSE mode (:math:`M_\odot`). |br|
516-
Default = Sampled from the mass ratio distribution specified by ``--mass-ratio-distribution`` (see also ``--mass-ratio-max``, ``-mass-ratio-min``, ``--minimum-secondary-mass'')
516+
Default = Sampled from the mass ratio distribution specified by ``--mass-ratio-distribution`` (see also ``--mass-ratio-max``, ``-mass-ratio-min``, ``--minimum-sampled-secondary-mass``)
517517

518518
**--initial-mass-function [ -i ]** |br|
519519
Initial mass function. |br|
520520
Options: { SALPETER, POWERLAW, UNIFORM, KROUPA } |br|
521521
``SALPETER`` and ``KROUPA`` use the IMFs of Salpeter 1955 and Kroupa 2001 |br|
522-
``POWERLAW`` samples from a single power law with slope ``--initial-mass-power`` |br|
523-
``UNIFORM`` samples uniformly between ``--initial-mass-min`` and ``--initial-mass-min`` |br|
522+
``POWERLAW`` is a single power law with slope ``--initial-mass-function-power`` |br|
523+
``UNIFORM`` is a uniform distribution between ``--initial-mass-function-min`` and ``--initial-mass-function-max`` |br|
524524
Default = KROUPA
525525

526-
**--initial-mass-max** |br|
527-
Maximum mass to generate using given IMF (:math:`M_\odot`). |br|
526+
**--initial-mass-function-max** |br|
527+
The maximum mass (in Msol) to sample from the initial mass function (IMF), (only used when sampling initial mass) (:math:`M_\odot`). |br|
528528
Default = 150.0
529529

530-
**--initial-mass-min** |br|
531-
Minimum mass to generate using given IMF (:math:`M_\odot`). |br|
530+
**--initial-mass-function-min** |br|
531+
The minimum mass (in Msol) to sample from the initial mass function (IMF), (only used when sampling initial mass) (:math:`M_\odot`). |br|
532532
Default = 5.0
533533

534-
**--initial-mass-power** |br|
535-
Single power law power to generate primary mass using ``POWERLAW`` IMF. |br|
534+
**--initial-mass-function-power** |br|
535+
The power to use when using the ``POWERLAW`` IMF. |br|
536536
Default = 0.0
537537

538538
.. _options-props-J:
@@ -950,9 +950,9 @@ Default = 0.03
950950
Minimum metallicity to generate. |br|
951951
Default = 0.0001
952952

953-
**--minimum-secondary-mass** |br|
954-
Minimum mass of secondary to generate (:math:`M_\odot`). |br|
955-
Defaults to 0.1 if ``--initial-mass-2`` is specified, otherwise value of ``--initial-mass-min``.
953+
**--minimum-sampled-secondary-mass** |br|
954+
Minimum mass value that can be sampled from the IMF when sampling the mass of the secondary star (:math:`M_\odot`). |br|
955+
Default = 0.1
956956

957957
**--mode** |br|
958958
The mode of evolution. |br|
@@ -1495,9 +1495,9 @@ 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-min, --initial-mass-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-power
14991499

1500-
--mass-ratio-distribution, --mass-ratio, --mass-ratio-min, --mass-ratio-max, --minimum-secondary-mass
1500+
--mass-ratio-distribution, --mass-ratio, --mass-ratio-min, --mass-ratio-max, --minimum-sampled-secondary-mass
15011501

15021502
--eccentricity-distribution, --eccentricity, --eccentricity-min, --eccentricity-max
15031503

online-docs/pages/whats-new.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ 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.22.02 August 08, 2025**
7+
8+
* The following options are now deprecated, and will be removed in 1 year:
9+
10+
* ``--initial-mass-min`` in favour of ``--initial-mass-function-min``
11+
* ``--initial-mass-max`` in favour of ``--initial-mass-function-max``
12+
* ``--initial-mass-power`` in favour of ``--initial-mass-function-power``
13+
* ``--minimum-mass-secondary`` in favour of ``--minimum-sampled-secondary-mass``
14+
15+
* The user supplied value for ``--minimum-sampled-secondary-mass`` now checked against the COMPAS values for minimum initial mass (0.00007 :math:`M_\odot`) and maximum initial mass (150.0 :math:`M_\odot`)
16+
* The secondary mass (for BSE), whether input by user, sampled, or calculated from the primary mass and mass ratio, now checked against the COMPAS value for minimum initial mass (0.00007 :math:`M_\odot`)
17+
* The default record types written to the SSE and BSE detailed output files now include only record types 1, 4, & 5 (INITIAL_STATE, TIMESTEP_COMPLETED, and FINAL_STATE)
18+
* The default record types written to the SSE and BSE pulsar evolution files now includes only record type 3 ((Pulsar) TIMESTEP_COMPLETED)
19+
620
**03.22.00 July 18, 2025**
721

822
* Changed default values of --enhance-CHE-lifetimes-luminosities and --scale-CHE-mass-loss-with-surface-helium-abundance to true

src/BaseBinaryStar.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ BaseBinaryStar::BaseBinaryStar(const unsigned long int p_Seed, const long int p_
2828
// check that the constituent stars are not touching
2929
// also check m2 > m2min
3030

31-
bool done = false;
32-
bool merger = false;
33-
bool rlof = false;
34-
bool secondarySmallerThanMinimumMass = false;
31+
bool done = false;
32+
bool rlof = false;
3533

3634
// determine if any if the initial conditions are sampled
3735
// we consider eccentricity distribution = ECCENTRICITY_DISTRIBUTION::ZERO to be not sampled!
@@ -203,16 +201,15 @@ BaseBinaryStar::BaseBinaryStar(const unsigned long int p_Seed, const long int p_
203201
m_Star1->SetCompanion(m_Star2);
204202
m_Star2->SetCompanion(m_Star1);
205203

206-
merger = (m_SemiMajorAxis * AU_TO_RSOL) < (m_Star1->Radius() + m_Star2->Radius());
207-
secondarySmallerThanMinimumMass = utils::Compare(mass2, OPTIONS->MinimumMassSecondary()) < 0;
208-
209204
// check whether our initial conditions are good
210205
// if they are - evolve the binary
211206
// if they are not ok:
212207
// - if we sampled at least one of them, sample again
213208
// - if all were user supplied, set error - Evolve() will show the error and return without evolving
214209

215-
bool ok = !((!OPTIONS->AllowRLOFAtBirth() && rlof) || (!OPTIONS->AllowTouchingAtBirth() && merger) || secondarySmallerThanMinimumMass);
210+
bool ok = !((!OPTIONS->AllowRLOFAtBirth() && rlof) || // rolf?
211+
(!OPTIONS->AllowTouchingAtBirth() && (m_SemiMajorAxis * AU_TO_RSOL) < (m_Star1->Radius() + m_Star2->Radius())) || // merger?
212+
(utils::Compare(mass2, MINIMUM_INITIAL_MASS) < 0)); // M2 < minimum?
216213

217214
done = ok;
218215
if (!sampled && !ok) {
@@ -1836,8 +1833,7 @@ double BaseBinaryStar::CalculateGammaAngularMomentumLoss_Static(const double p_D
18361833

18371834
double gamma;
18381835
MT_ANGULAR_MOMENTUM_LOSS_PRESCRIPTION gammaPrescription = OPTIONS->MassTransferAngularMomentumLossPrescription();
1839-
if(p_IsCommonEnvelope)
1840-
gammaPrescription = OPTIONS->CommonEnvelopeSecondStageGammaPrescription();
1836+
if (p_IsCommonEnvelope) gammaPrescription = OPTIONS->CommonEnvelopeSecondStageGammaPrescription();
18411837

18421838
switch (gammaPrescription) { // which prescription?
18431839

src/BaseBinaryStar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ class BaseBinaryStar {
564564
return LOGGING->LogCommonEnvelope(this, p_RecordType);
565565
}
566566

567-
bool PrintPulsarEvolutionParameters(const BSE_PULSAR_RECORD_TYPE p_RecordType = BSE_PULSAR_RECORD_TYPE::DEFAULT) const {
567+
bool PrintPulsarEvolutionParameters(const BSE_PULSAR_RECORD_TYPE p_RecordType) const {
568568
return OPTIONS->EvolvePulsars() ? LOGGING->LogBSEPulsarEvolutionParameters(this, p_RecordType) : true;
569569
}
570570

src/BaseStar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ class BaseStar {
369369
return OPTIONS->DetailedOutput() ? LOGGING->LogSSEDetailedOutput(this, p_Id, p_RecordType) : true; // Write record to SSE Detailed Output log file
370370
}
371371

372-
bool PrintPulsarEvolutionParameters(const SSE_PULSAR_RECORD_TYPE p_RecordType = SSE_PULSAR_RECORD_TYPE::DEFAULT) const {
372+
bool PrintPulsarEvolutionParameters(const SSE_PULSAR_RECORD_TYPE p_RecordType) const {
373373
return OPTIONS->EvolvePulsars() ? LOGGING->LogSSEPulsarEvolutionParameters(this, p_RecordType) : true;
374374
}
375375

0 commit comments

Comments
 (0)