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
14 changes: 7 additions & 7 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 Fri Jul 18 08:19:00 2025 by COMPAS v03.21.00
##~!!~## File Created Fri Aug 8 15:57:19 2025 by COMPAS v03.22.02
##~!!~##
##~!!~## 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 @@ -71,9 +71,9 @@ numericalChoices:
### LOGISTICS
# --debug-level: 0 # Default: 0
# --logfile-common-envelopes-record-types: -1 # Default: -1
# --logfile-detailed-output-record-types: -1 # Default: -1
# --logfile-detailed-output-record-types: 25 # Default: 25
# --logfile-double-compact-objects-record-types: -1 # Default: -1
# --logfile-pulsar-evolution-record-types: -1 # Default: -1
# --logfile-pulsar-evolution-record-types: 4 # Default: 4
# --logfile-rlof-parameters-record-types: -1 # Default: -1
# --logfile-supernovae-record-types: -1 # Default: -1
# --logfile-system-snapshot-log-record-types: -1 # Default: -1
Expand All @@ -96,9 +96,9 @@ numericalChoices:
### STELLAR PROPERTIES
# --cool-wind-mass-loss-multiplier: 1.000000 # Default: 1.000000
# --initial-mass: 5.000000 # Default: 5.000000 # initial mass for SSE
# --initial-mass-min: 5.000000 # Default: 5.000000 # use 5.0 for DCOs [Msol]
# --initial-mass-max: 150.00 # Default: 150.00 # stellar tracks extrapolated above 50 Msol (Hurley+2000) [Msol]
# --initial-mass-power: 0.000000 # Default: 0.000000
# --initial-mass-function-min: 5.000000 # Default: 5.000000 # use 5.0 for DCOs [Msol]
# --initial-mass-function-max: 150.00 # Default: 150.00 # stellar tracks extrapolated above 50 Msol (Hurley+2000) [Msol]
# --initial-mass-function-power: 0.000000 # Default: 0.000000
# --luminosity-to-mass-threshold: 4.200000 # Default: 4.200000
# --metallicity: 0.014200 # Default: 0.014200 # metallicity for both SSE and BSE - Solar metallicity Asplund+2010
# --metallicity-min: 0.000100 # Default: 0.000100
Expand All @@ -121,7 +121,7 @@ numericalChoices:
# --mass-ratio: 1.000000 # Default: 1.000000
# --mass-ratio-min: 0.010000 # Default: 0.010000
# --mass-ratio-max: 1.000000 # Default: 1.000000
# --minimum-secondary-mass: 0.100000 # Default: 0.100000 # Brown dwarf limit [Msol]
# --minimum-sampled-secondary-mass: 0.100000 # Default: 0.100000 # Brown dwarf limit [Msol]
# --orbital-period: 0.100000 # Default: 0.100000 # orbital period for BSE
# --orbital-period-min: 1.100000 # Default: 1.100000 # [days]
# --orbital-period-max: 1000.00 # Default: 1000.00 # [days]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ DEPRECATION NOTICE: property ``BLACK_HOLE_KICKS`` has been deprecated and will s
* - COMPAS variable:
- Options::m_InitialMassFunctionMax
* - Description:
- Value of program option ``--initial-mass-max``
- Value of program option ``--initial-mass-function-max``
* - Header String:
- PO_Initial_Mass_Func_Max

Expand All @@ -624,7 +624,7 @@ DEPRECATION NOTICE: property ``BLACK_HOLE_KICKS`` has been deprecated and will s
* - COMPAS variable:
- Options::m_InitialMassFunctionMin
* - Description:
- Value of program option ``--initial-mass-min``
- Value of program option ``--initial-mass-function-min``
* - Header String:
- PO_Initial_Mass_Func_Min

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

* - :cspan:`2` **MINIMUM_MASS_SECONDARY**
* - :cspan:`2` **MINIMUM_SAMPLED_SECONDARY_MASS**
-
* - Data type:
- DOUBLE
* - COMPAS variable:
- Options::m_MinimumMassSecondary
- Options::m_MinimumSampledSecondaryMass
* - Description:
- Value of program option ``--minimum-secondary-mass``
- Value of program option ``--minimum-sampled-secondary-mass``
* - Header String:
- PO_Min_Secondary_Mass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,26 +513,26 @@ Default = Sampled from IMF

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

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

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

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

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

.. _options-props-J:
Expand Down Expand Up @@ -718,7 +718,7 @@ Default = ’SSE_Detailed_Output’ for SSE mode; ’BSE_Detailed_Output’ for

**--logfile-detailed-output-record-types** |br|
Enabled record types for the BSE/SSE Detailed Output logfile. |br|
Default = -1 (all record types) |br|
Default = 25 (record types 1, 4, and 5 (INITIAL_STATE, TIMESTEP_COMPLETED, and FINAL_STATE)) |br|

**--logfile-double-compact-objects** |br|
Filename for the Double Compact Objects logfile (BSE mode). |br|
Expand All @@ -737,8 +737,8 @@ Filename for the Pulsar Evolution logfile (BSE mode). |br|
Default = ’BSE_Pulsar_Evolution’

**--logfile-pulsar-evolution-record-types** |br|
Enabled record types for the Pulsar Evolution logfile (BSE mode). |br|
Default = -1 (all record types) |br|
Enabled record types for the BSE/SSE Pulsar Evolution logfile. |br|
Default = 4 (record types 3 ((Pulsar) TIMESTEP_COMPLETED)) |br|

**--logfile-rlof-parameters** |br|
Filename for the RLOF Printing logfile (BSE mode). |br|
Expand Down Expand Up @@ -950,9 +950,9 @@ Default = 0.03
Minimum metallicity to generate. |br|
Default = 0.0001

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

**--mode** |br|
The mode of evolution. |br|
Expand Down Expand Up @@ -1495,9 +1495,9 @@ Go to :ref:`the top of this page <options-props-top>` for the full alphabetical

**Initial conditions**

--initial-mass-function, --initial-mass, --initial-mass-1, --initial-mass-2, --initial-mass-min, --initial-mass-max, --initial-mass-power
--initial-mass-function, --initial-mass, --initial-mass-1, --initial-mass-2, --initial-mass-function-min, --initial-mass-function-max, --initial-mass-power

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

--eccentricity-distribution, --eccentricity, --eccentricity-min, --eccentricity-max

Expand Down
14 changes: 14 additions & 0 deletions online-docs/pages/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ 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.22.02 August 08, 2025**

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

* ``--initial-mass-min`` in favour of ``--initial-mass-function-min``
* ``--initial-mass-max`` in favour of ``--initial-mass-function-max``
* ``--initial-mass-power`` in favour of ``--initial-mass-function-power``
* ``--minimum-mass-secondary`` in favour of ``--minimum-sampled-secondary-mass``

* 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`)
* 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`)
* 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)
* The default record types written to the SSE and BSE pulsar evolution files now includes only record type 3 ((Pulsar) TIMESTEP_COMPLETED)

**03.22.00 July 18, 2025**

* Changed default values of --enhance-CHE-lifetimes-luminosities and --scale-CHE-mass-loss-with-surface-helium-abundance to true
Expand Down
16 changes: 6 additions & 10 deletions src/BaseBinaryStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ BaseBinaryStar::BaseBinaryStar(const unsigned long int p_Seed, const long int p_
// check that the constituent stars are not touching
// also check m2 > m2min

bool done = false;
bool merger = false;
bool rlof = false;
bool secondarySmallerThanMinimumMass = false;
bool done = false;
bool rlof = false;

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

merger = (m_SemiMajorAxis * AU_TO_RSOL) < (m_Star1->Radius() + m_Star2->Radius());
secondarySmallerThanMinimumMass = utils::Compare(mass2, OPTIONS->MinimumMassSecondary()) < 0;

// check whether our initial conditions are good
// if they are - evolve the binary
// if they are not ok:
// - if we sampled at least one of them, sample again
// - if all were user supplied, set error - Evolve() will show the error and return without evolving

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

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

double gamma;
MT_ANGULAR_MOMENTUM_LOSS_PRESCRIPTION gammaPrescription = OPTIONS->MassTransferAngularMomentumLossPrescription();
if(p_IsCommonEnvelope)
gammaPrescription = OPTIONS->CommonEnvelopeSecondStageGammaPrescription();
if (p_IsCommonEnvelope) gammaPrescription = OPTIONS->CommonEnvelopeSecondStageGammaPrescription();

switch (gammaPrescription) { // which prescription?

Expand Down
2 changes: 1 addition & 1 deletion src/BaseBinaryStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ class BaseBinaryStar {
return LOGGING->LogCommonEnvelope(this, p_RecordType);
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/BaseStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class BaseStar {
return OPTIONS->DetailedOutput() ? LOGGING->LogSSEDetailedOutput(this, p_Id, p_RecordType) : true; // Write record to SSE Detailed Output log file
}

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

Expand Down
Loading