From 906dcac0e1a1e9c8687ff4c39670bf32d56bf443 Mon Sep 17 00:00:00 2001
From: David Hendriks <davidhendriks93@gmail.com>
Date: Mon, 13 May 2019 18:27:04 +0100
Subject: [PATCH] updated and read mcluster stuff and will put that in also

---
 README.md                                     | 23 +++++++++--
 nbody6_quick_guide.md                         | 12 +++++-
 project_description.md                        |  6 ++-
 .../nbody6_config_generator.py                | 38 +++++++++----------
 4 files changed, 54 insertions(+), 25 deletions(-)

diff --git a/README.md b/README.md
index 315b242..0579e0a 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,8 @@ Git for summerstudent project on evolution of open cluster (see project descript
 
 A manual to run the code and get output in correct format is present: `nbody6_quick_guide.md`.
 
-
-
 # TODO list: 
+## Practicalities
 - [ ] Get nbody6 working and get to know the code
   - [x]  Make appointment with max and go through things
 - [ ] Make it fairly easy for the student to work with nbody6
@@ -15,6 +14,22 @@ A manual to run the code and get output in correct format is present: `nbody6_qu
 - [ ] Ask someone to send us a couple of review papers on clusters
 - [x] Write up a more solid form of the project description
 - [ ] Stay in contact with Mark and Fabio, keep them in the loop of any further advice. Also discuss with them semi regularly about the topic. 
+- [ ] Create quickstart manual for us
+- [ ] Try out mcluster for the setup of Nbody simulation settings. They have a nice manual
+- [ ] Fix script for mcluster to put everything in a nice place with the logs
+- [ ] Finish the python config generator.
 
-
-- [] Create quickstart manual for us
+## Scientific
+- [ ] Decide upon the following scientific things:
+  - [ ] Total mass: What range of cluster masses/Total number of stars will we decide to evolve?
+  - [ ] Density profile: What will be the density profile that is the most sensible? See paper of Douglas and Heggie for inspiration
+  - [ ] Tidal field: Vary between no tidal field and tidal field? Think about this
+  - [ ] Binary fraction: Binary fraction for stars, and will we do a uniform one or mass dependant?
+  - [ ] Eccentricity distribution: Thermal is fine, but flat is also okay i think. 
+  - [ ] Period distribution: Sana 2012 if possible.
+  - [ ] Initial mass function: Lets decide to start by using the standard kroupa for now, no reason to do so otherwise, however choosing single mass is maybe good as a reference to other work.
+    - [ ] Mass limits: Decide which mass limits to take. Is 100 solarmass enough?
+  - [ ] Mass Segregation: I think no initial segregation, because we want to see, with an initial cluster, how the segregation occurs. But i am not sure if forming clusters have any segregation at all?
+  - [ ] Fractality: This is to simulate the imperfectness of the spatial distribution of stars at formation. I wonder how this can affect the outcomes.
+  - [ ] Stellar evolution settings:
+    - [ ] Use pre-evolved setting with cluster, might be fun to test out the paper via a shortcut
diff --git a/nbody6_quick_guide.md b/nbody6_quick_guide.md
index 9d125d7..d77287b 100644
--- a/nbody6_quick_guide.md
+++ b/nbody6_quick_guide.md
@@ -12,12 +12,22 @@
 We will go through the configuration file, and what all the variables mean, but they are also described in nbody6++\_manual.pdf. 
 
 The formatting for the config file is very plain, but I have created a script to generate the config files called `python_scripts_for_nbody6/nbody6_config_generator.py`
+Better idea: the software  package `mcluster` does this job for us. it will generate a file that nbody6 can read in, plus some initialisation summaries. 
+With the `-h` option you can see the variables that can be customized, and in the `McLusterManual.pdf` most of the options are explained.
+
+To run mcluster: 
+```
+./vol/ph/astro/dhendriks/mcluster/mcluster [OPTIONS]
+```
+
+It will generate (at least) 2 files, one of which should be used as an input for nbody6
+
 
 ### To run the code:
 To run a simulation we must pass the config file to the executable of nbody6++. 
 
 ```
-/vol/ph/astro_code/dhendriks/nbody6/ < "full path to configuration file."
+./vol/ph/astro_code/dhendriks/nbody6 < "full path to configuration file."
 ```
 
 Based on the input configuration this file will run until it gets terminated (by the code or  by you). 
diff --git a/project_description.md b/project_description.md
index e509cee..dfa2a6c 100644
--- a/project_description.md
+++ b/project_description.md
@@ -4,7 +4,10 @@ Black holes in clusters of stars play a significant role in the evolution of the
 
 How many black holes there are at the early stages of the cluster evolution, also called black hole retention fraction, depends on several factors, among which are the cluster properties (e.g.: initial density and mass) and stellar evolution (e.g.: initial-final mass relation for black holes, kick distributions). Our plan is to to use some cluster evolution models to probe how sensitive the outcome is to certain parameter variations like the kick distributions of black holes. 
 
-We will use a code called NBODY6 to evolve the cluster, so you will learn how to deal with running codes and processing the output of this. Other skills like Python and LateX will be useful as well.
+We will use a code called NBODY6  evolve the cluster, so you will learn how to deal with running codes and processing the output of this. Other skills like Python and LateX will be useful as well.
+
+To run the code with different setting we shall use mcluster to generate these different initial setting files
+
 
 ## Student:
 Sergi Pradas
@@ -30,6 +33,7 @@ Start of july - End of August (exact dates YTBD)
 * http://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=1991ARA%26A..29..543H&db_key=AST&high=384ab081c814843
 * http://adsabs.harvard.edu/abs/2013MNRAS.432.2779B
 * http://adsabs.harvard.edu/abs/2019arXiv190207718B
+* [Website containing some lectures on N-body integration](http://silkroad.bao.ac.cn/web/index.php/seminars/lectures)
 
 ## Some watching material:
 * https://www.cita.utoronto.ca/presentation-archive/?talk_id=745
diff --git a/python_scripts_for_nbody6/nbody6_config_generator.py b/python_scripts_for_nbody6/nbody6_config_generator.py
index 34f6fd3..1cf1c11 100644
--- a/python_scripts_for_nbody6/nbody6_config_generator.py
+++ b/python_scripts_for_nbody6/nbody6_config_generator.py
@@ -3,6 +3,9 @@
 """
 Script to generate a configuration file for nbody6
 Based on chap 4 of nbody6++_manual.pdf
+
+todo:
+- get some inspiration from mcluster
 """
 
 # Todo: finish defaults.py:
@@ -41,16 +44,13 @@ config = defaults.copy()
 # Override the values of the defaults config
 #print(config['nbody6'])
 
-def print_config(config):
+def display_config(config):
+    """
+    Function to display the config.
+    For now just jsondump that thing. not exactly how i want tho.
+    """
     print(json.dumps(config, indent=4))
-
-    # for key in config.keys():
-    #     print(key)
-
-
-
-
-print_config(config)
+# display_config(config)
 
 
 def generate_config(config, outfile):
@@ -59,14 +59,14 @@ def generate_config(config, outfile):
     TODO: Correctly put the logic of the stuff in it. See page 10 of nbody6 manual
     """
 
-    # Write nbody6.F line
-    # Write input.F line
-    # Write data.F line
-    # Write setup.F line
-    # Write scale.F line
-    # Write xtrnl0.F line
-    # Write binpop.F line
-    # Write hipop.F line
-    # Write imbhinit.F line
-    # Write cloud0.F line
+    # Write nbody6.F line:
+    # Write input.F line:
+    # Write data.F line:
+    # Write setup.F line:
+    # Write scale.F line:
+    # Write xtrnl0.F line:
+    # Write binpop.F line:
+    # Write hipop.F line:
+    # Write imbhinit.F line:
+    # Write cloud0.F line:
 
-- 
GitLab