Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
d1e6013c
"README.md" did not exist on "7d0863c3392918a52a81ae262868c150911a733d"
Commit
d1e6013c
authored
5 years ago
by
David Hendriks
Browse files
Options
Downloads
Patches
Plain Diff
changed example
parent
05064ac2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/example_population.py
+7
-8
7 additions, 8 deletions
examples/example_population.py
with
7 additions
and
8 deletions
examples/example_population.py
+
7
−
8
View file @
d1e6013c
...
...
@@ -14,7 +14,7 @@ from binarycpython.utils.custom_logging_functions import temp_dir
#########################################################
## Quick script to get some output
about which stars go supernova when.
## Quick script to get some output
def
output_lines
(
output
):
"""
Function that outputs the lines that were recieved from the binary_c run.
...
...
@@ -43,7 +43,7 @@ def parse_function(self, output):
# CHeck the header and act accordingly
if
(
headerline
==
'
MY_STELLAR_DATA
'
):
parameters
=
[
'
time
'
,
'
mass
'
,
'
zams_mass
'
,
'
probability
'
]
parameters
=
[
'
time
'
,
'
mass
'
,
'
zams_mass
'
,
'
probability
'
,
'
radius
'
]
values
=
el
.
split
()[
1
:]
if
not
os
.
path
.
exists
(
outfilename
):
...
...
@@ -67,7 +67,7 @@ example_pop.set(
# binary_c physics options
M_1
=
10
,
# bse_options
separation
=
0
,
# bse_options
orbital_period
=
4580
,
# bse_options
orbital_period
=
45
0000000
80
,
# bse_options
max_evolution_time
=
15000
,
# bse_options
eccentricity
=
0.02
,
# bse_options
...
...
@@ -101,12 +101,13 @@ if(stardata->star[0].stellar_type >= 2)
{
if (stardata->model.time < stardata->model.max_evolution_time)
{
Printf(
"
MY_STELLAR_DATA %30.12e %g %g %g
\\
n
"
,
Printf(
"
MY_STELLAR_DATA %30.12e %g %g
%g
%g
\\
n
"
,
//
stardata->model.time, // 1
stardata->star[0].mass, //2
stardata->star[0].pms_mass, //4
stardata->model.probability //6
stardata->model.probability, //5
stardata->star[0].radius // 6
);
};
/* Kill the simulation to save time */
...
...
@@ -115,7 +116,7 @@ if(stardata->star[0].stellar_type >= 2)
"""
)
# Add grid variables
resolution
=
{
'
M_1
'
:
10
}
resolution
=
{
'
M_1
'
:
10
0
}
# Mass
example_pop
.
add_grid_variable
(
...
...
@@ -129,7 +130,6 @@ example_pop.add_grid_variable(
dphasevol
=
"
dlnm1
"
,
parameter_name
=
"
M_1
"
,
condition
=
""
,
# Impose a condition on this grid variable. Mostly for a check for yourself
)
# Exporting of all the settings can be done with .export_all_info()
...
...
@@ -149,7 +149,6 @@ example_pop.export_all_info()
# output = example_pop.evolve_single()
# print(output)
## Executing a population
## This uses the values generated by the grid_variables
example_pop
.
evolve_population_mp_chunks
()
# TODO: update this function call
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment