Skip to content

Commit 62110b9

Browse files
authored
Merge pull request #1379 from TeamCOMPAS/Matlab
Making enhanced, interpolated Nanjing lambdas the default
2 parents 7918193 + d2aa69d commit 62110b9

File tree

9 files changed

+569
-158
lines changed

9 files changed

+569
-158
lines changed

compas_matlab_utils/ComparisonPlots.m

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.

compas_python_utils/preprocessing/compasConfigDefault.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##~!!~## COMPAS option values
2-
##~!!~## File Created Mon Apr 14 17:15:32 2025 by COMPAS v03.18.00
2+
##~!!~## File Created Thu May 1 20:17:56 2025 by COMPAS v03.18.01
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
@@ -48,9 +48,9 @@ booleanChoices:
4848
# --common-envelope-allow-immediate-RLOF-post-CE-survive: False # Default: False
4949
# --common-envelope-allow-main-sequence-survive: True # Default: True # Allow main sequence stars to survive CE
5050
# --common-envelope-allow-radiative-envelope-survive: False # Default: False
51-
# --common-envelope-lambda-nanjing-enhanced: False # Default: False
52-
# --common-envelope-lambda-nanjing-interpolate-in-mass: False # Default: False
53-
# --common-envelope-lambda-nanjing-interpolate-in-metallicity: False # Default: False
51+
# --common-envelope-lambda-nanjing-enhanced: True # Default: True
52+
# --common-envelope-lambda-nanjing-interpolate-in-mass: True # Default: True
53+
# --common-envelope-lambda-nanjing-interpolate-in-metallicity: True # Default: True
5454
# --common-envelope-lambda-nanjing-use-rejuvenated-mass: False # Default: False
5555
# --revised-energy-formalism-nandez-ivanova: False # Default: False
5656

Lines changed: 96 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,96 @@
1-
BSE switchlog
2-
=============
3-
4-
Default record definition for the BSE SwitchLog log file::
5-
6-
const ANY_PROPERTY_VECTOR BSE_SWITCH_LOG_REC = {
7-
BINARY_PROPERTY::RANDOM_SEED,
8-
BINARY_PROPERTY::TIME
9-
};
10-
11-
12-
The default record specification can be modified at runtime via a logfile record specifications file (program option ``--logfile-definitions``).
13-
See :doc:`standard-logfiles-record-specification` for details.
14-
15-
Note that the BSE SwitchLog file has the following columns automatically appended to each record:
16-
17-
- The constituent star switching stellar type: 1 = Primary, 2 = Secondary.
18-
- The stellar type from which the star is switching.
19-
- The stellar type to which the star is switching.
20-
21-
|br|
22-
**STAR_SWITCHING**
23-
24-
.. list-table::
25-
:widths: 20 80
26-
:header-rows: 0
27-
:class: aligned-text
28-
29-
* - Data type:
30-
- INT
31-
* - COMPAS variable:
32-
- `derived from` ``BaseBinaryStar::m_Star1/m_Star2``
33-
* - Description:
34-
- The constituent star switching stellar type, where 1 = Primary, and 2 = Secondary.
35-
* - Header String:
36-
- "STAR_SWITCHING"
37-
38-
**SWITCHING_FROM**
39-
40-
.. list-table::
41-
:widths: 20 80
42-
:header-rows: 0
43-
:class: aligned-text
44-
45-
* - Data type:
46-
- INT
47-
* - COMPAS variable:
48-
- `derived from` ``BaseStar::m_StellarType``
49-
* - Description:
50-
- The stellar type of the constituent star immediately prior to the switch.
51-
* - Header String:
52-
- "SWITCHING_FROM"
53-
54-
**SWITCHING_TO**
55-
56-
.. list-table::
57-
:widths: 20 80
58-
:header-rows: 0
59-
:class: aligned-text
60-
61-
* - Data type:
62-
- INT
63-
* - COMPAS variable:
64-
- Not applicable
65-
* - Description:
66-
- The stellar type to which the constituent star will switch (i.e. the stellar type immediately following the switch).
67-
* - Header String:
68-
- "SWITCHING_TO"
69-
70-
**IS_MERGER**
71-
72-
.. list-table::
73-
:widths: 20 80
74-
:header-rows: 0
75-
:class: aligned-text
76-
77-
* - Data type:
78-
- BOOL
79-
* - COMPAS variable:
80-
- Not applicable
81-
* - Description:
82-
- Flag to indicate if the switchlog record records a merger (rather than a simple switch)
83-
* - Header String:
84-
- "IS_MERGER"
85-
86-
These columns will always be automatically appended to each BSE Switch Log record: they cannot be removed via the log file record
87-
specifications file.
1+
BSE switchlog
2+
=============
3+
4+
Default record definition for the BSE SwitchLog log file::
5+
6+
const ANY_PROPERTY_VECTOR BSE_SWITCH_LOG_REC = {
7+
BINARY_PROPERTY::RANDOM_SEED,
8+
BINARY_PROPERTY::TIME,
9+
BINARY_PROPERTY::SEMI_MAJOR_AXIS_RSOL,
10+
BINARY_PROPERTY::ROCHE_LOBE_RADIUS_1,
11+
BINARY_PROPERTY::ROCHE_LOBE_RADIUS_2,
12+
STAR_1_PROPERTY::MASS,
13+
STAR_2_PROPERTY::MASS,
14+
STAR_1_PROPERTY::STELLAR_TYPE,
15+
STAR_2_PROPERTY::STELLAR_TYPE,
16+
STAR_1_PROPERTY::RADIUS,
17+
STAR_2_PROPERTY::RADIUS
18+
};
19+
20+
21+
The default record specification can be modified at runtime via a logfile record specifications file (program option ``--logfile-definitions``).
22+
See :doc:`standard-logfiles-record-specification` for details.
23+
24+
Note that the BSE SwitchLog file has the following columns automatically appended to each record:
25+
26+
- The constituent star switching stellar type: 1 = Primary, 2 = Secondary.
27+
- The stellar type from which the star is switching.
28+
- The stellar type to which the star is switching.
29+
30+
|br|
31+
**STAR_SWITCHING**
32+
33+
.. list-table::
34+
:widths: 20 80
35+
:header-rows: 0
36+
:class: aligned-text
37+
38+
* - Data type:
39+
- INT
40+
* - COMPAS variable:
41+
- `derived from` ``BaseBinaryStar::m_Star1/m_Star2``
42+
* - Description:
43+
- The constituent star switching stellar type, where 1 = Primary, and 2 = Secondary.
44+
* - Header String:
45+
- "STAR_SWITCHING"
46+
47+
**SWITCHING_FROM**
48+
49+
.. list-table::
50+
:widths: 20 80
51+
:header-rows: 0
52+
:class: aligned-text
53+
54+
* - Data type:
55+
- INT
56+
* - COMPAS variable:
57+
- `derived from` ``BaseStar::m_StellarType``
58+
* - Description:
59+
- The stellar type of the constituent star immediately prior to the switch.
60+
* - Header String:
61+
- "SWITCHING_FROM"
62+
63+
**SWITCHING_TO**
64+
65+
.. list-table::
66+
:widths: 20 80
67+
:header-rows: 0
68+
:class: aligned-text
69+
70+
* - Data type:
71+
- INT
72+
* - COMPAS variable:
73+
- Not applicable
74+
* - Description:
75+
- The stellar type to which the constituent star will switch (i.e. the stellar type immediately following the switch).
76+
* - Header String:
77+
- "SWITCHING_TO"
78+
79+
**IS_MERGER**
80+
81+
.. list-table::
82+
:widths: 20 80
83+
:header-rows: 0
84+
:class: aligned-text
85+
86+
* - Data type:
87+
- BOOL
88+
* - COMPAS variable:
89+
- Not applicable
90+
* - Description:
91+
- Flag to indicate if the switchlog record records a merger (rather than a simple switch)
92+
* - Header String:
93+
- "IS_MERGER"
94+
95+
These columns will always be automatically appended to each BSE Switch Log record: they cannot be removed via the log file record
96+
specifications file.
Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,57 @@
1-
SSE switchlog
2-
=============
3-
4-
Default record definition for the SSE SwitchLog log file::
5-
6-
const ANY_PROPERTY_VECTOR SSE_SWITCH_LOG_REC = {
7-
STAR_PROPERTY::RANDOM_SEED,
8-
STAR_PROPERTY::TIME
9-
};
10-
11-
12-
The default record specification can be modified at runtime via a logfile record specifications file (program option ``--logfile-definitions``).
13-
See :doc:`standard-logfiles-record-specification` for details.
14-
15-
Note that the SSE SwitchLog file has the following columns automatically appended to each record:
16-
17-
- The stellar type from which the star is switching.
18-
- The stellar type to which the star is switching.
19-
20-
|br|
21-
**SWITCHING_FROM**
22-
23-
.. list-table::
24-
:widths: 20 80
25-
:header-rows: 0
26-
:class: aligned-text
27-
28-
* - Data type:
29-
- INT
30-
* - COMPAS variable:
31-
- `derived from` ``BaseStar::m_StellarType``
32-
* - Description:
33-
- The stellar type of the star immediately prior to the switch.
34-
* - Header String:
35-
- "SWITCHING_FROM"
36-
37-
**SWITCHING_TO**
38-
39-
.. list-table::
40-
:widths: 20 80
41-
:header-rows: 0
42-
:class: aligned-text
43-
44-
* - Data type:
45-
- INT
46-
* - COMPAS variable:
47-
- Not applicable
48-
* - Description:
49-
- The stellar type to which the star will switch (i.e. the stellar type immediately following the switch).
50-
* - Header String:
51-
- "SWITCHING_TO"
52-
53-
These columns will always be automatically appended to each SSE Switch Log record: they cannot be removed via the log file record
54-
specifications file.
1+
SSE switchlog
2+
=============
3+
4+
Default record definition for the SSE SwitchLog log file::
5+
6+
const ANY_PROPERTY_VECTOR SSE_SWITCH_LOG_REC = {
7+
STAR_PROPERTY::RANDOM_SEED,
8+
STAR_PROPERTY::TIME,
9+
STAR_PROPERTY::MASS,
10+
STAR_PROPERTY::STELLAR_TYPE,
11+
STAR_PROPERTY::RADIUS
12+
};
13+
14+
15+
The default record specification can be modified at runtime via a logfile record specifications file (program option ``--logfile-definitions``).
16+
See :doc:`standard-logfiles-record-specification` for details.
17+
18+
Note that the SSE SwitchLog file has the following columns automatically appended to each record:
19+
20+
- The stellar type from which the star is switching.
21+
- The stellar type to which the star is switching.
22+
23+
|br|
24+
**SWITCHING_FROM**
25+
26+
.. list-table::
27+
:widths: 20 80
28+
:header-rows: 0
29+
:class: aligned-text
30+
31+
* - Data type:
32+
- INT
33+
* - COMPAS variable:
34+
- `derived from` ``BaseStar::m_StellarType``
35+
* - Description:
36+
- The stellar type of the star immediately prior to the switch.
37+
* - Header String:
38+
- "SWITCHING_FROM"
39+
40+
**SWITCHING_TO**
41+
42+
.. list-table::
43+
:widths: 20 80
44+
:header-rows: 0
45+
:class: aligned-text
46+
47+
* - Data type:
48+
- INT
49+
* - COMPAS variable:
50+
- Not applicable
51+
* - Description:
52+
- The stellar type to which the star will switch (i.e. the stellar type immediately following the switch).
53+
* - Header String:
54+
- "SWITCHING_TO"
55+
56+
These columns will always be automatically appended to each SSE Switch Log record: they cannot be removed via the log file record
57+
specifications file.

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ Default = 1.0
164164

165165
**--common-envelope-lambda-nanjing-enhanced** |br|
166166
Continuous extrapolation beyond maximum radius range in Nanjing lambda's as implemented in StarTrack. Only used when ``--common-envelope-lambda-prescription = LAMBDA_NANJING``. |br|
167-
Default = FALSE
167+
Default = TRUE
168168

169169
**--common-envelope-lambda-nanjing-interpolate-in-mass** |br|
170-
Interpolate Nanjing lambda parameters across different mass models. Only used when ``--common-envelope-lambda-prescription = LAMBDA_NANJING``. |br|
171-
Default = FALSE
170+
Interpolate Nanjing lambda parameters across different mass models. Only used when ``--common-envelope-lambda-prescription = LAMBDA_NANJING``. Requires ``--common-envelope-lambda-nanjing-enhanced``. |br|
171+
Default = TRUE
172172

173173
**--common-envelope-lambda-nanjing-interpolate-in-metallicity** |br|
174-
Interpolate Nanjing lambda parameters across population I and population II metallicity models. Only used when ``--common-envelope-lambda-prescription = LAMBDA_NANJING``. |br|
175-
Default = FALSE
174+
Interpolate Nanjing lambda parameters across population I and population II metallicity models. Only used when ``--common-envelope-lambda-prescription = LAMBDA_NANJING``. Requires ``--common-envelope-lambda-nanjing-enhanced``. |br|
175+
Default = TRUE
176176

177177
**--common-envelope-lambda-nanjing-use-rejuvenated-mass** |br|
178178
Use rejuvenated or effective ZAMS mass instead of true birth mass when computing Nanjing lambda parameters. Only used when ``--common-envelope-lambda-prescription = LAMBDA_NANJING``. |br|
@@ -1350,8 +1350,8 @@ This option is primarily intended for debugging/testing of convergence issues ra
13501350
**--timestep-multipliers** |br|
13511351
Phase-dependent multiplicative factors for timestep duration. |br|
13521352
See :doc:`Vector program options <./program-options-vector-options>` for option format. |br|
1353-
A multicative factor can be specified for each phase (stellar type), where the ordinal value (zero-based) of the option value
1354-
indicates the stellar type (from ``MS_LTE_07`` to ``CHEMICALLY_HOMOGENEOUS``, see stellar type list at
1353+
A multiplicative factor can be specified for each phase (stellar type), where the ordinal value (zero-based) of the
1354+
option value indicates the stellar type (from ``MS_LTE_07`` to ``CHEMICALLY_HOMOGENEOUS``, see stellar type list at
13551355
:doc:`../../Developer guide/Headers/typedefs-dot-h`>). |br|
13561356
|br|
13571357
This multiplier is applied after the timesteps are chosen using other program options such as ``--radial-change-fraction`` and

online-docs/pages/whats-new.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ 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.18.02 May 1, 2025**
7+
8+
* Changed default for Nanjing lambdas to use enhanced lambdas and interpolate in mass and metallicity
9+
610
**03.18.00 Apr 14, 2025**
711

812
New command line option:

src/LogTypedefs.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,16 @@ const ANY_PROPERTY_VECTOR BSE_SUPERNOVAE_REC = {
21462146
//
21472147
const ANY_PROPERTY_VECTOR BSE_SWITCH_LOG_REC = {
21482148
BINARY_PROPERTY::RANDOM_SEED,
2149-
BINARY_PROPERTY::TIME
2149+
BINARY_PROPERTY::TIME,
2150+
BINARY_PROPERTY::SEMI_MAJOR_AXIS_RSOL,
2151+
BINARY_PROPERTY::ROCHE_LOBE_RADIUS_1,
2152+
BINARY_PROPERTY::ROCHE_LOBE_RADIUS_2,
2153+
STAR_1_PROPERTY::MASS,
2154+
STAR_2_PROPERTY::MASS,
2155+
STAR_1_PROPERTY::STELLAR_TYPE,
2156+
STAR_2_PROPERTY::STELLAR_TYPE,
2157+
STAR_1_PROPERTY::RADIUS,
2158+
STAR_2_PROPERTY::RADIUS
21502159
};
21512160

21522161

@@ -2265,7 +2274,10 @@ const ANY_PROPERTY_VECTOR SSE_SUPERNOVAE_REC = {
22652274
//
22662275
const ANY_PROPERTY_VECTOR SSE_SWITCH_LOG_REC = {
22672276
STAR_PROPERTY::RANDOM_SEED,
2268-
STAR_PROPERTY::TIME
2277+
STAR_PROPERTY::TIME,
2278+
STAR_PROPERTY::MASS,
2279+
STAR_PROPERTY::STELLAR_TYPE,
2280+
STAR_PROPERTY::RADIUS
22692281
};
22702282

22712283

0 commit comments

Comments
 (0)