Page MenuHomec4science

No OneTemporary

File Metadata

Created
Sun, Oct 20, 11:44
This file is larger than 256 KB, so syntax highlighting was skipped.
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/PyChem/Doc/Makefile b/PyChem/Doc/Makefile
new file mode 100644
index 0000000..9ecb7ae
--- /dev/null
+++ b/PyChem/Doc/Makefile
@@ -0,0 +1,130 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PyChem.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PyChem.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/PyChem"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PyChem"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ make -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/PyChem/Doc/Readme b/PyChem/Doc/Readme
new file mode 100644
index 0000000..437fe94
--- /dev/null
+++ b/PyChem/Doc/Readme
@@ -0,0 +1,3 @@
+make html
+
+./rsync
diff --git a/PyChem/Doc/conf.py b/PyChem/Doc/conf.py
new file mode 100644
index 0000000..9950d5f
--- /dev/null
+++ b/PyChem/Doc/conf.py
@@ -0,0 +1,216 @@
+# -*- coding: utf-8 -*-
+#
+# PyChem documentation build configuration file, created by
+# sphinx-quickstart on Mon Jul 16 10:52:01 2012.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.insert(0, os.path.abspath('..'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'PyChem'
+copyright = u'2012, Yves Revaz'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.1'
+# The full version, including alpha/beta/rc tags.
+release = '0.1'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+html_logo = "logo.png"
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'PyChemdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'PyChem.tex', u'PyChem Documentation',
+ u'Yves Revaz', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'pychem', u'PyChem Documentation',
+ [u'Yves Revaz'], 1)
+]
diff --git a/PyChem/Doc/index.rst b/PyChem/Doc/index.rst
new file mode 100644
index 0000000..1c8868d
--- /dev/null
+++ b/PyChem/Doc/index.rst
@@ -0,0 +1,32 @@
+.. PyChem documentation master file, created by
+ sphinx-quickstart on Mon Jul 16 10:52:01 2012.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to PyChem's documentation!
+==================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 5
+
+
+ rst/Overview
+
+ rst/GenerateChemistryTable
+ rst/TablesAndContent
+ rst/ChemistryInGear
+
+ rst/PythonModules
+ rst/ChemistryCAPI
+ rst/ChemistryPythonCAPI
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/PyChem/Doc/logo.png b/PyChem/Doc/logo.png
new file mode 100644
index 0000000..c1c347e
Binary files /dev/null and b/PyChem/Doc/logo.png differ
diff --git a/PyChem/Doc/make.bat b/PyChem/Doc/make.bat
new file mode 100644
index 0000000..c5f8bfa
--- /dev/null
+++ b/PyChem/Doc/make.bat
@@ -0,0 +1,155 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=_build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+ set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+ :help
+ echo.Please use `make ^<target^>` where ^<target^> is one of
+ echo. html to make standalone HTML files
+ echo. dirhtml to make HTML files named index.html in directories
+ echo. singlehtml to make a single large HTML file
+ echo. pickle to make pickle files
+ echo. json to make JSON files
+ echo. htmlhelp to make HTML files and a HTML help project
+ echo. qthelp to make HTML files and a qthelp project
+ echo. devhelp to make HTML files and a Devhelp project
+ echo. epub to make an epub
+ echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+ echo. text to make text files
+ echo. man to make manual pages
+ echo. changes to make an overview over all changed/added/deprecated items
+ echo. linkcheck to check all external links for integrity
+ echo. doctest to run all doctests embedded in the documentation if enabled
+ goto end
+)
+
+if "%1" == "clean" (
+ for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+ del /q /s %BUILDDIR%\*
+ goto end
+)
+
+if "%1" == "html" (
+ %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+ goto end
+)
+
+if "%1" == "dirhtml" (
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+ goto end
+)
+
+if "%1" == "singlehtml" (
+ %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+ goto end
+)
+
+if "%1" == "pickle" (
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+ echo.
+ echo.Build finished; now you can process the pickle files.
+ goto end
+)
+
+if "%1" == "json" (
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+ echo.
+ echo.Build finished; now you can process the JSON files.
+ goto end
+)
+
+if "%1" == "htmlhelp" (
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+ echo.
+ echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+ goto end
+)
+
+if "%1" == "qthelp" (
+ %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+ echo.
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PyChem.qhcp
+ echo.To view the help file:
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PyChem.ghc
+ goto end
+)
+
+if "%1" == "devhelp" (
+ %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+ echo.
+ echo.Build finished.
+ goto end
+)
+
+if "%1" == "epub" (
+ %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+ echo.
+ echo.Build finished. The epub file is in %BUILDDIR%/epub.
+ goto end
+)
+
+if "%1" == "latex" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ echo.
+ echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+ goto end
+)
+
+if "%1" == "text" (
+ %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+ echo.
+ echo.Build finished. The text files are in %BUILDDIR%/text.
+ goto end
+)
+
+if "%1" == "man" (
+ %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+ echo.
+ echo.Build finished. The manual pages are in %BUILDDIR%/man.
+ goto end
+)
+
+if "%1" == "changes" (
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+ echo.
+ echo.The overview file is in %BUILDDIR%/changes.
+ goto end
+)
+
+if "%1" == "linkcheck" (
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+ echo.
+ echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+ goto end
+)
+
+if "%1" == "doctest" (
+ %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+ echo.
+ echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+ goto end
+)
+
+:end
diff --git a/PyChem/Doc/rst/ChemistryCAPI.rst b/PyChem/Doc/rst/ChemistryCAPI.rst
new file mode 100644
index 0000000..18c4d79
--- /dev/null
+++ b/PyChem/Doc/rst/ChemistryCAPI.rst
@@ -0,0 +1,375 @@
+Chemistry C API
+***************
+
+
+
+Some variables
+========================
+
+.. c:var:: Elt
+
+ table containing 1-helium core, 1-residual and yields for all elements
+
+ .. math::
+
+ \texttt{Elt[0].Array[j]} = \int_{0}^{m_j} \left(1-\omega(m)\right) \Phi(m)\,dm
+
+ \texttt{Elt[1].Array[j]} = \int_{0}^{m_j} \left(1-\alpha(m)\right) \Phi(m)\,dm
+
+ \texttt{Elt[i+2].Array[j]} = \int_{0}^{m_j} p_i(m) \Phi(m)\,dm
+
+
+ .. math::
+
+ \texttt{Elt[0].Metal[j]} = 1-\omega(m_j)
+
+ \texttt{Elt[1].Metal[j]} = 1-\alpha(m_j)
+
+ \texttt{Elt[i+1].Metal[j]} = p_i(m_j)
+
+
+ .. math::
+
+ \texttt{Elt[i+1].MSNIa} = \textrm{mass fraction in wd of element i}
+
+
+Initialisation functions
+========================
+
+.. c:function:: void allocate_chimie()
+
+ This function allocate all varaiables related to the chemistry
+
+
+.. c:function:: void set_table(int i)
+
+ Set the chemistry table to use
+
+
+.. c:function:: void read_chimie(char * filename,int it)
+
+ Read the chemistry table
+
+
+.. c:function:: void init_chimie(void)
+
+ This function initializes the chemistry parameters
+
+
+.. c:function:: void check_chimie(void)
+
+ This function performe simple checks
+ to validate the chemistry initialization
+
+
+
+.. c:function:: int get_nelts()
+
+ Return the number of elements considered
+
+.. c:function:: float get_SolarAbundance(i)
+
+ Return the solar abundance of elt i
+
+
+.. c:function:: char* get_Element(i)
+
+ Return the label of element i
+
+
+
+
+
+
+
+IMF functions
+=============
+
+.. c:function:: static double get_imf(double m)
+
+ This function returns the mass fraction of a star of mass m
+ using the current IMF
+
+.. c:function:: static double get_imf_M(double m1, double m2)
+
+ This function returns the mass fraction between m1 and m2
+ per mass unit, using the current IMF
+
+
+.. c:function:: static double get_imf_N(double m1, double m2)
+
+ This function returns the number fraction between m1 and m2
+ per mass unit, using the current IMF
+
+.. c:function:: static double imf_sampling()
+
+ Sample the imf using monte carlo approach
+
+
+
+.. c:function:: void init_imf(void)
+
+ This function initializes the imf parameters
+ defined in the chemistry file
+
+
+
+Lifetime functions
+==================
+
+
+.. c:function:: double star_lifetime(double z,double m)
+
+ Return the lifetime of a star of mass m and metallicity z
+
+
+.. c:function:: double star_mass_from_age(double z,double t)
+
+ Return the mass of a star having a livetime t and a metallicity z
+
+
+
+Dying stars functions
+=====================
+
+
+
+number of dying stars in a mass range
+"""""""""""""""""""""""""""""""""""""
+
+
+.. c:function:: double DYIN_rate(double m1,double m2)
+
+ compute the number of stars between m1 and m2
+ masses in code unit
+
+
+.. c:function:: double SNII_rate(double m1,double m2)
+
+ compute the number of SNII between m1 and m2
+ masses in code unit
+
+
+.. c:function:: double SNIa_rate(double m1,double m2)
+
+ compute the number of SNIa between m1 and m2
+ masses in code unit
+
+
+DYIN mass ejection
+"""""""""""""""""""""""""""""""""""""
+
+
+
+.. c:function:: void DYIN_mass_ejection(double m1,double m2)
+
+ Compute the mass fraction and yields of dying stars with masses between m1 and m2.
+ Store the result in the global variable ``MassFracDYIN``::
+
+ MassFracDYIN[0] = total gas
+ MassFracDYIN[1] = helium core (i.e. alpha(m))
+ MassFracDYIN[i] = frac mass elt i.
+
+
+
+.. c:function:: void DYIN_single_mass_ejection(double m1)
+
+ Compute the mass fraction and yields of a dying stars of masse m1.
+ Store the result in the global variable ``SingleMassFracDYIN``::
+
+ SingleMassFracDYIN[0] = total gas
+ SingleMassFracDYIN[1] = helium core (i.e. alpha(m))
+ SingleMassFracDYIN[i] = frac mass elt i.
+
+
+
+
+
+
+SNII mass ejection
+"""""""""""""""""""""""""""""""""""""
+
+
+.. c:function:: void SNII_mass_ejection(double m1,double m2)
+
+ .. warning:: here, we we do not limit the computation to SNII, yields are ok, but mass includes also less massives stars !!!
+
+ Compute the mass fraction and yields of SNII stars with masses between m1 and m2.
+ Store the result in the global variable ``MassFracSNII``::
+
+ MassFracSNII[0] = total gas per mass unit = 1-w (1 - mass fract of residual)
+ MassFracSNII[1] = 1-helium core (i.e. non processed elts)
+ MassFracSNII[i+2] = mass fract of elt i. (syntetised elts)
+
+
+ .. math::
+
+ \texttt{MassFracSNII[0]} = \int^{M_{to(t)}}_{M_{to(t+dt)}} \left(1-\omega(m)\right) \Phi(m)\,dm
+
+ \texttt{MassFracSNII[1]} = \int^{M_{to(t)}}_{M_{to(t+dt)}} \left(1-\alpha(m)\right) \Phi(m)\,dm
+
+ \texttt{MassFracSNII[i+2]} = \int^{M_{to(t)}}_{M_{to(t+dt)}} p_i(m) \Phi(m)\,dm
+
+
+.. c:function:: void SNII_single_mass_ejection(double m1)
+
+ .. warning:: here, we we do not limit the computation to SNII, yields are ok, but mass includes also less massives stars !!!
+
+ Compute the mass fraction and yields of a SNII stars of masse m1.
+ Store the result in the global variable ``SingleMassFracSNII``::
+
+ SingleMassFracSNII[0] = total gas per mass unit = 1-w (1 - mass fract of residual)
+ SingleMassFracSNII[1] = 1-helium core (i.e. non processed elts)
+ SingleMassFracSNII[i+2] = mass fract of elt i. (syntetised elts)
+
+
+ .. math::
+
+ \texttt{MassFracSNII[0]} = 1-\omega(m1)
+
+ \texttt{MassFracSNII[1]} = 1-\alpha(m)
+
+ \texttt{MassFracSNII[i+2]} = p_i(m)
+
+
+
+
+
+
+
+
+SNIa mass ejection
+"""""""""""""""""""""""""""""""""""""
+
+.. c:function:: void SNIa_mass_ejection(double m1,double m2)
+
+ Compute the total mass and element mass per mass unit of SNIa stars with masses between m1 and m2.
+ Store the result in the global variable ``MassFracSNIa``::
+
+ MassFracSNIa[0] = total gas per mass unit = 1-w (1 - mass fract of residual)
+ MassFracSNIa[1] = -1 (unused)
+ MassFracSNIa[i+2] = mass fract of elt i. (SNIa yields)
+
+ .. math::
+
+ \texttt{MassFracSNIa[0]} = (N_{Ia}/M_0)\,m_{WD}
+
+ \texttt{MassFracSNIa[i+2]} = (N_{Ia}/M_0)\,m_{WD}\,p_i
+
+
+ .. warning:: in the code, this seems wrong !!! m_WD is missing !!!
+
+
+
+
+.. c:function:: void SNIa_single_mass_ejection(double m1)
+
+ Compute the total mass mass of element of a SNIa stars of masse m1.
+ Store the result in the global variable ``SingleMassFracSNIa``::
+
+ SingleMassFracSNIa[0] = total gas per mass unit = 1-w (1 - mass fract of residual)
+ SingleMassFracSNIa[1] = -1 (unused)
+ SingleMassFracSNIa[i] = mass fract of elt i. (SNIa yields)
+
+
+ .. math::
+
+ \texttt{MassFracSNIa[0]} = m_{WD}
+
+ \texttt{MassFracSNIa[i+2]} = m_{WD}\,p_i
+
+
+
+Total mass ejection
+"""""""""""""""""""""""""""""""""""""
+
+.. c:function:: void Total_mass_ejection(double m1,double m2,double M0,double *z)
+
+ Sum the contribution in mass and yields of all stars in the mass range m1,m2.
+ Store the result in the global variable EjectedMass::
+
+ EjectedMass[0] = total gas
+ EjectedMass[1] = unused
+ EjectedMass[i+2] = mass of elt i.
+
+
+ FOR THE MOMENT::
+
+ - contrib of SNII (= all stars)
+ - contrib of SNIa
+
+
+ .. math::
+
+ \texttt{EjectedMass[0]} = M_0 \left( \int^{M_{to(t)}}_{M_{to(t+dt)}} \left(1-\omega(m)\right) \Phi(m)\,dm + (N_{Ia}/M_0)\,m_{WD} \right)
+
+ \texttt{EjectedMass[i]} = M_0 \left( z_i \int^{M_{to(t)}}_{M_{to(t+dt)}} \left(1-\alpha(m)\right) \Phi(m)\,dm + \int^{M_{to(t)}}_{M_{to(t+dt)}} p_i(m) \Phi(m)\,dm + (N_{Ia}/M_0)\,m_{WD}\,p_i \right)
+
+
+
+
+
+.. c:function:: void DYIN_Total_single_mass_ejection(double m1,double *z)
+
+ Mass and element ejected by a single dying stars of mass m1.
+ This takes into account processed and non processed gas
+ The results are stored in::
+
+ SingleEjectedMass[0] = gas mass
+ SingleEjectedMass[1] = unsued
+ SingleEjectedMass[i+2] = mass of elt i.
+
+
+
+
+.. c:function:: void SNII_Total_single_mass_ejection(double m1,double *z)
+
+ Mass and element ejected by a single SNII of mass m1.
+ This takes into account processed and non processed gas
+ The results are stored in::
+
+ SingleEjectedMass[0] = gas mass
+ SingleEjectedMass[1] = unsued
+ SingleEjectedMass[i+2] = mass of elt i.
+
+
+
+
+.. c:function:: void SNIa_Total_single_mass_ejection(double m1, double *z)
+
+ Mass and element ejected by a single SNIa of mass m1.
+ The results are stored in::
+
+ SingleEjectedMass[0] = gas mass
+ SingleEjectedMass[1] = unsued
+ SingleEjectedMass[i+2] = mass of elt i.
+
+
+
+.. c:function:: void Total_single_mass_ejection(double m1,double *z,double NSNII,double NSNIa,double NDYIN)
+
+ Sum the contribution in mass and yields of one star of mass m1.
+ Store the result in the global variable EjectedMass::
+
+ SingleEjectedMass[0] = total gas
+ SingleEjectedMass[1] = unused
+ SingleEjectedMass[i+2] = mass of elt i.
+
+
+ FOR THE MOMENT::
+
+ - contrib of SNII (= all stars)
+ - contrib of SNIa
+
+
+ .. math::
+
+ \texttt{EjectedMass[0]} = M_0 \left( \int^{M_{to(t)}}_{M_{to(t+dt)}} \left(1-\omega(m)\right) \Phi(m)\,dm \right) + m_{WD}
+
+ \texttt{EjectedMass[i]} = M_0 \left( z_i \int^{M_{to(t)}}_{M_{to(t+dt)}} \left(1-\alpha(m)\right) \Phi(m)\,dm + \int^{M_{to(t)}}_{M_{to(t+dt)}} p_i(m) \Phi(m)\,dm \right) + m_{WD}\,p_i
+
+
+
+
+
+
diff --git a/PyChem/Doc/rst/ChemistryInGear.rst b/PyChem/Doc/rst/ChemistryInGear.rst
new file mode 100644
index 0000000..b270cb1
--- /dev/null
+++ b/PyChem/Doc/rst/ChemistryInGear.rst
@@ -0,0 +1,148 @@
+Chemistry in Gear
+*****************
+
+Setting the mass range
+""""""""""""""""""""""
+
+in chimie.txt
+
+For each stellar particle, we first find the min and max live time of a particle::
+
+ /* minimum live time for a given metallicity */
+ minlivetime = star_lifetime(StP[m].Metal[NELEMENTS-1],Cp->Mmax*SOLAR_MASS/All.UnitMass_in_g)*All.HubbleParam;
+
+ /* maximum live time for a given metallicity */
+ maxlivetime = star_lifetime(StP[m].Metal[NELEMENTS-1],Cp->Mmin*SOLAR_MASS/All.UnitMass_in_g)*All.HubbleParam;
+
+where the function :c:func:`star_lifetime` has been used.
+Then, we compute ``t01`` and ``t02``, which bracket the time interval between the current age and
+the time during which the stellar particule was created.
+
+Then, ``m1`` and ``m2`` are determined, corresponding to the mass of stars that end their life
+during the current time step.
+
+``m1`` is either::
+
+
+ m1 = star_mass_from_age(StP[m].Metal[NELEMENTS-1],t02/All.HubbleParam)*All.HubbleParam;
+
+or::
+
+ m1 = Cp->Mmin*SOLAR_MASS/All.UnitMass_in_g*All.HubbleParam;
+
+
+Similarly, ``m2`` is either::
+
+
+ m2 = star_mass_from_age(StP[m].Metal[NELEMENTS-1],t01/All.HubbleParam)*All.HubbleParam;
+
+or::
+
+ m2 = Cp->Mmax*SOLAR_MASS/All.UnitMass_in_g*All.HubbleParam;
+
+where we have used :c:func:`star_mass_from_age`.
+
+
+Computing the number of dying stars
+"""""""""""""""""""""""""""""""""""
+
+Once we know that some stars may die during the
+current timestep, we need to compute the number of dying stars
+
+The number(float) of SNIa is given by (:c:func:`SNIa_rate`)::
+
+ NSNIa = SNIa_rate(m1/All.HubbleParam,m2/All.HubbleParam)*M0/All.HubbleParam;
+
+The number(float) of SNII is given by (:c:func:`SNII_rate`)::
+
+ NSNII = SNII_rate(m1/All.HubbleParam,m2/All.HubbleParam)*M0/All.HubbleParam;
+
+
+In the case where we use the flag ``CHIMIE_MC_SUPERNOVAE``,
+``NSNIa`` and ``NSNII`` are rounded to integer values, according to
+some probabilities::
+
+
+ double fNSNIa,fNSNII;
+
+ fNSNIa = NSNIa-floor(NSNIa);
+ NSNIa = floor(NSNIa);
+
+ if (get_Chimie_random_number(P[i].ID) < fNSNIa)
+ NSNIa = NSNIa+1;
+
+
+ fNSNII = NSNII-floor(NSNII);
+ NSNII = floor(NSNII);
+
+ if (get_Chimie_random_number(P[i].ID) < fNSNII)
+ NSNII = NSNII+1;
+
+
+
+
+
+Computing ejected mass and yields
+"""""""""""""""""""""""""""""""""
+
+
+If ``CHIMIE_MC_SUPERNOVAE`` is used, the total mass, as well as the ejected mass of each element
+is computed using the function :c:func:`Total_single_mass_ejection`::
+
+ Total_single_mass_ejection(0.5*(m1+m2)/All.HubbleParam,metals,NSNII,NSNIa,0);
+
+
+This functions fill the array ``SingleEjectedMass``.
+This array is then copied to the variables
+containing the total gas mass and the mass ejected per element::
+
+ StP[m].TotalEjectedGasMass = SingleEjectedMass[0]*All.HubbleParam;
+
+ for (k=0;k<NELEMENTS;k++)
+ StP[m].TotalEjectedEltMass[k] = SingleEjectedMass[k+2]*All.HubbleParam;
+
+
+If ``CHIMIE_MC_SUPERNOVAE`` is not used, the ejected total mass, as well as the ejected mass of each element
+is computed using the function :c:func:`Total_mass_ejection`::
+
+ Total_mass_ejection(m1/All.HubbleParam,m2/All.HubbleParam,M0/All.HubbleParam,metals);
+
+This functions fill the array ``EjectedMass``.
+
+
+This array is then copied to the variables
+containing the total gas mass and the mass ejected per element::
+
+ StP[m].TotalEjectedGasMass = EjectedMass[0]*All.HubbleParam;
+
+ for (k=0;k<NELEMENTS;k++)
+ StP[m].TotalEjectedEltMass[k] = EjectedMass[k+2]*All.HubbleParam;
+
+
+
+Computing ejected energy
+""""""""""""""""""""""""
+
+Finally, the total ejected energy per mass unit is obtained by multiplying the number of SNIa and SNII
+by the assumed supernova energy::
+
+ StP[m].TotalEjectedEgySpec = All.ChimieSupernovaEnergy* (NSNIa + NSNII) /StP[m].TotalEjectedGasMass;
+
+
+Variables used for the ejection of mass and energy
+""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The variables used for the ejection of mass and energy are::
+
+ StP[m].TotalEjectedGasMass
+ StP[m].TotalEjectedEltMass[k]
+ StP[m].TotalEjectedEgySpec
+ StP[m].NumberOfSNIa
+ StP[m].NumberOfSNII
+
+
+
+
+
+
+
diff --git a/PyChem/Doc/rst/ChemistryPythonCAPI.rst b/PyChem/Doc/rst/ChemistryPythonCAPI.rst
new file mode 100644
index 0000000..c89f318
--- /dev/null
+++ b/PyChem/Doc/rst/ChemistryPythonCAPI.rst
@@ -0,0 +1,93 @@
+Chemistry Python-C API
+**********************
+
+
+.. c:function:: static PyObject * chemistry_init_chimie(PyObject *self, PyObject *args, PyObject *kwds)
+
+.. c:function:: static PyObject * chemistry_set_table(PyObject *self, PyObject *args, PyObject *kwds)
+
+.. c:function:: static PyObject * chemistry_get_imf(self, args)
+
+.. c:function:: static PyObject * chemistry_get_imf_M(self, args)
+
+.. c:function:: static PyObject * chemistry_get_imf_N(self, args)
+
+.. c:function:: static PyObject * chemistry_star_lifetime(self, args)
+
+.. c:function:: static PyObject * chemistry_star_mass_from_age(self, args)
+
+.. c:function:: static PyObject * chemistry_DYIN_rate(self, args)
+
+.. c:function:: static PyObject * chemistry_SNII_rate(self, args)
+
+.. c:function:: static PyObject * chemistry_SNIa_rate(self, args)
+
+.. c:function:: static PyObject * chemistry_DYIN_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_DYIN_single_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_SNII_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_SNII_single_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_SNIa_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_SNIa_single_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_Total_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_DYIN_Total_single_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_SNII_Total_single_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_SNIa_Total_single_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_Total_single_mass_ejection(self, args)
+
+.. c:function:: static PyObject * chemistry_cooling_function(self, args)
+
+.. c:function:: static PyObject * chemistry_get_Mmax(self, args)
+
+.. c:function:: static PyObject * chemistry_get_Mmin(self, args)
+
+.. c:function:: static PyObject * chemistry_get_Mco(self, args)
+
+.. c:function:: static PyObject * chemistry_get_SNIa_Mpl(self, args)
+
+.. c:function:: static PyObject * chemistry_get_SNIa_Mpu(self, args)
+
+.. c:function:: static PyObject * chemistry_get_SNII_Mmin(self, args)
+
+.. c:function:: static PyObject * chemistry_get_SNII_Mmax(self, args)
+
+.. c:function:: static PyObject * chemistry_get_imf_Ntot(self, args)
+
+.. c:function:: static PyObject * chemistry_get_as(self, args)
+
+.. c:function:: static PyObject * chemistry_get_bs(self, args)
+
+.. c:function:: static PyObject * chemistry_get_fs(self, args)
+
+.. c:function:: static PyObject * chemistry_get_allnelts(self, args)
+
+.. c:function:: static PyObject * chemistry_get_nelts(self, args)
+
+.. c:function:: static PyObject * chemistry_get_allelts_labels(self, args)
+
+.. c:function:: static PyObject * chemistry_get_elts_labels(self, args)
+
+.. c:function:: static PyObject * chemistry_get_elts_SolarAbundances(self, args)
+
+.. c:function:: static PyObject * chemistry_get_MSNIa(self, args)
+
+.. c:function:: static PyObject * chemistry_get_MassFracSNII(self, args)
+
+.. c:function:: static PyObject * chemistry_get_SingleMassFracSNII(self, args)
+
+.. c:function:: static PyObject * chemistry_imf_sampling(self, args)
+
+.. c:function:: static PyObject * chemistry_SNII_rate_P(self, args)
+
+.. c:function:: static PyObject * chemistry_SNIa_rate_P(self, args)
+
+.. c:function:: static PyObject * chemistry_SNII_mass_ejection_P(self, args)
diff --git a/PyChem/Doc/rst/GenerateChemistryTable.rst b/PyChem/Doc/rst/GenerateChemistryTable.rst
new file mode 100644
index 0000000..0d67321
--- /dev/null
+++ b/PyChem/Doc/rst/GenerateChemistryTable.rst
@@ -0,0 +1,163 @@
+How to generage a Chemistry Table for GEAR
+******************************************
+
+Setup a parameter file
+======================
+
+
+First, it is important to create a parameter file that describes
+some chemistry parameters, including the IMF as well as the path to yields tables.
+
+The file (here, called ``chemistryparam.simple.py``) has a python syntax and is decomposed in the following blocks:
+
+
+IMF section
+"""""""""""
+
+The IMF is described by the following parameters::
+
+ ###########################
+ # IMF
+ ###########################
+
+ Mmin = 0.05 # min mass
+ Mmax = 50. # max mass
+
+ m_s = [0.08, 0.5, 1.0] # masses ranges
+ a_s = [-1.35, -1.35, -1.35, -1.35] # slopes
+
+
+
+SNII section
+""""""""""""
+
+Parameters for the SNII model::
+
+ ###########################
+ # SNII
+ ###########################
+
+ SNII_Mmin = 8. # mininal mass for SNII
+
+
+
+SNIa section
+""""""""""""
+
+Parameters for the SNIa model. Here, we use the Kobayashi model::
+
+ ###########################
+ # SNIa
+ ###########################
+
+ SNIa_Mpl = 3.0 # minimal mass for SNIa
+ SNIa_Mpu = 8.0 # maximal mass for SNIa
+
+ SNIa_a = -0.35 # imf slope
+
+ SNIa_Mdl1 = 0.9 # minimal mass for MS stars
+ SNIa_Mdu1 = 1.5 # maximal mass for MS stars
+ SNIa_bb1 = 0.02 # normalisation
+
+ SNIa_Mdl2 = 1.8 # minimal mass for RG stars
+ SNIa_Mdu2 = 2.6 # maximal mass for RG stars
+ SNIa_bb2 = 0.05 # normalisation
+
+
+
+Metal ejection section
+""""""""""""""""""""""
+
+Parameters related the the ejection of different elements::
+
+ ###########################
+ # Metal Ejection
+ ###########################
+
+ MetalFile = ['tables/MetalEjection.dat'] # file containing the amount of meta
+ # given as a function of its mass
+ # (Tsujimoto 95, Tab 1)
+
+ HeliumCoreFile = 'tables/HeliumCore.dat' # mass of helium core and remenent g
+ #
+ # Ej : 1-rement = ejected ma
+ # Ejnp: 1-helium core = ejected ma
+ # (Kobayashi 2000, private comm.)
+
+
+ SNIaFile = 'tables/SNIa/SNIaEjection.dat' # fraction of each element ejected b
+ # (Tsujimoto 95,Tab 2, W7)(Kodama &
+
+
+ MeanWDMass = 1.38 # Mean Whith Dwarfs Mass
+
+ # masses for metal injection
+ Mmin1 = 10.
+ Mmax1 = Mmax*1.5
+
+ # masses for helium core
+ Mmin2 = Mmin
+ Mmax2 = Mmax*1.5
+
+ # resolution in mass for integration
+ dM = 0.001
+
+ # number of output points
+ n = 200
+
+
+
+
+Solar abundances section
+""""""""""""""""""""""""
+
+File or list of files containing the solar abundances of different elements::
+
+ ###########################
+ # Solar abundances
+ ###########################
+
+ SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt" # solar abundances for all elements
+
+
+
+
+Elements section
+""""""""""""""""
+
+It is possible to specify a list of elements to follow, using ``elts``.
+In case ``elts`` is defined, ``nelts`` is set to ``len(elts)``.
+If ``elts`` is set to ``None``, only elements found into the tables
+are considered. Their number must be equal to ``nelts``::
+
+ ###########################
+ # Elements to follow
+ ###########################
+
+ elts = ["Fe","Mg","O","Metals"]
+ nelts = 4
+
+
+
+Generate the output
+===================
+
+Assuming
+The model is then display::
+
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.simple.py -o chemistry.simple.dat
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/Doc/rst/Overview.rst b/PyChem/Doc/rst/Overview.rst
new file mode 100644
index 0000000..ede6e1a
--- /dev/null
+++ b/PyChem/Doc/rst/Overview.rst
@@ -0,0 +1,6 @@
+Overview
+**********************
+
+
+**PyChem** is a wrapper around the chemical part of GEAR. It provides
+additional tools to generate chemistry tables.
diff --git a/PyChem/Doc/rst/PythonModules.rst b/PyChem/Doc/rst/PythonModules.rst
new file mode 100644
index 0000000..f2bac39
--- /dev/null
+++ b/PyChem/Doc/rst/PythonModules.rst
@@ -0,0 +1,13 @@
+Python modules
+==============
+
+.. toctree::
+ :maxdepth: 2
+
+ libimf
+ liblifetime
+ libmetalsSNIa
+ libmetalsSNII
+ libSNIa
+ libSNII
+ libSolarAbundances
diff --git a/PyChem/Doc/rst/TablesAndContent.rst b/PyChem/Doc/rst/TablesAndContent.rst
new file mode 100644
index 0000000..dd01da4
--- /dev/null
+++ b/PyChem/Doc/rst/TablesAndContent.rst
@@ -0,0 +1,203 @@
+Tables and their content
+************************
+
+MetalFile
+=========
+
+Mass of different elements, given in solar mass, produced by
+a star of mass M.
+
+example, from Tsujimoto 95, Table 1 : ``tables/MetalEjection.dat``::
+
+
+ # M Fe56 Mg24 O16 Metals
+ 10 0.0 0.0 0.0 0.0
+ 13 1.50e-1 9.23e-3 1.51e-1 4.51e-1
+ 15 1.44e-1 3.16e-2 3.55e-1 8.20e-1
+ 18 7.57e-2 3.62e-2 7.92e-1 1.45
+ 20 7.32e-2 1.47e-1 1.48 2.28
+ 25 5.24e-2 1.59e-1 2.99 4.28
+ 40 7.50e-2 3.54e-1 9.11 11.47
+ 70 7.50e-2 7.87e-1 21.4 26.71
+
+During the table construction, content of the table is processed by::
+
+ SNIIelts = libmetalsSNII.WriteParams(f,Mmin,Mmax,m_s,a_s,MetalFile,HeliumCoreFile,elts,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n)
+
+**Values initially in mass are converted in mass fraction.**
+Values are then written in the block labeled ``#### Metal Parameters ####``.
+
+In the C/API, this table is read by::
+
+ Elts[it][i].label # label of elements
+ Elts[it][i].Mmin Elts[it][i].Step # min mass, steps in mass
+ Elts[it][i].Metal[j] # mass fraction of element as a function of mass
+
+``it=i+2`` for element i.
+
+
+To retrieve the mass fraction of ejected elements for a 20 solar mass star, from python::
+
+ from PyChem import chemistry
+ chemistry.init_chimie("../chemistry.simple.dat")
+ chemistry.SNII_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())[2:]
+
+This recover the values of the original table::
+ 20*chemistry.SNII_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())[2:]
+
+
+To display the tables (in mass fraction)::
+
+ ../scripts/pychem_plot_SNII_yields --log xy --legend --xmin 0.05 --xmax 100 --ymin 1e-4 --ymax 1 chemistry.simple.dat
+
+
+
+HeliumCoreFile
+==============
+
+Mass of the remnent object (Residu, :math:`\omega(m)`) and helium core (:math:`\alpha(m)`) mass, both in solar mass,
+a star of mass m.
+
+
+example (from Kobayashi 2000, private comm.) : ``tables/HeliumCore.dat``::
+
+
+ # Mass Residu Helium Core
+ 0.80 0.459 0.459
+ 1.00 0.473 0.473
+ 1.50 0.480 0.480
+ 1.75 0.487 0.487
+ 2.00 0.404 0.404
+ 2.50 0.501 0.501
+ 3.00 0.508 0.508
+ 3.50 0.515 0.515
+ 4.00 0.550 0.550
+ 4.30 0.620 0.620
+ 4.60 0.675 0.675
+ 4.80 0.730 0.730
+ 5.00 0.870 0.870
+ 6.00 1.010 1.010
+ 8.00 1.120 1.120
+ 10.0 1.150 1.150
+ 13.0 1.500 3.300
+ 15.0 1.500 4.000
+ 18.0 1.500 5.000
+ 20.0 1.600 6.000
+ 25.0 2.000 8.000
+ 40.0 2.300 16.00
+ 70.0 2.500 32.00
+
+During the table construction, content of the table is processed by::
+
+ SNIIelts = libmetalsSNII.WriteParams(f,Mmin,Mmax,m_s,a_s,MetalFile,HeliumCoreFile,elts,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n)
+
+**Values initially in mass are converted in mass fraction.**
+In addition, we keep :math:`1-\omega(m)` and :math:`1-\alpha(m)`,
+instead of :math:`\omega(m)` :math:`\alpha(m)`.
+Values are then written in the block labeled ``#### Metal Parameters ####``.
+
+
+In the C/API, this table is read by::
+
+ Elts[it][i].label # label of elements
+ Elts[it][i].Mmin Elts[it][i].Step # min mass, steps in mass
+ Elts[it][i].Metal[j] # mass fraction of element as a function of mass
+
+``it=0`` for :math:`1-\omega(m)` (labeled Ej)
+and ``it=1`` for :math:`1-\alpha(m)` (labeled Ejnp).
+
+
+
+To retrieve the mass fraction of the ejected mass (:math:`1-\omega(m)`) and the mass fraction of the non
+processed mass (:math:`1-\alpha(m)`)::
+
+ from PyChem import chemistry
+ chemistry.init_chimie("../chemistry.simple.dat")
+ chemistry.SNII_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())[:2]
+
+This recover the values of the original table::
+ 20*(1-chemistry.SNII_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())[:2])
+
+
+
+To display the tables (in mass fraction)::
+
+ ../scripts/pychem_plot_SNII_yields --log xy --legend --xmin 0.05 --xmax 100 --ymin 1e-4 --ymax 1 chemistry.simple.dat
+
+
+
+
+
+SNIaFile
+========
+
+Mass of different elements, in solar mass, ejected during a SNIa explosion
+involving a 1.38 white dwarf.
+
+example (from Iwamoto et al 99) : ``tables/SNIa/SNIaEjection.dat``::
+
+ # Fe56 Mg24 O16 Metals
+ 6.13e-1 8.5e-3 1.43e-1 1.3743
+
+During the table construction, content of the table is processed by::
+
+ SNIaelts = libmetalsSNIa.WriteParams(f,SNIaFile,MeanWDMass,elts,nelts)
+
+**Contrary to the SNII tables, here, the elements are not converted in mass fraction. Values are then still
+in solar mass**.
+Their are then written in the block labeled ``# SNIa Metal Ejection``.
+
+
+In the C/API, this table is read by::
+
+ Elts[it][i].MSNIa # mass of element ejected by a SNIa
+
+``it=i+2`` for element i.
+``it=0`` and ``it=1`` are not used.
+
+
+To retrieve the ejected masses in python::
+
+ from PyChem import chemistry
+ chemistry.init_chimie("../chemistry.simple.dat")
+ chemistry.SNIa_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())[2:] * chemistry.CodeUnits_to_SolarMass_Factor()
+
+This recover directly the values of the original table.
+Note that by default the output of ``SNIa_single_mass_ejection`` is in code units.
+
+
+
+
+
+
+SolarAbundancesFile
+===================
+
+example : ``tables/SolarAbundances/Grevesse98.txt``::
+
+ # Z Elt X A Flag
+ 01 H 12.00 1.00797 0
+ 02 He 10.93 4.0026 0
+ 03 Li 1.10 6.941 0
+ 04 Be 1.40 9.0122 0
+ 05 B 2.55 10.811 0
+ 06 C 8.52 12.01115 0
+ 07 N 7.92 14.0067 0
+ 08 O 8.83 15.9994 0
+ 09 F 4.56 18.9984 0
+ 10 Ne 8.08 20.183 0
+ 11 Na 6.33 22.9898 0
+ 12 Mg 7.58 24.312 0
+ 13 Al 6.47 26.9815 0
+ 14 Si 7.55 28.086 0
+
+During the table construction, content of the table is processed by::
+
+ libSolarAbundances.WriteParams(f,SolarAbundancesFile,elts)
+
+
+
+
+
+
+
diff --git a/PyChem/Doc/rst/libSNII.rst b/PyChem/Doc/rst/libSNII.rst
new file mode 100644
index 0000000..5b357aa
--- /dev/null
+++ b/PyChem/Doc/rst/libSNII.rst
@@ -0,0 +1,7 @@
+The PyChem.libSNII module
+*************************
+
+.. automodule:: PyChem.libSNII
+ :members:
+
+
diff --git a/PyChem/Doc/rst/libSNIa.rst b/PyChem/Doc/rst/libSNIa.rst
new file mode 100644
index 0000000..d3b2c06
--- /dev/null
+++ b/PyChem/Doc/rst/libSNIa.rst
@@ -0,0 +1,7 @@
+The PyChem.libSNIa module
+*************************
+
+.. automodule:: PyChem.libSNIa
+ :members:
+
+
diff --git a/PyChem/Doc/rst/libSolarAbundances.rst b/PyChem/Doc/rst/libSolarAbundances.rst
new file mode 100644
index 0000000..62c7bea
--- /dev/null
+++ b/PyChem/Doc/rst/libSolarAbundances.rst
@@ -0,0 +1,7 @@
+The PyChem.libSolarAbundances module
+************************************
+
+.. automodule:: PyChem.libSolarAbundances
+ :members:
+
+
diff --git a/PyChem/Doc/rst/libimf.rst b/PyChem/Doc/rst/libimf.rst
new file mode 100644
index 0000000..ff69585
--- /dev/null
+++ b/PyChem/Doc/rst/libimf.rst
@@ -0,0 +1,7 @@
+The PyChem.libimf module
+************************
+
+.. automodule:: PyChem.libimf
+ :members:
+
+
diff --git a/PyChem/Doc/rst/liblifetime.rst b/PyChem/Doc/rst/liblifetime.rst
new file mode 100644
index 0000000..753f264
--- /dev/null
+++ b/PyChem/Doc/rst/liblifetime.rst
@@ -0,0 +1,7 @@
+The PyChem.liblifetime module
+*****************************
+
+.. automodule:: PyChem.liblifetime
+ :members:
+
+
diff --git a/PyChem/Doc/rst/libmetalsSNII.rst b/PyChem/Doc/rst/libmetalsSNII.rst
new file mode 100644
index 0000000..11944cb
--- /dev/null
+++ b/PyChem/Doc/rst/libmetalsSNII.rst
@@ -0,0 +1,7 @@
+The PyChem.libmetalsSNII module
+*******************************
+
+.. automodule:: PyChem.libmetalsSNII
+ :members:
+
+
diff --git a/PyChem/Doc/rst/libmetalsSNIa.rst b/PyChem/Doc/rst/libmetalsSNIa.rst
new file mode 100644
index 0000000..cea28ed
--- /dev/null
+++ b/PyChem/Doc/rst/libmetalsSNIa.rst
@@ -0,0 +1,7 @@
+The PyChem.libmetalsSNIa module
+*******************************
+
+.. automodule:: PyChem.libmetalsSNIa
+ :members:
+
+
diff --git a/PyChem/Doc/rsync b/PyChem/Doc/rsync
new file mode 100755
index 0000000..ffa7058
--- /dev/null
+++ b/PyChem/Doc/rsync
@@ -0,0 +1 @@
+rsync -av _build/html/* ~/WWW/public/PyChem/.
diff --git a/PyChem/PyChem/__init__.py b/PyChem/PyChem/__init__.py
new file mode 100644
index 0000000..102346d
--- /dev/null
+++ b/PyChem/PyChem/__init__.py
@@ -0,0 +1 @@
+from pNbody import *
diff --git a/PyChem/PyChem/__init__.pyc b/PyChem/PyChem/__init__.pyc
new file mode 100644
index 0000000..a720b47
Binary files /dev/null and b/PyChem/PyChem/__init__.pyc differ
diff --git a/PyChem/PyChem/libSNII.py b/PyChem/PyChem/libSNII.py
new file mode 100644
index 0000000..0ca2f3c
--- /dev/null
+++ b/PyChem/PyChem/libSNII.py
@@ -0,0 +1,21 @@
+"""
+This module deals with SNII parameters
+"""
+
+def WriteParams(f,SNII_Mmin):
+ """
+ Write SNII parameters.
+ For the moment, only SNII_Mmin is taken into account.
+
+ :param f: file
+ :type f: file handler
+
+ :param SNII_Mmin: min SNII mass
+ :type SNII_Mmin: float
+
+ :returns: none
+
+ """
+ f.write("#### SNII Parameters ####\n\n")
+ f.write("%g\n"%SNII_Mmin)
+ f.write("\n")
diff --git a/PyChem/PyChem/libSNII.pyc b/PyChem/PyChem/libSNII.pyc
new file mode 100644
index 0000000..8944cbe
Binary files /dev/null and b/PyChem/PyChem/libSNII.pyc differ
diff --git a/PyChem/PyChem/libSNIa.py b/PyChem/PyChem/libSNIa.py
new file mode 100644
index 0000000..97180ef
--- /dev/null
+++ b/PyChem/PyChem/libSNIa.py
@@ -0,0 +1,52 @@
+"""
+This module deals with SNIa parameters
+"""
+
+
+def WriteParams(f,SNIa_Mpl,SNIa_Mpu,SNIa_a,SNIa_Mdl1,SNIa_Mdu1,SNIa_bb1,SNIa_Mdl2,SNIa_Mdu2,SNIa_bb2):
+ """
+ Write SNIa parameters:
+
+ :param f: file
+ :type f: file handler
+
+ :param SNIa_Mpl: minimal mass for the SNIa
+ :type SNIa_Mpl: float
+
+ :param SNIa_Mpu: maximal mass for the SNIa
+ :type SNIa_Mpu: float
+
+ :param SNIa_a: imf slope of SNIa (Kobayashi)
+ :type SNIa_a: float
+
+ :param SNIa_Mdl1: min mass of MS stars (Kobayashi)
+ :type SNIa_Mdl1: float
+
+ :param SNIa_Mdu1: max mass of MS stars (Kobayashi)
+ :type SNIa_Mdu1: float
+
+ :param SNIa_bb1: normalisation factor (Kobayashi)
+ :type SNIa_bb1: float
+
+ :param SNIa_Mdl2: min mass of RG stars (Kobayashi)
+ :type SNIa_Mdl2: float
+
+ :param SNIa_Mdu2: max mass of RG stars (Kobayashi)
+ :type SNIa_Mdu2: float
+
+ :param SNIa_bb2: normalisation factor (Kobayashi)
+ :type SNIa_bb2: float
+
+ :returns: none
+
+ """
+
+ f.write("#### SNIa Parameters ####\n\n")
+ f.write("%g %g\n"%(SNIa_Mpl,SNIa_Mpu))
+ f.write("%g\n"%(SNIa_a))
+ f.write("%g %g %g\n"%(SNIa_Mdl1,SNIa_Mdu1,SNIa_bb1))
+ f.write("%g %g %g\n"%(SNIa_Mdl2,SNIa_Mdu2,SNIa_bb2))
+ f.write("\n")
+
+
+
diff --git a/PyChem/PyChem/libSNIa.pyc b/PyChem/PyChem/libSNIa.pyc
new file mode 100644
index 0000000..58d431a
Binary files /dev/null and b/PyChem/PyChem/libSNIa.pyc differ
diff --git a/PyChem/PyChem/libSolarAbundances.py b/PyChem/PyChem/libSolarAbundances.py
new file mode 100644
index 0000000..5ab1406
--- /dev/null
+++ b/PyChem/PyChem/libSolarAbundances.py
@@ -0,0 +1,121 @@
+#!/usr/bin/env python
+
+import string,sys,os
+from numpy import *
+
+import Ptools as pt
+
+
+"""
+This module deals with tables of Solar Abundances
+"""
+
+
+def WriteParams(f,Files,elts):
+ """
+ Write Solar Abundances:
+
+ :param f: file
+ :type f: file handler
+
+ :param Files: list of files containing values for the elements
+ :type Files: str
+
+ :param elts: list of elements
+ :type elts: python list
+
+
+ """
+ E = PE(Files)
+
+ f.write("\n")
+ f.write("# Element Solar Abundances\n")
+ f.write("\n")
+ f.write("# Number of elements\n")
+ f.write("%d\n"%len(elts))
+ f.write("\n")
+
+ for elt in elts:
+
+ if elt == "Metals":
+ abun = 0.02
+ else:
+ abun = E[elt]
+
+ f.write("# %s\n"%elt)
+ f.write("%g\n"%abun)
+ f.write("\n")
+
+
+
+
+
+
+def Read(file):
+ """
+ Read a file containing solar abundances.
+
+ :param file: file name
+ :type file: string
+
+ :returns: Z,X,A,Elt
+
+ """
+
+ f = open(file,'r')
+ lines = f.readlines()
+ f.close()
+
+ lines = lines[1:]
+
+ Elt = []
+ Z = zeros(len(lines),int)
+ X = zeros(len(lines),float)
+ A = zeros(len(lines),float)
+
+ for i,line in enumerate(lines):
+ line = string.split(line)
+
+ Elt.append(line[1])
+
+ Z[i] = int(line[0])
+ X[i] = float(line[2])
+ A[i] = float(line[3])
+
+ return Z,X,A,Elt
+
+
+class PE(dict):
+ def __init__(self,file):
+
+ Zs,Xs,As,Elts = Read(file)
+
+ '''
+ here,
+ Xs = 12 + log(Nx/NH)
+ '''
+
+ self.Zs = Zs
+ self.Xs = Xs
+ self.As = As
+ self.Elts = Elts
+
+ self.Ys = Xs
+ self.Xs = As *10**(Xs-12)
+ for i,elt in enumerate(self.Elts):
+ self[elt] = self.Xs[i]
+
+ def AtomicMass(self,elt):
+ idx = self.Elts.index(elt)
+ return self.As[idx]
+
+ def AtomicNumber(self,elt):
+ idx = self.Elts.index(elt)
+ return self.Zs[idx]
+
+ def SolarAbundance(self,elt):
+ """
+ Ax * Nx/NH (Ax=atomic mass)
+ """
+ idx = self.Elts.index(elt)
+ return self.Xs[idx]
diff --git a/PyChem/PyChem/libSolarAbundances.pyc b/PyChem/PyChem/libSolarAbundances.pyc
new file mode 100644
index 0000000..efeec6c
Binary files /dev/null and b/PyChem/PyChem/libSolarAbundances.pyc differ
diff --git a/PyChem/PyChem/libimf.py b/PyChem/PyChem/libimf.py
new file mode 100644
index 0000000..46da47a
--- /dev/null
+++ b/PyChem/PyChem/libimf.py
@@ -0,0 +1,224 @@
+
+from numpy import *
+import sys
+
+"""
+Compute functions linked to IMF computation
+"""
+
+def WriteParams(f,Mmin,Mmax,m_s,a_s):
+ """Write the IMF parameters in a file:
+
+ :param f: file
+ :type f: file handler
+
+ :param Mmin: min mass of the stars in the IMF
+ :type Mmin: float
+
+ :param Mmax: max mass of the stars in the IMF
+ :type Mmax: float
+
+ :param m_s: masses
+ :type m_s: ndarray
+
+ :param a_s: slopes
+ :type a_s: ndarray
+
+ :returns: None
+
+
+ """
+
+ f.write("#### IMF Parameters ####\n\n")
+
+ f.write("%g %g\n"%(Mmin,Mmax))
+ f.write("%d\n"%len(m_s))
+
+ if len(m_s)==0: # in case of single slope imf
+ m_s = [0]
+
+ for m in m_s:
+ f.write("%g "%m)
+ f.write("\n")
+
+ for a in a_s:
+ f.write("%g "%a)
+ f.write("\n")
+ f.write("\n")
+
+
+
+
+def ComputeConstants(m_s,a_s,mmin,mmax):
+ """
+ compute the coefficients of the power laws (b_s)
+ that normalize the imf:
+
+ :param m_s: masses
+ :type m_s: ndarray
+
+ :param a_s: slopes
+ :type a_s: ndarray
+
+ :param mmin: min mass of the stars in the IMF
+ :type mmin: float
+
+ :param mmax: max mass of the stars in the IMF
+ :type mmax: float
+
+ :returns: b_s
+
+ """
+
+ #####################
+ # find the constant
+ #####################
+
+ n = len(m_s)
+
+ b_s = zeros(len(a_s))
+
+ integral = 0
+
+ if n==0:
+ p = a_s[0]+1
+ integral = integral + (mmax**p-mmin**p)/(p)
+ b_s[0] = 1./integral
+
+ else:
+
+ cte = 1.0
+
+ if mmin < m_s[0]:
+ p = a_s[0]+1
+ integral = integral + (m_s[0]**p - mmin**p)/p
+
+
+ for i in xrange(n-1):
+ cte = cte*m_s[i]**( a_s[i] - a_s[i+1] )
+ p = a_s[i+1]+1
+ integral = integral + cte*(m_s[i+1]**p - m_s[i]**p)/p
+
+
+ if mmax > m_s[-1]:
+ cte = cte*m_s[-1]**( a_s[n-1] - a_s[n] )
+ p = a_s[n]+1
+ integral = integral + cte*(mmax**p - m_s[-1]**p)/p
+
+ # compute all b
+ b_s[0] = 1./integral
+
+ for i in xrange(n):
+ b_s[i+1] = b_s[i] * m_s[i]**( a_s[i] - a_s[i+1] )
+
+
+ return b_s
+
+
+
+
+def imf(m,m_s,a_s,b_s,mmin,mmax):
+ """
+ Compute an IMF, as a suite of power law:
+
+ :param m: star mass
+ :type m: float
+
+ :param m_s: masses
+ :type m_s: ndarray
+
+ :param a_s: slopes
+ :type a_s: ndarray
+
+ :param b_s: constants
+ :type b_s: ndarray
+
+ :param mmin: min mass of the stars in the IMF
+ :type mmin: float
+
+ :param mmax: max mass of the stars in the IMF
+ :type mmax: float
+
+ :returns: imf
+
+
+ """
+
+
+
+ #####################
+ # compute IMF
+ #####################
+
+ n = len(m_s)
+
+
+ if n==0:
+ return b_s[0]* m**a_s[0]
+
+
+ else:
+
+ for i in xrange(n):
+ if m < m_s[i]:
+ return b_s[i]* m**a_s[i]
+
+
+ return b_s[-1]* m**a_s[-1]
+
+
+
+
+def imfv(m,m_s,a_s,b_s,mmin,mmax):
+ """
+
+ .. warning:: Needs to be documented !!!
+
+ :param m: star mass
+ :type m: float
+
+ :param m_s: masses
+ :type m_s: ndarray
+
+ :param a_s: slopes
+ :type a_s: ndarray
+
+ :param b_s: constants
+ :type b_s: ndarray
+
+ :param mmin: min mass of the stars in the IMF
+ :type mmin: float
+
+ :param mmax: max mass of the stars in the IMF
+ :type mmax: float
+
+ """
+
+
+
+ #####################
+ # compute IMF
+ #####################
+
+ n = len(m_s)
+
+
+ if n==0:
+ return b_s[0]* m**a_s[0]
+
+
+ else:
+
+
+ i = 0
+ imf = b_s[i]* m**a_s[i]
+
+ for i in xrange(n):
+ c = (m > m_s[i])
+ imf = where(c,b_s[i+1]* m**a_s[i+1],imf)
+
+ return imf
+
+
+
+
diff --git a/PyChem/PyChem/libimf.pyc b/PyChem/PyChem/libimf.pyc
new file mode 100644
index 0000000..8ce1b8b
Binary files /dev/null and b/PyChem/PyChem/libimf.pyc differ
diff --git a/PyChem/PyChem/liblifetime.py b/PyChem/PyChem/liblifetime.py
new file mode 100644
index 0000000..d0d5dd4
--- /dev/null
+++ b/PyChem/PyChem/liblifetime.py
@@ -0,0 +1,17 @@
+
+def WriteParams(f):
+ """
+ Write lifetime parameters.
+ For the moment, the values are simply hard coded.
+
+ :param f: file
+ :type f: the file handler
+ :returns:none
+ """
+
+ f.write("#### Livetime ####\n")
+ f.write("\n")
+ f.write("-40.1107251082866 5.50992173040633 0.782431795366473\n")
+ f.write(" 141.929566656232 -15.88948185575660 -3.255779246324010\n")
+ f.write("-261.365531429482 17.07350618651300 9.866058678313810\n")
+ f.write("\n")
diff --git a/PyChem/PyChem/liblifetime.pyc b/PyChem/PyChem/liblifetime.pyc
new file mode 100644
index 0000000..e03af00
Binary files /dev/null and b/PyChem/PyChem/liblifetime.pyc differ
diff --git a/PyChem/PyChem/libmetalsSNII.py b/PyChem/PyChem/libmetalsSNII.py
new file mode 100644
index 0000000..cff3e9d
--- /dev/null
+++ b/PyChem/PyChem/libmetalsSNII.py
@@ -0,0 +1,543 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+import string,types,sys
+
+import libimf
+
+
+
+
+#####################################################
+def read_MetalFile(file,columns=None,lines=None,dtype=float,skipheader=False,cchar='#'):
+#####################################################
+ """
+ Read a file containing metal information:
+
+
+ :param fd: file name
+ :type fd: string or file handler
+
+ :param columns: columns to read
+ :type columns: python list
+
+ :param lines: lines to read
+ :type lines: python list
+
+ :param dtype: output dtype
+ :type dtype: dtype
+
+ :param skipheader: skip header
+ :type skipheader: bool
+
+ :param cchar: comment charater
+ :type cchar: string
+
+ :returns: data
+
+
+ ``[X,Y,Z] = READ('FILE',[1,4,13],lines=[10,1000])
+ Read columns 1,4 and 13 from 'FILE' from line 10 to 1000
+ into array X,Y and Z``
+
+
+ """
+
+
+ def RemoveComments(l):
+ if l[0]==cchar:
+ return None
+ else:
+ return l
+
+ def toNumList(l):
+ return map(dtype,l)
+
+ if type(file) != types.FileType:
+ f = open(file,'r')
+ else:
+ f = file
+
+
+ # read header while there is one
+ while 1:
+ fpos = f.tell()
+ header = f.readline()
+ if header[0] != cchar:
+ f.seek(fpos)
+ header = None
+ break
+ else:
+ if skipheader:
+ header = None
+ else:
+ # create dict from header
+ header = string.strip(header[2:])
+ elts = string.split(header)
+ break
+
+
+ # now, read the file content
+ lines = f.readlines()
+
+ # remove trailing
+ lines = map(string.strip, lines)
+
+
+ # remove comments
+ #lines = map(RemoveComments, lines)
+
+ # split
+ lines = map(string.split, lines)
+
+ # convert into float
+ lines = map(toNumList, lines)
+
+ # convert into array
+ lines = array(map(array, lines))
+
+ # transpose
+ lines = transpose(lines)
+
+ if header != None:
+ iobs = {}
+ i = 0
+ for elt in elts:
+ iobs[elt]=i
+ i = i + 1
+
+ vals = {}
+ for key in iobs.keys():
+ vals[key] = lines[iobs[key]]
+
+ return elts,vals
+
+
+ # return
+ if columns == None:
+ return lines
+ else:
+ return lines.take(axis=0,indices=columns)
+
+
+
+
+
+
+
+
+def WriteParams(f,Mmin,Mmax,m_s,a_s,MetalFiles,HeliumCoreFile,elts,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n):
+ """Write the SNIa parameters in a file:
+
+
+ :param f: file
+ :type f: file handler
+
+ :param Mmin: min SNII mass
+ :type Mmin: float
+
+ :param Mmax: max SNII mass
+ :type Mmax: float
+
+ :param m_s: IMF masses
+ :type m_s: ndarray
+
+ :param a_s: IMF slopes
+ :type a_s: ndarray
+
+ :param MetalFiles: file name of the file containing yields information
+ :type MetalFiles: string
+
+ :param HeliumCoreFile: file name of the file containing helium core information
+ :type HeliumCoreFile: string
+
+ :param elts: list of elements
+ :type elts: python list
+
+ :param nelts: number of elements
+ :type nelts: int
+
+ :param Mmin1: min star mass for yields interpolation
+ :type Mmin1: float
+
+ :param Mmax1: min SNII mass for yields interpolation
+ :type Mmax1: float
+
+ :param Mmin2: min star mass for helium core interpolation
+ :type Mmin2: float
+
+ :param Mmax2: max star mass for helium core interpolation
+ :type Mmax2: float
+
+ :param dM: mass steps
+ :type dM: float
+
+ :param n: ???
+ :type n: int
+
+
+ :returns: elts
+ """
+
+
+ Mi2,Resi,Hcoi = ReadAndInterpolateHeliumCore(HeliumCoreFile,Mmin2,Mmax2,dM)
+
+
+ datai = {}
+ eltbs = []
+ for MetalFile in MetalFiles:
+ Mi1_f,datai_f,elts_f = ReadAndInterpolate(MetalFile,Mmin1,Mmax1,dM)
+
+ Mi1 = Mi1_f
+ for elt in elts_f:
+ eltbs.append(elt)
+ datai[elt] = datai_f[elt]
+
+
+ # check if we have an entry for Metals
+ try:
+ eltbs.index('Metals')
+ compute_metals=False
+ except ValueError:
+ compute_metals=True
+
+
+ # compute metals
+ # here, we sum the contribution of all elements
+ if compute_metals:
+ print "compute Metals :"
+ metals = zeros(len(Mi1))
+ for elt in eltbs:
+ print "add ",elt
+ metals = metals + datai[elt]
+ print "--------"
+ eltbs.append('Metals')
+ datai['Metals'] = metals
+
+
+ if elts==None:
+ elts=eltbs
+ else:
+ nelts = len(elts)
+ # create a new data and elts
+ dataif = {}
+ for elt in elts:
+
+ # check if exists
+ if datai.has_key(elt):
+ dataif[elt] = datai[elt]
+ else:
+ # try to find isotopes
+ dataiso = zeros(len(Mi1))
+ for key in datai.keys():
+ if key[:len(elt)] == elt:
+ dataiso = dataiso+datai[key]
+ print "add",key,"to",elt
+ dataif[elt] = dataiso
+
+ datai = dataif
+
+ ## check length of elts
+ if len(elts)!=nelts: # nelts-1 because metals is not present
+ print "nelts(=%d) != len(elts)(=%d) !!!"%(nelts,len(elts))
+ raise "nelts(=%d) != len(elts)(=%d) !!!"%(nelts,len(elts))
+
+
+
+
+ # output steps
+ lStep1 = (log10(Mmax*1.25) - log10(Mmin1) )/float(n-1)
+ lStep2 = (log10(Mmax*1.25) - log10(Mmin2) )/float(n-1)
+ Ms1 = 10**(arange(n)*lStep1 + log10(Mmin1))
+ Ms2 = 10**(arange(n)*lStep2 + log10(Mmin2))
+
+ datas,Ress, Hcos = ComputeEjectats(Mi1,datai,elts, Mi2,Resi,Hcoi, Ms1,Ms2)
+ Idatas,IRess,IHcos = ComputeIntegrals(Mi1,datai,elts, Mi2,Resi,Hcoi ,Mmin,Mmax,m_s,a_s, Ms1,Ms2)
+
+
+
+ label = "#### Metal Parameters ####\n"
+
+ eltList = [ ("Ej",Ress,Mmin2,lStep2),("Ejnp",Hcos,Mmin2,lStep2) ]
+ for elt in elts:
+ eltList.append( (elt,datas[elt],Mmin1,lStep1) )
+ WriteOutput(f,label,eltList, n,nelts)
+
+
+ f.write("\n")
+
+ label = "#### Metal Ejecta Parameters ####\n"
+
+ eltList = [ ("IEj",IRess,Mmin2,lStep2),("IEjnp",IHcos,Mmin2,lStep2) ]
+ for elt in elts:
+ eltList.append( ("I%s"%elt,Idatas[elt],Mmin1,lStep1) )
+ WriteOutput(f,label,eltList, n,nelts)
+
+ return elts
+
+
+
+
+def WriteOutput(f,label,eltsList,n,nelts):
+ """
+ Write a block of yields
+ """
+
+
+ f.write(label)
+
+ f.write("\n# Number of points / Number of elements\n")
+ f.write("%d %d\n"%(n,nelts))
+
+
+ for elt,data,Mmin,lStep in eltsList:
+
+
+ f.write("\n# %s\n"%elt)
+ f.write("\n%g %g\n"%(Mmin,lStep))
+ for i in range(len(data)):
+ f.write("%e\n"%data[i])
+
+
+def ReadAndInterpolate(MetalFile,Mmin1,Mmax1,dM):
+ """
+ Read yields file and compute a linear interpolation of the values in
+ the range Mmin1,Mmax1:
+
+ :param MetalFiles: file name of the file containing yields information
+ :type MetalFiles: string
+
+ :param Mmin1: min star mass for the interpolation
+ :type Mmin1: float
+
+ :param Mmax1: max star mass for the interpolation
+ :type Mmax1: float
+
+ :param dM: mass steps
+ :type dM: float
+
+ :returns Mi2,Resi,Hcoi:
+
+ .. warning:: values in solar mass are converted in mass fraction
+
+
+ """
+
+
+
+
+ # read ejecta
+ elts,data = read_MetalFile(MetalFile,cchar='#')
+
+ # devide by mass in order to get a mass fraction
+ for elt in elts[1:]:
+ data[elt] = data[elt]/data['M']
+
+ # ... and remove mass from dict
+ M1 = data['M']
+ del data['M']
+ elts = elts[1:]
+
+
+ # linear interpolation
+ Mi1 = arange(Mmin1,Mmax1+dM,dM)
+
+ # interpolate elements
+ datai = {}
+ for elt in elts:
+ datai[elt] = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),data[elt].astype(float32))
+ datai[elt] = where(datai[elt]<=0,0,datai[elt])
+
+ return Mi1,datai,elts
+
+
+
+def ReadAndInterpolateHeliumCore(HeliumCoreFile,Mmin2,Mmax2,dM):
+
+ '''
+ Read helium core file and compute a linear interpolation of the values in
+ the range Mmin2,Mmax2:
+
+ :param HeliumCoreFile: file name of the file containing helium core information
+ :type HeliumCoreFile: string
+
+ :param Mmin2: min star mass for the interpolation
+ :type Mmin2: float
+
+ :param Mmax2: max star mass for the interpolation
+ :type Mmax2: float
+
+ :param dM: mass steps
+ :type dM: float
+
+ :returns Mi2,Resi,Hcoi:
+
+
+ '''
+
+ # read residual and helium core
+ M2,Res,Hco = pt.io.read_ascii(HeliumCoreFile,[0,1,2],skipheader=True,cchar='#')
+ Res = Res/M2
+ Hco = Hco/M2
+
+ # linear interpolation
+ Mi2 = arange(Mmin2,Mmax2+dM,dM)
+
+ # interpolate
+ # interpolate residual and helium core
+ Resi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Res.astype(float32))
+ Hcoi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Hco.astype(float32))
+ Resi = where(Resi<=0,0,Resi)
+ Hcoi = where(Hcoi<=0,0,Hcoi)
+
+ return Mi2,Resi,Hcoi
+
+
+
+
+
+
+def ComputeEjectats(Mi1,datai,elts, Mi2,Resi,Hcoi, Ms1,Ms2):
+ '''
+ From the interpolated values _i return the interpolation of ejectats
+ '''
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ Ress = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Resi).astype(float32))
+ Hcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Hcoi).astype(float32))
+
+ datas = {}
+ for elt in elts:
+ datas[elt] = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),datai[elt].astype(float32))
+
+
+
+
+ return datas,Ress,Hcos
+
+
+
+
+
+
+
+def ComputeIntegrals(Mi1,datai,elts, Mi2,Resi,Hcoi, Mmin,Mmax,m_s,a_s, Ms1,Ms2):
+ '''
+ From the interpolated values _i, integrate and return interpolation
+ '''
+
+ # imf
+ b_s = libimf.ComputeConstants(m_s,a_s,Mmin,Mmax)
+ imf1 = libimf.imfv(Mi1,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+ imf2 = libimf.imfv(Mi2,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+
+ Idata = {}
+ for elt in elts:
+ Idata[elt] = cumtrapz(imf1 * datai[elt],Mi1)
+
+
+ IRes = cumtrapz(imf2 * (1-Resi),Mi2)
+ IHco = cumtrapz(imf2 * (1-Hcoi),Mi2)
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ Idatas = {}
+ for elt in elts:
+ Idatas[elt] = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Idata[elt].astype(float32))
+
+ IRess = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IRes.astype(float32))
+ IHcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IHco.astype(float32))
+
+ return Idatas,IRess,IHcos
+
+
+
+
+
+
+
+
+
+
+def Plot():
+ """
+ Do some plotting
+ """
+
+ ###############################################
+ # plot
+ ###############################################
+
+
+ # plot 1
+
+ pt.subplot(211)
+
+ pt.plot(M2,Res,'ko')
+ pt.plot(Mi2,Resi,'k-')
+
+ pt.plot(M2,Hco,'ro')
+ pt.plot(Mi2,Hcoi,'r-')
+
+
+ pt.plot(M1,Fe,'yo')
+ pt.plot(Mi1,Fei,'y-')
+
+ pt.plot(M1,Mg,'go')
+ pt.plot(Mi1,Mgi,'g-')
+
+ pt.plot(M1,Ox,'bo')
+ pt.plot(Mi1,Oxi,'b-')
+
+ pt.plot(M1,Me,'co')
+ pt.plot(Mi1,Mei,'c-')
+
+ pt.semilogx()
+ pt.semilogy()
+
+ pt.axis([Mmin,Mmax1,1e-4,1e0])
+
+ # plot 2
+
+ pt.subplot(212)
+
+
+ pt.plot(Mi1[1:],IFe*500,'y')
+ pt.plot(Mi1[1:],IMg*500,'g')
+ pt.plot(Mi1[1:],IOx*10,'b')
+ pt.plot(Mi1[1:],IMe*10,'c')
+ pt.plot(Mi2[1:],IRes,'k')
+ pt.plot(Mi2[1:],IHco,'r')
+
+ '''
+ pt.plot(Ms1,IFes*500,'o')
+ pt.plot(Ms1,IMgs*500,'o')
+ pt.plot(Ms1,IOxs*10 ,'o')
+ pt.plot(Ms1,IMes*10 ,'o')
+ pt.plot(Ms2,IRess,'o')
+ pt.plot(Ms2,IHcos,'o')
+ '''
+
+
+
+ pt.semilogx()
+ pt.axis([Mmin,Mmax1,0.,4*b])
+
+ pt.show()
+
+
+
+
+
+
diff --git a/PyChem/PyChem/libmetalsSNII.pyc b/PyChem/PyChem/libmetalsSNII.pyc
new file mode 100644
index 0000000..0e59e41
Binary files /dev/null and b/PyChem/PyChem/libmetalsSNII.pyc differ
diff --git a/PyChem/PyChem/libmetalsSNIa.py b/PyChem/PyChem/libmetalsSNIa.py
new file mode 100644
index 0000000..b281d26
--- /dev/null
+++ b/PyChem/PyChem/libmetalsSNIa.py
@@ -0,0 +1,217 @@
+
+from numpy import *
+import sys,types,string
+
+'''
+This module computes information of the yields
+related to SNIa
+'''
+
+
+#####################################################
+def read_MetalFile(file,columns=None,lines=None,dtype=float,skipheader=False,cchar='#'):
+#####################################################
+ """
+ Read a file containing metal information:
+
+
+ :param fd: file name
+ :type fd: string or file handler
+
+ :param columns: columns to read
+ :type columns: python list
+
+ :param lines: lines to read
+ :type lines: python list
+
+ :param dtype: output dtype
+ :type dtype: dtype
+
+ :param skipheader: skip header
+ :type skipheader: bool
+
+ :param cchar: comment charater
+ :type cchar: string
+
+ :returns: data
+
+
+ ``[X,Y,Z] = READ('FILE',[1,4,13],lines=[10,1000])
+ Read columns 1,4 and 13 from 'FILE' from line 10 to 1000
+ into array X,Y and Z``
+
+
+ """
+
+ def RemoveComments(l):
+ if l[0]==cchar:
+ return None
+ else:
+ return l
+
+ def toNumList(l):
+ return map(dtype,l)
+
+ if type(file) != types.FileType:
+ f = open(file,'r')
+ else:
+ f = file
+
+
+ # read header while there is one
+ while 1:
+ fpos = f.tell()
+ header = f.readline()
+ if header[0] != cchar:
+ f.seek(fpos)
+ header = None
+ break
+ else:
+ if skipheader:
+ header = None
+ else:
+ # create dict from header
+ header = string.strip(header[2:])
+ elts = string.split(header)
+ break
+
+
+ # now, read the file content
+ lines = f.readlines()
+
+ # remove trailing
+ lines = map(string.strip, lines)
+
+
+ # remove comments
+ #lines = map(RemoveComments, lines)
+
+ # split
+ lines = map(string.split, lines)
+
+ # convert into float
+ lines = map(toNumList, lines)
+
+ # convert into array
+ lines = array(map(array, lines))
+
+ # transpose
+ lines = transpose(lines)
+
+ if header != None:
+ iobs = {}
+ i = 0
+ for elt in elts:
+ iobs[elt]=i
+ i = i + 1
+
+ vals = {}
+ for key in iobs.keys():
+ vals[key] = lines[iobs[key]]
+
+ return elts,vals
+
+
+ # return
+ if columns == None:
+ return lines
+ else:
+ return lines.take(axis=0,indices=columns)
+
+
+
+
+
+
+def WriteParams(f,SNIaFile,MeanWDMass,elts,nelts):
+ """Write the SNIa parameters in a file:
+
+
+ :param f: file
+ :type f: file handler
+
+ :param SNIaFile: file name
+ :type SNIaFile: string
+
+ :param MeanWDMass: mean white dwarf mass
+ :type MeanWDMass: float
+
+ :param elts: list of elements
+ :type elts: python list
+
+ :param nelts: number of elements
+ :type nelts: int
+
+ :returns: None
+ """
+
+
+
+ # read ejecta
+ eltbs,datai = read_MetalFile(SNIaFile,[0,1,2,3],skipheader=False,cchar='#')
+
+
+ if elts==None:
+ elts=eltbs
+ data = datai
+ else:
+ nelts = len(elts)
+ # create a new data and elts
+ dataif = {}
+ for elt in elts:
+
+ # check if exists
+ if datai.has_key(elt):
+ dataif[elt] = datai[elt]
+ else:
+ # try to find isotopes
+ dataiso = zeros(1)
+ for key in datai.keys():
+ if key[:len(elt)] == elt:
+ dataiso = dataiso+datai[key]
+ print "add",key,"to",elt
+ dataif[elt] = dataiso
+
+ data = dataif
+
+
+ # check length of elts
+ if len(elts)!=nelts:
+ raise "nelts(=%d) != len(elts)(=%d) !!!"%(nelts,len(elts))
+
+
+
+ f.write("\n")
+ f.write("# Mean WD Mass\n")
+ f.write("\n")
+ f.write("%f\n"%MeanWDMass)
+ f.write("\n")
+ f.write("# SNIa Metal Ejection\n")
+ f.write("\n")
+ f.write("# Number of elements\n")
+ f.write("%d\n"%nelts)
+ f.write("\n")
+
+ f.write("# Ej\n")
+ f.write("0.0\n")
+ f.write("\n")
+
+ f.write("# Ejnp\n")
+ f.write("0.0\n")
+ f.write("\n")
+
+
+ for elt in elts:
+ f.write("# %s\n"%elt)
+ f.write("%e\n"%data[elt])
+ f.write("\n")
+
+
+ return elts
+
+
+
+
+
+
+
diff --git a/PyChem/PyChem/libmetalsSNIa.pyc b/PyChem/PyChem/libmetalsSNIa.pyc
new file mode 100644
index 0000000..9071283
Binary files /dev/null and b/PyChem/PyChem/libmetalsSNIa.pyc differ
diff --git a/PyChem/Readme b/PyChem/Readme
new file mode 100644
index 0000000..67b4d94
--- /dev/null
+++ b/PyChem/Readme
@@ -0,0 +1,123 @@
+############################################################
+# tables
+############################################################
+
+
+
+
+
+
+
+
+############################################################
+# How to generate the chemistry parameter file for GEAR
+############################################################
+
+
+
+1) fill in a "chemistryparam.py" file that contains :
+
+
+ ###########################
+ # IMF
+ ###########################
+
+ Mmin = 0.05 # min mass
+ Mmax = 50. # max mass
+
+ m_s = [0.08, 0.5, 1.0] # masses ranges
+ a_s = [-1.35, -1.35, -1.35, -1.35] # slopes
+
+ ###########################
+ # SNII
+ ###########################
+
+ SNII_Mmin = 8. # mininal mass for SNII
+
+ ###########################
+ # SNIa
+ ###########################
+
+ SNIa_Mpl = 3.0 # minimal mass for SNIa
+ SNIa_Mpu = 8.0 # maximal mass for SNIa
+
+ SNIa_a = -0.35 # SNIa parameters according to Kobayashi 2000
+ SNIa_Mdl1 = 0.9
+ SNIa_Mdu1 = 1.5
+ SNIa_bb1 = 0.02
+
+ SNIa_Mdl2 = 1.8
+ SNIa_Mdu2 = 2.6
+ SNIa_bb2 = 0.05
+
+
+ ###########################
+ # Metal Injection
+ ###########################
+
+ # files
+ MetalFile = ['MetalEjection.dat'] # file containing the amount of metal produced during the life of a star
+ # given as a function of its mass
+ # (Tsujimoto 95, Tab 1)
+
+ HeliumCoreFile = 'HeliumCore.dat' # mass of helium core and remenent given as a function of the star mass
+ #
+ # Ej : 1-rement = ejected mass
+ # Ejnp: 1-helium core = ejected mass (non processed)
+ # (Kobayashi 2000, private comm.)
+
+
+ SNIaFile = 'SNIaEjection.dat' # fraction of each element ejected by SNIa (independent of the star mass)
+ # (Tsujimoto 95,Tab 2, W7)(Kodama & Arimoto 97,Iwamoto et al 99)
+
+ SolarAbundancesFile = "SolarAbundances/Grevesse98.txt" # solar abundances for all elements
+
+
+ # Mean Whith Dwarfs Mass
+ MeanWDMass = 1.38
+
+ # number of elements to follow
+ elts = ["Fe","Mg","O","Metals"]
+ nelts = 4
+
+ # masses for metal injection
+ Mmin1 = 10.
+ Mmax1 = Mmax*1.5
+
+ # masses for helium core
+ Mmin2 = Mmin
+ Mmax2 = Mmax*1.5
+
+ # resolution in mass for integration
+ dM = 0.001
+
+ # number of output points
+ n = 200
+
+ #################################################################
+ #################################################################
+
+
+
+
+2) run ./scripts/generate_chemistry_parameters.py
+ using "chemistryparam.py" file defined before.
+ This create a chimie parameter file that may be given to GEAR.
+
+ ../scripts/generate_chemistry_parameters.py -p chemistryparam.py -o chemitry.dat
+
+ -o NAME, --outputfile= NAME
+ Output file
+ -p NAME, --parameterfile= NAME
+ Parameter file
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/scripts/pychem_SSP_discret_evolution2 b/PyChem/scripts/pychem_SSP_discret_evolution2
new file mode 100755
index 0000000..010ec50
--- /dev/null
+++ b/PyChem/scripts/pychem_SSP_discret_evolution2
@@ -0,0 +1,1055 @@
+#!/usr/bin/env python
+
+
+from optparse import OptionParser
+
+from PyChem import chemistry
+from numpy import *
+import sys
+import string
+
+import Ptools as pt
+
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+ parser = pt.add_postscript_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'Fe',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'Mg',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--dt",
+ action="store",
+ dest="dt",
+ type="float",
+ default = 0.1,
+ help="dt",
+ metavar=" FLOAT")
+
+
+ parser.add_option("--mstar",
+ action="store",
+ dest="mstar",
+ type="float",
+ default = 1e5,
+ help="initial mass of the SSP in solar mass",
+ metavar=" FLOAT")
+
+ parser.add_option("--tstar",
+ action="store",
+ dest="tstar",
+ type="float",
+ default = 0,
+ help="formation time of the SSP",
+ metavar=" FLOAT")
+
+ parser.add_option("-o",
+ action="store",
+ dest="obs",
+ type="string",
+ default = 'Y',
+ help="observable to plot",
+ metavar=" STRING")
+
+ parser.add_option("--timeunit",
+ action="store",
+ dest="timeunit",
+ type="string",
+ default = None,
+ help="unit of time",
+ metavar=" STRING")
+
+
+ parser.add_option("--NumberOfTables",
+ action="store",
+ dest="NumberOfTables",
+ type="int",
+ default = 1,
+ help="NumberOfTables",
+ metavar=" INT")
+
+ parser.add_option("--DefaultTable",
+ action="store",
+ dest="DefaultTable",
+ type="int",
+ default = 0,
+ help="DefaultTable",
+ metavar=" INT")
+
+
+ parser.add_option("--discsn",
+ action="store_true",
+ dest="discsn",
+ default = False,
+ help="discretize sn",
+ metavar=" FLOAT")
+
+
+ parser.add_option("--seed",
+ action="store",
+ dest="seed",
+ type="int",
+ default = None,
+ help="initial random seed",
+ metavar=" INT")
+
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+
+
+########################################################################
+# M A I N
+########################################################################
+
+
+
+SOLAR_MASS = 1.989e33
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+
+
+
+
+feedback_energy = 10**51 /UnitMass_in_g/(UnitVelocity_in_cm_per_s)**2
+
+
+# parse options
+files,opt = parse_options()
+
+
+if opt.seed!=None:
+ random.seed(opt.seed)
+
+# units
+opt.ux = 1.0
+if opt.timeunit == None:
+ opt.ux = 1.0
+elif opt.timeunit == 'Myr':
+ opt.ux = UnitTime_in_s/(3600*24*365)/1e6
+elif opt.timeunit == 'Gyr':
+ opt.ux = UnitTime_in_s/(3600*24*365)/1e9
+
+# to plot
+opt.obs = string.split(opt.obs,',')
+
+
+
+# init chimie
+chemistry.init_chimie(files[0],opt.NumberOfTables,opt.DefaultTable)
+elts = chemistry.get_elts_labels()
+nelts = chemistry.get_nelts()
+
+print elts
+
+# some parameters
+dt = opt.dt
+tmax = opt.xmax / opt.ux
+t_star = opt.tstar # formation time of the SSP
+M0 = opt.mstar *SOLAR_MASS/UnitMass_in_g # gas mass of the SSP (in code unit)
+
+Mstacont = M0 # star mass
+Mstaj = M0
+Mstajcont = M0
+Mgascont = 10*M0 # gas mass
+Mgasj = 10*M0 # gas mass
+Mgasjcont = 10*M0 # gas mass
+
+# stellar initial element abondance
+metals = zeros(chemistry.get_nelts(),float)
+#metals[0] = 0.001771 *1
+#metals[1] = 0.00091245 *1
+#metals[2] = 0.0 *1
+#metals[3] = 0.02 *1 # metal abondance (=metallicity z)
+
+# gas initial element abondance
+metalgcont = zeros(chemistry.get_nelts(),float)
+metalgj = zeros(chemistry.get_nelts(),float)
+metalgjcont = zeros(chemistry.get_nelts(),float)
+
+
+# minimum live time of a star
+minlivetime = chemistry.star_lifetime(metals[-1],chemistry.get_Mmax())
+maxlivetime = chemistry.star_lifetime(metals[-1],chemistry.get_Mmin())
+
+print minlivetime
+print maxlivetime
+
+# times
+times = arange(dt,tmax,dt).astype(float)
+nt = len(times)
+
+# output arrays
+TIMES = zeros(nt,float) # time
+
+NSNIas = zeros(nt,float) # number of SNIa
+NSNIIs = zeros(nt,float) # number of SNII
+NSNIaconts = zeros(nt,float) # number of SNIa (continuous value)
+NSNIIconts = zeros(nt,float) # number of SNII (continuous value)
+
+NDYINs = zeros(nt,float) # number of dying stars
+NDYINconts = zeros(nt,float) # number of dying stars
+
+Es = zeros(nt,float) # injected energy
+Mecont = zeros(nt,float) # ejected mass (continuous)
+Mej = zeros(nt,float) # ejected mass (computed from NSN)
+Mejcont = zeros(nt,float) # ejected mass (computed from NSN,continuous)
+Mstaconts = zeros(nt,float) # star mass (continuous)
+Mstajs = zeros(nt,float) # star mass
+Mstajconts = zeros(nt,float) # star mass
+
+Mgasconts = zeros(nt,float) # gas mass
+Mgasjs = zeros(nt,float) # gas mass
+Mgasjconts = zeros(nt,float) # gas mass
+
+# elements to follow
+
+# ejected
+dataecont = {}
+dataej = {}
+dataejcont = {}
+for elt in elts:
+ dataecont[elt] = zeros(nt,float)
+ dataej[elt] = zeros(nt,float)
+ dataejcont[elt] = zeros(nt,float)
+
+# gas
+datagcont = {}
+datagj = {}
+datagjcont = {}
+for elt in elts:
+ datagcont[elt] = zeros(nt,float)
+ datagj[elt] = zeros(nt,float)
+ datagjcont[elt] = zeros(nt,float)
+
+
+
+
+###############################################
+# main loop
+###############################################
+
+for ti,time in enumerate(times):
+
+
+ tpdt = time + dt
+
+
+ if (tpdt - t_star >= minlivetime) and (tpdt - t_star < maxlivetime):
+
+ m1 = chemistry.star_mass_from_age(metals[-1],tpdt - t_star)
+
+ if (time - t_star >= minlivetime):
+
+ m2 = chemistry.star_mass_from_age(metals[-1],time - t_star)
+
+ else:
+ m2 = chemistry.get_Mmax()
+
+
+ if (m1>m2):
+ m1=m2
+ raise "m1>m2 !!!"
+
+ # number of SNIa
+ NSNIa = chemistry.SNIa_rate(m1,m2)*M0
+ # number of SNII
+ NSNII = chemistry.SNII_rate(m1,m2)*M0
+
+
+ # number of dying stars
+ NDYIN = chemistry.DYIN_rate(m1,m2)*M0
+
+
+
+
+
+
+ #########################
+ # discrete stuff
+
+ NSNIIcont = NSNII
+ NSNIacont = NSNIa
+ NDYINcont = NDYIN
+
+ if opt.discsn:
+ fNSNIa = NSNIa-floor(NSNIa) # fraction
+ NSNIa = floor(NSNIa) # integer
+
+ if random.random() < fNSNIa:
+ NSNIa = NSNIa+1
+
+
+ if opt.discsn:
+ fNSNII = NSNII-floor(NSNII) # fraction
+ NSNII = floor(NSNII) # integer
+
+ if random.random() < fNSNII:
+ NSNII = NSNII+1
+
+
+ if opt.discsn:
+ fNDYIN = NDYIN-floor(NDYIN) # fraction
+ NDYIN = floor(NDYIN) # integer
+
+ if random.random() < fNDYIN:
+ NDYIN = NDYIN+1
+
+ #
+ #########################
+
+
+
+ ##################################################
+ # mass and yields ejection
+ ##################################################
+
+
+ # standard way (continuous explosion)
+ EjectedMass = chemistry.Total_mass_ejection(m1,m2,M0,metals)
+ TotalEjectedEltMasscont = EjectedMass[2:]
+ TotalEjectedGasMasscont = EjectedMass[0]
+
+
+ # new way (discrete explosion)
+ EjectedMassj = chemistry.Total_single_mass_ejection(0.5*(m1+m2),metals,float(NSNII),float(NSNIa),float(NDYIN))
+ TotalEjectedEltMassj = EjectedMassj[2:]
+ TotalEjectedGasMassj = EjectedMassj[0]
+
+
+ # new way (continuous explosion)
+ EjectedMassjcont = chemistry.Total_single_mass_ejection(0.5*(m1+m2),metals,NSNIIcont,NSNIacont,NDYINcont)
+ TotalEjectedEltMassjcont = EjectedMassjcont[2:]
+ TotalEjectedGasMassjcont = EjectedMassjcont[0]
+
+
+ # other check
+ #SNII_EjectedMass = chemistry.SNII_Total_single_mass_ejection( 0.5*(m1+m2) ,metals) * NSNII
+ #SNIa_EjectedMass = chemistry.SNIa_Total_single_mass_ejection( 0.5*(m1+m2) ,metals) * NSNIa
+ #TotalEjectedEltMassjcont = SNII_EjectedMass[2:] + SNIa_EjectedMass[2:]
+ #TotalEjectedGasMassjcont = SNII_EjectedMass[0] + SNIa_EjectedMass[0]
+
+
+ '''
+ # all dying stars (= SNII + lighter masses)
+ DYIN_TotalEjectedGasMassj = chemistry.DYIN_Total_single_mass_ejection( 0.5*(m1+m2) ,metals)[0] * NSNIa # !!! need to add SNIa
+ DYIN_TotalEjectedGasMassjcont = chemistry.DYIN_Total_single_mass_ejection( 0.5*(m1+m2) ,metals)[0] * NSNIacont # !!! need to add SNIa
+ '''
+
+ ##################################################
+ # energy
+ ##################################################
+
+ # energy injected
+ TotalInjectedEnergy = feedback_energy* (NSNIa + NSNII)
+
+
+ # mass fraction of ejected elements
+ emetalcont = TotalEjectedEltMasscont /TotalEjectedGasMasscont
+ emetalj = TotalEjectedEltMassj /TotalEjectedGasMassj
+ emetaljcont= TotalEjectedEltMassjcont/TotalEjectedGasMassjcont
+
+
+ # metal enrichment
+ metalgcont = ((metalgcont *Mgascont) + TotalEjectedEltMasscont )
+ metalgj = ((metalgj *Mgasj) + TotalEjectedEltMassj )
+ metalgjcont = ((metalgjcont*Mgasjcont) + TotalEjectedEltMassjcont )
+
+
+
+ # Total Mass
+ Mstacont = Mstacont - TotalEjectedGasMasscont
+ Mstaj = Mstaj - TotalEjectedGasMassj
+ Mstajcont = Mstajcont - TotalEjectedGasMassjcont
+
+ # Gas Mass
+ Mgascont = Mgascont + TotalEjectedGasMasscont
+ Mgasj = Mgasj + TotalEjectedGasMassj
+ Mgasjcont = Mgasjcont + TotalEjectedGasMassjcont
+
+
+ # metal enrichment
+ metalgcont = metalgcont /Mgascont
+ metalgj = metalgj /Mgasj
+ metalgjcont = metalgjcont/Mgasjcont
+
+
+
+
+ # record output
+
+ TIMES[ti] = time
+
+ NSNIas[ti] = NSNIa
+ NSNIIs[ti] = NSNII
+
+ NSNIaconts[ti] = NSNIacont
+ NSNIIconts[ti] = NSNIIcont
+
+ NDYINs[ti] = NDYIN
+ NDYINconts[ti] = NDYINcont
+
+
+ Es[ti] = TotalInjectedEnergy
+
+ Mecont[ti] = TotalEjectedGasMasscont
+ Mej[ti] = TotalEjectedGasMassj
+ Mejcont[ti]= TotalEjectedGasMassjcont
+
+ Mstaconts[ti] = Mstacont # stellar mass
+ Mstajs[ti] = Mstaj # stellar mass
+ Mstajconts[ti] = Mstajcont # stellar mass
+
+
+ Mgasconts[ti] = Mgascont
+ Mgasjs[ti] = Mgasj
+ Mgasjconts[ti] = Mgasjcont
+
+
+ for j,elt in enumerate(elts):
+ dataecont[elt][ti] = emetalcont[j]
+ datagcont[elt][ti] = metalgcont[j]
+
+ dataej[elt][ti] = emetalj[j]
+ datagj[elt][ti] = metalgj[j]
+
+ dataejcont[elt][ti] = emetaljcont[j]
+ datagjcont[elt][ti] = metalgjcont[j]
+
+
+
+
+
+# remove time=0 values
+c = (TIMES!=0)
+TIMES = compress(c,TIMES) * opt.ux
+NSNIas = compress(c,NSNIas)
+NSNIIs = compress(c,NSNIIs)
+NSNIaconts = compress(c,NSNIaconts)
+NSNIIconts = compress(c,NSNIIconts)
+NDYINs = compress(c,NDYINs)
+NDYINconts = compress(c,NDYINconts)
+Es = compress(c,Es)
+Mecont = compress(c,Mecont)
+Mej = compress(c,Mej)
+Mejcont = compress(c,Mejcont)
+Mstaconts = compress(c,Mstaconts)
+Mstajs = compress(c,Mstajs)
+Mstajconts= compress(c,Mstajconts)
+Mgasconts = compress(c,Mgasconts)
+Mgasjs = compress(c,Mgasjs)
+Mgasjconts= compress(c,Mgasjconts)
+
+for elt in elts:
+ dataecont[elt] = compress(c,dataecont[elt])
+ datagcont[elt] = compress(c,datagcont[elt])
+
+ dataej[elt] = compress(c,dataej[elt])
+ datagj[elt] = compress(c,datagj[elt])
+
+ dataejcont[elt] = compress(c,dataejcont[elt])
+ datagjcont[elt] = compress(c,datagjcont[elt])
+
+# get Solar Abundances
+SolarAbun = chemistry.get_elts_SolarAbundances()
+
+Xsconts = {}
+Xsjs = {}
+Xsjconts= {}
+
+Xgconts = {}
+Xgjs = {}
+Xgjconts= {}
+
+for elt in elts:
+ Xsconts[elt] = log10(dataecont[elt] / SolarAbun[elt] + 1.0e-10)
+ Xgconts[elt] = log10(datagcont[elt] / SolarAbun[elt] + 1.0e-10)
+
+ Xsjs[elt] = log10(dataej[elt] / SolarAbun[elt] + 1.0e-10)
+ Xgjs[elt] = log10(datagj[elt] / SolarAbun[elt] + 1.0e-10)
+
+ Xsjconts[elt] = log10(dataejcont[elt] / SolarAbun[elt] + 1.0e-10)
+ Xgjconts[elt] = log10(datagjcont[elt] / SolarAbun[elt] + 1.0e-10)
+
+
+
+Xscont = Xsconts[opt.x]
+Yscont = Xsconts[opt.y]
+Xgcont = Xgconts[opt.x]
+Ygcont = Xgconts[opt.y]
+
+Xsj = Xsjs[opt.x]
+Ysj = Xsjs[opt.y]
+Xgj = Xgjs[opt.x]
+Ygj = Xgjs[opt.y]
+
+Xsjcont = Xsjconts[opt.x]
+Ysjcont = Xsjconts[opt.y]
+Xgjcont = Xgjconts[opt.x]
+Ygjcont = Xgjconts[opt.y]
+
+#########################################################
+# plot
+#########################################################
+
+
+pt.InitPlot([],opt)
+pt.pcolors
+fig = pt.gcf()
+
+#fig.subplots_adjust(left=0.02)
+#fig.subplots_adjust(right=0.99)
+#fig.subplots_adjust(bottom=0.1)
+#fig.subplots_adjust(top=0.99)
+#fig.subplots_adjust(wspace=0.0)
+fig.subplots_adjust(hspace=0.25)
+
+np = len(opt.obs)
+
+
+def PlotYields(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{[%s/H],[%s/H],[%s/%s]}$"%(opt.x,opt.y,opt.y,opt.x)
+
+ pt.subplot(np,1,i)
+
+
+ datas = []
+ data = pt.DataPoints(TIMES,Xscont,tpe='line',label='Xs',color='b')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Yscont,tpe='line',label='Ys',color='g')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Yscont-Xscont,tpe='line',label='Ys-Xs',color='r',linestyle='--')
+ datas.append(data)
+
+ data = pt.DataPoints(TIMES,Xsj,tpe='line',label='Xs',color='b',linestyle='--')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Ysj,tpe='line',label='Ys',color='g',linestyle='--')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Ysj-Xsj,tpe='line',label='Ys-Xs',color='r',linestyle='-')
+ datas.append(data)
+
+ data = pt.DataPoints(TIMES,Xsjcont,tpe='line',label='Xs',color='b')
+ #datas.append(data)
+ data = pt.DataPoints(TIMES,Ysjcont,tpe='line',label='Ys',color='g')
+ #datas.append(data)
+ data = pt.DataPoints(TIMES,Ysjcont-Xsjcont,tpe='line',label='Ys-Xs',color='r',linestyle='--')
+ #datas.append(data)
+
+
+
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color,ls=d.linestyle)
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+ ymin = -2
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotGasElts(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{gas\,[%s/H],[%s/H],[%s/%s]}$"%(opt.x,opt.y,opt.y,opt.x)
+
+ pt.subplot(np,1,i)
+
+
+ datas = []
+ data = pt.DataPoints(TIMES,Xgcont,tpe='line',label='Xs',color='b')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Ygcont,tpe='line',label='Ys',color='g')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Ygcont-Xgcont,tpe='line',label='Ys-Xs',color='r',linestyle='--')
+ datas.append(data)
+
+ data = pt.DataPoints(TIMES,Xgj,tpe='line',label='Xs',color='b',linestyle='--')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Ygj,tpe='line',label='Ys',color='g',linestyle='--')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Ygj-Xgj,tpe='line',label='Ys-Xs',color='r',linestyle='-')
+ datas.append(data)
+
+ data = pt.DataPoints(TIMES,Xgjcont,tpe='line',label='Xs',color='b')
+ #datas.append(data)
+ data = pt.DataPoints(TIMES,Ygjcont,tpe='line',label='Ys',color='g')
+ #datas.append(data)
+ data = pt.DataPoints(TIMES,Ygjcont-Xgjcont,tpe='line',label='Ys-Xs',color='r',linestyle='--')
+ #datas.append(data)
+
+
+
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color,ls=d.linestyle)
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+ ymin = -2
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotEnergy(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Supernova\,Energy}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,Es,tpe='line',label='Es',color='k')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ if opt.log==None:
+ log='y'
+ else:
+ log = opt.log + 'y'
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+def PlotEjectedMass(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Ejected\,Mass}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,Mecont,tpe='line',label='Es',color='r')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Mej,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Mejcont,tpe='line',label='Es',color='g')
+ #datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ if opt.log==None:
+ log=opt.log
+ else:
+ log = opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotCumEjectedMass(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Cumulative\,Ejected\,Mass}$"
+
+ pt.subplot(np,1,i)
+
+ cumcont = add.accumulate(Mecont)
+ cumj = add.accumulate(Mej)
+ cumjcont = add.accumulate(Mejcont)
+
+ datas = []
+ data = pt.DataPoints(TIMES,cumcont,tpe='line',label='Es',color='r')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,cumj,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,cumjcont,tpe='line',label='Es',color='g')
+ #datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ if opt.log==None:
+ log=opt.log
+ else:
+ log = opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotStellarMass(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Stellar\,Mass}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,Mstaconts,tpe='line',label='Es',color='r')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Mstajs,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Mstajconts,tpe='line',label='Es',color='g')
+ #datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ if opt.log==None:
+ log = opt.log
+ else:
+ log = opt.log
+
+ opt.ymin = 0
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotNDYIN(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Number\,dying\,stars}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,NDYINs,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,NDYINconts,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log=opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotCumNDYIN(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Cum\,Number\,of\,dying\,stars}$"
+
+ pt.subplot(np,1,i)
+
+ cum = add.accumulate(NDYINs)
+ cumc= add.accumulate(NDYINconts)
+
+ datas = []
+ data = pt.DataPoints(TIMES,cum,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,cumc,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log=opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+
+def PlotNSNII(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Number\,of\,SNII}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,NSNIIs,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,NSNIIconts,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log=opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotCumNSNII(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Cum\,Number\,of\,SNII}$"
+
+ pt.subplot(np,1,i)
+
+ cum = add.accumulate(NSNIIs)
+ cumc= add.accumulate(NSNIIconts)
+
+ datas = []
+ data = pt.DataPoints(TIMES,cum,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,cumc,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log=opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+def PlotNSNIa(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Number\,of\,SNIa}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,NSNIas,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,NSNIaconts,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log=opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotCumNSNIa(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Cum\,Number\,of\,SNIa}$"
+
+ pt.subplot(np,1,i)
+
+ cum = add.accumulate(NSNIas)
+ cumc= add.accumulate(NSNIaconts)
+
+ datas = []
+ data = pt.DataPoints(TIMES,cum,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,cumc,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log=opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+def PlotNSNIIDYIN(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Number\,of\,SNII\,and\,dying}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,NSNIIs+NDYINs,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,NSNIIconts+NDYINconts,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log=opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+def PlotDiff(i):
+
+ xlabel = r"$\rm{[%s/H]$"%(opt.x)
+ ylabel = r"$\rm{[%s/%s]}$"%(opt.y,opt.x)
+
+ pt.subplot(np,1,i)
+
+
+ datas = []
+ data = pt.DataPoints(Xgcont,Ygcont-Xgcont ,tpe='line',label='Xs',color='r')
+ datas.append(data)
+ data = pt.DataPoints(Xgj,Ygj-Xgj ,tpe='line',label='Xs',color='k')
+ datas.append(data)
+ #data = pt.DataPoints(Xgjcont,Ygjcont-Xgjcont,tpe='line',label='Xs',color='g')
+ #datas.append(data)
+
+
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log = opt.log
+ #xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+ xmin = -4
+ xmax = 0
+ ymin = -1
+ ymax = 2
+
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotStarMass(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Mass}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,Mstas,tpe='line',label='Mstas',color='k')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ log = opt.log
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+
+
+
+
+
+pdict = {'Y':PlotYields,'Yg':PlotGasElts,'ESN':PlotEnergy,'NSNII':PlotNSNII,'CumNSNII':PlotCumNSNII,'NSNIa':PlotNSNIa,'CumNSNIa':PlotCumNSNIa,'NDYIN':PlotNDYIN,'CumNDYIN':PlotCumNDYIN,
+ 'D':PlotDiff,'MSTAR':PlotStarMass,'EjMass':PlotEjectedMass,'CumEjMass':PlotCumEjectedMass,'StellarMass':PlotStellarMass,
+ 'NSNIIDYIN':PlotNSNIIDYIN,}
+
+ip = 1
+
+
+for obs in opt.obs:
+ pdict[obs](ip)
+ ip = ip + 1
+
+
+
+
+pt.EndPlot(files,opt)
+
+
+
+
+
diff --git a/PyChem/scripts/pychem_SSP_evolution b/PyChem/scripts/pychem_SSP_evolution
new file mode 100755
index 0000000..b1a824a
--- /dev/null
+++ b/PyChem/scripts/pychem_SSP_evolution
@@ -0,0 +1,850 @@
+#!/usr/bin/env python
+
+
+from optparse import OptionParser
+
+from PyChem import chemistry
+
+from numpy import *
+import sys
+import string
+
+import Ptools as pt
+
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+ parser = pt.add_postscript_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'Fe',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'Mg',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--dt",
+ action="store",
+ dest="dt",
+ type="float",
+ default = 0.1,
+ help="dt",
+ metavar=" FLOAT")
+
+
+ parser.add_option("--mstar",
+ action="store",
+ dest="mstar",
+ type="float",
+ default = 1e5,
+ help="initial mass of the SSP in solar mass",
+ metavar=" FLOAT")
+
+ parser.add_option("--tstar",
+ action="store",
+ dest="tstar",
+ type="float",
+ default = 0,
+ help="formation time of the SSP",
+ metavar=" FLOAT")
+
+ parser.add_option("-o",
+ action="store",
+ dest="obs",
+ type="string",
+ default = 'Y',
+ help="observable to plot",
+ metavar=" STRING")
+
+ parser.add_option("--timeunit",
+ action="store",
+ dest="timeunit",
+ type="string",
+ default = None,
+ help="unit of time",
+ metavar=" STRING")
+
+
+ parser.add_option("--NumberOfTables",
+ action="store",
+ dest="NumberOfTables",
+ type="int",
+ default = 1,
+ help="NumberOfTables",
+ metavar=" INT")
+
+ parser.add_option("--DefaultTable",
+ action="store",
+ dest="DefaultTable",
+ type="int",
+ default = 0,
+ help="DefaultTable",
+ metavar=" INT")
+
+
+ parser.add_option("--discsn",
+ action="store_true",
+ dest="discsn",
+ default = False,
+ help="discretize sn",
+ metavar=" FLOAT")
+
+
+ parser.add_option("--seed",
+ action="store",
+ dest="seed",
+ type="int",
+ default = 0,
+ help="initial random seed",
+ metavar=" INT")
+
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+
+
+########################################################################
+# M A I N
+########################################################################
+
+
+
+SOLAR_MASS = 1.989e33
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+
+
+
+
+feedback_energy = 10**51 /UnitMass_in_g/(UnitVelocity_in_cm_per_s)**2
+
+
+# parse options
+files,opt = parse_options()
+
+
+random.seed(opt.seed)
+
+# units
+opt.ux = 1.0
+if opt.timeunit == None:
+ opt.ux = 1.0
+elif opt.timeunit == 'Myr':
+ opt.ux = UnitTime_in_s/(3600*24*365)/1e6
+elif opt.timeunit == 'Gyr':
+ opt.ux = UnitTime_in_s/(3600*24*365)/1e9
+
+# to plot
+opt.obs = string.split(opt.obs,',')
+
+
+
+# init chimie
+chemistry.init_chimie(files[0],opt.NumberOfTables,opt.DefaultTable)
+elts = chemistry.get_elts_labels()
+nelts = chemistry.get_nelts()
+
+print elts
+
+# some parameters
+dt = opt.dt
+tmax = opt.xmax / opt.ux
+t_star = opt.tstar # formation time of the SSP
+M0 = opt.mstar *SOLAR_MASS/UnitMass_in_g # gas mass of the SSP (in code unit)
+
+Mstacont = M0 # star mass
+Mstaj = M0
+Mstajcont = M0
+Mgas = 10*M0 # gas mass
+
+# stellar initial element abondance
+metals = zeros(chemistry.get_nelts(),float)
+#metals[0] = 0.001771 *1
+#metals[1] = 0.00091245 *1
+#metals[2] = 0.0 *1
+#metals[3] = 0.02 *1 # metal abondance (=metallicity z)
+
+# gas initial element abondance
+metalg = zeros(chemistry.get_nelts(),float)
+
+
+
+# minimum live time of a star
+minlivetime = chemistry.star_lifetime(metals[-1],chemistry.get_Mmax())
+maxlivetime = chemistry.star_lifetime(metals[-1],chemistry.get_Mmin())
+
+print minlivetime
+print maxlivetime
+
+# times
+times = arange(dt,tmax,dt).astype(float)
+nt = len(times)
+
+# output arrays
+TIMES = zeros(nt,float) # time
+
+NSNIas = zeros(nt,float) # number of SNIa
+NSNIIs = zeros(nt,float) # number of SNII
+NSNIaconts = zeros(nt,float) # number of SNIa (continuous value)
+NSNIIconts = zeros(nt,float) # number of SNII (continuous value)
+
+
+Es = zeros(nt,float) # injected energy
+Mecont = zeros(nt,float) # ejected mass (continuous)
+Mej = zeros(nt,float) # ejected mass (computed from NSN)
+Mejcont = zeros(nt,float) # ejected mass (computed from NSN,continuous)
+Mstaconts = zeros(nt,float) # star mass (continuous)
+Mstajs = zeros(nt,float) # star mass
+Mstajconts = zeros(nt,float) # star mass
+
+Mgass = zeros(nt,float) # gas mass
+
+# elements to follow
+
+# ejected
+datae = {}
+for elt in elts:
+ datae[elt] = zeros(nt,float)
+
+# gas
+datag = {}
+for elt in elts:
+ datag[elt] = zeros(nt,float)
+
+
+
+
+###############################################
+# main loop
+###############################################
+
+for ti,time in enumerate(times):
+
+
+ tpdt = time + dt
+
+
+ if (tpdt - t_star >= minlivetime) and (tpdt - t_star < maxlivetime):
+
+ m1 = chemistry.star_mass_from_age(metals[-1],tpdt - t_star)
+
+ if (time - t_star >= minlivetime):
+
+ m2 = chemistry.star_mass_from_age(metals[-1],time - t_star)
+
+ else:
+ m2 = chemistry.get_Mmax()
+
+
+ if (m1>m2):
+ m1=m2
+ raise "m1>m2 !!!"
+
+ # number of SNIa
+ NSNIa = chemistry.SNIa_rate(m1,m2)*M0
+ # number of SNII
+ NSNII = chemistry.SNII_rate(m1,m2)*M0
+
+
+
+
+
+
+ #########################
+ # SN trick
+
+ NSNIIcont = NSNII
+ NSNIacont = NSNIa
+
+
+ if opt.discsn:
+ fNSNIa = NSNIa-floor(NSNIa) # fraction
+ NSNIa = floor(NSNIa) # integer
+
+ if random.random() < fNSNIa:
+ NSNIa = NSNIa+1
+
+
+ if opt.discsn:
+ fNSNII = NSNII-floor(NSNII) # fraction
+ NSNII = floor(NSNII) # integer
+
+ if random.random() < fNSNII:
+ NSNII = NSNII+1
+
+
+ #
+ #########################
+
+
+
+ EjectedMass = chemistry.Total_mass_ejection(m1,m2,M0,metals)
+
+ TotalEjectedEltMass = EjectedMass[2:]
+
+ TotalEjectedGasMasscont = EjectedMass[0] # continuous value !!! inconsitent with the next lines, as
+
+ SNII_TotalEjectedGasMassj = chemistry.SNII_Total_single_mass_ejection( 0.5*(m1+m2) ,metals)[0] * NSNII # !!! need to add SNIa
+ SNII_TotalEjectedGasMassjcont = chemistry.SNII_Total_single_mass_ejection( 0.5*(m1+m2) ,metals)[0] * NSNIIcont # !!! need to add SNIa
+
+ SNIa_TotalEjectedGasMassj = chemistry.SNIa_Total_single_mass_ejection( 0.5*(m1+m2) ,metals)[0] * NSNIa # !!! need to add SNIa
+ SNIa_TotalEjectedGasMassjcont = chemistry.SNIa_Total_single_mass_ejection( 0.5*(m1+m2) ,metals)[0] * NSNIacont # !!! need to add SNIa
+
+ TotalEjectedGasMassj = SNII_TotalEjectedGasMassj + SNIa_TotalEjectedGasMassj
+ TotalEjectedGasMassjcont = SNII_TotalEjectedGasMassjcont+ SNIa_TotalEjectedGasMassjcont
+
+ # energy injected
+ TotalInjectedEnergy = feedback_energy* (NSNIa + NSNII)
+
+
+ # mass fraction of ejected elements
+ emetal = TotalEjectedEltMass/TotalEjectedGasMasscont
+
+
+ # metal enrichment
+ metalg = ((metalg*Mgas) + TotalEjectedEltMass )
+
+ # Total Mass
+ Mstacont = Mstacont - TotalEjectedGasMasscont
+ Mstaj = Mstaj - TotalEjectedGasMassj
+ Mstajcont = Mstajcont - TotalEjectedGasMassjcont
+
+ # Gas Mass
+ Mgas = Mgas + TotalEjectedGasMasscont
+
+ # metal enrichment
+ metalg = metalg/Mgas
+
+
+
+
+ # record output
+
+ TIMES[ti] = time
+
+ NSNIas[ti] = NSNIa
+ NSNIIs[ti] = NSNII
+
+ NSNIaconts[ti] = NSNIacont
+ NSNIIconts[ti] = NSNIIcont
+
+ Es[ti] = TotalInjectedEnergy
+
+ Mecont[ti] = TotalEjectedGasMasscont
+ Mej[ti] = TotalEjectedGasMassj
+ Mejcont[ti]= TotalEjectedGasMassjcont
+
+ Mstaconts[ti] = Mstacont # stellar mass
+ Mstajs[ti] = Mstaj # stellar mass
+ Mstajconts[ti] = Mstajcont # stellar mass
+
+
+ Mgass[ti] = Mgas
+
+
+ for j,elt in enumerate(elts):
+ datae[elt][ti] = emetal[j]
+ datag[elt][ti] = metalg[j]
+
+# remove time=0 values
+c = (TIMES!=0)
+TIMES = compress(c,TIMES) * opt.ux
+NSNIas = compress(c,NSNIas)
+NSNIIs = compress(c,NSNIIs)
+NSNIaconts = compress(c,NSNIaconts)
+NSNIIconts = compress(c,NSNIIconts)
+Es = compress(c,Es)
+Mecont = compress(c,Mecont)
+Mej = compress(c,Mej)
+Mejcont = compress(c,Mejcont)
+Mstaconts = compress(c,Mstaconts)
+Mstajs = compress(c,Mstajs)
+Mstajconts= compress(c,Mstajconts)
+Mgass = compress(c,Mgass)
+
+for elt in elts:
+ datae[elt] = compress(c,datae[elt])
+ datag[elt] = compress(c,datag[elt])
+
+
+# get Solar Abundances
+SolarAbun = chemistry.get_elts_SolarAbundances()
+
+Xss = {}
+Xgs = {}
+for elt in elts:
+ Xss[elt] = log10(datae[elt] / SolarAbun[elt] + 1.0e-10)
+ Xgs[elt] = log10(datag[elt] / SolarAbun[elt] + 1.0e-10)
+
+
+
+Xs = Xss[opt.x]
+Ys = Xss[opt.y]
+Xg = Xgs[opt.x]
+Yg = Xgs[opt.y]
+
+
+#########################################################
+# plot
+#########################################################
+
+
+pt.InitPlot([],opt)
+pt.pcolors
+fig = pt.gcf()
+
+#fig.subplots_adjust(left=0.02)
+#fig.subplots_adjust(right=0.99)
+#fig.subplots_adjust(bottom=0.1)
+#fig.subplots_adjust(top=0.99)
+#fig.subplots_adjust(wspace=0.0)
+fig.subplots_adjust(hspace=0.25)
+
+np = len(opt.obs)
+
+
+def PlotYields(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{[%s/H],[%s/H],[%s/%s]}$"%(opt.x,opt.y,opt.y,opt.x)
+
+ pt.subplot(np,1,i)
+
+
+ datas = []
+ data = pt.DataPoints(TIMES,Xs,tpe='line',label='Xs',color='b')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Ys,tpe='line',label='Ys',color='g')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Ys-Xs,tpe='line',label='Ys-Xs',color='r',linestyle='--')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color,ls=d.linestyle)
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+ ymin = -2
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+def PlotEnergy(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Supernova\,Energy}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,Es,tpe='line',label='Es',color='k')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ if opt.log==None:
+ opt.log='y'
+ else:
+ opt.log = opt.log + 'y'
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+def PlotEjectedMass(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Ejected\,Mass}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,Mecont,tpe='line',label='Es',color='r')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Mej,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Mejcont,tpe='line',label='Es',color='g')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ if opt.log==None:
+ opt.log='y'
+ else:
+ opt.log = opt.log + 'y'
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+def PlotStellarMass(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Stellar\,Mass}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,Mstaconts,tpe='line',label='Es',color='r')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Mstajs,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,Mstajconts,tpe='line',label='Es',color='g')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ if opt.log==None:
+ opt.log='y'
+ else:
+ opt.log = opt.log + 'y'
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+def PlotNSNII(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Number\,of\,SN}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,NSNIIs,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,NSNIIconts,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ opt.log=None
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotCumNSNII(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Cum\,Number\,of\,SN}$"
+
+ pt.subplot(np,1,i)
+
+ cum = add.accumulate(NSNIIs)
+ cumc= add.accumulate(NSNIIconts)
+
+ datas = []
+ data = pt.DataPoints(TIMES,cum,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,cumc,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ opt.log=None
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+def PlotNSNIa(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Number\,of\,SN}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,NSNIas,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,NSNIaconts,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ opt.log=None
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotCumNSNIa(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Cum\,Number\,of\,SN}$"
+
+ pt.subplot(np,1,i)
+
+ cum = add.accumulate(NSNIas)
+ cumc= add.accumulate(NSNIaconts)
+
+ datas = []
+ data = pt.DataPoints(TIMES,cum,tpe='line',label='Es',color='k')
+ datas.append(data)
+ data = pt.DataPoints(TIMES,cumc,tpe='line',label='Es',color='r')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ opt.log=None
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+
+def PlotDiff(i):
+
+ xlabel = r"$\rm{[%s/H]$"%(opt.x)
+ ylabel = r"$\rm{[%s/%s]}$"%(opt.y,opt.x)
+
+ pt.subplot(np,1,i)
+
+
+ datas = []
+ data = pt.DataPoints(Xg,Yg-Xg,tpe='line',label='Xs',color='b')
+ datas.append(data)
+
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ opt.log = None
+ #xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+ xmin = -4
+ xmax = 0
+ ymin = -1
+ ymax = 2
+
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+def PlotStarMass(i):
+
+ xlabel = r'$\rm{Time} [\rm{%s}]$'%(opt.timeunit)
+ ylabel = r"$\rm{Mass}$"
+
+ pt.subplot(np,1,i)
+
+ datas = []
+ data = pt.DataPoints(TIMES,Mstas,tpe='line',label='Mstas',color='k')
+ datas.append(data)
+
+ for d in datas:
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+
+
+
+
+
+
+
+
+pdict = {'Y':PlotYields,'ESN':PlotEnergy,'NSNII':PlotNSNII,'CumNSNII':PlotCumNSNII,'NSNIa':PlotNSNIa,'CumNSNIa':PlotCumNSNIa,'D':PlotDiff,'MSTAR':PlotStarMass,'EjMass':PlotEjectedMass,'StellarMass':PlotStellarMass}
+
+ip = 1
+
+
+for obs in opt.obs:
+ pdict[obs](ip)
+ ip = ip + 1
+
+
+
+
+pt.EndPlot(files,opt)
+
+
+
+
+
+#######################################
+#pt.subplot(3,1,1)
+
+#pt.plot(TIMES,Xs)
+#pt.plot(TIMES,Ys)
+#pt.plot(TIMES,Ys-Xs,'--')
+##pt.semilogx()
+
+#pt.axis([dt,tmax,-3,2])
+#pt.xlabel('Time')
+#pt.ylabel('%s,%s,%s-%s'%(opt.x,opt.y,opt.y,opt.x))
+
+#######################################
+#pt.subplot(3,1,2)
+
+##pt.plot(TIMES,Yg-Xg)
+##pt.axis([dt,tmax,-4,2])
+#pt.plot(TIMES,datae['Mg']/(datae['Fe']+1e-20))
+##pt.plot(TIMES,datae['Mg'])
+#pt.semilogy()
+##pt.axis([dt,tmax,1e-])
+#pt.xlabel('Time')
+#pt.ylabel('%s-%s'%(opt.y,opt.x))
+
+#######################################
+#pt.subplot(3,1,3)
+
+#pt.plot(Xg,Yg-Xg)
+#pt.axis([-4,0,-4,2])
+#pt.xlabel('%s'%opt.x)
+#pt.ylabel('%s-%s'%(opt.y,opt.x))
+
+
+#'''
+#######################################
+#pt.subplot(6,1,1)
+
+#pt.plot(TIMES,NSNIIs)
+#pt.plot(TIMES,NSNIas)
+#pt.semilogy()
+#pt.semilogx()
+#pt.axis([dt,tmax,1e-5,1e3])
+#pt.xlabel('Time')
+#pt.ylabel('Number of SN')
+
+#######################################
+#pt.subplot(6,1,2)
+
+#pt.plot(TIMES,Es)
+#pt.semilogy()
+#pt.semilogx()
+#pt.axis([dt,tmax,1e-12,1e-5])
+#pt.xlabel('Time')
+#pt.ylabel('Energy')
+
+#######################################
+#pt.subplot(6,1,3)
+
+#pt.plot(TIMES,Xs)
+#pt.plot(TIMES,Ys)
+#pt.plot(TIMES,Ys-Xs,'--')
+##pt.semilogx()
+
+#pt.axis([dt,tmax,-3,2])
+#pt.xlabel('Time')
+#pt.ylabel('%s,%s,%s-%s'%(opt.x,opt.y,opt.y,opt.x))
+
+#######################################
+#pt.subplot(6,1,4)
+
+#pt.plot(TIMES,Mstas)
+##pt.plot(TIMES,Mgass)
+##pt.plot(TIMES,Mgass+Mstas)
+#pt.semilogx()
+##pt.axis([dt,tmax,0,2.2*M0])
+#pt.xlabel('Time')
+#pt.ylabel('Total mass')
+
+#######################################
+#pt.subplot(6,1,5)
+
+#pt.plot(TIMES,Xg)
+#pt.plot(TIMES,Yg)
+#pt.plot(TIMES,Yg-Xg)
+#pt.semilogx()
+#pt.axis([dt,tmax,-10,2])
+#pt.xlabel('Time')
+#pt.ylabel('%s,%s'%(opt.x,opt.y))
+
+#######################################
+#pt.subplot(6,1,6)
+
+#pt.plot(Xg,Yg-Xg)
+#pt.axis([-4,0,-4,2])
+#pt.xlabel('%s'%opt.x)
+#pt.ylabel('%s-%s'%(opt.y,opt.x))
+#'''
+
+#pt.show()
+
+
diff --git a/PyChem/scripts/pychem_generate_parameters b/PyChem/scripts/pychem_generate_parameters
new file mode 100755
index 0000000..b08a414
--- /dev/null
+++ b/PyChem/scripts/pychem_generate_parameters
@@ -0,0 +1,95 @@
+#!/usr/bin/env python
+
+from optparse import OptionParser
+
+from PyChem import liblifetime
+from PyChem import libimf
+from PyChem import libSNIa
+from PyChem import libSNII
+from PyChem import libmetalsSNII
+from PyChem import libmetalsSNIa
+from PyChem import libSolarAbundances
+import sys
+
+def parse_options():
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+
+ parser.add_option("-o","--outputfile",
+ action="store",
+ dest="outputfile",
+ type="string",
+ default = 'mychimie.dat',
+ help="Output file",
+ metavar=" NAME")
+
+ parser.add_option("-p","--parameterfile",
+ action="store",
+ dest="parameterfile",
+ type="string",
+ default = 'chimieparam.py',
+ help="Parameter file",
+ metavar=" NAME")
+
+
+ (options, args) = parser.parse_args()
+
+
+ files = args
+
+ return files,options
+
+
+
+
+###########################################################
+# Main
+###########################################################
+
+files,opt = parse_options()
+
+f = open(opt.outputfile,'w')
+
+
+execfile(opt.parameterfile)
+
+
+
+# Lifetime
+liblifetime.WriteParams(f)
+
+# IMF
+libimf.WriteParams(f,Mmin,Mmax,m_s,a_s)
+
+# SNII
+print "SNII"
+libSNII.WriteParams(f,SNII_Mmin)
+
+# SNIa
+print "SNIa"
+libSNIa.WriteParams(f,SNIa_Mpl,SNIa_Mpu,SNIa_a,SNIa_Mdl1,SNIa_Mdu1,SNIa_bb1,SNIa_Mdl2,SNIa_Mdu2,SNIa_bb2)
+
+# Metal
+print "SNII Metal"
+SNIIelts = libmetalsSNII.WriteParams(f,Mmin,Mmax,m_s,a_s,MetalFile,HeliumCoreFile,elts,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n)
+
+# Metal
+print "SNIa Metal"
+SNIaelts = libmetalsSNIa.WriteParams(f,SNIaFile,MeanWDMass,elts,nelts)
+
+if (SNIIelts!=SNIaelts):
+ raise "SNIIelts !=SNIaelts"
+
+elts = SNIaelts
+
+# SolarAbundances
+print "Solar Abundances"
+libSolarAbundances.WriteParams(f,SolarAbundancesFile,elts)
+
+
+f.close()
+
+
+
diff --git a/PyChem/scripts/pychem_lifetime b/PyChem/scripts/pychem_lifetime
new file mode 100755
index 0000000..71c8d40
--- /dev/null
+++ b/PyChem/scripts/pychem_lifetime
@@ -0,0 +1,107 @@
+#!/usr/bin/env python
+
+
+from optparse import OptionParser
+import Ptools as pt
+from pNbody import *
+from pNbody import units
+import string
+
+from scipy import optimize
+
+from PyChem import chemistry
+
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_postscript_options(parser)
+ parser = pt.add_ftype_options(parser)
+ parser = pt.add_reduc_options(parser)
+ parser = pt.add_center_options(parser)
+ parser = pt.add_select_options(parser)
+ parser = pt.add_cmd_options(parser)
+ parser = pt.add_display_options(parser)
+ parser = pt.add_info_options(parser)
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'r',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'T',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--z",
+ action="store",
+ dest="z",
+ type="string",
+ default = None,
+ help="z value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--legend",
+ action="store_true",
+ dest="legend",
+ default = False,
+ help="add a legend")
+
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+########################################################################
+# MAIN
+########################################################################
+
+
+files,opt = parse_options()
+
+file = files[0]
+
+
+chemistry.init_chimie(file)
+
+
+metals = zeros(chemistry.get_nelts(),float)
+
+
+minlivetime = chemistry.star_lifetime(metals[-1],chemistry.get_Mmax())
+maxlivetime = chemistry.star_lifetime(metals[-1],chemistry.get_Mmin())
+
+
+
+print "minlivetime =%g"%(minlivetime)
+print "maxlivetime =%g"%(maxlivetime)
+
+
+
+
+
+
diff --git a/PyChem/scripts/pychem_mass_ejection b/PyChem/scripts/pychem_mass_ejection
new file mode 100755
index 0000000..1e02d9b
--- /dev/null
+++ b/PyChem/scripts/pychem_mass_ejection
@@ -0,0 +1,152 @@
+#!/usr/bin/env python
+
+
+
+from optparse import OptionParser
+import Ptools as pt
+from pNbody import *
+from pNbody import units
+import string
+
+from scipy import optimize
+
+from PyChem import chemistry
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_postscript_options(parser)
+ parser = pt.add_ftype_options(parser)
+ parser = pt.add_reduc_options(parser)
+ parser = pt.add_center_options(parser)
+ parser = pt.add_select_options(parser)
+ parser = pt.add_cmd_options(parser)
+ parser = pt.add_display_options(parser)
+ parser = pt.add_info_options(parser)
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'r',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'T',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--z",
+ action="store",
+ dest="z",
+ type="string",
+ default = None,
+ help="z value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--legend",
+ action="store_true",
+ dest="legend",
+ default = False,
+ help="add a legend")
+
+ parser.add_option("--elts",
+ action="store",
+ type="string",
+ dest="elts",
+ default = None,
+ help="element name")
+
+ parser.add_option("--m1",
+ action="store",
+ type="float",
+ dest="m1",
+ default = None,
+ help=" min mass in Msol")
+
+ parser.add_option("--m2",
+ action="store",
+ type="float",
+ dest="m2",
+ default = None,
+ help=" max mass in Msol")
+
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+########################################################################
+# MAIN
+########################################################################
+
+files,opt = parse_options()
+
+file = files[0]
+
+chemistry.init_chimie(file)
+
+mmax = chemistry.get_Mmax()
+mmin = chemistry.get_Mmin()
+
+if opt.m1 != None:
+ m1 = opt.m1
+ m1 = m1 * (1.989e+33/UnitMass_in_g)
+else:
+ m1 = mmin
+
+if opt.m2 != None:
+ m2 = opt.m2
+ m2 = m2 * (1.989e+33/UnitMass_in_g)
+else:
+ m2 = mmax
+
+
+
+
+M0 = 1.
+metals = zeros(chemistry.get_nelts(),float)
+
+
+print "mmin = %f"%(mmin/ (1.989e+33/UnitMass_in_g))
+print "mmax = %f"%(mmax/ (1.989e+33/UnitMass_in_g))
+
+# Contribution of SNII
+EjectedMass_SNII = chemistry.SNII_mass_ejection(m1,m2)[0]
+print "Ejected mass fraction due to SNII = %f"%EjectedMass_SNII
+
+
+# Contribution of SNIa
+NSNIa = chemistry.SNIa_rate(m1,m2)*M0;
+Mco = chemistry.get_Mco() # in code unit
+EjectedMass_SNIa = Mco * NSNIa;
+print "Ejected mass fraction due to SNIa = %f"%EjectedMass_SNIa
+
+
+
+# Total from chemistry
+EjectedMass = chemistry.Total_mass_ejection(m1,m2,M0,metals)
+print "Total Ejected mass fraction = %f"%EjectedMass[0]
+print "Total Ejected mass fraction = %f"%(EjectedMass_SNIa+EjectedMass_SNII)
+
+
diff --git a/PyChem/scripts/pychem_plot_DYIN_yields b/PyChem/scripts/pychem_plot_DYIN_yields
new file mode 100755
index 0000000..e4b8277
--- /dev/null
+++ b/PyChem/scripts/pychem_plot_DYIN_yields
@@ -0,0 +1,202 @@
+#!/usr/bin/env python
+
+
+
+from optparse import OptionParser
+import Ptools as pt
+from pNbody import *
+from pNbody import units
+import string
+
+from scipy import optimize
+
+from PyChem import chemistry
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_postscript_options(parser)
+ parser = pt.add_ftype_options(parser)
+ parser = pt.add_reduc_options(parser)
+ parser = pt.add_center_options(parser)
+ parser = pt.add_select_options(parser)
+ parser = pt.add_cmd_options(parser)
+ parser = pt.add_display_options(parser)
+ parser = pt.add_info_options(parser)
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'r',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'T',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--z",
+ action="store",
+ dest="z",
+ type="string",
+ default = None,
+ help="z value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--legend",
+ action="store_true",
+ dest="legend",
+ default = False,
+ help="add a legend")
+
+ parser.add_option("--elts",
+ action="store",
+ type="string",
+ dest="elts",
+ default = None,
+ help="element name")
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+
+
+
+#######################################
+# MakePlot
+#######################################
+
+
+def MakePlot(files,opt):
+
+
+ # some inits
+ datas = []
+ linest = pt.LineStyles()
+
+
+ if opt.elts !=None:
+ opt.elts = string.split(opt.elts,',')
+
+ # read files
+ for file in files:
+
+
+ chemistry.init_chimie(file)
+
+ nelts = chemistry.get_allnelts()
+ labels = chemistry.get_allelts_labels()
+
+
+ mmax = chemistry.get_Mmax()
+ mmin = chemistry.get_Mmin()
+ # mass range
+ ms = arange(mmin,mmax,1e-12).astype(float32)
+
+ ################
+ # get values
+ ################
+
+ if opt.elts==None:
+ elts = labels
+ else:
+ elts = opt.elts
+
+ colors = pt.Colors(n=len(elts))
+
+
+ #for nelt in xrange(nelts):
+ for elt in elts:
+ nelt = labels.index(elt)
+ print elt,nelt
+
+ x = ms
+ y = zeros(len(x))
+ for i,m in enumerate(ms):
+ y[i] = chemistry.DYIN_single_mass_ejection(m)[nelt]
+
+ x = x / (1.989e+33/UnitMass_in_g) # to solar mass
+
+
+ xlabel = r"$\rm{Star\,\,Mass [M_{\odot}]}$"
+ ylabel = r"$\rm{Mass\,\,Fraction}$"
+ label = "%s (%s)"%(labels[nelt],file)
+ data = pt.DataPoints(x,y,label=label,color=colors.get(),tpe='line',linestyle=linest.current())
+ datas.append(data)
+
+ linest.next()
+
+
+
+
+
+ # now, plot
+ for d in datas:
+
+ if d.tpe=='points' or d.tpe=='both':
+ pt.scatter(d.x,d.y,c=d.color,s=5,linewidths=0,marker='o',vmin=opt.zmin,vmax=opt.zmax)
+
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color,ls=d.linestyle)
+
+
+ # set limits and draw axis
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot axis
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ if opt.legend:
+ pt.LegendFromDataPoints(datas,loc='lower left')
+
+
+
+########################################################################
+# MAIN
+########################################################################
+
+
+
+if __name__ == '__main__':
+ files,opt = parse_options()
+ pt.InitPlot(files,opt)
+ pt.pcolors
+ MakePlot(files,opt)
+ pt.EndPlot(files,opt)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/scripts/pychem_plot_IMF b/PyChem/scripts/pychem_plot_IMF
new file mode 100755
index 0000000..a45acdb
--- /dev/null
+++ b/PyChem/scripts/pychem_plot_IMF
@@ -0,0 +1,199 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+
+
+from optparse import OptionParser
+from pNbody import *
+from pNbody import units
+import string
+
+from scipy import optimize
+
+from PyChem import chemistry
+
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_postscript_options(parser)
+ parser = pt.add_ftype_options(parser)
+ parser = pt.add_reduc_options(parser)
+ parser = pt.add_center_options(parser)
+ parser = pt.add_select_options(parser)
+ parser = pt.add_cmd_options(parser)
+ parser = pt.add_display_options(parser)
+ parser = pt.add_info_options(parser)
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'r',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'T',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--z",
+ action="store",
+ dest="z",
+ type="string",
+ default = None,
+ help="z value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--legend",
+ action="store_true",
+ dest="legend",
+ default = False,
+ help="add a legend")
+
+ parser.add_option("--NumberOfTables",
+ action="store",
+ dest="NumberOfTables",
+ type="int",
+ default = 1,
+ help="NumberOfTables",
+ metavar=" INT")
+
+ parser.add_option("--DefaultTable",
+ action="store",
+ dest="DefaultTable",
+ type="int",
+ default = 0,
+ help="DefaultTable",
+ metavar=" INT")
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+
+
+
+#######################################
+# MakePlot
+#######################################
+
+
+def MakePlot(files,opt):
+
+
+ # some inits
+ colors = pt.Colors(n=len(files))
+ datas = []
+
+
+ # read files
+ for file in files:
+
+ chemistry.init_chimie(file,opt.NumberOfTables,opt.DefaultTable)
+
+ mmax = chemistry.get_Mmax()
+ mmin = chemistry.get_Mmin()
+
+ # mass range
+ ms = arange(mmin,mmax,1e-12).astype(float32)
+
+ ################
+ # get values
+ ################
+
+ x = ms
+ y = chemistry.get_imf(x)
+
+ #x = arange(mmin,mmax,1e-11)
+ #y = chemistry.get_imf_N(x[0:-1],x[1:])
+ #x = x[:-1]
+
+
+
+ x = x / (1.989e+33/UnitMass_in_g) # to solar mass
+
+ xlabel = r"$\rm{Star\,\,Mass [M_{\odot}]}$"
+ ylabel = r"$\rm{Mass\,\,Fraction}$"
+ data = pt.DataPoints(x,y,label=file,color=colors.get(),tpe='line')
+ datas.append(data)
+
+
+
+ # check integral
+ for d in datas:
+ dx = d.x[1:]-d.x[:-1]
+ I = sum(dx * d.y[:-1])
+ print "intergral = %g"%I
+
+
+
+
+ # now, plot
+ for d in datas:
+
+ if d.tpe=='points' or d.tpe=='both':
+ pt.scatter(d.x,d.y,c=d.color,s=5,linewidths=0,marker='o',vmin=opt.zmin,vmax=opt.zmax)
+
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+
+ # set limits and draw axis
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot axis
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ if opt.legend:
+ pt.LegendFromDataPoints(datas)
+
+
+
+########################################################################
+# MAIN
+########################################################################
+
+
+
+if __name__ == '__main__':
+ files,opt = parse_options()
+ pt.InitPlot(files,opt)
+ pt.pcolors
+ MakePlot(files,opt)
+ pt.EndPlot(files,opt)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/scripts/pychem_plot_SNII_interated_yields b/PyChem/scripts/pychem_plot_SNII_interated_yields
new file mode 100755
index 0000000..89e8e59
--- /dev/null
+++ b/PyChem/scripts/pychem_plot_SNII_interated_yields
@@ -0,0 +1,197 @@
+#!/usr/bin/env python
+
+
+
+from optparse import OptionParser
+import Ptools as pt
+from pNbody import *
+from pNbody import units
+import string
+
+from scipy import optimize
+
+from PyChem import chemistry
+
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_postscript_options(parser)
+ parser = pt.add_ftype_options(parser)
+ parser = pt.add_reduc_options(parser)
+ parser = pt.add_center_options(parser)
+ parser = pt.add_select_options(parser)
+ parser = pt.add_cmd_options(parser)
+ parser = pt.add_display_options(parser)
+ parser = pt.add_info_options(parser)
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'r',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'T',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--z",
+ action="store",
+ dest="z",
+ type="string",
+ default = None,
+ help="z value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--legend",
+ action="store_true",
+ dest="legend",
+ default = False,
+ help="add a legend")
+
+ parser.add_option("--elts",
+ action="store",
+ type="string",
+ dest="elts",
+ default = None,
+ help="element name")
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+
+
+
+#######################################
+# MakePlot
+#######################################
+
+
+def MakePlot(files,opt):
+
+
+ # some inits
+ datas = []
+ linest = pt.LineStyles()
+
+ if opt.elts !=None:
+ opt.elts = string.split(opt.elts,',')
+
+ # read files
+ for file in files:
+
+
+ chemistry.init_chimie(file)
+
+ nelts = chemistry.get_allnelts()
+ labels = chemistry.get_allelts_labels()
+
+
+ mmax = chemistry.get_Mmax()
+ mmin = chemistry.get_Mmin()
+ # mass range
+ ms = arange(mmin,mmax,1e-12).astype(float32)
+
+ ################
+ # get values
+ ################
+
+ if opt.elts==None:
+ elts = labels
+ else:
+ elts = opt.elts
+
+ colors = pt.Colors(n=len(elts))
+
+ #for nelt in xrange(nelts):
+ for elt in elts:
+ nelt = labels.index(elt)
+ print elt,nelt
+
+ x = ms
+ y = zeros(len(x))
+ for i,m in enumerate(ms):
+ y[i] = chemistry.SNII_mass_ejection(0,m)[nelt]
+
+ x = x / (1.989e+33/UnitMass_in_g) # to solar mass
+
+
+ xlabel = r"$\rm{Star\,\,Mass [M_{\odot}]}$"
+ ylabel = r"$\rm{Mass\,\,Fraction}$"
+ label = "%s (%s)"%(labels[nelt],file)
+ data = pt.DataPoints(x,y,label=label,color=colors.get(),tpe='line',linestyle=linest.current())
+ datas.append(data)
+
+ linest.next()
+
+ # now, plot
+ for d in datas:
+
+ if d.tpe=='points' or d.tpe=='both':
+ pt.scatter(d.x,d.y,c=d.color,s=5,linewidths=0,marker='o',vmin=opt.zmin,vmax=opt.zmax)
+
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color,ls=d.linestyle)
+
+
+ # set limits and draw axis
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot axis
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ if opt.legend:
+ pt.LegendFromDataPoints(datas,loc='lower left')
+
+
+
+########################################################################
+# MAIN
+########################################################################
+
+
+
+if __name__ == '__main__':
+ files,opt = parse_options()
+ pt.InitPlot(files,opt)
+ pt.pcolors
+ MakePlot(files,opt)
+ pt.EndPlot(files,opt)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/scripts/pychem_plot_SNII_yields b/PyChem/scripts/pychem_plot_SNII_yields
new file mode 100755
index 0000000..16d09e8
--- /dev/null
+++ b/PyChem/scripts/pychem_plot_SNII_yields
@@ -0,0 +1,202 @@
+#!/usr/bin/env python
+
+
+
+from optparse import OptionParser
+import Ptools as pt
+from pNbody import *
+from pNbody import units
+import string
+
+from scipy import optimize
+
+from PyChem import chemistry
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_postscript_options(parser)
+ parser = pt.add_ftype_options(parser)
+ parser = pt.add_reduc_options(parser)
+ parser = pt.add_center_options(parser)
+ parser = pt.add_select_options(parser)
+ parser = pt.add_cmd_options(parser)
+ parser = pt.add_display_options(parser)
+ parser = pt.add_info_options(parser)
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'r',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'T',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--z",
+ action="store",
+ dest="z",
+ type="string",
+ default = None,
+ help="z value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--legend",
+ action="store_true",
+ dest="legend",
+ default = False,
+ help="add a legend")
+
+ parser.add_option("--elts",
+ action="store",
+ type="string",
+ dest="elts",
+ default = None,
+ help="element name")
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+
+
+
+#######################################
+# MakePlot
+#######################################
+
+
+def MakePlot(files,opt):
+
+
+ # some inits
+ datas = []
+ linest = pt.LineStyles()
+
+
+ if opt.elts !=None:
+ opt.elts = string.split(opt.elts,',')
+
+ # read files
+ for file in files:
+
+
+ chemistry.init_chimie(file)
+
+ nelts = chemistry.get_allnelts()
+ labels = chemistry.get_allelts_labels()
+
+
+ mmax = chemistry.get_Mmax()
+ mmin = chemistry.get_Mmin()
+ # mass range
+ ms = arange(mmin,mmax,1e-12).astype(float32)
+
+ ################
+ # get values
+ ################
+
+ if opt.elts==None:
+ elts = labels
+ else:
+ elts = opt.elts
+
+ colors = pt.Colors(n=len(elts))
+
+
+ #for nelt in xrange(nelts):
+ for elt in elts:
+ nelt = labels.index(elt)
+ print elt,nelt
+
+ x = ms
+ y = zeros(len(x))
+ for i,m in enumerate(ms):
+ y[i] = chemistry.SNII_single_mass_ejection(m)[nelt]
+
+ x = x / (1.989e+33/UnitMass_in_g) # to solar mass
+
+
+ xlabel = r"$\rm{Star\,\,Mass [M_{\odot}]}$"
+ ylabel = r"$\rm{Mass\,\,Fraction}$"
+ label = "%s (%s)"%(labels[nelt],file)
+ data = pt.DataPoints(x,y,label=label,color=colors.get(),tpe='line',linestyle=linest.current())
+ datas.append(data)
+
+ linest.next()
+
+
+
+
+
+ # now, plot
+ for d in datas:
+
+ if d.tpe=='points' or d.tpe=='both':
+ pt.scatter(d.x,d.y,c=d.color,s=5,linewidths=0,marker='o',vmin=opt.zmin,vmax=opt.zmax)
+
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color,ls=d.linestyle)
+
+
+ # set limits and draw axis
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot axis
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ if opt.legend:
+ pt.LegendFromDataPoints(datas,loc='lower left')
+
+
+
+########################################################################
+# MAIN
+########################################################################
+
+
+
+if __name__ == '__main__':
+ files,opt = parse_options()
+ pt.InitPlot(files,opt)
+ pt.pcolors
+ MakePlot(files,opt)
+ pt.EndPlot(files,opt)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/scripts/pychem_plot_lifetime b/PyChem/scripts/pychem_plot_lifetime
new file mode 100755
index 0000000..bb2d1c0
--- /dev/null
+++ b/PyChem/scripts/pychem_plot_lifetime
@@ -0,0 +1,189 @@
+#!/usr/bin/env python
+
+
+
+from optparse import OptionParser
+import Ptools as pt
+from pNbody import *
+from pNbody import units
+import string
+
+from scipy import optimize
+
+from PyChem import chemistry
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_postscript_options(parser)
+ parser = pt.add_ftype_options(parser)
+ parser = pt.add_reduc_options(parser)
+ parser = pt.add_center_options(parser)
+ parser = pt.add_select_options(parser)
+ parser = pt.add_cmd_options(parser)
+ parser = pt.add_display_options(parser)
+ parser = pt.add_info_options(parser)
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'r',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'T',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--z",
+ action="store",
+ dest="z",
+ type="string",
+ default = None,
+ help="z value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--legend",
+ action="store_true",
+ dest="legend",
+ default = False,
+ help="add a legend")
+
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+
+
+
+#######################################
+# MakePlot
+#######################################
+
+
+def MakePlot(files,opt):
+
+
+ # some inits
+ datas = []
+
+
+ # read files
+ for file in files:
+
+
+ chemistry.init_chimie(file)
+
+
+ mmax = chemistry.get_Mmax()
+ mmin = chemistry.get_Mmin()
+ # mass range
+ ms = arange(mmin,mmax,1e-12).astype(float32)
+ z0 = 0.02
+ zs = z0 * 10**array([-10.,-1.,-0.25,0,0.25,0.5,])
+
+
+ ################
+ # get values
+ ################
+
+ colors = pt.Colors(n=len(zs))
+
+ for z in zs:
+
+
+ x = ms
+ y = zeros(len(x))
+ for i,m in enumerate(ms):
+ y[i] = chemistry.star_lifetime(z,x[i]) *UnitTime_in_s/(31536000)/1e6 # in Myr
+
+
+
+
+
+ x = x / (1.989e+33/UnitMass_in_g) # to solar mass
+
+
+
+ xlabel = r"$\rm{Star\,\,Mass [M_{\odot}]}$"
+ ylabel = r"$\rm{Life\,\,Time\,[Myr]}$"
+ label = "z=%6.2f (%s)"%(log10(z/z0),file)
+ data = pt.DataPoints(x,y,label=label,color=colors.get(),tpe='line')
+ datas.append(data)
+
+
+
+
+
+
+
+ # now, plot
+ for d in datas:
+
+ if d.tpe=='points' or d.tpe=='both':
+ pt.scatter(d.x,d.y,c=d.color,s=5,linewidths=0,marker='o',vmin=opt.zmin,vmax=opt.zmax)
+
+ if d.tpe=='line' or d.tpe=='both':
+ pt.plot(d.x,d.y,color=d.color)
+
+
+ # set limits and draw axis
+ xmin,xmax,ymin,ymax = pt.SetLimitsFromDataPoints(opt.xmin,opt.xmax,opt.ymin,opt.ymax,datas,opt.log)
+
+ # plot axis
+ pt.SetAxis(xmin,xmax,ymin,ymax,log=opt.log)
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ if opt.legend:
+ pt.LegendFromDataPoints(datas,loc='upper right')
+
+
+
+########################################################################
+# MAIN
+########################################################################
+
+
+
+if __name__ == '__main__':
+ files,opt = parse_options()
+ pt.InitPlot(files,opt)
+ pt.pcolors
+ MakePlot(files,opt)
+ pt.EndPlot(files,opt)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/scripts/pychem_sample_IMF b/PyChem/scripts/pychem_sample_IMF
new file mode 100755
index 0000000..657d9ac
--- /dev/null
+++ b/PyChem/scripts/pychem_sample_IMF
@@ -0,0 +1,233 @@
+#!/usr/bin/env python
+
+
+import Ptools as pt
+
+
+from optparse import OptionParser
+from pNbody import *
+from pNbody import units
+import string
+
+from scipy import optimize
+
+from PyChem import chemistry
+
+
+
+def parse_options():
+
+
+ usage = "usage: %prog [options] file"
+ parser = OptionParser(usage=usage)
+
+ parser = pt.add_limits_options(parser)
+ parser = pt.add_log_options(parser)
+ parser = pt.add_postscript_options(parser)
+
+ parser.add_option("--x",
+ action="store",
+ dest="x",
+ type="string",
+ default = 'Fe',
+ help="x value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--y",
+ action="store",
+ dest="y",
+ type="string",
+ default = 'Mg',
+ help="y value to plot",
+ metavar=" STRING")
+
+ parser.add_option("--dt",
+ action="store",
+ dest="dt",
+ type="float",
+ default = 0.1,
+ help="dt",
+ metavar=" FLOAT")
+
+
+ parser.add_option("--mstar",
+ action="store",
+ dest="mstar",
+ type="float",
+ default = 1e5,
+ help="initial mass of the SSP in solar mass",
+ metavar=" FLOAT")
+
+ parser.add_option("--tstar",
+ action="store",
+ dest="tstar",
+ type="float",
+ default = 0,
+ help="formation time of the SSP",
+ metavar=" FLOAT")
+
+ parser.add_option("-o",
+ action="store",
+ dest="obs",
+ type="string",
+ default = 'Y',
+ help="observable to plot",
+ metavar=" STRING")
+
+ parser.add_option("--timeunit",
+ action="store",
+ dest="timeunit",
+ type="string",
+ default = None,
+ help="unit of time",
+ metavar=" STRING")
+
+
+ parser.add_option("--NumberOfTables",
+ action="store",
+ dest="NumberOfTables",
+ type="int",
+ default = 1,
+ help="NumberOfTables",
+ metavar=" INT")
+
+ parser.add_option("--DefaultTable",
+ action="store",
+ dest="DefaultTable",
+ type="int",
+ default = 0,
+ help="DefaultTable",
+ metavar=" INT")
+
+
+ (options, args) = parser.parse_args()
+
+
+ pt.check_files_number(args)
+
+ files = args
+
+ return files,options
+
+
+########################################################################
+# M A I N
+########################################################################
+
+
+
+SOLAR_MASS = 1.989e33
+
+UnitLength_in_cm = 3.085e+21
+UnitMass_in_g = 1.989e+43
+UnitVelocity_in_cm_per_s = 20725573.785998672
+UnitTime_in_s = 148849920000000.0
+
+
+
+files,opt = parse_options()
+file = files[0]
+
+
+
+# some parameters
+M0 = opt.mstar *SOLAR_MASS/UnitMass_in_g # gas mass of the SSP (in code unit)
+
+
+
+
+# init
+chemistry.init_chimie(file,opt.NumberOfTables,opt.DefaultTable)
+mmax = chemistry.get_Mmax()
+mmin = chemistry.get_Mmin()
+
+
+
+##################
+# theoretical imf
+##################
+'''
+here, the imf is normed in order that
+the integral of it, i.e, the mass fraction
+of stars is equal to 1.
+'''
+bins_th = arange(mmin,mmax,1e-12).astype(float32)
+hx_th = chemistry.get_imf(bins_th).astype(float32)
+bins_th = bins_th.astype(float)*UnitMass_in_g/SOLAR_MASS
+
+
+
+##################
+# sampled imf
+##################
+'''
+here, the imf is normed, in order that the total mass of
+the stars = M0
+==> the normalisation is different from the theoretical imf.
+'''
+# compute the number of stars per mass between m1 and m2 (dep on M0)
+# N this is thus the number of stars in a particle of mass M0
+N = chemistry.get_imf_N(array([mmin]),array([mmax]))[0]*M0
+# compute the masses
+ms = chemistry.imf_sampling(int(N),1)
+
+
+# in Msol
+print "number of stars",N
+print "total mass ",sum(ms)*UnitMass_in_g/SOLAR_MASS
+#print min(ms)*UnitMass_in_g/SOLAR_MASS
+#print max(ms)*UnitMass_in_g/SOLAR_MASS
+
+
+
+##############################################
+# plot the imf
+##############################################
+
+# to ms
+ms = ms*UnitMass_in_g/SOLAR_MASS
+mmin = mmin *UnitMass_in_g/SOLAR_MASS
+mmax = mmax *UnitMass_in_g/SOLAR_MASS
+
+#ms = compress(ms>8,ms)
+#print len(ms)
+
+
+n = 10000.
+db = (mmax-mmin)/n
+
+bins = arange(mmin,mmax+db,db)
+
+# histogram
+n = searchsorted(sort(ms),bins)
+n = concatenate([n,[len(ms)]])
+hx = n[1:]-n[:-1]
+hx = hx*bins
+
+print "total mass (histogram)",sum(hx)
+
+pt.plot(bins,hx)
+pt.plot(bins_th,hx_th)
+
+
+################
+# get values
+################
+
+x = ms
+y = chemistry.get_imf(x)
+
+
+
+
+pt.loglog()
+pt.xlabel(r'$\rm{Mass}\,[\rm{M}_\odot]$')
+pt.ylabel(r'$\rm{number\,of\,stars}\,,\,\rm{mass\,fraction}$')
+
+pt.show()
+
+
+
+
+
+
diff --git a/PyChem/setup.py b/PyChem/setup.py
new file mode 100644
index 0000000..13793f5
--- /dev/null
+++ b/PyChem/setup.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+
+import os,sys
+
+from distutils.core import setup, Extension
+from distutils.sysconfig import get_python_inc
+from distutils.sysconfig import get_python_lib
+
+import glob
+
+'''
+In order to compile with mpi,
+
+export CC=mpicc
+python setup.py build
+
+
+'''
+
+
+
+
+
+incdir = os.path.join(get_python_inc(plat_specific=1), 'numpy')
+libdir = os.path.join(get_python_lib(plat_specific=1), 'numpy')
+
+
+gadget_files=glob.glob("src/*.c")
+
+
+
+
+PYTHON_INC = "/usr/include/python2.6/"
+MPI_DIR = "/usr/lib64/openmpi/lib/"
+MPI_LIB = "mpi"
+MPI_INC = "/usr/include/openmpi-x86_64/"
+
+
+
+setup(name='PyChem',
+ version='0.0',
+ description='Python Chemical evolution code base wrapped around GEAR',
+ author='Yves Revaz',
+ author_email='yves.revaz@epfl.ch',
+ url='http://obswww.unige.ch/~revaz/pNbody',
+ packages=['PyChem'],
+# ext_modules=[
+# Extension('PyGear.gadget', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('NOGRAVITY', '1'),('LONG_X', '1'),('LONG_Y', '1'),('LONG_Z', '0.125')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB] )
+# ]
+# ext_modules=[
+# Extension('PyGear.gadget', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB] )
+# ]
+
+# This is used for turb
+
+# ext_modules=[
+# Extension('PyChem.gadget', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('NOGRAVITY', '1'),('ISOTHERM_EQS', '1'),('ONLY_MASTER_READ_EWALD', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB] )
+# ]
+
+# This is used for pychem
+
+ ext_modules=[
+ Extension('PyChem.chemistry', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('CHIMIE', '1'),('STELLAR_PROP', '1'),('ENTROPYPRED', '1'), ('PYCHEM', '1'),('ONLY_MASTER_READ_EWALD', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB] )
+ ]
+
+
+ )
diff --git a/PyChem/shared/Readme b/PyChem/shared/Readme
new file mode 100644
index 0000000..f189f12
--- /dev/null
+++ b/PyChem/shared/Readme
@@ -0,0 +1,147 @@
+############################################################
+# used chemical parameter files
+############################################################
+# files for the old format (ex : dSph-1280-8) is no longer supported
+
+ * for dSph tests (dSph-1324-8new !!! Si->Ba : Fe,Mg,O,Si,Metals)
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.yr.py -o chimie.yr.dat
+
+ * for dSph with new code (compatible with paper simulations, only 4 elts, Fe,Mg,O,Metals)
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.yr.4.py -o chimie.yr.4.dat
+
+
+
+ * for dSph2 ("Fe","Mg","O","Ba","Metals")
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.yr.2.py -o chimie.yr.2.dat
+
+
+ * salpeter IMF
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.salpeter.py -o chimie.salpeter.dat
+
+ * 2 different IMF
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.yr.py -o chimie.yr.dat.0
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.yr.py.1 -o chimie.yr.dat.1
+
+
+ * yields from Francois (Mon Apr 18 13:11:44 CEST 2011)
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.francois.py -o chimie.francois.dat
+
+
+
+./plot_SNII_yields.py --log xy --legend --xmin 0.05 --xmax 100 --ymin 1e-4 --ymax 1 --elts=Ej,Ejnp,Fe,Mg,O chimie.yr.dat chimie.francois.dat
+./plot_SNII_interated_yields.py --log xy --legend --xmin 0.05 --xmax 100 --ymin 1e-4 --ymax 1 --elts=Ej,Ejnp,Fe,Mg,O chimie.yr.dat chimie.francois.dat
+
+ * chimie.francois-met.dat = chimie.francois.dat with Metals from chimie.yr.dat
+
+ * yields from Francois + SNIa from Francois
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.francois-002.py -o chimie.francois-002.dat
+
+
+
+ * yields from Woosley (Tue May 3 15:18:43 CEST 2011)
+ ../scripts/pychem_generate_parameters -p chemistryparameters/chimieparam.woosley.py -o chimie.woosley.dat
+
+
+
+############################################################
+# plot IMF
+############################################################
+
+../scripts/pychem_plot_IMF --log xy chimie.yr.dat chimie.salpeter.dat --legend
+
+
+
+
+############################################################
+# sample IMF
+############################################################
+
+../scripts/pychem_sample_IMF chimie.yr.dat --mstar 1e4
+
+
+
+############################################################
+# lifetime
+############################################################
+
+Plot the stars lifetime as a function of mass and metallicity
+
+../scripts/pychem_plot_lifetime --legend --log xy --xmin 0.05 --xmax 100 --ymin 1e-1 --ymax 1e10 chimie.yr.dat
+
+../scripts/pychem_lifetime chimie.yr.dat.1
+
+
+
+
+############################################################
+# yields
+############################################################
+
+Plot the Mass fraction of ejected elements due to the explotion of one SNII of mass m
+
+../scripts/pychem_plot_SNII_yields --log xy --legend --xmin 0.05 --xmax 100 --ymin 1e-4 --ymax 1 chimie.yr.dat
+../scripts/pychem_plot_DYIN_yields --log xy --legend --xmin 0.05 --xmax 100 --ymin 1e-4 --ymax 1 chimie.yr.dat
+
+
+../scripts/pychem_plot_SNII_yields --log xy --legend --xmin 0.05 --xmax 100 --ymin 1e-4 --ymax 1 --elts=Ej,Ejnp,Fe56,Mg24,O16,Metals chimie.yr.dat
+
+
+Plot the integrated yields (!! the zero depends on the zero of the function...)
+
+../scripts/pychem_plot_SNII_interated_yields --log xy --legend --xmin 0.05 --xmax 100 --ymin 1e-4 --ymax 1 chimie.yr.dat
+
+
+Estimation of the energy lost by stars
+
+../scripts/pychem_mass_ejection chimie.yr.dat.1
+
+
+
+
+
+############################################################
+# chemical evolution
+############################################################
+
+# chemical enrichment due to a SSP
+
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 0 --xmax 30 --y Mg --timeunit Myr -o Y,ESN
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 0.001 --xmax 13 --y Mg --timeunit Gyr -o Y,ESN
+
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 0.001 --xmax 20 --y Mg --timeunit Gyr -o Y,ESN --log x
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 1 --xmax 20000 --y Mg --timeunit Myr -o Y,ESN --log x
+
+
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 1 --xmax 20000 --y Mg --timeunit Myr -o D
+
+
+# evolution of the stellar mass
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 1 --xmax 20000 --y Mg --timeunit Myr -o MSTAR --log x --ymin 0 --ymax 1e-5 --NumberOfTables 2 --DefaultTable 0
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 1 --xmax 20000 --y Mg --timeunit Myr -o MSTAR --log x --ymin 0 --ymax 1e-5 --NumberOfTables 2 --DefaultTable 1
+
+
+(il faudrait un pgm style SSP_evolution.py mais ou l'on plot ce qui nous interesse.
+ou alors ecrire les output de SSP_evolution.py et le plotter avec un autre pgm...)
+
+
+
+# using different tables
+
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 1 --xmax 20000 --y Mg --timeunit Myr -o Y,ESN --log x --NumberOfTables 2
+../scripts/pychem_SSP_evolution chimie.yr.dat --xmin 1 --xmax 20000 --y Mg --timeunit Myr -o Y,ESN --log x --NumberOfTables 2 --DefaultTable 1
+
+
+
+# using the SN trick
+../scripts/pychem_SSP_evolution chimie.yr.dat --mstar 1e7 --xmin 0 --xmax 50 --y Mg --timeunit Myr -o NSNII,CumNSNII --mstar 3e4 --dt .1 --discsn
+../scripts/pychem_SSP_evolution chimie.yr.dat --mstar 1e7 --xmin 0 --xmax 3000 --y Mg --timeunit Myr -o NSNIa,CumNSNIa --mstar 3e4 --dt .1 --discsn
+
+
+../scripts/pychem_SSP_discret_evolution2 chimie.yr.dat --mstar 1e7 --xmin 0 --discsn --x Fe --y Mg --timeunit Myr --mstar 1e4 --dt .1 --xmax 3000 -o CumNSNII,CumNSNIa,CumNDYIN,CumEjMass,StellarMass,Y,Yg,D
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistry.simple.dat b/PyChem/shared/chemistry.simple.dat
new file mode 100644
index 0000000..c1788f2
--- /dev/null
+++ b/PyChem/shared/chemistry.simple.dat
@@ -0,0 +1,2527 @@
+#### Livetime ####
+
+-40.1107251082866 5.50992173040633 0.782431795366473
+ 141.929566656232 -15.88948185575660 -3.255779246324010
+-261.365531429482 17.07350618651300 9.866058678313810
+
+#### IMF Parameters ####
+
+0.05 50
+3
+0.08 0.5 1
+0.7 -0.8 -1.7 -1.3
+
+#### SNII Parameters ####
+
+8
+
+#### SNIa Parameters ####
+
+3 8
+-0.35
+0.9 1.5 0.02
+1.8 2.6 0.05
+
+#### Metal Parameters ####
+
+# Number of points / Number of elements
+200 4
+
+# Ej
+
+0.05 0.0155624
+4.843730e-02
+4.935623e-02
+5.030868e-02
+5.129588e-02
+5.231913e-02
+5.337968e-02
+5.447892e-02
+5.561825e-02
+5.679915e-02
+5.802314e-02
+5.929179e-02
+6.060675e-02
+6.196962e-02
+6.338228e-02
+6.484646e-02
+6.636404e-02
+6.793699e-02
+6.956732e-02
+7.125717e-02
+7.300862e-02
+7.482401e-02
+7.670562e-02
+7.865587e-02
+8.067726e-02
+8.277240e-02
+8.494399e-02
+8.719482e-02
+8.952773e-02
+9.194581e-02
+9.445206e-02
+9.704976e-02
+9.974223e-02
+1.025330e-01
+1.054255e-01
+1.084235e-01
+1.115309e-01
+1.147517e-01
+1.180900e-01
+1.215501e-01
+1.251365e-01
+1.288536e-01
+1.327064e-01
+1.366998e-01
+1.408388e-01
+1.451289e-01
+1.495755e-01
+1.541843e-01
+1.589612e-01
+1.639124e-01
+1.690443e-01
+1.743633e-01
+1.798765e-01
+1.855907e-01
+1.915134e-01
+1.976523e-01
+2.040152e-01
+2.106101e-01
+2.174456e-01
+2.245306e-01
+2.318740e-01
+2.394853e-01
+2.473743e-01
+2.555511e-01
+2.640263e-01
+2.728106e-01
+2.819155e-01
+2.913525e-01
+3.011338e-01
+3.112719e-01
+3.217799e-01
+3.326714e-01
+3.439602e-01
+3.556607e-01
+3.677883e-01
+3.803582e-01
+3.933867e-01
+4.068906e-01
+4.208871e-01
+4.353943e-01
+4.504307e-01
+4.660157e-01
+4.821694e-01
+4.989123e-01
+5.162661e-01
+5.314058e-01
+5.427305e-01
+5.544683e-01
+5.666343e-01
+5.792443e-01
+5.923142e-01
+6.058611e-01
+6.199021e-01
+6.344554e-01
+6.495397e-01
+6.651744e-01
+6.807522e-01
+6.899109e-01
+6.994038e-01
+7.092429e-01
+7.194411e-01
+7.368875e-01
+7.569233e-01
+7.776899e-01
+7.980127e-01
+7.982467e-01
+7.984892e-01
+7.987405e-01
+7.990010e-01
+7.992710e-01
+7.995510e-01
+8.042794e-01
+8.101172e-01
+8.161680e-01
+8.224396e-01
+8.289399e-01
+8.342458e-01
+8.392339e-01
+8.444039e-01
+8.497626e-01
+8.539259e-01
+8.564276e-01
+8.590205e-01
+8.617080e-01
+8.601962e-01
+8.568598e-01
+8.548928e-01
+8.535241e-01
+8.496331e-01
+8.360225e-01
+8.264965e-01
+8.275483e-01
+8.286386e-01
+8.297685e-01
+8.309396e-01
+8.328840e-01
+8.360294e-01
+8.392897e-01
+8.426689e-01
+8.461714e-01
+8.498016e-01
+8.535643e-01
+8.574644e-01
+8.613294e-01
+8.650263e-01
+8.688580e-01
+8.728295e-01
+8.769459e-01
+8.812124e-01
+8.849934e-01
+8.849465e-01
+8.848978e-01
+8.848472e-01
+8.847950e-01
+8.847407e-01
+8.846844e-01
+8.846261e-01
+8.875960e-01
+8.913530e-01
+8.952472e-01
+8.992833e-01
+9.025038e-01
+9.056354e-01
+9.088813e-01
+9.122456e-01
+9.157327e-01
+9.174708e-01
+9.185946e-01
+9.197595e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.207747e-01
+9.221712e-01
+9.236184e-01
+9.251186e-01
+9.266735e-01
+9.282851e-01
+9.299554e-01
+9.316868e-01
+9.334813e-01
+9.353413e-01
+9.372691e-01
+9.392673e-01
+9.413384e-01
+9.429768e-01
+9.440540e-01
+9.451705e-01
+9.463276e-01
+9.475270e-01
+9.487702e-01
+9.500588e-01
+9.513942e-01
+9.527785e-01
+9.542133e-01
+9.557003e-01
+9.572417e-01
+9.588393e-01
+
+# Ejnp
+
+0.05 0.0155624
+4.843730e-02
+4.935623e-02
+5.030868e-02
+5.129588e-02
+5.231913e-02
+5.337968e-02
+5.447892e-02
+5.561825e-02
+5.679915e-02
+5.802314e-02
+5.929179e-02
+6.060675e-02
+6.196962e-02
+6.338228e-02
+6.484646e-02
+6.636404e-02
+6.793699e-02
+6.956732e-02
+7.125717e-02
+7.300862e-02
+7.482401e-02
+7.670562e-02
+7.865587e-02
+8.067726e-02
+8.277240e-02
+8.494399e-02
+8.719482e-02
+8.952773e-02
+9.194581e-02
+9.445206e-02
+9.704976e-02
+9.974223e-02
+1.025330e-01
+1.054255e-01
+1.084235e-01
+1.115309e-01
+1.147517e-01
+1.180900e-01
+1.215501e-01
+1.251365e-01
+1.288536e-01
+1.327064e-01
+1.366998e-01
+1.408388e-01
+1.451289e-01
+1.495755e-01
+1.541843e-01
+1.589612e-01
+1.639124e-01
+1.690443e-01
+1.743633e-01
+1.798765e-01
+1.855907e-01
+1.915134e-01
+1.976523e-01
+2.040152e-01
+2.106101e-01
+2.174456e-01
+2.245306e-01
+2.318740e-01
+2.394853e-01
+2.473743e-01
+2.555511e-01
+2.640263e-01
+2.728106e-01
+2.819155e-01
+2.913525e-01
+3.011338e-01
+3.112719e-01
+3.217799e-01
+3.326714e-01
+3.439602e-01
+3.556607e-01
+3.677883e-01
+3.803582e-01
+3.933867e-01
+4.068906e-01
+4.208871e-01
+4.353943e-01
+4.504307e-01
+4.660157e-01
+4.821694e-01
+4.989123e-01
+5.162661e-01
+5.314058e-01
+5.427305e-01
+5.544683e-01
+5.666343e-01
+5.792443e-01
+5.923142e-01
+6.058611e-01
+6.199021e-01
+6.344554e-01
+6.495397e-01
+6.651744e-01
+6.807522e-01
+6.899109e-01
+6.994038e-01
+7.092429e-01
+7.194411e-01
+7.368875e-01
+7.569233e-01
+7.776899e-01
+7.980127e-01
+7.982467e-01
+7.984892e-01
+7.987405e-01
+7.990010e-01
+7.992710e-01
+7.995510e-01
+8.042794e-01
+8.101172e-01
+8.161680e-01
+8.224396e-01
+8.289399e-01
+8.342458e-01
+8.392339e-01
+8.444039e-01
+8.497626e-01
+8.539259e-01
+8.564276e-01
+8.590205e-01
+8.617080e-01
+8.601962e-01
+8.568598e-01
+8.548928e-01
+8.535241e-01
+8.496331e-01
+8.360225e-01
+8.264965e-01
+8.275483e-01
+8.286386e-01
+8.297685e-01
+8.309396e-01
+8.328840e-01
+8.360294e-01
+8.392897e-01
+8.426689e-01
+8.461714e-01
+8.498016e-01
+8.535643e-01
+8.574644e-01
+8.613294e-01
+8.650263e-01
+8.688580e-01
+8.728295e-01
+8.769459e-01
+8.812124e-01
+8.826500e-01
+8.656790e-01
+8.480889e-01
+8.298569e-01
+8.109598e-01
+7.913733e-01
+7.710722e-01
+7.500303e-01
+7.436701e-01
+7.405392e-01
+7.372940e-01
+7.339306e-01
+7.316641e-01
+7.295763e-01
+7.274125e-01
+7.251695e-01
+7.228449e-01
+7.168616e-01
+7.093693e-01
+7.016037e-01
+6.976798e-01
+6.946764e-01
+6.915635e-01
+6.883371e-01
+6.849929e-01
+6.815267e-01
+6.772454e-01
+6.722804e-01
+6.671343e-01
+6.618005e-01
+6.562721e-01
+6.505419e-01
+6.446027e-01
+6.384468e-01
+6.320664e-01
+6.254531e-01
+6.185986e-01
+6.114941e-01
+6.041303e-01
+5.987492e-01
+5.959238e-01
+5.929955e-01
+5.899602e-01
+5.868143e-01
+5.835535e-01
+5.801739e-01
+5.766708e-01
+5.730400e-01
+5.692767e-01
+5.653761e-01
+5.613332e-01
+5.571429e-01
+
+# Fe
+
+10 0.0039994
+0.000000e+00
+3.558248e-04
+7.149428e-04
+1.077384e-03
+1.443177e-03
+1.812354e-03
+2.184950e-03
+2.560988e-03
+2.940513e-03
+3.323540e-03
+3.710113e-03
+4.100263e-03
+4.494023e-03
+4.891425e-03
+5.292505e-03
+5.697295e-03
+6.105825e-03
+6.518144e-03
+6.934274e-03
+7.354248e-03
+7.778116e-03
+8.205902e-03
+8.637641e-03
+9.073380e-03
+9.513151e-03
+9.956989e-03
+1.040493e-02
+1.085702e-02
+1.131329e-02
+1.147916e-02
+1.136204e-02
+1.124385e-02
+1.112455e-02
+1.100415e-02
+1.088264e-02
+1.076000e-02
+1.063623e-02
+1.051132e-02
+1.038525e-02
+1.025801e-02
+1.012959e-02
+9.999991e-03
+9.869192e-03
+9.737178e-03
+9.603944e-03
+9.357847e-03
+9.106077e-03
+8.851975e-03
+8.595521e-03
+8.336697e-03
+8.075474e-03
+7.811835e-03
+7.545760e-03
+7.277224e-03
+7.006200e-03
+6.732671e-03
+6.456610e-03
+6.177995e-03
+5.896807e-03
+5.613012e-03
+5.326595e-03
+5.037524e-03
+4.745778e-03
+4.451338e-03
+4.197761e-03
+4.152264e-03
+4.106346e-03
+4.060003e-03
+4.013231e-03
+3.966028e-03
+3.918387e-03
+3.870306e-03
+3.821779e-03
+3.772804e-03
+3.723375e-03
+3.673490e-03
+3.617734e-03
+3.559467e-03
+3.500659e-03
+3.441308e-03
+3.381408e-03
+3.320953e-03
+3.259939e-03
+3.198361e-03
+3.136212e-03
+3.073489e-03
+3.010186e-03
+2.946297e-03
+2.881817e-03
+2.816740e-03
+2.751061e-03
+2.684775e-03
+2.617876e-03
+2.550357e-03
+2.482214e-03
+2.413440e-03
+2.344030e-03
+2.273978e-03
+2.203279e-03
+2.131924e-03
+2.094300e-03
+2.090877e-03
+2.087421e-03
+2.083935e-03
+2.080415e-03
+2.076864e-03
+2.073279e-03
+2.069661e-03
+2.066010e-03
+2.062325e-03
+2.058605e-03
+2.054852e-03
+2.051064e-03
+2.047240e-03
+2.043382e-03
+2.039487e-03
+2.035557e-03
+2.031590e-03
+2.027586e-03
+2.023546e-03
+2.019468e-03
+2.015352e-03
+2.011198e-03
+2.007006e-03
+2.002775e-03
+1.998505e-03
+1.994196e-03
+1.989846e-03
+1.985456e-03
+1.981026e-03
+1.976555e-03
+1.972042e-03
+1.967488e-03
+1.962891e-03
+1.958252e-03
+1.953570e-03
+1.948845e-03
+1.944076e-03
+1.939262e-03
+1.934405e-03
+1.929502e-03
+1.924554e-03
+1.919561e-03
+1.914520e-03
+1.909434e-03
+1.904300e-03
+1.899119e-03
+1.893890e-03
+1.888613e-03
+1.883287e-03
+1.877911e-03
+1.870429e-03
+1.860474e-03
+1.850428e-03
+1.840288e-03
+1.830054e-03
+1.819726e-03
+1.809302e-03
+1.798782e-03
+1.788165e-03
+1.777449e-03
+1.766635e-03
+1.755720e-03
+1.744704e-03
+1.733586e-03
+1.722366e-03
+1.711041e-03
+1.699612e-03
+1.688077e-03
+1.676435e-03
+1.664686e-03
+1.652828e-03
+1.640860e-03
+1.628782e-03
+1.616592e-03
+1.604289e-03
+1.591872e-03
+1.579340e-03
+1.566693e-03
+1.553928e-03
+1.541045e-03
+1.528044e-03
+1.514921e-03
+1.501678e-03
+1.488312e-03
+1.474822e-03
+1.461208e-03
+1.447467e-03
+1.433599e-03
+1.419603e-03
+1.405478e-03
+1.391222e-03
+1.376834e-03
+1.362313e-03
+1.347658e-03
+1.332866e-03
+1.317939e-03
+1.302873e-03
+1.287668e-03
+1.272321e-03
+
+# Mg
+
+10 0.0039994
+0.000000e+00
+2.189493e-05
+4.399288e-05
+6.629503e-05
+8.880370e-05
+1.115203e-04
+1.344471e-04
+1.575863e-04
+1.809394e-04
+2.045084e-04
+2.282958e-04
+2.523030e-04
+2.765323e-04
+3.009858e-04
+3.256656e-04
+3.505736e-04
+3.757118e-04
+4.010831e-04
+4.266892e-04
+4.525315e-04
+4.786134e-04
+5.049363e-04
+5.315030e-04
+5.583153e-04
+5.853758e-04
+6.126869e-04
+6.402500e-04
+6.680684e-04
+6.961443e-04
+7.527266e-04
+8.371091e-04
+9.222738e-04
+1.008226e-03
+1.094973e-03
+1.182523e-03
+1.270883e-03
+1.360059e-03
+1.450062e-03
+1.540896e-03
+1.632571e-03
+1.725094e-03
+1.818474e-03
+1.912716e-03
+2.007831e-03
+2.103826e-03
+2.102377e-03
+2.097917e-03
+2.093416e-03
+2.088873e-03
+2.084289e-03
+2.079661e-03
+2.074991e-03
+2.070278e-03
+2.065522e-03
+2.060721e-03
+2.055875e-03
+2.050985e-03
+2.046050e-03
+2.041069e-03
+2.036042e-03
+2.030969e-03
+2.025848e-03
+2.020680e-03
+2.015465e-03
+2.087396e-03
+2.532631e-03
+2.981994e-03
+3.435511e-03
+3.893219e-03
+4.355166e-03
+4.821386e-03
+5.291916e-03
+5.766809e-03
+6.246086e-03
+6.729800e-03
+7.217988e-03
+7.323246e-03
+7.286363e-03
+7.249138e-03
+7.211570e-03
+7.173653e-03
+7.135385e-03
+7.096764e-03
+7.057786e-03
+7.018446e-03
+6.978743e-03
+6.938672e-03
+6.898231e-03
+6.857415e-03
+6.816221e-03
+6.774648e-03
+6.732689e-03
+6.690343e-03
+6.647604e-03
+6.604470e-03
+6.560936e-03
+6.517000e-03
+6.472658e-03
+6.427906e-03
+6.382740e-03
+6.379153e-03
+6.417723e-03
+6.456651e-03
+6.495939e-03
+6.535590e-03
+6.575608e-03
+6.615997e-03
+6.656759e-03
+6.697898e-03
+6.739418e-03
+6.781321e-03
+6.823613e-03
+6.866296e-03
+6.909373e-03
+6.952850e-03
+6.996728e-03
+7.041012e-03
+7.085706e-03
+7.130814e-03
+7.176339e-03
+7.222285e-03
+7.268656e-03
+7.315456e-03
+7.362689e-03
+7.410359e-03
+7.458470e-03
+7.507026e-03
+7.556031e-03
+7.605490e-03
+7.655406e-03
+7.705784e-03
+7.756629e-03
+7.807944e-03
+7.859732e-03
+7.912001e-03
+7.964753e-03
+8.017993e-03
+8.071724e-03
+8.125956e-03
+8.180685e-03
+8.235925e-03
+8.291673e-03
+8.347938e-03
+8.404722e-03
+8.462033e-03
+8.519874e-03
+8.578249e-03
+8.637166e-03
+8.696625e-03
+8.756638e-03
+8.817203e-03
+8.863611e-03
+8.893255e-03
+8.923171e-03
+8.953365e-03
+8.983838e-03
+9.014593e-03
+9.045633e-03
+9.076959e-03
+9.108575e-03
+9.140483e-03
+9.172688e-03
+9.205190e-03
+9.237993e-03
+9.271099e-03
+9.304511e-03
+9.338234e-03
+9.372266e-03
+9.406614e-03
+9.441281e-03
+9.476268e-03
+9.511579e-03
+9.547216e-03
+9.583183e-03
+9.619482e-03
+9.656118e-03
+9.693092e-03
+9.730408e-03
+9.768071e-03
+9.806080e-03
+9.844442e-03
+9.883159e-03
+9.922234e-03
+9.961670e-03
+1.000147e-02
+1.004164e-02
+1.008218e-02
+1.012310e-02
+1.016439e-02
+1.020607e-02
+1.024813e-02
+1.029058e-02
+1.033343e-02
+1.037667e-02
+1.042031e-02
+1.046435e-02
+1.050881e-02
+1.055367e-02
+1.059895e-02
+1.064464e-02
+
+# O
+
+10 0.0039994
+0.000000e+00
+3.581978e-04
+7.197112e-04
+1.084566e-03
+1.452804e-03
+1.824435e-03
+2.199516e-03
+2.578061e-03
+2.960116e-03
+3.345698e-03
+3.734849e-03
+4.127599e-03
+4.523985e-03
+4.924037e-03
+5.327787e-03
+5.735278e-03
+6.146535e-03
+6.561603e-03
+6.980505e-03
+7.403281e-03
+7.829972e-03
+8.260608e-03
+8.695230e-03
+9.133872e-03
+9.576570e-03
+1.002337e-02
+1.047430e-02
+1.092940e-02
+1.138871e-02
+1.198405e-02
+1.271216e-02
+1.344701e-02
+1.418866e-02
+1.493715e-02
+1.569258e-02
+1.645500e-02
+1.722448e-02
+1.800107e-02
+1.878485e-02
+1.957588e-02
+2.037422e-02
+2.117996e-02
+2.199314e-02
+2.281386e-02
+2.364215e-02
+2.457941e-02
+2.552842e-02
+2.648621e-02
+2.745286e-02
+2.842847e-02
+2.941308e-02
+3.040681e-02
+3.140973e-02
+3.242194e-02
+3.344350e-02
+3.447453e-02
+3.551508e-02
+3.656527e-02
+3.762516e-02
+3.869487e-02
+3.977447e-02
+4.086405e-02
+4.196373e-02
+4.307356e-02
+4.442865e-02
+4.693052e-02
+4.945552e-02
+5.200389e-02
+5.457583e-02
+5.717158e-02
+5.979133e-02
+6.243533e-02
+6.510380e-02
+6.779692e-02
+7.051498e-02
+7.325819e-02
+7.523228e-02
+7.693115e-02
+7.864574e-02
+8.037619e-02
+8.212265e-02
+8.388527e-02
+8.566421e-02
+8.745958e-02
+8.927158e-02
+9.110032e-02
+9.294599e-02
+9.480874e-02
+9.668873e-02
+9.858610e-02
+1.005010e-01
+1.024337e-01
+1.043842e-01
+1.063528e-01
+1.083395e-01
+1.103447e-01
+1.123684e-01
+1.144108e-01
+1.164722e-01
+1.185526e-01
+1.204319e-01
+1.221072e-01
+1.237979e-01
+1.255044e-01
+1.272265e-01
+1.289647e-01
+1.307189e-01
+1.324894e-01
+1.342762e-01
+1.360795e-01
+1.378996e-01
+1.397364e-01
+1.415903e-01
+1.434613e-01
+1.453497e-01
+1.472555e-01
+1.491789e-01
+1.511201e-01
+1.530793e-01
+1.550567e-01
+1.570522e-01
+1.590663e-01
+1.610990e-01
+1.631505e-01
+1.652210e-01
+1.673107e-01
+1.694196e-01
+1.715481e-01
+1.736963e-01
+1.758644e-01
+1.780525e-01
+1.802608e-01
+1.824896e-01
+1.847390e-01
+1.870092e-01
+1.893004e-01
+1.916129e-01
+1.939466e-01
+1.963020e-01
+1.986793e-01
+2.010784e-01
+2.034998e-01
+2.059436e-01
+2.084100e-01
+2.108992e-01
+2.134114e-01
+2.159469e-01
+2.185058e-01
+2.210884e-01
+2.236949e-01
+2.263255e-01
+2.281935e-01
+2.291593e-01
+2.301341e-01
+2.311179e-01
+2.321107e-01
+2.331128e-01
+2.341241e-01
+2.351448e-01
+2.361749e-01
+2.372146e-01
+2.382638e-01
+2.393228e-01
+2.403916e-01
+2.414703e-01
+2.425589e-01
+2.436576e-01
+2.447665e-01
+2.458857e-01
+2.470152e-01
+2.481551e-01
+2.493056e-01
+2.504667e-01
+2.516386e-01
+2.528213e-01
+2.540150e-01
+2.552197e-01
+2.564356e-01
+2.576627e-01
+2.589011e-01
+2.601510e-01
+2.614125e-01
+2.626857e-01
+2.639706e-01
+2.652674e-01
+2.665761e-01
+2.678971e-01
+2.692302e-01
+2.705757e-01
+2.719336e-01
+2.733040e-01
+2.746872e-01
+2.760832e-01
+2.774920e-01
+2.789139e-01
+2.803490e-01
+2.817973e-01
+2.832591e-01
+2.847343e-01
+2.862232e-01
+
+# Metals
+
+10 0.0039994
+0.000000e+00
+1.069851e-03
+2.149604e-03
+3.239341e-03
+4.339159e-03
+5.449153e-03
+6.569408e-03
+7.700041e-03
+8.841135e-03
+9.992771e-03
+1.115508e-02
+1.232814e-02
+1.351204e-02
+1.470690e-02
+1.591281e-02
+1.712988e-02
+1.835819e-02
+1.959790e-02
+2.084907e-02
+2.211178e-02
+2.338619e-02
+2.467241e-02
+2.597051e-02
+2.728064e-02
+2.860286e-02
+2.993735e-02
+3.128416e-02
+3.264344e-02
+3.401529e-02
+3.530334e-02
+3.651015e-02
+3.772812e-02
+3.895736e-02
+4.019795e-02
+4.145005e-02
+4.271373e-02
+4.398908e-02
+4.527624e-02
+4.657531e-02
+4.788640e-02
+4.920962e-02
+5.054508e-02
+5.189289e-02
+5.325316e-02
+5.462605e-02
+5.582879e-02
+5.703710e-02
+5.825658e-02
+5.948736e-02
+6.072950e-02
+6.198315e-02
+6.324840e-02
+6.452534e-02
+6.581409e-02
+6.711479e-02
+6.842750e-02
+6.975237e-02
+7.108949e-02
+7.243897e-02
+7.380094e-02
+7.517551e-02
+7.656279e-02
+7.796292e-02
+7.937603e-02
+8.103344e-02
+8.382249e-02
+8.663747e-02
+8.947843e-02
+9.234565e-02
+9.523943e-02
+9.815997e-02
+1.011075e-01
+1.040824e-01
+1.070847e-01
+1.101148e-01
+1.131730e-01
+1.155458e-01
+1.176768e-01
+1.198276e-01
+1.219982e-01
+1.241889e-01
+1.263999e-01
+1.286314e-01
+1.308835e-01
+1.331564e-01
+1.354504e-01
+1.377656e-01
+1.401022e-01
+1.424604e-01
+1.448405e-01
+1.472425e-01
+1.496668e-01
+1.521135e-01
+1.545829e-01
+1.570750e-01
+1.595903e-01
+1.621288e-01
+1.646908e-01
+1.672765e-01
+1.698862e-01
+1.720888e-01
+1.738787e-01
+1.756852e-01
+1.775083e-01
+1.793484e-01
+1.812054e-01
+1.830797e-01
+1.849713e-01
+1.868804e-01
+1.888071e-01
+1.907517e-01
+1.927142e-01
+1.946950e-01
+1.966940e-01
+1.987116e-01
+2.007478e-01
+2.028028e-01
+2.048769e-01
+2.069701e-01
+2.090827e-01
+2.112149e-01
+2.133668e-01
+2.155385e-01
+2.177304e-01
+2.199425e-01
+2.221752e-01
+2.244285e-01
+2.267026e-01
+2.289978e-01
+2.313141e-01
+2.336520e-01
+2.360114e-01
+2.383927e-01
+2.407960e-01
+2.432216e-01
+2.456696e-01
+2.481402e-01
+2.506337e-01
+2.531503e-01
+2.556901e-01
+2.582535e-01
+2.608405e-01
+2.634515e-01
+2.660866e-01
+2.687461e-01
+2.714303e-01
+2.741393e-01
+2.768732e-01
+2.796326e-01
+2.824174e-01
+2.852280e-01
+2.872894e-01
+2.884641e-01
+2.896495e-01
+2.908460e-01
+2.920536e-01
+2.932723e-01
+2.945023e-01
+2.957436e-01
+2.969965e-01
+2.982610e-01
+2.995371e-01
+3.008251e-01
+3.021249e-01
+3.034368e-01
+3.047608e-01
+3.060971e-01
+3.074458e-01
+3.088069e-01
+3.101806e-01
+3.115670e-01
+3.129663e-01
+3.143784e-01
+3.158037e-01
+3.172421e-01
+3.186939e-01
+3.201591e-01
+3.216378e-01
+3.231302e-01
+3.246365e-01
+3.261566e-01
+3.276908e-01
+3.292393e-01
+3.308020e-01
+3.323792e-01
+3.339710e-01
+3.355775e-01
+3.371989e-01
+3.388353e-01
+3.404868e-01
+3.421535e-01
+3.438358e-01
+3.455336e-01
+3.472471e-01
+3.489764e-01
+3.507217e-01
+3.524832e-01
+3.542610e-01
+3.560552e-01
+3.578661e-01
+
+#### Metal Ejecta Parameters ####
+
+# Number of points / Number of elements
+200 4
+
+# IEj
+
+0.05 0.0155624
+8.206815e-05
+2.370714e-04
+4.047551e-04
+5.862745e-04
+7.828567e-04
+9.958115e-04
+1.226530e-03
+1.477058e-03
+1.748617e-03
+2.042938e-03
+2.362879e-03
+2.709811e-03
+3.086701e-03
+3.495351e-03
+3.923152e-03
+4.364125e-03
+4.818805e-03
+5.287757e-03
+5.771519e-03
+6.270749e-03
+6.786058e-03
+7.318125e-03
+7.867619e-03
+8.435268e-03
+9.021813e-03
+9.628053e-03
+1.025482e-02
+1.090293e-02
+1.157330e-02
+1.226686e-02
+1.298458e-02
+1.372747e-02
+1.449659e-02
+1.529304e-02
+1.611798e-02
+1.697260e-02
+1.785816e-02
+1.877598e-02
+1.972741e-02
+2.071389e-02
+2.173691e-02
+2.279802e-02
+2.389884e-02
+2.504107e-02
+2.622646e-02
+2.745688e-02
+2.873424e-02
+3.006056e-02
+3.143792e-02
+3.286853e-02
+3.435466e-02
+3.589871e-02
+3.750316e-02
+3.917060e-02
+4.090377e-02
+4.270547e-02
+4.457868e-02
+4.652649e-02
+4.855209e-02
+5.065887e-02
+5.285032e-02
+5.513012e-02
+5.750208e-02
+5.997020e-02
+6.253864e-02
+6.518428e-02
+6.785256e-02
+7.054213e-02
+7.325339e-02
+7.598678e-02
+7.874273e-02
+8.152161e-02
+8.432387e-02
+8.714992e-02
+9.000015e-02
+9.287501e-02
+9.577491e-02
+9.870028e-02
+1.016515e-01
+1.046291e-01
+1.076333e-01
+1.106647e-01
+1.137237e-01
+1.168107e-01
+1.199263e-01
+1.230735e-01
+1.262540e-01
+1.294692e-01
+1.327203e-01
+1.360089e-01
+1.393363e-01
+1.427040e-01
+1.461135e-01
+1.495662e-01
+1.530639e-01
+1.566079e-01
+1.601764e-01
+1.637549e-01
+1.673445e-01
+1.709463e-01
+1.745754e-01
+1.782619e-01
+1.820087e-01
+1.858174e-01
+1.896309e-01
+1.934048e-01
+1.971397e-01
+2.008358e-01
+2.044937e-01
+2.081138e-01
+2.117050e-01
+2.152829e-01
+2.188487e-01
+2.224031e-01
+2.259470e-01
+2.294789e-01
+2.329939e-01
+2.364924e-01
+2.399752e-01
+2.434418e-01
+2.468832e-01
+2.502979e-01
+2.536866e-01
+2.570437e-01
+2.603533e-01
+2.636164e-01
+2.668394e-01
+2.700189e-01
+2.731374e-01
+2.761648e-01
+2.791540e-01
+2.821150e-01
+2.850484e-01
+2.879544e-01
+2.908340e-01
+2.936923e-01
+2.965309e-01
+2.993504e-01
+3.021510e-01
+3.049335e-01
+3.076982e-01
+3.104457e-01
+3.131764e-01
+3.158896e-01
+3.185854e-01
+3.212645e-01
+3.239272e-01
+3.265741e-01
+3.292055e-01
+3.318135e-01
+3.343935e-01
+3.369458e-01
+3.394706e-01
+3.419683e-01
+3.444391e-01
+3.468834e-01
+3.493048e-01
+3.517101e-01
+3.541000e-01
+3.564748e-01
+3.588339e-01
+3.611758e-01
+3.635008e-01
+3.658094e-01
+3.681019e-01
+3.703770e-01
+3.726307e-01
+3.748631e-01
+3.770735e-01
+3.792603e-01
+3.814238e-01
+3.835641e-01
+3.856816e-01
+3.877764e-01
+3.898494e-01
+3.919030e-01
+3.939377e-01
+3.959539e-01
+3.979518e-01
+3.999317e-01
+4.018940e-01
+4.038388e-01
+4.057665e-01
+4.076773e-01
+4.095715e-01
+4.114494e-01
+4.133112e-01
+4.151571e-01
+4.169855e-01
+4.187966e-01
+4.205903e-01
+4.223672e-01
+4.241273e-01
+4.258709e-01
+4.275983e-01
+4.293097e-01
+4.310052e-01
+4.326852e-01
+4.343499e-01
+4.359994e-01
+
+# IEjnp
+
+0.05 0.0155624
+8.206815e-05
+2.370714e-04
+4.047551e-04
+5.862745e-04
+7.828567e-04
+9.958115e-04
+1.226530e-03
+1.477058e-03
+1.748617e-03
+2.042938e-03
+2.362879e-03
+2.709811e-03
+3.086701e-03
+3.495351e-03
+3.923152e-03
+4.364125e-03
+4.818805e-03
+5.287757e-03
+5.771519e-03
+6.270749e-03
+6.786058e-03
+7.318125e-03
+7.867619e-03
+8.435268e-03
+9.021813e-03
+9.628053e-03
+1.025482e-02
+1.090293e-02
+1.157330e-02
+1.226686e-02
+1.298458e-02
+1.372747e-02
+1.449659e-02
+1.529304e-02
+1.611798e-02
+1.697260e-02
+1.785816e-02
+1.877598e-02
+1.972741e-02
+2.071389e-02
+2.173691e-02
+2.279802e-02
+2.389884e-02
+2.504107e-02
+2.622646e-02
+2.745688e-02
+2.873424e-02
+3.006056e-02
+3.143792e-02
+3.286853e-02
+3.435466e-02
+3.589871e-02
+3.750316e-02
+3.917060e-02
+4.090377e-02
+4.270547e-02
+4.457868e-02
+4.652649e-02
+4.855209e-02
+5.065887e-02
+5.285032e-02
+5.513012e-02
+5.750208e-02
+5.997020e-02
+6.253864e-02
+6.518428e-02
+6.785256e-02
+7.054213e-02
+7.325339e-02
+7.598678e-02
+7.874273e-02
+8.152161e-02
+8.432387e-02
+8.714992e-02
+9.000015e-02
+9.287501e-02
+9.577491e-02
+9.870028e-02
+1.016515e-01
+1.046291e-01
+1.076333e-01
+1.106647e-01
+1.137237e-01
+1.168107e-01
+1.199263e-01
+1.230735e-01
+1.262540e-01
+1.294692e-01
+1.327203e-01
+1.360089e-01
+1.393363e-01
+1.427040e-01
+1.461135e-01
+1.495662e-01
+1.530639e-01
+1.566079e-01
+1.601764e-01
+1.637549e-01
+1.673445e-01
+1.709463e-01
+1.745754e-01
+1.782619e-01
+1.820087e-01
+1.858174e-01
+1.896309e-01
+1.934048e-01
+1.971397e-01
+2.008358e-01
+2.044937e-01
+2.081138e-01
+2.117050e-01
+2.152829e-01
+2.188487e-01
+2.224031e-01
+2.259470e-01
+2.294789e-01
+2.329939e-01
+2.364924e-01
+2.399752e-01
+2.434418e-01
+2.468832e-01
+2.502979e-01
+2.536866e-01
+2.570437e-01
+2.603533e-01
+2.636164e-01
+2.668394e-01
+2.700189e-01
+2.731374e-01
+2.761648e-01
+2.791540e-01
+2.821150e-01
+2.850484e-01
+2.879544e-01
+2.908340e-01
+2.936923e-01
+2.965309e-01
+2.993504e-01
+3.021510e-01
+3.049335e-01
+3.076982e-01
+3.104457e-01
+3.131764e-01
+3.158896e-01
+3.185854e-01
+3.212645e-01
+3.239272e-01
+3.265741e-01
+3.292050e-01
+3.317812e-01
+3.342795e-01
+3.366995e-01
+3.390406e-01
+3.413024e-01
+3.434843e-01
+3.455858e-01
+3.476235e-01
+3.496303e-01
+3.516071e-01
+3.535541e-01
+3.554726e-01
+3.573653e-01
+3.592322e-01
+3.610736e-01
+3.628896e-01
+3.646771e-01
+3.664278e-01
+3.681412e-01
+3.698213e-01
+3.714761e-01
+3.731061e-01
+3.747112e-01
+3.762917e-01
+3.778475e-01
+3.793783e-01
+3.808821e-01
+3.823586e-01
+3.838080e-01
+3.852301e-01
+3.866250e-01
+3.879927e-01
+3.893331e-01
+3.906463e-01
+3.919321e-01
+3.931905e-01
+3.944216e-01
+3.956251e-01
+3.968021e-01
+3.979597e-01
+3.990995e-01
+4.002213e-01
+4.013254e-01
+4.024118e-01
+4.034804e-01
+4.045314e-01
+4.055647e-01
+4.065804e-01
+4.075785e-01
+4.085590e-01
+4.095219e-01
+
+# IFe
+
+10 0.0039994
+1.591616e-11
+1.381650e-07
+5.473994e-07
+1.228735e-06
+2.183195e-06
+3.411784e-06
+4.915550e-06
+6.695554e-06
+8.752861e-06
+1.108841e-05
+1.370345e-05
+1.659890e-05
+1.977599e-05
+2.323571e-05
+2.697919e-05
+3.100760e-05
+3.532192e-05
+3.992350e-05
+4.481326e-05
+4.999246e-05
+5.546230e-05
+6.122398e-05
+6.727839e-05
+7.362716e-05
+8.027122e-05
+8.721178e-05
+9.445008e-05
+1.019874e-04
+1.098249e-04
+1.179094e-04
+1.259366e-04
+1.338592e-04
+1.416769e-04
+1.493895e-04
+1.569967e-04
+1.644983e-04
+1.718941e-04
+1.791838e-04
+1.863671e-04
+1.934437e-04
+2.004133e-04
+2.072759e-04
+2.140308e-04
+2.206781e-04
+2.272174e-04
+2.336114e-04
+2.398191e-04
+2.458401e-04
+2.516738e-04
+2.573196e-04
+2.627769e-04
+2.680449e-04
+2.731233e-04
+2.780114e-04
+2.827084e-04
+2.872140e-04
+2.915273e-04
+2.956478e-04
+2.995748e-04
+3.033077e-04
+3.068458e-04
+3.101885e-04
+3.133352e-04
+3.162850e-04
+3.190401e-04
+3.217042e-04
+3.243319e-04
+3.269231e-04
+3.294777e-04
+3.319956e-04
+3.344767e-04
+3.369209e-04
+3.393281e-04
+3.416983e-04
+3.440313e-04
+3.463270e-04
+3.485841e-04
+3.507994e-04
+3.529725e-04
+3.551033e-04
+3.571918e-04
+3.592378e-04
+3.612411e-04
+3.632017e-04
+3.651194e-04
+3.669942e-04
+3.688258e-04
+3.706142e-04
+3.723592e-04
+3.740606e-04
+3.757185e-04
+3.773326e-04
+3.789029e-04
+3.804290e-04
+3.819111e-04
+3.833488e-04
+3.847421e-04
+3.860908e-04
+3.873948e-04
+3.886539e-04
+3.898731e-04
+3.910821e-04
+3.922857e-04
+3.934841e-04
+3.946772e-04
+3.958649e-04
+3.970473e-04
+3.982244e-04
+3.993962e-04
+4.005627e-04
+4.017240e-04
+4.028798e-04
+4.040305e-04
+4.051757e-04
+4.063157e-04
+4.074504e-04
+4.085798e-04
+4.097039e-04
+4.108227e-04
+4.119362e-04
+4.130444e-04
+4.141473e-04
+4.152449e-04
+4.163372e-04
+4.174243e-04
+4.185060e-04
+4.195824e-04
+4.206535e-04
+4.217194e-04
+4.227799e-04
+4.238351e-04
+4.248851e-04
+4.259297e-04
+4.269690e-04
+4.280031e-04
+4.290318e-04
+4.300552e-04
+4.310733e-04
+4.320861e-04
+4.330936e-04
+4.340958e-04
+4.350927e-04
+4.360843e-04
+4.370705e-04
+4.380514e-04
+4.390270e-04
+4.399973e-04
+4.409623e-04
+4.419219e-04
+4.428762e-04
+4.438251e-04
+4.447685e-04
+4.457047e-04
+4.466332e-04
+4.475542e-04
+4.484675e-04
+4.493732e-04
+4.502713e-04
+4.511618e-04
+4.520445e-04
+4.529196e-04
+4.537871e-04
+4.546468e-04
+4.554988e-04
+4.563431e-04
+4.571796e-04
+4.580085e-04
+4.588295e-04
+4.596428e-04
+4.604482e-04
+4.612459e-04
+4.620358e-04
+4.628178e-04
+4.635919e-04
+4.643582e-04
+4.651166e-04
+4.658671e-04
+4.666097e-04
+4.673444e-04
+4.680711e-04
+4.687899e-04
+4.695007e-04
+4.702035e-04
+4.708983e-04
+4.715851e-04
+4.722638e-04
+4.729344e-04
+4.735970e-04
+4.742515e-04
+4.748978e-04
+4.755360e-04
+4.761661e-04
+4.767880e-04
+4.774017e-04
+4.780071e-04
+4.786043e-04
+4.791934e-04
+4.797741e-04
+4.803466e-04
+4.809107e-04
+
+# IMg
+
+10 0.0039994
+9.805490e-13
+8.501729e-09
+3.368314e-08
+7.560811e-08
+1.343396e-07
+2.099387e-07
+3.024707e-07
+4.120002e-07
+5.385909e-07
+6.823066e-07
+8.432180e-07
+1.021386e-06
+1.216882e-06
+1.429771e-06
+1.660119e-06
+1.908000e-06
+2.173474e-06
+2.456623e-06
+2.757512e-06
+3.076206e-06
+3.412781e-06
+3.767313e-06
+4.139871e-06
+4.530528e-06
+4.939357e-06
+5.366433e-06
+5.811828e-06
+6.275626e-06
+6.757891e-06
+7.263952e-06
+7.823146e-06
+8.440227e-06
+9.115414e-06
+9.848933e-06
+1.064102e-05
+1.149188e-05
+1.240179e-05
+1.337094e-05
+1.439960e-05
+1.548797e-05
+1.663633e-05
+1.784490e-05
+1.911393e-05
+2.044365e-05
+2.183435e-05
+2.325364e-05
+2.466605e-05
+2.607155e-05
+2.747016e-05
+2.886186e-05
+3.024667e-05
+3.162456e-05
+3.299555e-05
+3.435964e-05
+3.571683e-05
+3.706712e-05
+3.841048e-05
+3.974695e-05
+4.107648e-05
+4.239911e-05
+4.371483e-05
+4.502362e-05
+4.632550e-05
+4.762046e-05
+4.891306e-05
+5.038860e-05
+5.214475e-05
+5.418256e-05
+5.650308e-05
+5.910743e-05
+6.199672e-05
+6.517192e-05
+6.863437e-05
+7.238495e-05
+7.642500e-05
+8.075550e-05
+8.528886e-05
+8.979838e-05
+9.427266e-05
+9.871161e-05
+1.031152e-04
+1.074834e-04
+1.118162e-04
+1.161134e-04
+1.203751e-04
+1.246012e-04
+1.287915e-04
+1.329462e-04
+1.370650e-04
+1.411480e-04
+1.451951e-04
+1.492062e-04
+1.531813e-04
+1.571203e-04
+1.610232e-04
+1.648898e-04
+1.687201e-04
+1.725141e-04
+1.762717e-04
+1.799928e-04
+1.836835e-04
+1.873803e-04
+1.910892e-04
+1.948103e-04
+1.985438e-04
+2.022898e-04
+2.060483e-04
+2.098196e-04
+2.136036e-04
+2.174005e-04
+2.212105e-04
+2.250336e-04
+2.288700e-04
+2.327198e-04
+2.365830e-04
+2.404599e-04
+2.443506e-04
+2.482551e-04
+2.521735e-04
+2.561061e-04
+2.600529e-04
+2.640141e-04
+2.679897e-04
+2.719799e-04
+2.759849e-04
+2.800046e-04
+2.840394e-04
+2.880892e-04
+2.921544e-04
+2.962348e-04
+3.003307e-04
+3.044423e-04
+3.085695e-04
+3.127127e-04
+3.168719e-04
+3.210472e-04
+3.252389e-04
+3.294469e-04
+3.336715e-04
+3.379127e-04
+3.421708e-04
+3.464458e-04
+3.507379e-04
+3.550473e-04
+3.593741e-04
+3.637183e-04
+3.680803e-04
+3.724601e-04
+3.768578e-04
+3.812736e-04
+3.857076e-04
+3.901583e-04
+3.946138e-04
+3.990719e-04
+4.035327e-04
+4.079963e-04
+4.124628e-04
+4.169323e-04
+4.214048e-04
+4.258805e-04
+4.303594e-04
+4.348416e-04
+4.393274e-04
+4.438165e-04
+4.483094e-04
+4.528058e-04
+4.573062e-04
+4.618105e-04
+4.663186e-04
+4.708310e-04
+4.753474e-04
+4.798682e-04
+4.843933e-04
+4.889229e-04
+4.934571e-04
+4.979959e-04
+5.025396e-04
+5.070880e-04
+5.116415e-04
+5.161999e-04
+5.207636e-04
+5.253325e-04
+5.299068e-04
+5.344865e-04
+5.390718e-04
+5.436628e-04
+5.482595e-04
+5.528622e-04
+5.574707e-04
+5.620854e-04
+5.667063e-04
+5.713334e-04
+5.759669e-04
+5.806070e-04
+5.852537e-04
+5.899071e-04
+5.945673e-04
+5.992344e-04
+6.039087e-04
+6.085900e-04
+
+# IO
+
+10 0.0039994
+1.602984e-11
+1.390854e-07
+5.510519e-07
+1.236935e-06
+2.197754e-06
+3.434528e-06
+4.948335e-06
+6.740200e-06
+8.811214e-06
+1.116237e-05
+1.379481e-05
+1.670959e-05
+1.990786e-05
+2.339060e-05
+2.715905e-05
+3.121432e-05
+3.555740e-05
+4.018971e-05
+4.511198e-05
+5.032582e-05
+5.583209e-05
+6.163208e-05
+6.772700e-05
+7.411803e-05
+8.080638e-05
+8.779328e-05
+9.507977e-05
+1.026674e-04
+1.105572e-04
+1.187749e-04
+1.274583e-04
+1.366306e-04
+1.462936e-04
+1.564495e-04
+1.671000e-04
+1.782472e-04
+1.898935e-04
+2.020404e-04
+2.146905e-04
+2.278452e-04
+2.415072e-04
+2.556785e-04
+2.703610e-04
+2.855569e-04
+3.012688e-04
+3.175320e-04
+3.343854e-04
+3.518320e-04
+3.698741e-04
+3.885137e-04
+4.077542e-04
+4.275978e-04
+4.480467e-04
+4.691044e-04
+4.907723e-04
+5.130544e-04
+5.359522e-04
+5.594688e-04
+5.836072e-04
+6.083697e-04
+6.337592e-04
+6.597785e-04
+6.864306e-04
+7.137179e-04
+7.416576e-04
+7.708161e-04
+8.014936e-04
+8.336965e-04
+8.674311e-04
+9.027030e-04
+9.395187e-04
+9.778854e-04
+1.017809e-03
+1.059296e-03
+1.102352e-03
+1.146984e-03
+1.193017e-03
+1.239991e-03
+1.287886e-03
+1.336705e-03
+1.386455e-03
+1.437139e-03
+1.488762e-03
+1.541327e-03
+1.594839e-03
+1.649302e-03
+1.704723e-03
+1.761103e-03
+1.818448e-03
+1.876764e-03
+1.936054e-03
+1.996323e-03
+2.057576e-03
+2.119817e-03
+2.183051e-03
+2.247284e-03
+2.312518e-03
+2.378761e-03
+2.446017e-03
+2.514290e-03
+2.583554e-03
+2.653620e-03
+2.724463e-03
+2.796087e-03
+2.868495e-03
+2.941692e-03
+3.015683e-03
+3.090471e-03
+3.166060e-03
+3.242455e-03
+3.319661e-03
+3.397680e-03
+3.476520e-03
+3.556183e-03
+3.636674e-03
+3.717996e-03
+3.800156e-03
+3.883157e-03
+3.967005e-03
+4.051703e-03
+4.137256e-03
+4.223670e-03
+4.310949e-03
+4.399097e-03
+4.488118e-03
+4.578020e-03
+4.668805e-03
+4.760478e-03
+4.853047e-03
+4.946513e-03
+5.040884e-03
+5.136163e-03
+5.232354e-03
+5.329466e-03
+5.427501e-03
+5.526465e-03
+5.626366e-03
+5.727203e-03
+5.828987e-03
+5.931720e-03
+6.035409e-03
+6.140057e-03
+6.245673e-03
+6.352261e-03
+6.459825e-03
+6.568373e-03
+6.677909e-03
+6.788439e-03
+6.899967e-03
+7.012501e-03
+7.126047e-03
+7.240515e-03
+7.355273e-03
+7.470200e-03
+7.585299e-03
+7.700571e-03
+7.816022e-03
+7.931652e-03
+8.047463e-03
+8.163461e-03
+8.279647e-03
+8.396022e-03
+8.512594e-03
+8.629359e-03
+8.746325e-03
+8.863491e-03
+8.980865e-03
+9.098443e-03
+9.216233e-03
+9.334238e-03
+9.452458e-03
+9.570897e-03
+9.689557e-03
+9.808443e-03
+9.927558e-03
+1.004690e-02
+1.016648e-02
+1.028630e-02
+1.040636e-02
+1.052665e-02
+1.064720e-02
+1.076799e-02
+1.088904e-02
+1.101034e-02
+1.113190e-02
+1.125372e-02
+1.137581e-02
+1.149816e-02
+1.162079e-02
+1.174369e-02
+1.186686e-02
+1.199032e-02
+1.211406e-02
+1.223809e-02
+1.236240e-02
+1.248701e-02
+1.261192e-02
+1.273713e-02
+1.286265e-02
+1.298846e-02
+
+# IMetals
+
+10 0.0039994
+4.786216e-11
+4.154135e-07
+1.645851e-06
+3.694411e-06
+6.564165e-06
+1.025811e-05
+1.477951e-05
+2.013129e-05
+2.631691e-05
+3.333919e-05
+4.120177e-05
+4.990736e-05
+5.945982e-05
+6.986200e-05
+8.111738e-05
+9.322946e-05
+1.062014e-04
+1.200367e-04
+1.347386e-04
+1.503109e-04
+1.667567e-04
+1.840800e-04
+2.022840e-04
+2.213725e-04
+2.413488e-04
+2.622169e-04
+2.839800e-04
+3.066424e-04
+3.302069e-04
+3.546607e-04
+3.799063e-04
+4.059323e-04
+4.327421e-04
+4.603385e-04
+4.887253e-04
+5.179062e-04
+5.478840e-04
+5.786626e-04
+6.102456e-04
+6.426359e-04
+6.758375e-04
+7.098543e-04
+7.446895e-04
+7.803468e-04
+8.168300e-04
+8.540822e-04
+8.920401e-04
+9.307074e-04
+9.700879e-04
+1.010185e-03
+1.051000e-03
+1.092539e-03
+1.134804e-03
+1.177798e-03
+1.221526e-03
+1.265991e-03
+1.311196e-03
+1.357144e-03
+1.403839e-03
+1.451285e-03
+1.499485e-03
+1.548444e-03
+1.598164e-03
+1.648651e-03
+1.699919e-03
+1.752530e-03
+1.806778e-03
+1.862673e-03
+1.920218e-03
+1.979423e-03
+2.040295e-03
+2.102840e-03
+2.167067e-03
+2.232981e-03
+2.300591e-03
+2.369905e-03
+2.440766e-03
+2.512760e-03
+2.585876e-03
+2.660115e-03
+2.735485e-03
+2.811992e-03
+2.889640e-03
+2.968434e-03
+3.048381e-03
+3.129487e-03
+3.211758e-03
+3.295196e-03
+3.379812e-03
+3.465609e-03
+3.552591e-03
+3.640769e-03
+3.730144e-03
+3.820727e-03
+3.912520e-03
+4.005532e-03
+4.099765e-03
+4.195230e-03
+4.291930e-03
+4.389873e-03
+4.489000e-03
+4.588946e-03
+4.689650e-03
+4.791121e-03
+4.893361e-03
+4.996375e-03
+5.100167e-03
+5.204745e-03
+5.310110e-03
+5.416268e-03
+5.523225e-03
+5.630983e-03
+5.739550e-03
+5.848930e-03
+5.959127e-03
+6.070146e-03
+6.181994e-03
+6.294674e-03
+6.408192e-03
+6.522553e-03
+6.637761e-03
+6.753824e-03
+6.870743e-03
+6.988528e-03
+7.107181e-03
+7.226708e-03
+7.347116e-03
+7.468408e-03
+7.590591e-03
+7.713669e-03
+7.837650e-03
+7.962538e-03
+8.088336e-03
+8.215055e-03
+8.342696e-03
+8.471267e-03
+8.600775e-03
+8.731221e-03
+8.862616e-03
+8.994964e-03
+9.128270e-03
+9.262539e-03
+9.397780e-03
+9.533998e-03
+9.671196e-03
+9.809382e-03
+9.948567e-03
+1.008875e-02
+1.022994e-02
+1.037214e-02
+1.051536e-02
+1.065952e-02
+1.080399e-02
+1.094865e-02
+1.109350e-02
+1.123855e-02
+1.138381e-02
+1.152927e-02
+1.167494e-02
+1.182082e-02
+1.196691e-02
+1.211323e-02
+1.225977e-02
+1.240653e-02
+1.255352e-02
+1.270074e-02
+1.284820e-02
+1.299591e-02
+1.314385e-02
+1.329204e-02
+1.344048e-02
+1.358917e-02
+1.373812e-02
+1.388733e-02
+1.403681e-02
+1.418655e-02
+1.433657e-02
+1.448686e-02
+1.463743e-02
+1.478829e-02
+1.493943e-02
+1.509086e-02
+1.524258e-02
+1.539461e-02
+1.554693e-02
+1.569956e-02
+1.585250e-02
+1.600576e-02
+1.615933e-02
+1.631322e-02
+1.646744e-02
+1.662198e-02
+1.677686e-02
+1.693208e-02
+1.708763e-02
+1.724354e-02
+1.739979e-02
+1.755639e-02
+1.771336e-02
+1.787068e-02
+
+# Mean WD Mass
+
+1.380000
+
+# SNIa Metal Ejection
+
+# Number of elements
+4
+
+# Ej
+0.0
+
+# Ejnp
+0.0
+
+# Fe
+6.130000e-01
+
+# Mg
+8.500000e-03
+
+# O
+1.430000e-01
+
+# Metals
+1.374300e+00
+
+
+# Element Solar Abundances
+
+# Number of elements
+4
+
+# Fe
+0.00176604
+
+# Mg
+0.000924316
+
+# O
+0.0108169
+
+# Metals
+0.02
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.francois-002.py b/PyChem/shared/chemistryparameters/chimieparam.francois-002.py
new file mode 100644
index 0000000..b27de3f
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.francois-002.py
@@ -0,0 +1,115 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 0.05
+Mmax = 50.
+
+# salpeter
+#m_s = []
+#a_s = [-1.35]
+
+# salpeter
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# krupa 01, revisited
+m_s = [ 0.08, 0.5, 1.0]
+a_s = [0.7, -0.8, -1.7, -1.3]
+
+# krupa 01
+#m_s = [ 0.01, 0.08, 0.5, 1.0]
+#a_s = [0.7, 0.7, -0.3, -1.3, -1.3]
+
+# krupa 93
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [-0.3, -0.3, -1.2, -1.7]
+
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/Francois/yieldsSNII.txt','tables/Francois/yields_tsujimoto95bis.txt'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/Francois/HeliumCore.dat'
+SNIaFile = 'tables/Francois/yields_SNIa_francois.txt' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Si","Metals"]
+nelts = 69
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.francois.py b/PyChem/shared/chemistryparameters/chimieparam.francois.py
new file mode 100644
index 0000000..e073c34
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.francois.py
@@ -0,0 +1,115 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 0.05
+Mmax = 50.
+
+# salpeter
+#m_s = []
+#a_s = [-1.35]
+
+# salpeter
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# krupa 01, revisited
+m_s = [ 0.08, 0.5, 1.0]
+a_s = [0.7, -0.8, -1.7, -1.3]
+
+# krupa 01
+#m_s = [ 0.01, 0.08, 0.5, 1.0]
+#a_s = [0.7, 0.7, -0.3, -1.3, -1.3]
+
+# krupa 93
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [-0.3, -0.3, -1.2, -1.7]
+
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/Francois/yieldsSNII.txt','tables/Francois/yields_tsujimoto95bis.txt'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/Francois/HeliumCore.dat'
+SNIaFile = 'tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Si","Metals"]
+nelts = 69
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.salpeter.py b/PyChem/shared/chemistryparameters/chimieparam.salpeter.py
new file mode 100644
index 0000000..55d9d20
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.salpeter.py
@@ -0,0 +1,102 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 0.05
+Mmax = 50.
+
+m_s = [0.08, 0.5, 1.0]
+a_s = [-1.35, -1.35, -1.35, -1.35]
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [0.7, -0.8, -1.7, -1.3]
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/MetalSNII/yields_tsujimoto95bis.txt','tables/MetalSNII/cescutti2006bis.txt'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/HeliumCore.dat'
+SNIaFile = 'tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Ba","Metals"]
+#elts = ["Fe56","Mg24","O16","Ba","Metals"]
+nelts = 69
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.simple.py b/PyChem/shared/chemistryparameters/chimieparam.simple.py
new file mode 100644
index 0000000..656c3ec
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.simple.py
@@ -0,0 +1,115 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 0.05
+Mmax = 50.
+
+# salpeter
+#m_s = []
+#a_s = [-1.35]
+
+# salpeter
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# krupa 01, revisited
+m_s = [ 0.08, 0.5, 1.0]
+a_s = [0.7, -0.8, -1.7, -1.3]
+
+# krupa 01
+#m_s = [ 0.01, 0.08, 0.5, 1.0]
+#a_s = [0.7, 0.7, -0.3, -1.3, -1.3]
+
+# krupa 93
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [-0.3, -0.3, -1.2, -1.7]
+
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/MetalEjection.dat'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/HeliumCore.dat'
+SNIaFile = 'tables/SNIa/SNIaEjection.dat' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Metals"]
+nelts = 4
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.woosley.py b/PyChem/shared/chemistryparameters/chimieparam.woosley.py
new file mode 100644
index 0000000..548c22b
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.woosley.py
@@ -0,0 +1,115 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 0.05
+Mmax = 50.
+
+# salpeter
+#m_s = []
+#a_s = [-1.35]
+
+# salpeter
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# krupa 01, revisited
+m_s = [ 0.08, 0.5, 1.0]
+a_s = [0.7, -0.8, -1.7, -1.3]
+
+# krupa 01
+#m_s = [ 0.01, 0.08, 0.5, 1.0]
+#a_s = [0.7, 0.7, -0.3, -1.3, -1.3]
+
+# krupa 93
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [-0.3, -0.3, -1.2, -1.7]
+
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/Woosley/yieldsSNII.txt'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/Woosley/HeliumCore.dat'
+SNIaFile = 'tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Si","Metals"]
+nelts = 69
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.yr.2.py b/PyChem/shared/chemistryparameters/chimieparam.yr.2.py
new file mode 100644
index 0000000..952b2b8
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.yr.2.py
@@ -0,0 +1,116 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 0.05
+Mmax = 50.
+
+# salpeter
+#m_s = []
+#a_s = [-1.35]
+
+# salpeter
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# krupa 01, revisited
+m_s = [ 0.08, 0.5, 1.0]
+a_s = [0.7, -0.8, -1.7, -1.3]
+
+# krupa 01
+#m_s = [ 0.01, 0.08, 0.5, 1.0]
+#a_s = [0.7, 0.7, -0.3, -1.3, -1.3]
+
+# krupa 93
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [-0.3, -0.3, -1.2, -1.7]
+
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/MetalSNII/yields_tsujimoto95bis.txt','tables/MetalSNII/cescutti2006bis.txt'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/HeliumCore.dat'
+SNIaFile = 'tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Ba","Metals"]
+#elts = ["Fe56","Mg24","O16","Ba","Metals"]
+nelts = 69
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.yr.4.py b/PyChem/shared/chemistryparameters/chimieparam.yr.4.py
new file mode 100644
index 0000000..03d4af3
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.yr.4.py
@@ -0,0 +1,116 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 0.05
+Mmax = 50.
+
+# salpeter
+#m_s = []
+#a_s = [-1.35]
+
+# salpeter
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# krupa 01, revisited
+m_s = [ 0.08, 0.5, 1.0]
+a_s = [0.7, -0.8, -1.7, -1.3]
+
+# krupa 01
+#m_s = [ 0.01, 0.08, 0.5, 1.0]
+#a_s = [0.7, 0.7, -0.3, -1.3, -1.3]
+
+# krupa 93
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [-0.3, -0.3, -1.2, -1.7]
+
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/MetalSNII/yields_tsujimoto95bis.txt','tables/MetalSNII/cescutti2006bis.txt'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/HeliumCore.dat'
+SNIaFile = 'tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Metals"]
+#elts = ["Fe56","Mg24","O16","Ba","Metals"]
+nelts = 69
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.yr.py b/PyChem/shared/chemistryparameters/chimieparam.yr.py
new file mode 100644
index 0000000..87c0711
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.yr.py
@@ -0,0 +1,116 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 0.05
+Mmax = 50.
+
+# salpeter
+#m_s = []
+#a_s = [-1.35]
+
+# salpeter
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# krupa 01, revisited
+m_s = [ 0.08, 0.5, 1.0]
+a_s = [0.7, -0.8, -1.7, -1.3]
+
+# krupa 01
+#m_s = [ 0.01, 0.08, 0.5, 1.0]
+#a_s = [0.7, 0.7, -0.3, -1.3, -1.3]
+
+# krupa 93
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [-0.3, -0.3, -1.2, -1.7]
+
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/MetalSNII/yields_tsujimoto95bis.txt','tables/MetalSNII/cescutti2006bis.txt'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/HeliumCore.dat'
+SNIaFile = 'tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Si","Ca","Metals"]
+#elts = ["Fe56","Mg24","O16","Ba","Metals"]
+nelts = 69
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chemistryparameters/chimieparam.yr.py.1 b/PyChem/shared/chemistryparameters/chimieparam.yr.py.1
new file mode 100644
index 0000000..08560df
--- /dev/null
+++ b/PyChem/shared/chemistryparameters/chimieparam.yr.py.1
@@ -0,0 +1,125 @@
+
+
+###########################
+# IMF
+###########################
+
+Mmin = 49
+Mmax = 50.
+
+# POP3
+m_s = []
+a_s = [-1.3]
+
+
+
+# salpeter
+#m_s = []
+#a_s = [-1.35]
+
+# salpeter
+#m_s = [0.08, 0.5, 1.0]
+#a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# krupa 01, revisited
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [0.7, -0.8, -1.7, -1.3]
+
+# krupa 01
+#m_s = [ 0.01, 0.08, 0.5, 1.0]
+#a_s = [0.7, 0.7, -0.3, -1.3, -1.3]
+
+# krupa 93
+#m_s = [ 0.08, 0.5, 1.0]
+#a_s = [-0.3, -0.3, -1.2, -1.7]
+
+
+
+
+
+###########################
+# SNII
+###########################
+
+SNII_Mmin = 8.
+
+###########################
+# SNIa
+###########################
+
+SNIa_Mpl = 3.0
+SNIa_Mpu = 8.0
+
+SNIa_a = -0.35
+SNIa_Mdl1 = 0.9
+SNIa_Mdu1 = 1.5
+SNIa_bb1 = 0.02
+
+SNIa_Mdl2 = 1.8
+SNIa_Mdu2 = 2.6
+SNIa_bb2 = 0.05
+
+
+###########################
+# Metal Injection
+###########################
+
+# files
+MetalFile = ['tables/MetalSNII/yields_tsujimoto95bis.txt','tables/MetalSNII/cescutti2006bis.txt'] #'MetalEjection.dat'
+HeliumCoreFile = 'tables/HeliumCore.dat'
+SNIaFile = 'tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt' #'SNIaEjection.dat'
+SolarAbundancesFile = "tables/SolarAbundances/Grevesse98.txt"
+
+# Mean Whith Dwarfs Mass
+MeanWDMass = 1.38
+
+# number of elements to follow
+elts = ["Fe","Mg","O","Ba","Metals"]
+#elts = ["Fe56","Mg24","O16","Ba","Metals"]
+nelts = 69
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/chimie.salpeter.dat b/PyChem/shared/chimie.salpeter.dat
new file mode 100644
index 0000000..31687f5
--- /dev/null
+++ b/PyChem/shared/chimie.salpeter.dat
@@ -0,0 +1,2941 @@
+#### Livetime ####
+
+-40.1107251082866 5.50992173040633 0.782431795366473
+ 141.929566656232 -15.88948185575660 -3.255779246324010
+-261.365531429482 17.07350618651300 9.866058678313810
+
+#### IMF Parameters ####
+
+0.05 50
+3
+0.08 0.5 1
+-1.35 -1.35 -1.35 -1.35
+
+#### SNII Parameters ####
+
+8
+
+#### SNIa Parameters ####
+
+3 8
+-0.35
+0.9 1.5 0.02
+1.8 2.6 0.05
+
+#### Metal Parameters ####
+
+# Number of points / Number of elements
+200 5
+
+# Ej
+
+0.05 0.0155624
+4.843730e-02
+4.935623e-02
+5.030868e-02
+5.129588e-02
+5.231913e-02
+5.337968e-02
+5.447892e-02
+5.561825e-02
+5.679915e-02
+5.802314e-02
+5.929179e-02
+6.060675e-02
+6.196962e-02
+6.338228e-02
+6.484646e-02
+6.636404e-02
+6.793699e-02
+6.956732e-02
+7.125717e-02
+7.300862e-02
+7.482401e-02
+7.670562e-02
+7.865587e-02
+8.067726e-02
+8.277240e-02
+8.494399e-02
+8.719482e-02
+8.952773e-02
+9.194581e-02
+9.445206e-02
+9.704976e-02
+9.974223e-02
+1.025330e-01
+1.054255e-01
+1.084235e-01
+1.115309e-01
+1.147517e-01
+1.180900e-01
+1.215501e-01
+1.251365e-01
+1.288536e-01
+1.327064e-01
+1.366998e-01
+1.408388e-01
+1.451289e-01
+1.495755e-01
+1.541843e-01
+1.589612e-01
+1.639124e-01
+1.690443e-01
+1.743633e-01
+1.798765e-01
+1.855907e-01
+1.915134e-01
+1.976523e-01
+2.040152e-01
+2.106101e-01
+2.174456e-01
+2.245306e-01
+2.318740e-01
+2.394853e-01
+2.473743e-01
+2.555511e-01
+2.640263e-01
+2.728106e-01
+2.819155e-01
+2.913525e-01
+3.011338e-01
+3.112719e-01
+3.217799e-01
+3.326714e-01
+3.439602e-01
+3.556607e-01
+3.677883e-01
+3.803582e-01
+3.933867e-01
+4.068906e-01
+4.208871e-01
+4.353943e-01
+4.504307e-01
+4.660157e-01
+4.821694e-01
+4.989123e-01
+5.162661e-01
+5.314058e-01
+5.427305e-01
+5.544683e-01
+5.666343e-01
+5.792443e-01
+5.923142e-01
+6.058611e-01
+6.199021e-01
+6.344554e-01
+6.495397e-01
+6.651744e-01
+6.807522e-01
+6.899109e-01
+6.994038e-01
+7.092429e-01
+7.194411e-01
+7.368875e-01
+7.569233e-01
+7.776899e-01
+7.980127e-01
+7.982467e-01
+7.984892e-01
+7.987405e-01
+7.990010e-01
+7.992710e-01
+7.995510e-01
+8.042794e-01
+8.101172e-01
+8.161680e-01
+8.224396e-01
+8.289399e-01
+8.342458e-01
+8.392339e-01
+8.444039e-01
+8.497626e-01
+8.539259e-01
+8.564276e-01
+8.590205e-01
+8.617080e-01
+8.601962e-01
+8.568598e-01
+8.548928e-01
+8.535241e-01
+8.496331e-01
+8.360225e-01
+8.264965e-01
+8.275483e-01
+8.286386e-01
+8.297685e-01
+8.309396e-01
+8.328840e-01
+8.360294e-01
+8.392897e-01
+8.426689e-01
+8.461714e-01
+8.498016e-01
+8.535643e-01
+8.574644e-01
+8.613294e-01
+8.650263e-01
+8.688580e-01
+8.728295e-01
+8.769459e-01
+8.812124e-01
+8.849934e-01
+8.849465e-01
+8.848978e-01
+8.848472e-01
+8.847950e-01
+8.847407e-01
+8.846844e-01
+8.846261e-01
+8.875960e-01
+8.913530e-01
+8.952472e-01
+8.992833e-01
+9.025038e-01
+9.056354e-01
+9.088813e-01
+9.122456e-01
+9.157327e-01
+9.174708e-01
+9.185946e-01
+9.197595e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.207747e-01
+9.221712e-01
+9.236184e-01
+9.251186e-01
+9.266735e-01
+9.282851e-01
+9.299554e-01
+9.316868e-01
+9.334813e-01
+9.353413e-01
+9.372691e-01
+9.392673e-01
+9.413384e-01
+9.429768e-01
+9.440540e-01
+9.451705e-01
+9.463276e-01
+9.475270e-01
+9.487702e-01
+9.500588e-01
+9.513942e-01
+9.527785e-01
+9.542133e-01
+9.557003e-01
+9.572417e-01
+9.588393e-01
+
+# Ejnp
+
+0.05 0.0155624
+4.843730e-02
+4.935623e-02
+5.030868e-02
+5.129588e-02
+5.231913e-02
+5.337968e-02
+5.447892e-02
+5.561825e-02
+5.679915e-02
+5.802314e-02
+5.929179e-02
+6.060675e-02
+6.196962e-02
+6.338228e-02
+6.484646e-02
+6.636404e-02
+6.793699e-02
+6.956732e-02
+7.125717e-02
+7.300862e-02
+7.482401e-02
+7.670562e-02
+7.865587e-02
+8.067726e-02
+8.277240e-02
+8.494399e-02
+8.719482e-02
+8.952773e-02
+9.194581e-02
+9.445206e-02
+9.704976e-02
+9.974223e-02
+1.025330e-01
+1.054255e-01
+1.084235e-01
+1.115309e-01
+1.147517e-01
+1.180900e-01
+1.215501e-01
+1.251365e-01
+1.288536e-01
+1.327064e-01
+1.366998e-01
+1.408388e-01
+1.451289e-01
+1.495755e-01
+1.541843e-01
+1.589612e-01
+1.639124e-01
+1.690443e-01
+1.743633e-01
+1.798765e-01
+1.855907e-01
+1.915134e-01
+1.976523e-01
+2.040152e-01
+2.106101e-01
+2.174456e-01
+2.245306e-01
+2.318740e-01
+2.394853e-01
+2.473743e-01
+2.555511e-01
+2.640263e-01
+2.728106e-01
+2.819155e-01
+2.913525e-01
+3.011338e-01
+3.112719e-01
+3.217799e-01
+3.326714e-01
+3.439602e-01
+3.556607e-01
+3.677883e-01
+3.803582e-01
+3.933867e-01
+4.068906e-01
+4.208871e-01
+4.353943e-01
+4.504307e-01
+4.660157e-01
+4.821694e-01
+4.989123e-01
+5.162661e-01
+5.314058e-01
+5.427305e-01
+5.544683e-01
+5.666343e-01
+5.792443e-01
+5.923142e-01
+6.058611e-01
+6.199021e-01
+6.344554e-01
+6.495397e-01
+6.651744e-01
+6.807522e-01
+6.899109e-01
+6.994038e-01
+7.092429e-01
+7.194411e-01
+7.368875e-01
+7.569233e-01
+7.776899e-01
+7.980127e-01
+7.982467e-01
+7.984892e-01
+7.987405e-01
+7.990010e-01
+7.992710e-01
+7.995510e-01
+8.042794e-01
+8.101172e-01
+8.161680e-01
+8.224396e-01
+8.289399e-01
+8.342458e-01
+8.392339e-01
+8.444039e-01
+8.497626e-01
+8.539259e-01
+8.564276e-01
+8.590205e-01
+8.617080e-01
+8.601962e-01
+8.568598e-01
+8.548928e-01
+8.535241e-01
+8.496331e-01
+8.360225e-01
+8.264965e-01
+8.275483e-01
+8.286386e-01
+8.297685e-01
+8.309396e-01
+8.328840e-01
+8.360294e-01
+8.392897e-01
+8.426689e-01
+8.461714e-01
+8.498016e-01
+8.535643e-01
+8.574644e-01
+8.613294e-01
+8.650263e-01
+8.688580e-01
+8.728295e-01
+8.769459e-01
+8.812124e-01
+8.826500e-01
+8.656790e-01
+8.480889e-01
+8.298569e-01
+8.109598e-01
+7.913733e-01
+7.710722e-01
+7.500303e-01
+7.436701e-01
+7.405392e-01
+7.372940e-01
+7.339306e-01
+7.316641e-01
+7.295763e-01
+7.274125e-01
+7.251695e-01
+7.228449e-01
+7.168616e-01
+7.093693e-01
+7.016037e-01
+6.976798e-01
+6.946764e-01
+6.915635e-01
+6.883371e-01
+6.849929e-01
+6.815267e-01
+6.772454e-01
+6.722804e-01
+6.671343e-01
+6.618005e-01
+6.562721e-01
+6.505419e-01
+6.446027e-01
+6.384468e-01
+6.320664e-01
+6.254531e-01
+6.185986e-01
+6.114941e-01
+6.041303e-01
+5.987492e-01
+5.959238e-01
+5.929955e-01
+5.899602e-01
+5.868143e-01
+5.835535e-01
+5.801739e-01
+5.766708e-01
+5.730400e-01
+5.692767e-01
+5.653761e-01
+5.613332e-01
+5.571429e-01
+
+# Fe
+
+10 0.0039994
+0.000000e+00
+3.723316e-04
+7.481165e-04
+1.127377e-03
+1.510143e-03
+1.896445e-03
+2.286330e-03
+2.679817e-03
+3.076952e-03
+3.477752e-03
+3.882263e-03
+4.290514e-03
+4.702549e-03
+5.118392e-03
+5.538080e-03
+5.961653e-03
+6.389137e-03
+6.820589e-03
+7.256027e-03
+7.695485e-03
+8.139022e-03
+8.586653e-03
+9.038430e-03
+9.494383e-03
+9.954557e-03
+1.041899e-02
+1.088772e-02
+1.136078e-02
+1.183822e-02
+1.201732e-02
+1.190568e-02
+1.179300e-02
+1.167928e-02
+1.156451e-02
+1.144868e-02
+1.133178e-02
+1.121379e-02
+1.109472e-02
+1.097454e-02
+1.085325e-02
+1.073084e-02
+1.060729e-02
+1.048261e-02
+1.035677e-02
+1.022976e-02
+9.976223e-03
+9.716522e-03
+9.454418e-03
+9.189887e-03
+8.922912e-03
+8.653464e-03
+8.381523e-03
+8.107068e-03
+7.830072e-03
+7.550513e-03
+7.268367e-03
+6.983614e-03
+6.696224e-03
+6.406181e-03
+6.113447e-03
+5.818013e-03
+5.519841e-03
+5.218904e-03
+4.915189e-03
+4.651350e-03
+4.591124e-03
+4.530341e-03
+4.468996e-03
+4.407083e-03
+4.344599e-03
+4.281535e-03
+4.217888e-03
+4.153652e-03
+4.088821e-03
+4.023393e-03
+3.957357e-03
+3.896135e-03
+3.836351e-03
+3.776013e-03
+3.715118e-03
+3.653659e-03
+3.591630e-03
+3.529028e-03
+3.465848e-03
+3.402082e-03
+3.337726e-03
+3.272776e-03
+3.207224e-03
+3.141066e-03
+3.074296e-03
+3.006908e-03
+2.938897e-03
+2.870257e-03
+2.800980e-03
+2.731066e-03
+2.660501e-03
+2.589286e-03
+2.517410e-03
+2.444871e-03
+2.371659e-03
+2.333467e-03
+2.330783e-03
+2.328073e-03
+2.325339e-03
+2.322579e-03
+2.319794e-03
+2.316983e-03
+2.314146e-03
+2.311283e-03
+2.308393e-03
+2.305477e-03
+2.302533e-03
+2.299563e-03
+2.296565e-03
+2.293539e-03
+2.290485e-03
+2.287403e-03
+2.284292e-03
+2.281153e-03
+2.277985e-03
+2.274787e-03
+2.271559e-03
+2.268302e-03
+2.265015e-03
+2.261697e-03
+2.258349e-03
+2.254969e-03
+2.251558e-03
+2.248116e-03
+2.244642e-03
+2.241136e-03
+2.237597e-03
+2.234026e-03
+2.230421e-03
+2.226783e-03
+2.223112e-03
+2.219406e-03
+2.215667e-03
+2.211893e-03
+2.208083e-03
+2.204239e-03
+2.200359e-03
+2.196443e-03
+2.192491e-03
+2.188502e-03
+2.184476e-03
+2.180413e-03
+2.176313e-03
+2.172175e-03
+2.167998e-03
+2.163783e-03
+2.156083e-03
+2.144285e-03
+2.132378e-03
+2.120361e-03
+2.108233e-03
+2.095992e-03
+2.083639e-03
+2.071171e-03
+2.058588e-03
+2.045888e-03
+2.033071e-03
+2.020135e-03
+2.007079e-03
+1.993903e-03
+1.980605e-03
+1.967184e-03
+1.953639e-03
+1.939968e-03
+1.926170e-03
+1.912246e-03
+1.898192e-03
+1.884009e-03
+1.869694e-03
+1.855246e-03
+1.840665e-03
+1.825950e-03
+1.811098e-03
+1.796109e-03
+1.780980e-03
+1.765713e-03
+1.750303e-03
+1.734751e-03
+1.719056e-03
+1.703215e-03
+1.687227e-03
+1.671092e-03
+1.654807e-03
+1.638372e-03
+1.621785e-03
+1.605044e-03
+1.588148e-03
+1.571096e-03
+1.553887e-03
+1.536518e-03
+1.518988e-03
+1.501296e-03
+1.483441e-03
+1.465420e-03
+1.447232e-03
+
+# Mg
+
+10 0.0039994
+0.000000e+00
+2.729427e-05
+5.484093e-05
+8.264254e-05
+1.107017e-04
+1.390197e-04
+1.676001e-04
+1.964450e-04
+2.255568e-04
+2.549377e-04
+2.845905e-04
+3.145176e-04
+3.447214e-04
+3.752052e-04
+4.059703e-04
+4.370208e-04
+4.683577e-04
+4.999852e-04
+5.319051e-04
+5.641200e-04
+5.966332e-04
+6.294474e-04
+6.625648e-04
+6.959888e-04
+7.297220e-04
+7.637676e-04
+7.981276e-04
+8.328056e-04
+8.678043e-04
+9.317882e-04
+1.024040e-03
+1.117147e-03
+1.211116e-03
+1.305954e-03
+1.401668e-03
+1.498269e-03
+1.595763e-03
+1.694159e-03
+1.793465e-03
+1.893690e-03
+1.994842e-03
+2.096931e-03
+2.199961e-03
+2.303947e-03
+2.408895e-03
+2.427621e-03
+2.443863e-03
+2.460256e-03
+2.476800e-03
+2.493497e-03
+2.510348e-03
+2.527356e-03
+2.544520e-03
+2.561844e-03
+2.579328e-03
+2.596974e-03
+2.614783e-03
+2.632756e-03
+2.650896e-03
+2.669204e-03
+2.687681e-03
+2.706329e-03
+2.725150e-03
+2.744144e-03
+2.851233e-03
+3.383711e-03
+3.921118e-03
+4.463498e-03
+5.010888e-03
+5.563356e-03
+6.120924e-03
+6.683651e-03
+7.251590e-03
+7.824786e-03
+8.403283e-03
+8.987114e-03
+9.146377e-03
+9.148277e-03
+9.150195e-03
+9.152131e-03
+9.154084e-03
+9.156055e-03
+9.158044e-03
+9.160053e-03
+9.162080e-03
+9.164126e-03
+9.166189e-03
+9.168272e-03
+9.170374e-03
+9.172498e-03
+9.174638e-03
+9.176800e-03
+9.178982e-03
+9.181184e-03
+9.183406e-03
+9.185649e-03
+9.187912e-03
+9.190196e-03
+9.192501e-03
+9.194829e-03
+9.223163e-03
+9.277867e-03
+9.333077e-03
+9.388799e-03
+9.445035e-03
+9.501792e-03
+9.559073e-03
+9.616885e-03
+9.675231e-03
+9.734117e-03
+9.793549e-03
+9.853529e-03
+9.914066e-03
+9.975161e-03
+1.003682e-02
+1.009905e-02
+1.016186e-02
+1.022525e-02
+1.028922e-02
+1.035379e-02
+1.041896e-02
+1.048472e-02
+1.055110e-02
+1.061809e-02
+1.068570e-02
+1.075393e-02
+1.082280e-02
+1.089230e-02
+1.096245e-02
+1.103324e-02
+1.110469e-02
+1.117680e-02
+1.124958e-02
+1.132303e-02
+1.139716e-02
+1.147198e-02
+1.154749e-02
+1.162369e-02
+1.170061e-02
+1.177823e-02
+1.185657e-02
+1.193564e-02
+1.201544e-02
+1.209598e-02
+1.217726e-02
+1.225929e-02
+1.234208e-02
+1.242564e-02
+1.250997e-02
+1.259509e-02
+1.268099e-02
+1.275091e-02
+1.280189e-02
+1.285334e-02
+1.290527e-02
+1.295768e-02
+1.301058e-02
+1.306396e-02
+1.311783e-02
+1.317221e-02
+1.322709e-02
+1.328248e-02
+1.333837e-02
+1.339479e-02
+1.345173e-02
+1.350919e-02
+1.356719e-02
+1.362572e-02
+1.368479e-02
+1.374442e-02
+1.380459e-02
+1.386532e-02
+1.392661e-02
+1.398846e-02
+1.405089e-02
+1.411390e-02
+1.417749e-02
+1.424167e-02
+1.430644e-02
+1.437181e-02
+1.443779e-02
+1.450438e-02
+1.457158e-02
+1.463941e-02
+1.470786e-02
+1.477695e-02
+1.484667e-02
+1.491704e-02
+1.498806e-02
+1.505974e-02
+1.513208e-02
+1.520509e-02
+1.527877e-02
+1.535314e-02
+1.542820e-02
+1.550395e-02
+1.558040e-02
+1.565756e-02
+1.573543e-02
+1.581402e-02
+
+# O
+
+10 0.0039994
+0.000000e+00
+3.581978e-04
+7.197112e-04
+1.084566e-03
+1.452804e-03
+1.824435e-03
+2.199516e-03
+2.578061e-03
+2.960116e-03
+3.345698e-03
+3.734849e-03
+4.127599e-03
+4.523989e-03
+4.924040e-03
+5.327791e-03
+5.735282e-03
+6.146539e-03
+6.561607e-03
+6.980509e-03
+7.403284e-03
+7.829975e-03
+8.260611e-03
+8.695234e-03
+9.133875e-03
+9.576574e-03
+1.002337e-02
+1.047430e-02
+1.092941e-02
+1.138872e-02
+1.201160e-02
+1.279408e-02
+1.358380e-02
+1.438084e-02
+1.518524e-02
+1.599708e-02
+1.681644e-02
+1.764338e-02
+1.847796e-02
+1.932028e-02
+2.017038e-02
+2.102835e-02
+2.189425e-02
+2.276816e-02
+2.365016e-02
+2.454032e-02
+2.546063e-02
+2.639012e-02
+2.732821e-02
+2.827498e-02
+2.923050e-02
+3.019486e-02
+3.116815e-02
+3.215043e-02
+3.314182e-02
+3.414236e-02
+3.515217e-02
+3.617133e-02
+3.719991e-02
+3.823800e-02
+3.928570e-02
+4.034308e-02
+4.141025e-02
+4.248730e-02
+4.357432e-02
+4.490967e-02
+4.740754e-02
+4.992853e-02
+5.247284e-02
+5.504072e-02
+5.763231e-02
+6.024793e-02
+6.288771e-02
+6.555194e-02
+6.824079e-02
+7.095453e-02
+7.369339e-02
+7.566179e-02
+7.735445e-02
+7.906280e-02
+8.078691e-02
+8.252700e-02
+8.428320e-02
+8.605565e-02
+8.784446e-02
+8.964983e-02
+9.147193e-02
+9.331087e-02
+9.516682e-02
+9.703992e-02
+9.893038e-02
+1.008383e-01
+1.027639e-01
+1.047073e-01
+1.066687e-01
+1.086482e-01
+1.106461e-01
+1.126624e-01
+1.146974e-01
+1.167512e-01
+1.188240e-01
+1.206974e-01
+1.223686e-01
+1.240551e-01
+1.257574e-01
+1.274753e-01
+1.292091e-01
+1.309590e-01
+1.327251e-01
+1.345075e-01
+1.363064e-01
+1.381219e-01
+1.399542e-01
+1.418035e-01
+1.436699e-01
+1.455536e-01
+1.474547e-01
+1.493733e-01
+1.513098e-01
+1.532641e-01
+1.552365e-01
+1.572272e-01
+1.592363e-01
+1.612640e-01
+1.633104e-01
+1.653758e-01
+1.674602e-01
+1.695640e-01
+1.716872e-01
+1.738301e-01
+1.759928e-01
+1.781755e-01
+1.803783e-01
+1.826016e-01
+1.848455e-01
+1.871101e-01
+1.893956e-01
+1.917023e-01
+1.940303e-01
+1.963799e-01
+1.987512e-01
+2.011445e-01
+2.035598e-01
+2.059976e-01
+2.084579e-01
+2.109409e-01
+2.134469e-01
+2.159761e-01
+2.185287e-01
+2.211050e-01
+2.237050e-01
+2.263291e-01
+2.281939e-01
+2.291604e-01
+2.301358e-01
+2.311203e-01
+2.321138e-01
+2.331166e-01
+2.341286e-01
+2.351500e-01
+2.361808e-01
+2.372212e-01
+2.382712e-01
+2.393309e-01
+2.404005e-01
+2.414799e-01
+2.425693e-01
+2.436688e-01
+2.447784e-01
+2.458983e-01
+2.470286e-01
+2.481694e-01
+2.493207e-01
+2.504826e-01
+2.516553e-01
+2.528389e-01
+2.540333e-01
+2.552389e-01
+2.564555e-01
+2.576835e-01
+2.589228e-01
+2.601736e-01
+2.614359e-01
+2.627100e-01
+2.639958e-01
+2.652935e-01
+2.666032e-01
+2.679251e-01
+2.692591e-01
+2.706055e-01
+2.719644e-01
+2.733358e-01
+2.747199e-01
+2.761168e-01
+2.775267e-01
+2.789496e-01
+2.803856e-01
+2.818350e-01
+2.832977e-01
+2.847740e-01
+2.862639e-01
+
+# Ba
+
+10 0.0039994
+0.000000e+00
+1.097078e-08
+2.204297e-08
+3.321747e-08
+4.449566e-08
+5.587788e-08
+6.736559e-08
+7.895960e-08
+9.066082e-08
+1.024703e-07
+1.143891e-07
+1.264181e-07
+1.385582e-07
+1.508109e-07
+1.631769e-07
+1.756572e-07
+1.882529e-07
+2.009654e-07
+2.137953e-07
+2.267439e-07
+2.354499e-07
+2.268915e-07
+2.182539e-07
+2.095364e-07
+2.007382e-07
+1.918587e-07
+1.828970e-07
+1.738524e-07
+1.647242e-07
+1.555114e-07
+1.462134e-07
+1.368295e-07
+1.273587e-07
+1.178003e-07
+1.081535e-07
+9.841733e-08
+8.859115e-08
+7.867402e-08
+6.866526e-08
+5.856373e-08
+4.836897e-08
+3.807986e-08
+2.769548e-08
+1.721503e-08
+6.637606e-09
+6.268832e-09
+6.210778e-09
+6.152187e-09
+6.093053e-09
+6.033373e-09
+5.973141e-09
+5.912351e-09
+5.850999e-09
+5.789079e-09
+5.726587e-09
+5.663516e-09
+5.599862e-09
+5.535619e-09
+5.470782e-09
+5.405346e-09
+5.339303e-09
+5.272649e-09
+5.205378e-09
+5.137486e-09
+5.068965e-09
+4.999811e-09
+4.930016e-09
+4.859577e-09
+4.788485e-09
+4.716735e-09
+4.644322e-09
+4.571239e-09
+4.497480e-09
+4.423038e-09
+4.347908e-09
+4.272082e-09
+4.195556e-09
+4.118321e-09
+4.040371e-09
+3.961701e-09
+3.882302e-09
+3.802169e-09
+3.721294e-09
+3.639673e-09
+3.557296e-09
+3.474155e-09
+3.390246e-09
+3.305561e-09
+3.220093e-09
+3.133834e-09
+3.046775e-09
+2.958912e-09
+2.870237e-09
+2.780741e-09
+2.690417e-09
+2.599257e-09
+2.507254e-09
+2.414400e-09
+2.320687e-09
+2.226107e-09
+2.130652e-09
+2.034313e-09
+1.937084e-09
+1.838955e-09
+1.739918e-09
+1.639965e-09
+1.539087e-09
+1.437275e-09
+1.334523e-09
+1.230818e-09
+1.126155e-09
+1.020525e-09
+9.139161e-10
+8.063212e-10
+6.977308e-10
+5.881349e-10
+4.775265e-10
+3.658940e-10
+2.532285e-10
+1.395213e-10
+2.476330e-11
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+
+# Metals
+
+10 0.0039994
+0.000000e+00
+1.070708e-03
+2.151318e-03
+3.241926e-03
+4.342638e-03
+5.453505e-03
+6.574661e-03
+7.706203e-03
+8.848213e-03
+1.000077e-02
+1.116401e-02
+1.233798e-02
+1.352285e-02
+1.471866e-02
+1.592553e-02
+1.714358e-02
+1.837287e-02
+1.961356e-02
+2.086573e-02
+2.212947e-02
+2.340491e-02
+2.469213e-02
+2.599125e-02
+2.730238e-02
+2.862566e-02
+2.996118e-02
+3.130905e-02
+3.266938e-02
+3.404230e-02
+3.533176e-02
+3.654025e-02
+3.775990e-02
+3.899088e-02
+4.023322e-02
+4.148704e-02
+4.275249e-02
+4.402962e-02
+4.531859e-02
+4.661947e-02
+4.793239e-02
+4.925746e-02
+5.059478e-02
+5.194445e-02
+5.330665e-02
+5.468144e-02
+5.589831e-02
+5.712123e-02
+5.835548e-02
+5.960116e-02
+6.085835e-02
+6.212717e-02
+6.340776e-02
+6.470016e-02
+6.600451e-02
+6.732095e-02
+6.864958e-02
+6.999048e-02
+7.134379e-02
+7.270962e-02
+7.408809e-02
+7.547931e-02
+7.688339e-02
+7.830047e-02
+7.973066e-02
+8.140108e-02
+8.418250e-02
+8.698966e-02
+8.982284e-02
+9.268221e-02
+9.556805e-02
+9.848054e-02
+1.014200e-01
+1.043867e-01
+1.073808e-01
+1.104026e-01
+1.134524e-01
+1.158151e-01
+1.179355e-01
+1.200755e-01
+1.222353e-01
+1.244151e-01
+1.266151e-01
+1.288354e-01
+1.310762e-01
+1.333378e-01
+1.356203e-01
+1.379240e-01
+1.402489e-01
+1.425953e-01
+1.449635e-01
+1.473536e-01
+1.497657e-01
+1.522002e-01
+1.546572e-01
+1.571369e-01
+1.596397e-01
+1.621655e-01
+1.647147e-01
+1.672875e-01
+1.698841e-01
+1.720806e-01
+1.738713e-01
+1.756786e-01
+1.775027e-01
+1.793436e-01
+1.812016e-01
+1.830767e-01
+1.849692e-01
+1.868792e-01
+1.888068e-01
+1.907524e-01
+1.927158e-01
+1.946975e-01
+1.966975e-01
+1.987160e-01
+2.007532e-01
+2.028092e-01
+2.048842e-01
+2.069785e-01
+2.090921e-01
+2.112253e-01
+2.133782e-01
+2.155510e-01
+2.177439e-01
+2.199571e-01
+2.221908e-01
+2.244451e-01
+2.267203e-01
+2.290166e-01
+2.313341e-01
+2.336730e-01
+2.360336e-01
+2.384160e-01
+2.408205e-01
+2.432472e-01
+2.456963e-01
+2.481682e-01
+2.506628e-01
+2.531806e-01
+2.557216e-01
+2.582862e-01
+2.608745e-01
+2.634867e-01
+2.661231e-01
+2.687839e-01
+2.714693e-01
+2.741796e-01
+2.769148e-01
+2.796755e-01
+2.824617e-01
+2.852736e-01
+2.873352e-01
+2.885089e-01
+2.896935e-01
+2.908890e-01
+2.920955e-01
+2.933132e-01
+2.945421e-01
+2.957825e-01
+2.970343e-01
+2.982977e-01
+2.995728e-01
+3.008597e-01
+3.021585e-01
+3.034693e-01
+3.047922e-01
+3.061274e-01
+3.074749e-01
+3.088349e-01
+3.102075e-01
+3.115928e-01
+3.129908e-01
+3.144018e-01
+3.158259e-01
+3.172632e-01
+3.187137e-01
+3.201777e-01
+3.216552e-01
+3.231463e-01
+3.246513e-01
+3.261702e-01
+3.277032e-01
+3.292503e-01
+3.308118e-01
+3.323877e-01
+3.339781e-01
+3.355833e-01
+3.372034e-01
+3.388384e-01
+3.404885e-01
+3.421539e-01
+3.438348e-01
+3.455311e-01
+3.472432e-01
+3.489711e-01
+3.507150e-01
+3.524750e-01
+3.542513e-01
+3.560441e-01
+3.578534e-01
+
+#### Metal Ejecta Parameters ####
+
+# Number of points / Number of elements
+200 5
+
+# IEj
+
+0.05 0.0155624
+3.692117e-04
+1.027219e-03
+1.690218e-03
+2.358282e-03
+3.031578e-03
+3.710359e-03
+4.394950e-03
+5.084807e-03
+5.781070e-03
+6.484153e-03
+7.193230e-03
+7.909730e-03
+8.633279e-03
+9.364177e-03
+1.010294e-02
+1.084978e-02
+1.160501e-02
+1.236899e-02
+1.314165e-02
+1.392376e-02
+1.471539e-02
+1.551707e-02
+1.632898e-02
+1.715144e-02
+1.798477e-02
+1.882943e-02
+1.968590e-02
+2.055424e-02
+2.143510e-02
+2.232876e-02
+2.323561e-02
+2.415612e-02
+2.509057e-02
+2.603954e-02
+2.700335e-02
+2.798243e-02
+2.897730e-02
+2.998840e-02
+3.101619e-02
+3.206112e-02
+3.312372e-02
+3.420448e-02
+3.530391e-02
+3.642250e-02
+3.756085e-02
+3.871943e-02
+3.989886e-02
+4.109965e-02
+4.232243e-02
+4.356778e-02
+4.483631e-02
+4.612863e-02
+4.744536e-02
+4.878721e-02
+5.015476e-02
+5.154875e-02
+5.296987e-02
+5.441879e-02
+5.589626e-02
+5.740304e-02
+5.893985e-02
+6.050749e-02
+6.210674e-02
+6.373842e-02
+6.540334e-02
+6.710237e-02
+6.883638e-02
+7.060622e-02
+7.241283e-02
+7.425714e-02
+7.614008e-02
+7.806261e-02
+8.002575e-02
+8.203050e-02
+8.407790e-02
+8.616900e-02
+8.830491e-02
+9.048674e-02
+9.271560e-02
+9.499267e-02
+9.731913e-02
+9.969621e-02
+1.021251e-01
+1.046072e-01
+1.071406e-01
+1.097011e-01
+1.122840e-01
+1.148904e-01
+1.175213e-01
+1.201776e-01
+1.228606e-01
+1.255711e-01
+1.283104e-01
+1.310796e-01
+1.338797e-01
+1.367118e-01
+1.395584e-01
+1.424079e-01
+1.452611e-01
+1.481189e-01
+1.509931e-01
+1.539077e-01
+1.568646e-01
+1.598649e-01
+1.628637e-01
+1.658261e-01
+1.687525e-01
+1.716434e-01
+1.744993e-01
+1.773206e-01
+1.801143e-01
+1.828928e-01
+1.856569e-01
+1.884073e-01
+1.911446e-01
+1.938677e-01
+1.965730e-01
+1.992608e-01
+2.019318e-01
+2.045855e-01
+2.072152e-01
+2.098199e-01
+2.124000e-01
+2.149516e-01
+2.174625e-01
+2.199338e-01
+2.223703e-01
+2.247697e-01
+2.271187e-01
+2.293951e-01
+2.316387e-01
+2.338572e-01
+2.360511e-01
+2.382206e-01
+2.403665e-01
+2.424928e-01
+2.446006e-01
+2.466904e-01
+2.487627e-01
+2.508177e-01
+2.528560e-01
+2.548780e-01
+2.568840e-01
+2.588736e-01
+2.608469e-01
+2.628044e-01
+2.647465e-01
+2.666737e-01
+2.685861e-01
+2.704781e-01
+2.723464e-01
+2.741913e-01
+2.760132e-01
+2.778122e-01
+2.795887e-01
+2.813430e-01
+2.830777e-01
+2.847979e-01
+2.865039e-01
+2.881961e-01
+2.898742e-01
+2.915370e-01
+2.931849e-01
+2.948182e-01
+2.964372e-01
+2.980410e-01
+2.996269e-01
+3.011951e-01
+3.027450e-01
+3.042756e-01
+3.057872e-01
+3.072799e-01
+3.087540e-01
+3.102098e-01
+3.116478e-01
+3.130697e-01
+3.144761e-01
+3.158672e-01
+3.172433e-01
+3.186045e-01
+3.199511e-01
+3.212834e-01
+3.226016e-01
+3.239059e-01
+3.251965e-01
+3.264738e-01
+3.277378e-01
+3.289888e-01
+3.302257e-01
+3.314487e-01
+3.326579e-01
+3.338535e-01
+3.350357e-01
+3.362047e-01
+3.373608e-01
+3.385041e-01
+3.396348e-01
+3.407532e-01
+3.418593e-01
+3.429535e-01
+
+# IEjnp
+
+0.05 0.0155624
+3.692117e-04
+1.027219e-03
+1.690218e-03
+2.358282e-03
+3.031578e-03
+3.710359e-03
+4.394950e-03
+5.084807e-03
+5.781070e-03
+6.484153e-03
+7.193230e-03
+7.909730e-03
+8.633279e-03
+9.364177e-03
+1.010294e-02
+1.084978e-02
+1.160501e-02
+1.236899e-02
+1.314165e-02
+1.392376e-02
+1.471539e-02
+1.551707e-02
+1.632898e-02
+1.715144e-02
+1.798477e-02
+1.882943e-02
+1.968590e-02
+2.055424e-02
+2.143510e-02
+2.232876e-02
+2.323561e-02
+2.415612e-02
+2.509057e-02
+2.603954e-02
+2.700335e-02
+2.798243e-02
+2.897730e-02
+2.998840e-02
+3.101619e-02
+3.206112e-02
+3.312372e-02
+3.420448e-02
+3.530391e-02
+3.642250e-02
+3.756085e-02
+3.871943e-02
+3.989886e-02
+4.109965e-02
+4.232243e-02
+4.356778e-02
+4.483631e-02
+4.612863e-02
+4.744536e-02
+4.878721e-02
+5.015476e-02
+5.154875e-02
+5.296987e-02
+5.441879e-02
+5.589626e-02
+5.740304e-02
+5.893985e-02
+6.050749e-02
+6.210674e-02
+6.373842e-02
+6.540334e-02
+6.710237e-02
+6.883638e-02
+7.060622e-02
+7.241283e-02
+7.425714e-02
+7.614008e-02
+7.806261e-02
+8.002575e-02
+8.203050e-02
+8.407790e-02
+8.616900e-02
+8.830491e-02
+9.048674e-02
+9.271560e-02
+9.499267e-02
+9.731913e-02
+9.969621e-02
+1.021251e-01
+1.046072e-01
+1.071406e-01
+1.097011e-01
+1.122840e-01
+1.148904e-01
+1.175213e-01
+1.201776e-01
+1.228606e-01
+1.255711e-01
+1.283104e-01
+1.310796e-01
+1.338797e-01
+1.367118e-01
+1.395584e-01
+1.424079e-01
+1.452611e-01
+1.481189e-01
+1.509931e-01
+1.539077e-01
+1.568646e-01
+1.598649e-01
+1.628637e-01
+1.658261e-01
+1.687525e-01
+1.716434e-01
+1.744993e-01
+1.773206e-01
+1.801143e-01
+1.828928e-01
+1.856569e-01
+1.884073e-01
+1.911446e-01
+1.938677e-01
+1.965730e-01
+1.992608e-01
+2.019318e-01
+2.045855e-01
+2.072152e-01
+2.098199e-01
+2.124000e-01
+2.149516e-01
+2.174625e-01
+2.199338e-01
+2.223703e-01
+2.247697e-01
+2.271187e-01
+2.293951e-01
+2.316387e-01
+2.338572e-01
+2.360511e-01
+2.382206e-01
+2.403665e-01
+2.424928e-01
+2.446006e-01
+2.466904e-01
+2.487627e-01
+2.508177e-01
+2.528560e-01
+2.548780e-01
+2.568840e-01
+2.588736e-01
+2.608469e-01
+2.628044e-01
+2.647465e-01
+2.666737e-01
+2.685857e-01
+2.704546e-01
+2.722638e-01
+2.740131e-01
+2.757024e-01
+2.773315e-01
+2.789003e-01
+2.804086e-01
+2.818684e-01
+2.833036e-01
+2.847148e-01
+2.861021e-01
+2.874668e-01
+2.888106e-01
+2.901339e-01
+2.914366e-01
+2.927191e-01
+2.939793e-01
+2.952112e-01
+2.964148e-01
+2.975928e-01
+2.987511e-01
+2.998899e-01
+3.010094e-01
+3.021097e-01
+3.031908e-01
+3.042527e-01
+3.052940e-01
+3.063146e-01
+3.073146e-01
+3.082940e-01
+3.092531e-01
+3.101917e-01
+3.111099e-01
+3.120078e-01
+3.128855e-01
+3.137430e-01
+3.145803e-01
+3.153974e-01
+3.161951e-01
+3.169782e-01
+3.177479e-01
+3.185041e-01
+3.192470e-01
+3.199767e-01
+3.206932e-01
+3.213965e-01
+3.220869e-01
+3.227642e-01
+3.234286e-01
+3.240802e-01
+3.247189e-01
+
+# IFe
+
+10 0.0039994
+1.210765e-11
+1.049702e-07
+4.157664e-07
+9.329742e-07
+1.657179e-06
+2.588968e-06
+3.728928e-06
+5.077658e-06
+6.635804e-06
+8.403862e-06
+1.038259e-05
+1.257252e-05
+1.497430e-05
+1.758858e-05
+2.041596e-05
+2.345713e-05
+2.671272e-05
+3.018338e-05
+3.386976e-05
+3.777255e-05
+4.189240e-05
+4.623007e-05
+5.078616e-05
+5.556134e-05
+6.055651e-05
+6.577210e-05
+7.120892e-05
+7.686781e-05
+8.274923e-05
+8.881412e-05
+9.483792e-05
+1.007862e-04
+1.066586e-04
+1.124552e-04
+1.181757e-04
+1.238202e-04
+1.293886e-04
+1.348806e-04
+1.402963e-04
+1.456355e-04
+1.508980e-04
+1.560839e-04
+1.611929e-04
+1.662250e-04
+1.711801e-04
+1.760284e-04
+1.807376e-04
+1.853071e-04
+1.897368e-04
+1.940263e-04
+1.981754e-04
+2.021837e-04
+2.060510e-04
+2.097769e-04
+2.133610e-04
+2.168032e-04
+2.201030e-04
+2.232601e-04
+2.262742e-04
+2.291449e-04
+2.318719e-04
+2.344549e-04
+2.368935e-04
+2.391873e-04
+2.413379e-04
+2.434169e-04
+2.454622e-04
+2.474735e-04
+2.494510e-04
+2.513944e-04
+2.533038e-04
+2.551792e-04
+2.570203e-04
+2.588272e-04
+2.605999e-04
+2.623382e-04
+2.640430e-04
+2.657164e-04
+2.673585e-04
+2.689693e-04
+2.705487e-04
+2.720966e-04
+2.736130e-04
+2.750977e-04
+2.765509e-04
+2.779724e-04
+2.793621e-04
+2.807199e-04
+2.820459e-04
+2.833400e-04
+2.846021e-04
+2.858320e-04
+2.870299e-04
+2.881955e-04
+2.893289e-04
+2.904299e-04
+2.914986e-04
+2.925347e-04
+2.935383e-04
+2.945093e-04
+2.954513e-04
+2.963856e-04
+2.973159e-04
+2.982420e-04
+2.991642e-04
+3.000822e-04
+3.009962e-04
+3.019061e-04
+3.028121e-04
+3.037139e-04
+3.046117e-04
+3.055056e-04
+3.063953e-04
+3.072811e-04
+3.081629e-04
+3.090406e-04
+3.099144e-04
+3.107842e-04
+3.116500e-04
+3.125118e-04
+3.133696e-04
+3.142235e-04
+3.150734e-04
+3.159194e-04
+3.167614e-04
+3.175994e-04
+3.184336e-04
+3.192638e-04
+3.200900e-04
+3.209124e-04
+3.217308e-04
+3.225453e-04
+3.233559e-04
+3.241626e-04
+3.249654e-04
+3.257643e-04
+3.265593e-04
+3.273504e-04
+3.281377e-04
+3.289210e-04
+3.297005e-04
+3.304761e-04
+3.312478e-04
+3.320157e-04
+3.327798e-04
+3.335400e-04
+3.342963e-04
+3.350488e-04
+3.357975e-04
+3.365423e-04
+3.372833e-04
+3.380202e-04
+3.387510e-04
+3.394755e-04
+3.401937e-04
+3.409055e-04
+3.416109e-04
+3.423099e-04
+3.430025e-04
+3.436887e-04
+3.443686e-04
+3.450420e-04
+3.457090e-04
+3.463696e-04
+3.470238e-04
+3.476716e-04
+3.483130e-04
+3.489479e-04
+3.495764e-04
+3.501985e-04
+3.508141e-04
+3.514232e-04
+3.520259e-04
+3.526221e-04
+3.532119e-04
+3.537952e-04
+3.543719e-04
+3.549422e-04
+3.555060e-04
+3.560633e-04
+3.566141e-04
+3.571583e-04
+3.576961e-04
+3.582273e-04
+3.587519e-04
+3.592700e-04
+3.597816e-04
+3.602865e-04
+3.607849e-04
+3.612767e-04
+3.617619e-04
+3.622405e-04
+3.627125e-04
+3.631779e-04
+3.636366e-04
+3.640887e-04
+3.645342e-04
+3.649730e-04
+3.654051e-04
+3.658306e-04
+
+# IMg
+
+10 0.0039994
+8.881784e-13
+7.695007e-09
+3.047785e-08
+6.839218e-08
+1.214803e-07
+1.897852e-07
+2.733505e-07
+3.722198e-07
+4.864378e-07
+6.160490e-07
+7.610997e-07
+9.216310e-07
+1.097696e-06
+1.289336e-06
+1.496597e-06
+1.719533e-06
+1.958182e-06
+2.212602e-06
+2.482831e-06
+2.768928e-06
+3.070938e-06
+3.388908e-06
+3.722893e-06
+4.072943e-06
+4.439109e-06
+4.821442e-06
+5.219994e-06
+5.634818e-06
+6.065962e-06
+6.517297e-06
+7.010149e-06
+7.547947e-06
+8.130821e-06
+8.758907e-06
+9.432333e-06
+1.015126e-05
+1.091580e-05
+1.172612e-05
+1.258235e-05
+1.348463e-05
+1.443311e-05
+1.542795e-05
+1.646926e-05
+1.755723e-05
+1.869198e-05
+1.985311e-05
+2.101826e-05
+2.218744e-05
+2.336067e-05
+2.453802e-05
+2.571949e-05
+2.690512e-05
+2.809496e-05
+2.928905e-05
+3.048738e-05
+3.169006e-05
+3.289706e-05
+3.410843e-05
+3.532421e-05
+3.654444e-05
+3.776915e-05
+3.899839e-05
+4.023219e-05
+4.147059e-05
+4.271723e-05
+4.412105e-05
+4.576026e-05
+4.763555e-05
+4.974760e-05
+5.209711e-05
+5.468480e-05
+5.751132e-05
+6.057747e-05
+6.388393e-05
+6.743139e-05
+7.122062e-05
+7.518328e-05
+7.914277e-05
+8.309039e-05
+8.702607e-05
+9.094996e-05
+9.486207e-05
+9.876248e-05
+1.026511e-04
+1.065281e-04
+1.103935e-04
+1.142473e-04
+1.180896e-04
+1.219204e-04
+1.257398e-04
+1.295477e-04
+1.333442e-04
+1.371295e-04
+1.409035e-04
+1.446663e-04
+1.484178e-04
+1.521583e-04
+1.558875e-04
+1.596057e-04
+1.633129e-04
+1.670118e-04
+1.707180e-04
+1.744342e-04
+1.781607e-04
+1.818972e-04
+1.856441e-04
+1.894015e-04
+1.931694e-04
+1.969478e-04
+2.007371e-04
+2.045371e-04
+2.083481e-04
+2.121701e-04
+2.160033e-04
+2.198477e-04
+2.237034e-04
+2.275707e-04
+2.314494e-04
+2.353399e-04
+2.392422e-04
+2.431563e-04
+2.470824e-04
+2.510207e-04
+2.549711e-04
+2.589339e-04
+2.629091e-04
+2.668969e-04
+2.708973e-04
+2.749105e-04
+2.789366e-04
+2.829757e-04
+2.870279e-04
+2.910933e-04
+2.951720e-04
+2.992643e-04
+3.033700e-04
+3.074896e-04
+3.116228e-04
+3.157700e-04
+3.199312e-04
+3.241067e-04
+3.282964e-04
+3.325005e-04
+3.367191e-04
+3.409524e-04
+3.452004e-04
+3.494634e-04
+3.537414e-04
+3.580344e-04
+3.623428e-04
+3.666666e-04
+3.710045e-04
+3.753475e-04
+3.796938e-04
+3.840436e-04
+3.883970e-04
+3.927541e-04
+3.971150e-04
+4.014796e-04
+4.058482e-04
+4.102208e-04
+4.145976e-04
+4.189787e-04
+4.233640e-04
+4.277538e-04
+4.321480e-04
+4.365470e-04
+4.409506e-04
+4.453589e-04
+4.497724e-04
+4.541907e-04
+4.586142e-04
+4.630428e-04
+4.674768e-04
+4.719162e-04
+4.763612e-04
+4.808117e-04
+4.852679e-04
+4.897300e-04
+4.941979e-04
+4.986719e-04
+5.031521e-04
+5.076384e-04
+5.121311e-04
+5.166302e-04
+5.211358e-04
+5.256481e-04
+5.301672e-04
+5.346931e-04
+5.392259e-04
+5.437658e-04
+5.483130e-04
+5.528674e-04
+5.574292e-04
+5.619985e-04
+5.665754e-04
+5.711600e-04
+5.757525e-04
+5.803528e-04
+5.849613e-04
+
+# IO
+
+10 0.0039994
+1.165290e-11
+1.009848e-07
+3.999776e-07
+8.975476e-07
+1.594257e-06
+2.490662e-06
+3.587353e-06
+4.884860e-06
+6.383823e-06
+8.084782e-06
+9.988376e-06
+1.209513e-05
+1.440573e-05
+1.692073e-05
+1.964075e-05
+2.256647e-05
+2.569842e-05
+2.903730e-05
+3.258369e-05
+3.633829e-05
+4.030173e-05
+4.447467e-05
+4.885776e-05
+5.345166e-05
+5.825708e-05
+6.327470e-05
+6.850506e-05
+7.394905e-05
+7.960724e-05
+8.550158e-05
+9.175093e-05
+9.837496e-05
+1.053746e-04
+1.127511e-04
+1.205057e-04
+1.286395e-04
+1.371538e-04
+1.460498e-04
+1.553288e-04
+1.649917e-04
+1.750402e-04
+1.854754e-04
+1.962984e-04
+2.075105e-04
+2.191133e-04
+2.311131e-04
+2.435168e-04
+2.563256e-04
+2.695414e-04
+2.831650e-04
+2.971983e-04
+3.116423e-04
+3.264986e-04
+3.417687e-04
+3.574538e-04
+3.735558e-04
+3.900757e-04
+4.070151e-04
+4.243755e-04
+4.421584e-04
+4.603653e-04
+4.789978e-04
+4.980578e-04
+5.175460e-04
+5.374746e-04
+5.582480e-04
+5.800800e-04
+6.029740e-04
+6.269333e-04
+6.519614e-04
+6.780617e-04
+7.052375e-04
+7.334927e-04
+7.628300e-04
+7.932542e-04
+8.247679e-04
+8.572473e-04
+8.903679e-04
+9.241153e-04
+9.584923e-04
+9.935012e-04
+1.029145e-03
+1.065425e-03
+1.102344e-03
+1.139905e-03
+1.178111e-03
+1.216963e-03
+1.256465e-03
+1.296618e-03
+1.337426e-03
+1.378891e-03
+1.421015e-03
+1.463802e-03
+1.507254e-03
+1.551373e-03
+1.596163e-03
+1.641626e-03
+1.687765e-03
+1.734582e-03
+1.782082e-03
+1.830242e-03
+1.878935e-03
+1.928142e-03
+1.977866e-03
+2.028108e-03
+2.078871e-03
+2.130157e-03
+2.181970e-03
+2.234310e-03
+2.287180e-03
+2.340585e-03
+2.394525e-03
+2.449004e-03
+2.504023e-03
+2.559585e-03
+2.615693e-03
+2.672351e-03
+2.729559e-03
+2.787321e-03
+2.845639e-03
+2.904517e-03
+2.963956e-03
+3.023959e-03
+3.084530e-03
+3.145671e-03
+3.207384e-03
+3.269673e-03
+3.332540e-03
+3.395989e-03
+3.460021e-03
+3.524641e-03
+3.589849e-03
+3.655650e-03
+3.722047e-03
+3.789042e-03
+3.856638e-03
+3.924839e-03
+3.993647e-03
+4.063066e-03
+4.133096e-03
+4.203745e-03
+4.275011e-03
+4.346902e-03
+4.419417e-03
+4.492561e-03
+4.566338e-03
+4.640751e-03
+4.715799e-03
+4.791490e-03
+4.867826e-03
+4.944811e-03
+5.022382e-03
+5.100116e-03
+5.177927e-03
+5.255819e-03
+5.333792e-03
+5.411851e-03
+5.489994e-03
+5.568226e-03
+5.646547e-03
+5.724960e-03
+5.803464e-03
+5.882064e-03
+5.960758e-03
+6.039553e-03
+6.118447e-03
+6.197442e-03
+6.276542e-03
+6.355746e-03
+6.435059e-03
+6.514479e-03
+6.594011e-03
+6.673654e-03
+6.753413e-03
+6.833289e-03
+6.913283e-03
+6.993396e-03
+7.073632e-03
+7.153992e-03
+7.234477e-03
+7.315091e-03
+7.395833e-03
+7.476707e-03
+7.557716e-03
+7.638859e-03
+7.720140e-03
+7.801559e-03
+7.883120e-03
+7.964825e-03
+8.046674e-03
+8.128670e-03
+8.210815e-03
+8.293114e-03
+8.375565e-03
+8.458169e-03
+8.540932e-03
+8.623854e-03
+8.706938e-03
+8.790184e-03
+8.873596e-03
+
+# IBa
+
+10 0.0039994
+3.564857e-16
+3.092970e-12
+1.225031e-11
+2.748957e-11
+4.882805e-11
+7.628276e-11
+1.098712e-10
+1.496110e-10
+1.955205e-10
+2.476161e-10
+3.059180e-10
+3.704437e-10
+4.412106e-10
+5.182397e-10
+6.015464e-10
+6.911538e-10
+7.870762e-10
+8.893393e-10
+9.979564e-10
+1.112951e-09
+1.234090e-09
+1.353908e-09
+1.468896e-09
+1.579045e-09
+1.684343e-09
+1.784778e-09
+1.880339e-09
+1.971014e-09
+2.056791e-09
+2.137660e-09
+2.213605e-09
+2.284619e-09
+2.350686e-09
+2.411794e-09
+2.467932e-09
+2.519086e-09
+2.565244e-09
+2.606393e-09
+2.642519e-09
+2.673610e-09
+2.699651e-09
+2.720630e-09
+2.736534e-09
+2.747347e-09
+2.753057e-09
+2.756080e-09
+2.759065e-09
+2.762012e-09
+2.764921e-09
+2.767794e-09
+2.770628e-09
+2.773425e-09
+2.776185e-09
+2.778906e-09
+2.781590e-09
+2.784236e-09
+2.786844e-09
+2.789415e-09
+2.791947e-09
+2.794442e-09
+2.796898e-09
+2.799316e-09
+2.801696e-09
+2.804037e-09
+2.806341e-09
+2.808606e-09
+2.810832e-09
+2.813020e-09
+2.815170e-09
+2.817280e-09
+2.819353e-09
+2.821386e-09
+2.823380e-09
+2.825336e-09
+2.827252e-09
+2.829130e-09
+2.830968e-09
+2.832768e-09
+2.834528e-09
+2.836248e-09
+2.837929e-09
+2.839571e-09
+2.841173e-09
+2.842736e-09
+2.844259e-09
+2.845741e-09
+2.847184e-09
+2.848588e-09
+2.849950e-09
+2.851273e-09
+2.852556e-09
+2.853798e-09
+2.855000e-09
+2.856162e-09
+2.857283e-09
+2.858363e-09
+2.859402e-09
+2.860401e-09
+2.861358e-09
+2.862275e-09
+2.863150e-09
+2.863985e-09
+2.864778e-09
+2.865529e-09
+2.866239e-09
+2.866907e-09
+2.867534e-09
+2.868118e-09
+2.868661e-09
+2.869162e-09
+2.869621e-09
+2.870037e-09
+2.870411e-09
+2.870742e-09
+2.871031e-09
+2.871277e-09
+2.871480e-09
+2.871641e-09
+2.871758e-09
+2.871832e-09
+2.871863e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+2.871864e-09
+
+# IMetals
+
+10 0.0039994
+3.478817e-11
+3.018649e-07
+1.195585e-06
+2.682908e-06
+4.765490e-06
+7.444964e-06
+1.072307e-05
+1.460157e-05
+1.908216e-05
+2.416660e-05
+2.985663e-05
+3.615406e-05
+4.306081e-05
+5.057850e-05
+5.870900e-05
+6.745430e-05
+7.681613e-05
+8.679670e-05
+9.739737e-05
+1.086204e-04
+1.204675e-04
+1.329411e-04
+1.460428e-04
+1.597746e-04
+1.741386e-04
+1.891368e-04
+2.047712e-04
+2.210439e-04
+2.379570e-04
+2.555000e-04
+2.736030e-04
+2.922576e-04
+3.114652e-04
+3.312280e-04
+3.515475e-04
+3.724261e-04
+3.938654e-04
+4.158674e-04
+4.384345e-04
+4.615681e-04
+4.852705e-04
+5.095443e-04
+5.343903e-04
+5.598115e-04
+5.858100e-04
+6.123469e-04
+6.393809e-04
+6.669138e-04
+6.949476e-04
+7.234835e-04
+7.525245e-04
+7.820716e-04
+8.121277e-04
+8.426942e-04
+8.737729e-04
+9.053668e-04
+9.374768e-04
+9.701054e-04
+1.003255e-03
+1.036927e-03
+1.071123e-03
+1.105847e-03
+1.141100e-03
+1.176884e-03
+1.213212e-03
+1.250468e-03
+1.288858e-03
+1.328384e-03
+1.369053e-03
+1.410865e-03
+1.453828e-03
+1.497942e-03
+1.543215e-03
+1.589648e-03
+1.637247e-03
+1.686014e-03
+1.735841e-03
+1.786435e-03
+1.837786e-03
+1.889896e-03
+1.942769e-03
+1.996408e-03
+2.050815e-03
+2.105994e-03
+2.161948e-03
+2.218681e-03
+2.276196e-03
+2.334495e-03
+2.393582e-03
+2.453462e-03
+2.514136e-03
+2.575608e-03
+2.637881e-03
+2.700961e-03
+2.764849e-03
+2.829548e-03
+2.895063e-03
+2.961398e-03
+3.028554e-03
+3.096537e-03
+3.165307e-03
+3.234611e-03
+3.304409e-03
+3.374708e-03
+3.445506e-03
+3.516808e-03
+3.588617e-03
+3.660934e-03
+3.733765e-03
+3.807110e-03
+3.880972e-03
+3.955354e-03
+4.030261e-03
+4.105694e-03
+4.181655e-03
+4.258150e-03
+4.335179e-03
+4.412746e-03
+4.490855e-03
+4.569508e-03
+4.648708e-03
+4.728457e-03
+4.808760e-03
+4.889620e-03
+4.971038e-03
+5.053020e-03
+5.135566e-03
+5.218682e-03
+5.302371e-03
+5.386633e-03
+5.471475e-03
+5.556897e-03
+5.642906e-03
+5.729503e-03
+5.816690e-03
+5.904472e-03
+5.992854e-03
+6.081836e-03
+6.171423e-03
+6.261618e-03
+6.352427e-03
+6.443847e-03
+6.535890e-03
+6.628552e-03
+6.721842e-03
+6.815760e-03
+6.910312e-03
+7.005498e-03
+7.101326e-03
+7.197796e-03
+7.294914e-03
+7.392620e-03
+7.490491e-03
+7.588448e-03
+7.686490e-03
+7.784621e-03
+7.882844e-03
+7.981159e-03
+8.079569e-03
+8.178077e-03
+8.276686e-03
+8.375395e-03
+8.474209e-03
+8.573129e-03
+8.672157e-03
+8.771296e-03
+8.870548e-03
+8.969914e-03
+9.069398e-03
+9.169003e-03
+9.268727e-03
+9.368578e-03
+9.468552e-03
+9.568658e-03
+9.668892e-03
+9.769261e-03
+9.869765e-03
+9.970407e-03
+1.007119e-02
+1.017211e-02
+1.027318e-02
+1.037440e-02
+1.047577e-02
+1.057728e-02
+1.067896e-02
+1.078079e-02
+1.088277e-02
+1.098492e-02
+1.108724e-02
+1.118972e-02
+1.129237e-02
+1.139519e-02
+1.149818e-02
+1.160135e-02
+1.170470e-02
+1.180823e-02
+1.191194e-02
+1.201584e-02
+1.211993e-02
+1.222421e-02
+
+# Mean WD Mass
+
+1.380000
+
+# SNIa Metal Ejection
+
+# Number of elements
+5
+
+# Ej
+0.0
+
+# Ejnp
+0.0
+
+# Fe
+7.434630e-01
+
+# Mg
+8.572300e-03
+
+# O
+1.430000e-01
+
+# Ba
+0.000000e+00
+
+# Metals
+1.370000e+00
+
+
+# Element Solar Abundances
+
+# Number of elements
+5
+
+# Fe
+0.00176604
+
+# Mg
+0.000924316
+
+# O
+0.0108169
+
+# Ba
+1.85267e-08
+
+# Metals
+0.02
+
diff --git a/PyChem/shared/chimie.yr.dat b/PyChem/shared/chimie.yr.dat
new file mode 100644
index 0000000..0f68043
--- /dev/null
+++ b/PyChem/shared/chimie.yr.dat
@@ -0,0 +1,3355 @@
+#### Livetime ####
+
+-40.1107251082866 5.50992173040633 0.782431795366473
+ 141.929566656232 -15.88948185575660 -3.255779246324010
+-261.365531429482 17.07350618651300 9.866058678313810
+
+#### IMF Parameters ####
+
+0.05 50
+3
+0.08 0.5 1
+0.7 -0.8 -1.7 -1.3
+
+#### SNII Parameters ####
+
+8
+
+#### SNIa Parameters ####
+
+3 8
+-0.35
+0.9 1.5 0.02
+1.8 2.6 0.05
+
+#### Metal Parameters ####
+
+# Number of points / Number of elements
+200 6
+
+# Ej
+
+0.05 0.0155624
+4.843730e-02
+4.935623e-02
+5.030868e-02
+5.129588e-02
+5.231913e-02
+5.337968e-02
+5.447892e-02
+5.561825e-02
+5.679915e-02
+5.802314e-02
+5.929179e-02
+6.060675e-02
+6.196962e-02
+6.338228e-02
+6.484646e-02
+6.636404e-02
+6.793699e-02
+6.956732e-02
+7.125717e-02
+7.300862e-02
+7.482401e-02
+7.670562e-02
+7.865587e-02
+8.067726e-02
+8.277240e-02
+8.494399e-02
+8.719482e-02
+8.952773e-02
+9.194581e-02
+9.445206e-02
+9.704976e-02
+9.974223e-02
+1.025330e-01
+1.054255e-01
+1.084235e-01
+1.115309e-01
+1.147517e-01
+1.180900e-01
+1.215501e-01
+1.251365e-01
+1.288536e-01
+1.327064e-01
+1.366998e-01
+1.408388e-01
+1.451289e-01
+1.495755e-01
+1.541843e-01
+1.589612e-01
+1.639124e-01
+1.690443e-01
+1.743633e-01
+1.798765e-01
+1.855907e-01
+1.915134e-01
+1.976523e-01
+2.040152e-01
+2.106101e-01
+2.174456e-01
+2.245306e-01
+2.318740e-01
+2.394853e-01
+2.473743e-01
+2.555511e-01
+2.640263e-01
+2.728106e-01
+2.819155e-01
+2.913525e-01
+3.011338e-01
+3.112719e-01
+3.217799e-01
+3.326714e-01
+3.439602e-01
+3.556607e-01
+3.677883e-01
+3.803582e-01
+3.933867e-01
+4.068906e-01
+4.208871e-01
+4.353943e-01
+4.504307e-01
+4.660157e-01
+4.821694e-01
+4.989123e-01
+5.162661e-01
+5.314058e-01
+5.427305e-01
+5.544683e-01
+5.666343e-01
+5.792443e-01
+5.923142e-01
+6.058611e-01
+6.199021e-01
+6.344554e-01
+6.495397e-01
+6.651744e-01
+6.807522e-01
+6.899109e-01
+6.994038e-01
+7.092429e-01
+7.194411e-01
+7.368875e-01
+7.569233e-01
+7.776899e-01
+7.980127e-01
+7.982467e-01
+7.984892e-01
+7.987405e-01
+7.990010e-01
+7.992710e-01
+7.995510e-01
+8.042794e-01
+8.101172e-01
+8.161680e-01
+8.224396e-01
+8.289399e-01
+8.342458e-01
+8.392339e-01
+8.444039e-01
+8.497626e-01
+8.539259e-01
+8.564276e-01
+8.590205e-01
+8.617080e-01
+8.601962e-01
+8.568598e-01
+8.548928e-01
+8.535241e-01
+8.496331e-01
+8.360225e-01
+8.264965e-01
+8.275483e-01
+8.286386e-01
+8.297685e-01
+8.309396e-01
+8.328840e-01
+8.360294e-01
+8.392897e-01
+8.426689e-01
+8.461714e-01
+8.498016e-01
+8.535643e-01
+8.574644e-01
+8.613294e-01
+8.650263e-01
+8.688580e-01
+8.728295e-01
+8.769459e-01
+8.812124e-01
+8.849934e-01
+8.849465e-01
+8.848978e-01
+8.848472e-01
+8.847950e-01
+8.847407e-01
+8.846844e-01
+8.846261e-01
+8.875960e-01
+8.913530e-01
+8.952472e-01
+8.992833e-01
+9.025038e-01
+9.056354e-01
+9.088813e-01
+9.122456e-01
+9.157327e-01
+9.174708e-01
+9.185946e-01
+9.197595e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.200000e-01
+9.207747e-01
+9.221712e-01
+9.236184e-01
+9.251186e-01
+9.266735e-01
+9.282851e-01
+9.299554e-01
+9.316868e-01
+9.334813e-01
+9.353413e-01
+9.372691e-01
+9.392673e-01
+9.413384e-01
+9.429768e-01
+9.440540e-01
+9.451705e-01
+9.463276e-01
+9.475270e-01
+9.487702e-01
+9.500588e-01
+9.513942e-01
+9.527785e-01
+9.542133e-01
+9.557003e-01
+9.572417e-01
+9.588393e-01
+
+# Ejnp
+
+0.05 0.0155624
+4.843730e-02
+4.935623e-02
+5.030868e-02
+5.129588e-02
+5.231913e-02
+5.337968e-02
+5.447892e-02
+5.561825e-02
+5.679915e-02
+5.802314e-02
+5.929179e-02
+6.060675e-02
+6.196962e-02
+6.338228e-02
+6.484646e-02
+6.636404e-02
+6.793699e-02
+6.956732e-02
+7.125717e-02
+7.300862e-02
+7.482401e-02
+7.670562e-02
+7.865587e-02
+8.067726e-02
+8.277240e-02
+8.494399e-02
+8.719482e-02
+8.952773e-02
+9.194581e-02
+9.445206e-02
+9.704976e-02
+9.974223e-02
+1.025330e-01
+1.054255e-01
+1.084235e-01
+1.115309e-01
+1.147517e-01
+1.180900e-01
+1.215501e-01
+1.251365e-01
+1.288536e-01
+1.327064e-01
+1.366998e-01
+1.408388e-01
+1.451289e-01
+1.495755e-01
+1.541843e-01
+1.589612e-01
+1.639124e-01
+1.690443e-01
+1.743633e-01
+1.798765e-01
+1.855907e-01
+1.915134e-01
+1.976523e-01
+2.040152e-01
+2.106101e-01
+2.174456e-01
+2.245306e-01
+2.318740e-01
+2.394853e-01
+2.473743e-01
+2.555511e-01
+2.640263e-01
+2.728106e-01
+2.819155e-01
+2.913525e-01
+3.011338e-01
+3.112719e-01
+3.217799e-01
+3.326714e-01
+3.439602e-01
+3.556607e-01
+3.677883e-01
+3.803582e-01
+3.933867e-01
+4.068906e-01
+4.208871e-01
+4.353943e-01
+4.504307e-01
+4.660157e-01
+4.821694e-01
+4.989123e-01
+5.162661e-01
+5.314058e-01
+5.427305e-01
+5.544683e-01
+5.666343e-01
+5.792443e-01
+5.923142e-01
+6.058611e-01
+6.199021e-01
+6.344554e-01
+6.495397e-01
+6.651744e-01
+6.807522e-01
+6.899109e-01
+6.994038e-01
+7.092429e-01
+7.194411e-01
+7.368875e-01
+7.569233e-01
+7.776899e-01
+7.980127e-01
+7.982467e-01
+7.984892e-01
+7.987405e-01
+7.990010e-01
+7.992710e-01
+7.995510e-01
+8.042794e-01
+8.101172e-01
+8.161680e-01
+8.224396e-01
+8.289399e-01
+8.342458e-01
+8.392339e-01
+8.444039e-01
+8.497626e-01
+8.539259e-01
+8.564276e-01
+8.590205e-01
+8.617080e-01
+8.601962e-01
+8.568598e-01
+8.548928e-01
+8.535241e-01
+8.496331e-01
+8.360225e-01
+8.264965e-01
+8.275483e-01
+8.286386e-01
+8.297685e-01
+8.309396e-01
+8.328840e-01
+8.360294e-01
+8.392897e-01
+8.426689e-01
+8.461714e-01
+8.498016e-01
+8.535643e-01
+8.574644e-01
+8.613294e-01
+8.650263e-01
+8.688580e-01
+8.728295e-01
+8.769459e-01
+8.812124e-01
+8.826500e-01
+8.656790e-01
+8.480889e-01
+8.298569e-01
+8.109598e-01
+7.913733e-01
+7.710722e-01
+7.500303e-01
+7.436701e-01
+7.405392e-01
+7.372940e-01
+7.339306e-01
+7.316641e-01
+7.295763e-01
+7.274125e-01
+7.251695e-01
+7.228449e-01
+7.168616e-01
+7.093693e-01
+7.016037e-01
+6.976798e-01
+6.946764e-01
+6.915635e-01
+6.883371e-01
+6.849929e-01
+6.815267e-01
+6.772454e-01
+6.722804e-01
+6.671343e-01
+6.618005e-01
+6.562721e-01
+6.505419e-01
+6.446027e-01
+6.384468e-01
+6.320664e-01
+6.254531e-01
+6.185986e-01
+6.114941e-01
+6.041303e-01
+5.987492e-01
+5.959238e-01
+5.929955e-01
+5.899602e-01
+5.868143e-01
+5.835535e-01
+5.801739e-01
+5.766708e-01
+5.730400e-01
+5.692767e-01
+5.653761e-01
+5.613332e-01
+5.571429e-01
+
+# Fe
+
+10 0.0039994
+0.000000e+00
+3.723316e-04
+7.481165e-04
+1.127377e-03
+1.510143e-03
+1.896445e-03
+2.286330e-03
+2.679817e-03
+3.076952e-03
+3.477752e-03
+3.882263e-03
+4.290514e-03
+4.702549e-03
+5.118392e-03
+5.538080e-03
+5.961653e-03
+6.389137e-03
+6.820589e-03
+7.256027e-03
+7.695485e-03
+8.139022e-03
+8.586653e-03
+9.038430e-03
+9.494383e-03
+9.954557e-03
+1.041899e-02
+1.088772e-02
+1.136078e-02
+1.183822e-02
+1.201732e-02
+1.190568e-02
+1.179300e-02
+1.167928e-02
+1.156451e-02
+1.144868e-02
+1.133178e-02
+1.121379e-02
+1.109472e-02
+1.097454e-02
+1.085325e-02
+1.073084e-02
+1.060729e-02
+1.048261e-02
+1.035677e-02
+1.022976e-02
+9.976223e-03
+9.716522e-03
+9.454418e-03
+9.189887e-03
+8.922912e-03
+8.653464e-03
+8.381523e-03
+8.107068e-03
+7.830072e-03
+7.550513e-03
+7.268367e-03
+6.983614e-03
+6.696224e-03
+6.406181e-03
+6.113447e-03
+5.818013e-03
+5.519841e-03
+5.218904e-03
+4.915189e-03
+4.651350e-03
+4.591124e-03
+4.530341e-03
+4.468996e-03
+4.407083e-03
+4.344599e-03
+4.281535e-03
+4.217888e-03
+4.153652e-03
+4.088821e-03
+4.023393e-03
+3.957357e-03
+3.896135e-03
+3.836351e-03
+3.776013e-03
+3.715118e-03
+3.653659e-03
+3.591630e-03
+3.529028e-03
+3.465848e-03
+3.402082e-03
+3.337726e-03
+3.272776e-03
+3.207224e-03
+3.141066e-03
+3.074296e-03
+3.006908e-03
+2.938897e-03
+2.870257e-03
+2.800980e-03
+2.731066e-03
+2.660501e-03
+2.589286e-03
+2.517410e-03
+2.444871e-03
+2.371659e-03
+2.333467e-03
+2.330783e-03
+2.328073e-03
+2.325339e-03
+2.322579e-03
+2.319794e-03
+2.316983e-03
+2.314146e-03
+2.311283e-03
+2.308393e-03
+2.305477e-03
+2.302533e-03
+2.299563e-03
+2.296565e-03
+2.293539e-03
+2.290485e-03
+2.287403e-03
+2.284292e-03
+2.281153e-03
+2.277985e-03
+2.274787e-03
+2.271559e-03
+2.268302e-03
+2.265015e-03
+2.261697e-03
+2.258349e-03
+2.254969e-03
+2.251558e-03
+2.248116e-03
+2.244642e-03
+2.241136e-03
+2.237597e-03
+2.234026e-03
+2.230421e-03
+2.226783e-03
+2.223112e-03
+2.219406e-03
+2.215667e-03
+2.211893e-03
+2.208083e-03
+2.204239e-03
+2.200359e-03
+2.196443e-03
+2.192491e-03
+2.188502e-03
+2.184476e-03
+2.180413e-03
+2.176313e-03
+2.172175e-03
+2.167998e-03
+2.163783e-03
+2.156083e-03
+2.144285e-03
+2.132378e-03
+2.120361e-03
+2.108233e-03
+2.095992e-03
+2.083639e-03
+2.071171e-03
+2.058588e-03
+2.045888e-03
+2.033071e-03
+2.020135e-03
+2.007079e-03
+1.993903e-03
+1.980605e-03
+1.967184e-03
+1.953639e-03
+1.939968e-03
+1.926170e-03
+1.912246e-03
+1.898192e-03
+1.884009e-03
+1.869694e-03
+1.855246e-03
+1.840665e-03
+1.825950e-03
+1.811098e-03
+1.796109e-03
+1.780980e-03
+1.765713e-03
+1.750303e-03
+1.734751e-03
+1.719056e-03
+1.703215e-03
+1.687227e-03
+1.671092e-03
+1.654807e-03
+1.638372e-03
+1.621785e-03
+1.605044e-03
+1.588148e-03
+1.571096e-03
+1.553887e-03
+1.536518e-03
+1.518988e-03
+1.501296e-03
+1.483441e-03
+1.465420e-03
+1.447232e-03
+
+# Mg
+
+10 0.0039994
+0.000000e+00
+2.729427e-05
+5.484093e-05
+8.264254e-05
+1.107017e-04
+1.390197e-04
+1.676001e-04
+1.964450e-04
+2.255568e-04
+2.549377e-04
+2.845905e-04
+3.145176e-04
+3.447214e-04
+3.752052e-04
+4.059703e-04
+4.370208e-04
+4.683577e-04
+4.999852e-04
+5.319051e-04
+5.641200e-04
+5.966332e-04
+6.294474e-04
+6.625648e-04
+6.959888e-04
+7.297220e-04
+7.637676e-04
+7.981276e-04
+8.328056e-04
+8.678043e-04
+9.317882e-04
+1.024040e-03
+1.117147e-03
+1.211116e-03
+1.305954e-03
+1.401668e-03
+1.498269e-03
+1.595763e-03
+1.694159e-03
+1.793465e-03
+1.893690e-03
+1.994842e-03
+2.096931e-03
+2.199961e-03
+2.303947e-03
+2.408895e-03
+2.427621e-03
+2.443863e-03
+2.460256e-03
+2.476800e-03
+2.493497e-03
+2.510348e-03
+2.527356e-03
+2.544520e-03
+2.561844e-03
+2.579328e-03
+2.596974e-03
+2.614783e-03
+2.632756e-03
+2.650896e-03
+2.669204e-03
+2.687681e-03
+2.706329e-03
+2.725150e-03
+2.744144e-03
+2.851233e-03
+3.383711e-03
+3.921118e-03
+4.463498e-03
+5.010888e-03
+5.563356e-03
+6.120924e-03
+6.683651e-03
+7.251590e-03
+7.824786e-03
+8.403283e-03
+8.987114e-03
+9.146377e-03
+9.148277e-03
+9.150195e-03
+9.152131e-03
+9.154084e-03
+9.156055e-03
+9.158044e-03
+9.160053e-03
+9.162080e-03
+9.164126e-03
+9.166189e-03
+9.168272e-03
+9.170374e-03
+9.172498e-03
+9.174638e-03
+9.176800e-03
+9.178982e-03
+9.181184e-03
+9.183406e-03
+9.185649e-03
+9.187912e-03
+9.190196e-03
+9.192501e-03
+9.194829e-03
+9.223163e-03
+9.277867e-03
+9.333077e-03
+9.388799e-03
+9.445035e-03
+9.501792e-03
+9.559073e-03
+9.616885e-03
+9.675231e-03
+9.734117e-03
+9.793549e-03
+9.853529e-03
+9.914066e-03
+9.975161e-03
+1.003682e-02
+1.009905e-02
+1.016186e-02
+1.022525e-02
+1.028922e-02
+1.035379e-02
+1.041896e-02
+1.048472e-02
+1.055110e-02
+1.061809e-02
+1.068570e-02
+1.075393e-02
+1.082280e-02
+1.089230e-02
+1.096245e-02
+1.103324e-02
+1.110469e-02
+1.117680e-02
+1.124958e-02
+1.132303e-02
+1.139716e-02
+1.147198e-02
+1.154749e-02
+1.162369e-02
+1.170061e-02
+1.177823e-02
+1.185657e-02
+1.193564e-02
+1.201544e-02
+1.209598e-02
+1.217726e-02
+1.225929e-02
+1.234208e-02
+1.242564e-02
+1.250997e-02
+1.259509e-02
+1.268099e-02
+1.275091e-02
+1.280189e-02
+1.285334e-02
+1.290527e-02
+1.295768e-02
+1.301058e-02
+1.306396e-02
+1.311783e-02
+1.317221e-02
+1.322709e-02
+1.328248e-02
+1.333837e-02
+1.339479e-02
+1.345173e-02
+1.350919e-02
+1.356719e-02
+1.362572e-02
+1.368479e-02
+1.374442e-02
+1.380459e-02
+1.386532e-02
+1.392661e-02
+1.398846e-02
+1.405089e-02
+1.411390e-02
+1.417749e-02
+1.424167e-02
+1.430644e-02
+1.437181e-02
+1.443779e-02
+1.450438e-02
+1.457158e-02
+1.463941e-02
+1.470786e-02
+1.477695e-02
+1.484667e-02
+1.491704e-02
+1.498806e-02
+1.505974e-02
+1.513208e-02
+1.520509e-02
+1.527877e-02
+1.535314e-02
+1.542820e-02
+1.550395e-02
+1.558040e-02
+1.565756e-02
+1.573543e-02
+1.581402e-02
+
+# O
+
+10 0.0039994
+0.000000e+00
+3.581978e-04
+7.197112e-04
+1.084566e-03
+1.452804e-03
+1.824435e-03
+2.199516e-03
+2.578061e-03
+2.960116e-03
+3.345698e-03
+3.734849e-03
+4.127599e-03
+4.523989e-03
+4.924040e-03
+5.327791e-03
+5.735282e-03
+6.146539e-03
+6.561607e-03
+6.980509e-03
+7.403284e-03
+7.829975e-03
+8.260611e-03
+8.695234e-03
+9.133875e-03
+9.576574e-03
+1.002337e-02
+1.047430e-02
+1.092941e-02
+1.138872e-02
+1.201160e-02
+1.279408e-02
+1.358380e-02
+1.438084e-02
+1.518524e-02
+1.599708e-02
+1.681644e-02
+1.764338e-02
+1.847796e-02
+1.932028e-02
+2.017038e-02
+2.102835e-02
+2.189425e-02
+2.276816e-02
+2.365016e-02
+2.454032e-02
+2.546063e-02
+2.639012e-02
+2.732821e-02
+2.827498e-02
+2.923050e-02
+3.019486e-02
+3.116815e-02
+3.215043e-02
+3.314182e-02
+3.414236e-02
+3.515217e-02
+3.617133e-02
+3.719991e-02
+3.823800e-02
+3.928570e-02
+4.034308e-02
+4.141025e-02
+4.248730e-02
+4.357432e-02
+4.490967e-02
+4.740754e-02
+4.992853e-02
+5.247284e-02
+5.504072e-02
+5.763231e-02
+6.024793e-02
+6.288771e-02
+6.555194e-02
+6.824079e-02
+7.095453e-02
+7.369339e-02
+7.566179e-02
+7.735445e-02
+7.906280e-02
+8.078691e-02
+8.252700e-02
+8.428320e-02
+8.605565e-02
+8.784446e-02
+8.964983e-02
+9.147193e-02
+9.331087e-02
+9.516682e-02
+9.703992e-02
+9.893038e-02
+1.008383e-01
+1.027639e-01
+1.047073e-01
+1.066687e-01
+1.086482e-01
+1.106461e-01
+1.126624e-01
+1.146974e-01
+1.167512e-01
+1.188240e-01
+1.206974e-01
+1.223686e-01
+1.240551e-01
+1.257574e-01
+1.274753e-01
+1.292091e-01
+1.309590e-01
+1.327251e-01
+1.345075e-01
+1.363064e-01
+1.381219e-01
+1.399542e-01
+1.418035e-01
+1.436699e-01
+1.455536e-01
+1.474547e-01
+1.493733e-01
+1.513098e-01
+1.532641e-01
+1.552365e-01
+1.572272e-01
+1.592363e-01
+1.612640e-01
+1.633104e-01
+1.653758e-01
+1.674602e-01
+1.695640e-01
+1.716872e-01
+1.738301e-01
+1.759928e-01
+1.781755e-01
+1.803783e-01
+1.826016e-01
+1.848455e-01
+1.871101e-01
+1.893956e-01
+1.917023e-01
+1.940303e-01
+1.963799e-01
+1.987512e-01
+2.011445e-01
+2.035598e-01
+2.059976e-01
+2.084579e-01
+2.109409e-01
+2.134469e-01
+2.159761e-01
+2.185287e-01
+2.211050e-01
+2.237050e-01
+2.263291e-01
+2.281939e-01
+2.291604e-01
+2.301358e-01
+2.311203e-01
+2.321138e-01
+2.331166e-01
+2.341286e-01
+2.351500e-01
+2.361808e-01
+2.372212e-01
+2.382712e-01
+2.393309e-01
+2.404005e-01
+2.414799e-01
+2.425693e-01
+2.436688e-01
+2.447784e-01
+2.458983e-01
+2.470286e-01
+2.481694e-01
+2.493207e-01
+2.504826e-01
+2.516553e-01
+2.528389e-01
+2.540333e-01
+2.552389e-01
+2.564555e-01
+2.576835e-01
+2.589228e-01
+2.601736e-01
+2.614359e-01
+2.627100e-01
+2.639958e-01
+2.652935e-01
+2.666032e-01
+2.679251e-01
+2.692591e-01
+2.706055e-01
+2.719644e-01
+2.733358e-01
+2.747199e-01
+2.761168e-01
+2.775267e-01
+2.789496e-01
+2.803856e-01
+2.818350e-01
+2.832977e-01
+2.847740e-01
+2.862639e-01
+
+# Si
+
+10 0.0039994
+0.000000e+00
+1.647919e-04
+3.311113e-04
+4.989672e-04
+6.683748e-04
+8.393489e-04
+1.011908e-03
+1.186064e-03
+1.361826e-03
+1.539219e-03
+1.718255e-03
+1.898943e-03
+2.081303e-03
+2.265351e-03
+2.451101e-03
+2.638571e-03
+2.827771e-03
+3.018728e-03
+3.211448e-03
+3.405951e-03
+3.602253e-03
+3.800372e-03
+4.000323e-03
+4.202126e-03
+4.405793e-03
+4.611347e-03
+4.818801e-03
+5.028177e-03
+5.239485e-03
+5.341187e-03
+5.336084e-03
+5.330936e-03
+5.325740e-03
+5.320495e-03
+5.315203e-03
+5.309861e-03
+5.304470e-03
+5.299029e-03
+5.293537e-03
+5.287995e-03
+5.282401e-03
+5.276756e-03
+5.271059e-03
+5.265309e-03
+5.259505e-03
+5.252654e-03
+5.245711e-03
+5.238703e-03
+5.231630e-03
+5.224491e-03
+5.217287e-03
+5.210016e-03
+5.202678e-03
+5.195271e-03
+5.187796e-03
+5.180253e-03
+5.172640e-03
+5.164955e-03
+5.157200e-03
+5.149373e-03
+5.141474e-03
+5.133501e-03
+5.125455e-03
+5.117334e-03
+5.110397e-03
+5.109475e-03
+5.108545e-03
+5.107606e-03
+5.106658e-03
+5.105702e-03
+5.104736e-03
+5.103762e-03
+5.102778e-03
+5.101786e-03
+5.100784e-03
+5.099773e-03
+5.087926e-03
+5.071969e-03
+5.055865e-03
+5.039612e-03
+5.023208e-03
+5.006652e-03
+4.989943e-03
+4.973081e-03
+4.956061e-03
+4.938885e-03
+4.921549e-03
+4.904053e-03
+4.886395e-03
+4.868574e-03
+4.850588e-03
+4.832436e-03
+4.814115e-03
+4.795626e-03
+4.776965e-03
+4.758131e-03
+4.739123e-03
+4.719939e-03
+4.700578e-03
+4.681039e-03
+4.736514e-03
+4.868046e-03
+5.000794e-03
+5.134774e-03
+5.269991e-03
+5.406459e-03
+5.544189e-03
+5.683195e-03
+5.823486e-03
+5.965075e-03
+6.107974e-03
+6.252194e-03
+6.397749e-03
+6.544652e-03
+6.692913e-03
+6.842544e-03
+6.993561e-03
+7.145975e-03
+7.299799e-03
+7.455047e-03
+7.611730e-03
+7.769864e-03
+7.929458e-03
+8.090530e-03
+8.253093e-03
+8.417159e-03
+8.582744e-03
+8.749861e-03
+8.918521e-03
+9.088744e-03
+9.260543e-03
+9.433926e-03
+9.608919e-03
+9.785530e-03
+9.963773e-03
+1.014367e-02
+1.032522e-02
+1.050846e-02
+1.069339e-02
+1.088003e-02
+1.106840e-02
+1.125851e-02
+1.145039e-02
+1.164403e-02
+1.183947e-02
+1.203672e-02
+1.223579e-02
+1.243670e-02
+1.263947e-02
+1.284412e-02
+1.305066e-02
+1.316588e-02
+1.317325e-02
+1.318068e-02
+1.318819e-02
+1.319576e-02
+1.320340e-02
+1.321112e-02
+1.321890e-02
+1.322676e-02
+1.323469e-02
+1.324269e-02
+1.325077e-02
+1.325892e-02
+1.326715e-02
+1.327545e-02
+1.328383e-02
+1.329229e-02
+1.330082e-02
+1.330944e-02
+1.331813e-02
+1.332691e-02
+1.333576e-02
+1.334470e-02
+1.335372e-02
+1.336283e-02
+1.337201e-02
+1.338129e-02
+1.339065e-02
+1.340009e-02
+1.340963e-02
+1.341925e-02
+1.342896e-02
+1.343876e-02
+1.344865e-02
+1.345863e-02
+1.346871e-02
+1.347887e-02
+1.348914e-02
+1.349949e-02
+1.350995e-02
+1.352050e-02
+1.353114e-02
+1.354189e-02
+1.355273e-02
+1.356368e-02
+1.357473e-02
+1.358587e-02
+1.359713e-02
+1.360848e-02
+
+# Ca
+
+10 0.0039994
+0.000000e+00
+6.319722e-06
+1.269794e-05
+1.913513e-05
+2.563192e-05
+3.218872e-05
+3.880629e-05
+4.548504e-05
+5.222566e-05
+5.902845e-05
+6.589439e-05
+7.282372e-05
+7.981720e-05
+8.687540e-05
+9.399885e-05
+1.011882e-04
+1.084440e-04
+1.157671e-04
+1.231579e-04
+1.306169e-04
+1.381451e-04
+1.457428e-04
+1.534108e-04
+1.611499e-04
+1.689605e-04
+1.768435e-04
+1.847992e-04
+1.928287e-04
+2.009323e-04
+2.096396e-04
+2.189380e-04
+2.283224e-04
+2.377937e-04
+2.473525e-04
+2.569997e-04
+2.667365e-04
+2.765630e-04
+2.864805e-04
+2.964897e-04
+3.065917e-04
+3.167871e-04
+3.270766e-04
+3.374615e-04
+3.479424e-04
+3.585204e-04
+3.555420e-04
+3.521198e-04
+3.486660e-04
+3.451802e-04
+3.416622e-04
+3.381117e-04
+3.345282e-04
+3.309117e-04
+3.272617e-04
+3.235779e-04
+3.198601e-04
+3.161077e-04
+3.123208e-04
+3.084988e-04
+3.046415e-04
+3.007484e-04
+2.968193e-04
+2.928539e-04
+2.888518e-04
+2.838280e-04
+2.740046e-04
+2.640901e-04
+2.540839e-04
+2.439853e-04
+2.337932e-04
+2.235067e-04
+2.131250e-04
+2.026473e-04
+1.920728e-04
+1.814004e-04
+1.706292e-04
+1.698743e-04
+1.728490e-04
+1.758513e-04
+1.788813e-04
+1.819394e-04
+1.850258e-04
+1.881408e-04
+1.912845e-04
+1.944573e-04
+1.976595e-04
+2.008914e-04
+2.041531e-04
+2.074450e-04
+2.107673e-04
+2.141204e-04
+2.175045e-04
+2.209199e-04
+2.243669e-04
+2.278458e-04
+2.313569e-04
+2.349004e-04
+2.384768e-04
+2.420863e-04
+2.457291e-04
+2.506458e-04
+2.568538e-04
+2.631194e-04
+2.694429e-04
+2.758249e-04
+2.822659e-04
+2.887664e-04
+2.953272e-04
+3.019487e-04
+3.086314e-04
+3.153759e-04
+3.221828e-04
+3.290528e-04
+3.359862e-04
+3.429838e-04
+3.500461e-04
+3.571738e-04
+3.643674e-04
+3.716276e-04
+3.789549e-04
+3.863501e-04
+3.938136e-04
+4.013462e-04
+4.089485e-04
+4.166210e-04
+4.243647e-04
+4.321799e-04
+4.400675e-04
+4.480279e-04
+4.560622e-04
+4.641706e-04
+4.723541e-04
+4.806134e-04
+4.889490e-04
+4.973617e-04
+5.058523e-04
+5.144214e-04
+5.230698e-04
+5.317982e-04
+5.406074e-04
+5.494981e-04
+5.584709e-04
+5.675268e-04
+5.766666e-04
+5.858907e-04
+5.952004e-04
+6.045962e-04
+6.140787e-04
+6.236491e-04
+6.333081e-04
+6.430563e-04
+6.464238e-04
+6.422617e-04
+6.380611e-04
+6.338217e-04
+6.295431e-04
+6.252248e-04
+6.208667e-04
+6.164681e-04
+6.120290e-04
+6.075487e-04
+6.030269e-04
+5.984635e-04
+5.938576e-04
+5.892093e-04
+5.845180e-04
+5.797831e-04
+5.750046e-04
+5.701818e-04
+5.653143e-04
+5.604020e-04
+5.554440e-04
+5.504403e-04
+5.453903e-04
+5.402935e-04
+5.351495e-04
+5.299580e-04
+5.247185e-04
+5.194306e-04
+5.140936e-04
+5.087072e-04
+5.032712e-04
+4.977846e-04
+4.922475e-04
+4.866590e-04
+4.810190e-04
+4.753267e-04
+4.695817e-04
+4.637835e-04
+4.579318e-04
+4.520259e-04
+4.460654e-04
+4.400497e-04
+4.339784e-04
+4.278509e-04
+4.216667e-04
+4.154253e-04
+4.091263e-04
+4.027688e-04
+3.963525e-04
+
+# Metals
+
+10 0.0039994
+0.000000e+00
+1.070708e-03
+2.151318e-03
+3.241926e-03
+4.342638e-03
+5.453505e-03
+6.574661e-03
+7.706203e-03
+8.848213e-03
+1.000077e-02
+1.116401e-02
+1.233798e-02
+1.352285e-02
+1.471866e-02
+1.592553e-02
+1.714358e-02
+1.837287e-02
+1.961356e-02
+2.086573e-02
+2.212947e-02
+2.340491e-02
+2.469213e-02
+2.599125e-02
+2.730238e-02
+2.862566e-02
+2.996118e-02
+3.130905e-02
+3.266938e-02
+3.404230e-02
+3.533176e-02
+3.654025e-02
+3.775990e-02
+3.899088e-02
+4.023322e-02
+4.148704e-02
+4.275249e-02
+4.402962e-02
+4.531859e-02
+4.661947e-02
+4.793239e-02
+4.925746e-02
+5.059478e-02
+5.194445e-02
+5.330665e-02
+5.468144e-02
+5.589831e-02
+5.712123e-02
+5.835548e-02
+5.960116e-02
+6.085835e-02
+6.212717e-02
+6.340776e-02
+6.470016e-02
+6.600451e-02
+6.732095e-02
+6.864958e-02
+6.999048e-02
+7.134379e-02
+7.270962e-02
+7.408809e-02
+7.547931e-02
+7.688339e-02
+7.830047e-02
+7.973066e-02
+8.140108e-02
+8.418250e-02
+8.698966e-02
+8.982284e-02
+9.268221e-02
+9.556805e-02
+9.848054e-02
+1.014200e-01
+1.043867e-01
+1.073808e-01
+1.104026e-01
+1.134524e-01
+1.158151e-01
+1.179355e-01
+1.200755e-01
+1.222353e-01
+1.244151e-01
+1.266151e-01
+1.288354e-01
+1.310762e-01
+1.333378e-01
+1.356203e-01
+1.379240e-01
+1.402489e-01
+1.425953e-01
+1.449635e-01
+1.473536e-01
+1.497657e-01
+1.522002e-01
+1.546572e-01
+1.571369e-01
+1.596397e-01
+1.621655e-01
+1.647147e-01
+1.672875e-01
+1.698841e-01
+1.720806e-01
+1.738713e-01
+1.756786e-01
+1.775027e-01
+1.793436e-01
+1.812016e-01
+1.830767e-01
+1.849692e-01
+1.868792e-01
+1.888068e-01
+1.907524e-01
+1.927158e-01
+1.946975e-01
+1.966975e-01
+1.987160e-01
+2.007532e-01
+2.028092e-01
+2.048842e-01
+2.069785e-01
+2.090921e-01
+2.112253e-01
+2.133782e-01
+2.155510e-01
+2.177439e-01
+2.199571e-01
+2.221908e-01
+2.244451e-01
+2.267203e-01
+2.290166e-01
+2.313341e-01
+2.336730e-01
+2.360336e-01
+2.384160e-01
+2.408205e-01
+2.432472e-01
+2.456963e-01
+2.481682e-01
+2.506628e-01
+2.531806e-01
+2.557216e-01
+2.582862e-01
+2.608745e-01
+2.634867e-01
+2.661231e-01
+2.687839e-01
+2.714693e-01
+2.741796e-01
+2.769148e-01
+2.796755e-01
+2.824617e-01
+2.852736e-01
+2.873352e-01
+2.885089e-01
+2.896935e-01
+2.908890e-01
+2.920955e-01
+2.933132e-01
+2.945421e-01
+2.957825e-01
+2.970343e-01
+2.982977e-01
+2.995728e-01
+3.008597e-01
+3.021585e-01
+3.034693e-01
+3.047922e-01
+3.061274e-01
+3.074749e-01
+3.088349e-01
+3.102075e-01
+3.115928e-01
+3.129908e-01
+3.144018e-01
+3.158259e-01
+3.172632e-01
+3.187137e-01
+3.201777e-01
+3.216552e-01
+3.231463e-01
+3.246513e-01
+3.261702e-01
+3.277032e-01
+3.292503e-01
+3.308118e-01
+3.323877e-01
+3.339781e-01
+3.355833e-01
+3.372034e-01
+3.388384e-01
+3.404885e-01
+3.421539e-01
+3.438348e-01
+3.455311e-01
+3.472432e-01
+3.489711e-01
+3.507150e-01
+3.524750e-01
+3.542513e-01
+3.560441e-01
+3.578534e-01
+
+#### Metal Ejecta Parameters ####
+
+# Number of points / Number of elements
+200 6
+
+# IEj
+
+0.05 0.0155624
+8.206815e-05
+2.370714e-04
+4.047551e-04
+5.862745e-04
+7.828567e-04
+9.958115e-04
+1.226530e-03
+1.477058e-03
+1.748617e-03
+2.042938e-03
+2.362879e-03
+2.709811e-03
+3.086701e-03
+3.495351e-03
+3.923152e-03
+4.364125e-03
+4.818805e-03
+5.287757e-03
+5.771519e-03
+6.270749e-03
+6.786058e-03
+7.318125e-03
+7.867619e-03
+8.435268e-03
+9.021813e-03
+9.628053e-03
+1.025482e-02
+1.090293e-02
+1.157330e-02
+1.226686e-02
+1.298458e-02
+1.372747e-02
+1.449659e-02
+1.529304e-02
+1.611798e-02
+1.697260e-02
+1.785816e-02
+1.877598e-02
+1.972741e-02
+2.071389e-02
+2.173691e-02
+2.279802e-02
+2.389884e-02
+2.504107e-02
+2.622646e-02
+2.745688e-02
+2.873424e-02
+3.006056e-02
+3.143792e-02
+3.286853e-02
+3.435466e-02
+3.589871e-02
+3.750316e-02
+3.917060e-02
+4.090377e-02
+4.270547e-02
+4.457868e-02
+4.652649e-02
+4.855209e-02
+5.065887e-02
+5.285032e-02
+5.513012e-02
+5.750208e-02
+5.997020e-02
+6.253864e-02
+6.518428e-02
+6.785256e-02
+7.054213e-02
+7.325339e-02
+7.598678e-02
+7.874273e-02
+8.152161e-02
+8.432387e-02
+8.714992e-02
+9.000015e-02
+9.287501e-02
+9.577491e-02
+9.870028e-02
+1.016515e-01
+1.046291e-01
+1.076333e-01
+1.106647e-01
+1.137237e-01
+1.168107e-01
+1.199263e-01
+1.230735e-01
+1.262540e-01
+1.294692e-01
+1.327203e-01
+1.360089e-01
+1.393363e-01
+1.427040e-01
+1.461135e-01
+1.495662e-01
+1.530639e-01
+1.566079e-01
+1.601764e-01
+1.637549e-01
+1.673445e-01
+1.709463e-01
+1.745754e-01
+1.782619e-01
+1.820087e-01
+1.858174e-01
+1.896309e-01
+1.934048e-01
+1.971397e-01
+2.008358e-01
+2.044937e-01
+2.081138e-01
+2.117050e-01
+2.152829e-01
+2.188487e-01
+2.224031e-01
+2.259470e-01
+2.294789e-01
+2.329939e-01
+2.364924e-01
+2.399752e-01
+2.434418e-01
+2.468832e-01
+2.502979e-01
+2.536866e-01
+2.570437e-01
+2.603533e-01
+2.636164e-01
+2.668394e-01
+2.700189e-01
+2.731374e-01
+2.761648e-01
+2.791540e-01
+2.821150e-01
+2.850484e-01
+2.879544e-01
+2.908340e-01
+2.936923e-01
+2.965309e-01
+2.993504e-01
+3.021510e-01
+3.049335e-01
+3.076982e-01
+3.104457e-01
+3.131764e-01
+3.158896e-01
+3.185854e-01
+3.212645e-01
+3.239272e-01
+3.265741e-01
+3.292055e-01
+3.318135e-01
+3.343935e-01
+3.369458e-01
+3.394706e-01
+3.419683e-01
+3.444391e-01
+3.468834e-01
+3.493048e-01
+3.517101e-01
+3.541000e-01
+3.564748e-01
+3.588339e-01
+3.611758e-01
+3.635008e-01
+3.658094e-01
+3.681019e-01
+3.703770e-01
+3.726307e-01
+3.748631e-01
+3.770735e-01
+3.792603e-01
+3.814238e-01
+3.835641e-01
+3.856816e-01
+3.877764e-01
+3.898494e-01
+3.919030e-01
+3.939377e-01
+3.959539e-01
+3.979518e-01
+3.999317e-01
+4.018940e-01
+4.038388e-01
+4.057665e-01
+4.076773e-01
+4.095715e-01
+4.114494e-01
+4.133112e-01
+4.151571e-01
+4.169855e-01
+4.187966e-01
+4.205903e-01
+4.223672e-01
+4.241273e-01
+4.258709e-01
+4.275983e-01
+4.293097e-01
+4.310052e-01
+4.326852e-01
+4.343499e-01
+4.359994e-01
+
+# IEjnp
+
+0.05 0.0155624
+8.206815e-05
+2.370714e-04
+4.047551e-04
+5.862745e-04
+7.828567e-04
+9.958115e-04
+1.226530e-03
+1.477058e-03
+1.748617e-03
+2.042938e-03
+2.362879e-03
+2.709811e-03
+3.086701e-03
+3.495351e-03
+3.923152e-03
+4.364125e-03
+4.818805e-03
+5.287757e-03
+5.771519e-03
+6.270749e-03
+6.786058e-03
+7.318125e-03
+7.867619e-03
+8.435268e-03
+9.021813e-03
+9.628053e-03
+1.025482e-02
+1.090293e-02
+1.157330e-02
+1.226686e-02
+1.298458e-02
+1.372747e-02
+1.449659e-02
+1.529304e-02
+1.611798e-02
+1.697260e-02
+1.785816e-02
+1.877598e-02
+1.972741e-02
+2.071389e-02
+2.173691e-02
+2.279802e-02
+2.389884e-02
+2.504107e-02
+2.622646e-02
+2.745688e-02
+2.873424e-02
+3.006056e-02
+3.143792e-02
+3.286853e-02
+3.435466e-02
+3.589871e-02
+3.750316e-02
+3.917060e-02
+4.090377e-02
+4.270547e-02
+4.457868e-02
+4.652649e-02
+4.855209e-02
+5.065887e-02
+5.285032e-02
+5.513012e-02
+5.750208e-02
+5.997020e-02
+6.253864e-02
+6.518428e-02
+6.785256e-02
+7.054213e-02
+7.325339e-02
+7.598678e-02
+7.874273e-02
+8.152161e-02
+8.432387e-02
+8.714992e-02
+9.000015e-02
+9.287501e-02
+9.577491e-02
+9.870028e-02
+1.016515e-01
+1.046291e-01
+1.076333e-01
+1.106647e-01
+1.137237e-01
+1.168107e-01
+1.199263e-01
+1.230735e-01
+1.262540e-01
+1.294692e-01
+1.327203e-01
+1.360089e-01
+1.393363e-01
+1.427040e-01
+1.461135e-01
+1.495662e-01
+1.530639e-01
+1.566079e-01
+1.601764e-01
+1.637549e-01
+1.673445e-01
+1.709463e-01
+1.745754e-01
+1.782619e-01
+1.820087e-01
+1.858174e-01
+1.896309e-01
+1.934048e-01
+1.971397e-01
+2.008358e-01
+2.044937e-01
+2.081138e-01
+2.117050e-01
+2.152829e-01
+2.188487e-01
+2.224031e-01
+2.259470e-01
+2.294789e-01
+2.329939e-01
+2.364924e-01
+2.399752e-01
+2.434418e-01
+2.468832e-01
+2.502979e-01
+2.536866e-01
+2.570437e-01
+2.603533e-01
+2.636164e-01
+2.668394e-01
+2.700189e-01
+2.731374e-01
+2.761648e-01
+2.791540e-01
+2.821150e-01
+2.850484e-01
+2.879544e-01
+2.908340e-01
+2.936923e-01
+2.965309e-01
+2.993504e-01
+3.021510e-01
+3.049335e-01
+3.076982e-01
+3.104457e-01
+3.131764e-01
+3.158896e-01
+3.185854e-01
+3.212645e-01
+3.239272e-01
+3.265741e-01
+3.292050e-01
+3.317812e-01
+3.342795e-01
+3.366995e-01
+3.390406e-01
+3.413024e-01
+3.434843e-01
+3.455858e-01
+3.476235e-01
+3.496303e-01
+3.516071e-01
+3.535541e-01
+3.554726e-01
+3.573653e-01
+3.592322e-01
+3.610736e-01
+3.628896e-01
+3.646771e-01
+3.664278e-01
+3.681412e-01
+3.698213e-01
+3.714761e-01
+3.731061e-01
+3.747112e-01
+3.762917e-01
+3.778475e-01
+3.793783e-01
+3.808821e-01
+3.823586e-01
+3.838080e-01
+3.852301e-01
+3.866250e-01
+3.879927e-01
+3.893331e-01
+3.906463e-01
+3.919321e-01
+3.931905e-01
+3.944216e-01
+3.956251e-01
+3.968021e-01
+3.979597e-01
+3.990995e-01
+4.002213e-01
+4.013254e-01
+4.024118e-01
+4.034804e-01
+4.045314e-01
+4.055647e-01
+4.065804e-01
+4.075785e-01
+4.085590e-01
+4.095219e-01
+
+# IFe
+
+10 0.0039994
+1.665512e-11
+1.445769e-07
+5.727998e-07
+1.285749e-06
+2.284491e-06
+3.570094e-06
+5.143651e-06
+7.006223e-06
+9.158961e-06
+1.160294e-05
+1.433928e-05
+1.736911e-05
+2.069361e-05
+2.431386e-05
+2.823104e-05
+3.244632e-05
+3.696085e-05
+4.177593e-05
+4.689256e-05
+5.231221e-05
+5.803577e-05
+6.406469e-05
+7.040019e-05
+7.704343e-05
+8.399581e-05
+9.125844e-05
+9.883253e-05
+1.067197e-04
+1.149208e-04
+1.233814e-04
+1.317888e-04
+1.400945e-04
+1.482981e-04
+1.563993e-04
+1.643982e-04
+1.722943e-04
+1.800873e-04
+1.877772e-04
+1.953637e-04
+2.028464e-04
+2.102251e-04
+2.174998e-04
+2.246698e-04
+2.317352e-04
+2.386956e-04
+2.455092e-04
+2.521302e-04
+2.585579e-04
+2.647918e-04
+2.708312e-04
+2.766756e-04
+2.823243e-04
+2.877767e-04
+2.930322e-04
+2.980902e-04
+3.029499e-04
+3.076109e-04
+3.120723e-04
+3.163335e-04
+3.203940e-04
+3.242529e-04
+3.279097e-04
+3.313638e-04
+3.346142e-04
+3.376630e-04
+3.406118e-04
+3.435141e-04
+3.463696e-04
+3.491782e-04
+3.519398e-04
+3.546542e-04
+3.573214e-04
+3.599413e-04
+3.625136e-04
+3.650383e-04
+3.675152e-04
+3.699454e-04
+3.723321e-04
+3.746752e-04
+3.769746e-04
+3.792302e-04
+3.814419e-04
+3.836096e-04
+3.857331e-04
+3.878123e-04
+3.898471e-04
+3.918373e-04
+3.937829e-04
+3.956836e-04
+3.975395e-04
+3.993502e-04
+4.011158e-04
+4.028360e-04
+4.045107e-04
+4.061398e-04
+4.077232e-04
+4.092607e-04
+4.107521e-04
+4.121974e-04
+4.135963e-04
+4.149541e-04
+4.163015e-04
+4.176435e-04
+4.189804e-04
+4.203120e-04
+4.216383e-04
+4.229594e-04
+4.242752e-04
+4.255858e-04
+4.268911e-04
+4.281912e-04
+4.294861e-04
+4.307757e-04
+4.320602e-04
+4.333393e-04
+4.346133e-04
+4.358821e-04
+4.371456e-04
+4.384039e-04
+4.396571e-04
+4.409050e-04
+4.421478e-04
+4.433853e-04
+4.446176e-04
+4.458448e-04
+4.470668e-04
+4.482836e-04
+4.494952e-04
+4.507016e-04
+4.519029e-04
+4.530989e-04
+4.542898e-04
+4.554755e-04
+4.566561e-04
+4.578315e-04
+4.590017e-04
+4.601668e-04
+4.613267e-04
+4.624814e-04
+4.636311e-04
+4.647755e-04
+4.659148e-04
+4.670489e-04
+4.681778e-04
+4.693017e-04
+4.704203e-04
+4.715339e-04
+4.726422e-04
+4.737455e-04
+4.748435e-04
+4.759365e-04
+4.770238e-04
+4.781028e-04
+4.791730e-04
+4.802342e-04
+4.812864e-04
+4.823297e-04
+4.833640e-04
+4.843894e-04
+4.854057e-04
+4.864131e-04
+4.874115e-04
+4.884008e-04
+4.893810e-04
+4.903522e-04
+4.913143e-04
+4.922673e-04
+4.932111e-04
+4.941458e-04
+4.950714e-04
+4.959877e-04
+4.968950e-04
+4.977930e-04
+4.986817e-04
+4.995613e-04
+5.004315e-04
+5.012925e-04
+5.021442e-04
+5.029865e-04
+5.038196e-04
+5.046433e-04
+5.054576e-04
+5.062625e-04
+5.070579e-04
+5.078440e-04
+5.086206e-04
+5.093876e-04
+5.101453e-04
+5.108934e-04
+5.116319e-04
+5.123609e-04
+5.130803e-04
+5.137900e-04
+5.144902e-04
+5.151806e-04
+5.158615e-04
+5.165326e-04
+5.171939e-04
+5.178455e-04
+5.184874e-04
+
+# IMg
+
+10 0.0039994
+1.222134e-12
+1.059811e-08
+4.198955e-08
+9.425230e-08
+1.674662e-07
+2.617071e-07
+3.770574e-07
+5.135953e-07
+6.714017e-07
+8.505576e-07
+1.051147e-06
+1.273247e-06
+1.516952e-06
+1.782333e-06
+2.069482e-06
+2.378485e-06
+2.709428e-06
+3.062396e-06
+3.437479e-06
+3.834757e-06
+4.254329e-06
+4.696285e-06
+5.160709e-06
+5.647693e-06
+6.157337e-06
+6.689726e-06
+7.244951e-06
+7.823113e-06
+8.424300e-06
+9.053940e-06
+9.741809e-06
+1.049274e-05
+1.130700e-05
+1.218483e-05
+1.312645e-05
+1.413215e-05
+1.520217e-05
+1.633676e-05
+1.753621e-05
+1.880074e-05
+2.013062e-05
+2.152614e-05
+2.298754e-05
+2.451512e-05
+2.610912e-05
+2.774093e-05
+2.937911e-05
+3.102372e-05
+3.267483e-05
+3.433245e-05
+3.599667e-05
+3.766750e-05
+3.934506e-05
+4.102936e-05
+4.272044e-05
+4.441841e-05
+4.612330e-05
+4.783513e-05
+4.955399e-05
+5.127995e-05
+5.301302e-05
+5.475331e-05
+5.650085e-05
+5.825570e-05
+6.002313e-05
+6.201422e-05
+6.434027e-05
+6.700259e-05
+7.000237e-05
+7.334095e-05
+7.701968e-05
+8.103979e-05
+8.540275e-05
+9.010971e-05
+9.516228e-05
+1.005615e-04
+1.062105e-04
+1.118576e-04
+1.174903e-04
+1.231087e-04
+1.287127e-04
+1.343025e-04
+1.398780e-04
+1.454394e-04
+1.509867e-04
+1.565199e-04
+1.620391e-04
+1.675443e-04
+1.730355e-04
+1.785129e-04
+1.839765e-04
+1.894262e-04
+1.948623e-04
+2.002845e-04
+2.056932e-04
+2.110882e-04
+2.164697e-04
+2.218377e-04
+2.271922e-04
+2.325333e-04
+2.378648e-04
+2.432094e-04
+2.485709e-04
+2.539495e-04
+2.593453e-04
+2.647585e-04
+2.701894e-04
+2.756378e-04
+2.811043e-04
+2.865887e-04
+2.920914e-04
+2.976124e-04
+3.031519e-04
+3.087103e-04
+3.142874e-04
+3.198836e-04
+3.254990e-04
+3.311338e-04
+3.367882e-04
+3.424623e-04
+3.481563e-04
+3.538704e-04
+3.596047e-04
+3.653596e-04
+3.711350e-04
+3.769311e-04
+3.827483e-04
+3.885867e-04
+3.944463e-04
+4.003275e-04
+4.062304e-04
+4.121552e-04
+4.181020e-04
+4.240711e-04
+4.300626e-04
+4.360769e-04
+4.421140e-04
+4.481740e-04
+4.542573e-04
+4.603641e-04
+4.664944e-04
+4.726484e-04
+4.788265e-04
+4.850289e-04
+4.912555e-04
+4.975068e-04
+5.037830e-04
+5.100841e-04
+5.164105e-04
+5.227622e-04
+5.291396e-04
+5.355407e-04
+5.419524e-04
+5.483720e-04
+5.547997e-04
+5.612356e-04
+5.676799e-04
+5.741327e-04
+5.805942e-04
+5.870645e-04
+5.935438e-04
+6.000321e-04
+6.065298e-04
+6.130368e-04
+6.195535e-04
+6.260797e-04
+6.326160e-04
+6.391622e-04
+6.457185e-04
+6.522854e-04
+6.588625e-04
+6.654504e-04
+6.720489e-04
+6.786586e-04
+6.852793e-04
+6.919113e-04
+6.985547e-04
+7.052098e-04
+7.118766e-04
+7.185552e-04
+7.252460e-04
+7.319490e-04
+7.386644e-04
+7.453924e-04
+7.521331e-04
+7.588868e-04
+7.656534e-04
+7.724335e-04
+7.792268e-04
+7.860338e-04
+7.928545e-04
+7.996891e-04
+8.065379e-04
+8.134010e-04
+8.202784e-04
+8.271705e-04
+8.340774e-04
+8.409993e-04
+8.479364e-04
+8.548888e-04
+
+# IO
+
+10 0.0039994
+1.602984e-11
+1.390854e-07
+5.510519e-07
+1.236935e-06
+2.197761e-06
+3.434528e-06
+4.948335e-06
+6.740200e-06
+8.811214e-06
+1.116237e-05
+1.379481e-05
+1.670959e-05
+1.990786e-05
+2.339063e-05
+2.715908e-05
+3.121432e-05
+3.555743e-05
+4.018971e-05
+4.511198e-05
+5.032576e-05
+5.583209e-05
+6.163213e-05
+6.772706e-05
+7.411803e-05
+8.080638e-05
+8.779328e-05
+9.507983e-05
+1.026674e-04
+1.105572e-04
+1.187800e-04
+1.275023e-04
+1.367513e-04
+1.465298e-04
+1.568394e-04
+1.676822e-04
+1.790606e-04
+1.909768e-04
+2.034329e-04
+2.164311e-04
+2.299735e-04
+2.440626e-04
+2.587007e-04
+2.738899e-04
+2.896325e-04
+3.059310e-04
+3.227949e-04
+3.402344e-04
+3.582522e-04
+3.768507e-04
+3.960319e-04
+4.157992e-04
+4.361542e-04
+4.571000e-04
+4.786393e-04
+5.007740e-04
+5.235074e-04
+5.468414e-04
+5.707794e-04
+5.953233e-04
+6.204762e-04
+6.462405e-04
+6.726196e-04
+6.996158e-04
+7.272316e-04
+7.554844e-04
+7.849485e-04
+8.159284e-04
+8.484302e-04
+8.824600e-04
+9.180242e-04
+9.551295e-04
+9.937806e-04
+1.033986e-03
+1.075751e-03
+1.119082e-03
+1.163986e-03
+1.210287e-03
+1.257524e-03
+1.305677e-03
+1.354751e-03
+1.404750e-03
+1.455679e-03
+1.507542e-03
+1.560342e-03
+1.614086e-03
+1.668775e-03
+1.724418e-03
+1.781015e-03
+1.838573e-03
+1.897097e-03
+1.956590e-03
+2.017057e-03
+2.078502e-03
+2.140932e-03
+2.204351e-03
+2.268762e-03
+2.334171e-03
+2.400584e-03
+2.468004e-03
+2.536437e-03
+2.605856e-03
+2.676075e-03
+2.747067e-03
+2.818837e-03
+2.891390e-03
+2.964728e-03
+3.038856e-03
+3.113779e-03
+3.189500e-03
+3.266025e-03
+3.343358e-03
+3.421501e-03
+3.500462e-03
+3.580242e-03
+3.660847e-03
+3.742283e-03
+3.824551e-03
+3.907659e-03
+3.991610e-03
+4.076408e-03
+4.162059e-03
+4.248566e-03
+4.335936e-03
+4.424172e-03
+4.513280e-03
+4.603264e-03
+4.694128e-03
+4.785877e-03
+4.878519e-03
+4.972055e-03
+5.066493e-03
+5.161836e-03
+5.258088e-03
+5.355258e-03
+5.453348e-03
+5.552363e-03
+5.652311e-03
+5.753195e-03
+5.855021e-03
+5.957792e-03
+6.061518e-03
+6.166199e-03
+6.271843e-03
+6.378458e-03
+6.486046e-03
+6.594612e-03
+6.704165e-03
+6.814708e-03
+6.926246e-03
+7.038787e-03
+7.152337e-03
+7.266805e-03
+7.381564e-03
+7.496492e-03
+7.611591e-03
+7.726864e-03
+7.842317e-03
+7.957948e-03
+8.073763e-03
+8.189764e-03
+8.305952e-03
+8.422331e-03
+8.538906e-03
+8.655676e-03
+8.772646e-03
+8.889817e-03
+9.007196e-03
+9.124780e-03
+9.242576e-03
+9.360587e-03
+9.478813e-03
+9.597259e-03
+9.715927e-03
+9.834821e-03
+9.953943e-03
+1.007330e-02
+1.019288e-02
+1.031271e-02
+1.043278e-02
+1.055308e-02
+1.067364e-02
+1.079444e-02
+1.091550e-02
+1.103682e-02
+1.115839e-02
+1.128022e-02
+1.140232e-02
+1.152469e-02
+1.164732e-02
+1.177024e-02
+1.189343e-02
+1.201690e-02
+1.214065e-02
+1.226470e-02
+1.238903e-02
+1.251366e-02
+1.263858e-02
+1.276381e-02
+1.288934e-02
+1.301518e-02
+
+# ISi
+
+10 0.0039994
+7.375434e-12
+6.398750e-08
+2.535162e-07
+5.690599e-07
+1.011100e-06
+1.580091e-06
+2.276538e-06
+3.100897e-06
+4.053676e-06
+5.135356e-06
+6.346439e-06
+7.687413e-06
+9.158801e-06
+1.076108e-05
+1.249477e-05
+1.436044e-05
+1.635852e-05
+1.848965e-05
+2.075423e-05
+2.315288e-05
+2.568608e-05
+2.835444e-05
+3.115847e-05
+3.409872e-05
+3.717575e-05
+4.039009e-05
+4.374236e-05
+4.723310e-05
+5.086287e-05
+5.461159e-05
+5.836421e-05
+6.210286e-05
+6.582768e-05
+6.953848e-05
+7.323542e-05
+7.691846e-05
+8.058766e-05
+8.424302e-05
+8.788449e-05
+9.151216e-05
+9.512602e-05
+9.872607e-05
+1.023123e-04
+1.058848e-04
+1.094436e-04
+1.129883e-04
+1.165185e-04
+1.200343e-04
+1.235357e-04
+1.270227e-04
+1.304954e-04
+1.339536e-04
+1.373975e-04
+1.408270e-04
+1.442422e-04
+1.476430e-04
+1.510295e-04
+1.544017e-04
+1.577595e-04
+1.611030e-04
+1.644322e-04
+1.677471e-04
+1.710477e-04
+1.743340e-04
+1.776061e-04
+1.808670e-04
+1.841184e-04
+1.873601e-04
+1.905924e-04
+1.938151e-04
+1.970283e-04
+2.002321e-04
+2.034264e-04
+2.066113e-04
+2.097867e-04
+2.129528e-04
+2.161071e-04
+2.192431e-04
+2.223607e-04
+2.254597e-04
+2.285401e-04
+2.316020e-04
+2.346454e-04
+2.376701e-04
+2.406763e-04
+2.436637e-04
+2.466327e-04
+2.495829e-04
+2.525145e-04
+2.554274e-04
+2.583216e-04
+2.611970e-04
+2.640538e-04
+2.668918e-04
+2.697110e-04
+2.725115e-04
+2.752931e-04
+2.780559e-04
+2.807999e-04
+2.835250e-04
+2.862423e-04
+2.890171e-04
+2.918603e-04
+2.947723e-04
+2.977534e-04
+3.008039e-04
+3.039242e-04
+3.071144e-04
+3.103750e-04
+3.137063e-04
+3.171085e-04
+3.205820e-04
+3.241271e-04
+3.277442e-04
+3.314335e-04
+3.351955e-04
+3.390304e-04
+3.429386e-04
+3.469205e-04
+3.509763e-04
+3.551064e-04
+3.593111e-04
+3.635909e-04
+3.679460e-04
+3.723769e-04
+3.768838e-04
+3.814672e-04
+3.861274e-04
+3.908649e-04
+3.956797e-04
+4.005725e-04
+4.055436e-04
+4.105934e-04
+4.157222e-04
+4.209304e-04
+4.262185e-04
+4.315868e-04
+4.370356e-04
+4.425654e-04
+4.481766e-04
+4.538697e-04
+4.596449e-04
+4.655027e-04
+4.714436e-04
+4.774678e-04
+4.835758e-04
+4.897682e-04
+4.960452e-04
+5.024073e-04
+5.088549e-04
+5.153886e-04
+5.219975e-04
+5.286065e-04
+5.352008e-04
+5.417808e-04
+5.483462e-04
+5.548974e-04
+5.614343e-04
+5.679570e-04
+5.744656e-04
+5.809601e-04
+5.874406e-04
+5.939071e-04
+6.003596e-04
+6.067985e-04
+6.132235e-04
+6.196349e-04
+6.260326e-04
+6.324167e-04
+6.387874e-04
+6.451445e-04
+6.514884e-04
+6.578188e-04
+6.641361e-04
+6.704401e-04
+6.767311e-04
+6.830089e-04
+6.892739e-04
+6.955258e-04
+7.017649e-04
+7.079912e-04
+7.142048e-04
+7.204056e-04
+7.265939e-04
+7.327696e-04
+7.389328e-04
+7.450836e-04
+7.512221e-04
+7.573482e-04
+7.634620e-04
+7.695638e-04
+7.756535e-04
+7.817311e-04
+7.877967e-04
+7.938505e-04
+7.998924e-04
+8.059225e-04
+8.119409e-04
+8.179477e-04
+8.239428e-04
+
+# ICa
+
+10 0.0039994
+2.833289e-13
+2.453874e-09
+9.722157e-09
+2.182321e-08
+3.877517e-08
+6.059599e-08
+8.730399e-08
+1.189180e-07
+1.554567e-07
+1.969388e-07
+2.433840e-07
+2.948091e-07
+3.512364e-07
+4.126832e-07
+4.791700e-07
+5.507172e-07
+6.273431e-07
+7.090703e-07
+7.959161e-07
+8.879042e-07
+9.850519e-07
+1.087383e-06
+1.194916e-06
+1.307672e-06
+1.425676e-06
+1.548946e-06
+1.677503e-06
+1.811371e-06
+1.950571e-06
+2.095227e-06
+2.245902e-06
+2.402709e-06
+2.565675e-06
+2.734827e-06
+2.910187e-06
+3.091782e-06
+3.279638e-06
+3.473780e-06
+3.674242e-06
+3.881043e-06
+4.094212e-06
+4.313782e-06
+4.539772e-06
+4.772213e-06
+5.011136e-06
+5.252041e-06
+5.489988e-06
+5.724974e-06
+5.956996e-06
+6.186041e-06
+6.412100e-06
+6.635171e-06
+6.855245e-06
+7.072316e-06
+7.286377e-06
+7.497421e-06
+7.705437e-06
+7.910420e-06
+8.112363e-06
+8.311257e-06
+8.507094e-06
+8.699870e-06
+8.889573e-06
+9.076198e-06
+9.259677e-06
+9.437636e-06
+9.608823e-06
+9.773219e-06
+9.930799e-06
+1.008154e-05
+1.022542e-05
+1.036242e-05
+1.049252e-05
+1.061568e-05
+1.073189e-05
+1.084112e-05
+1.094568e-05
+1.105148e-05
+1.115882e-05
+1.126772e-05
+1.137819e-05
+1.149022e-05
+1.160384e-05
+1.171904e-05
+1.183584e-05
+1.195424e-05
+1.207425e-05
+1.219587e-05
+1.231913e-05
+1.244402e-05
+1.257055e-05
+1.269874e-05
+1.282858e-05
+1.296010e-05
+1.309329e-05
+1.322816e-05
+1.336473e-05
+1.350301e-05
+1.364299e-05
+1.378470e-05
+1.392832e-05
+1.407493e-05
+1.422474e-05
+1.437775e-05
+1.453397e-05
+1.469343e-05
+1.485614e-05
+1.502211e-05
+1.519135e-05
+1.536389e-05
+1.553974e-05
+1.571890e-05
+1.590141e-05
+1.608727e-05
+1.627650e-05
+1.646912e-05
+1.666514e-05
+1.686457e-05
+1.706744e-05
+1.727376e-05
+1.748354e-05
+1.769681e-05
+1.791357e-05
+1.813386e-05
+1.835768e-05
+1.858504e-05
+1.881598e-05
+1.905049e-05
+1.928862e-05
+1.953036e-05
+1.977574e-05
+2.002477e-05
+2.027748e-05
+2.053387e-05
+2.079398e-05
+2.105782e-05
+2.132540e-05
+2.159674e-05
+2.187187e-05
+2.215080e-05
+2.243356e-05
+2.272015e-05
+2.301060e-05
+2.330494e-05
+2.360317e-05
+2.390532e-05
+2.421141e-05
+2.452145e-05
+2.483548e-05
+2.515350e-05
+2.547554e-05
+2.580086e-05
+2.612421e-05
+2.644458e-05
+2.676195e-05
+2.707633e-05
+2.738771e-05
+2.769607e-05
+2.800144e-05
+2.830378e-05
+2.860310e-05
+2.889939e-05
+2.919265e-05
+2.948286e-05
+2.977003e-05
+3.005414e-05
+3.033520e-05
+3.061319e-05
+3.088811e-05
+3.115995e-05
+3.142870e-05
+3.169437e-05
+3.195693e-05
+3.221640e-05
+3.247274e-05
+3.272598e-05
+3.297608e-05
+3.322306e-05
+3.346689e-05
+3.370758e-05
+3.394511e-05
+3.417948e-05
+3.441068e-05
+3.463871e-05
+3.486354e-05
+3.508519e-05
+3.530364e-05
+3.551888e-05
+3.573090e-05
+3.593970e-05
+3.614527e-05
+3.634760e-05
+3.654668e-05
+3.674250e-05
+3.693505e-05
+3.712434e-05
+3.731033e-05
+3.749304e-05
+3.767245e-05
+3.784854e-05
+
+# IMetals
+
+10 0.0039994
+4.797585e-11
+4.157482e-07
+1.647160e-06
+3.697380e-06
+6.569404e-06
+1.026635e-05
+1.479127e-05
+2.014742e-05
+2.633792e-05
+3.336585e-05
+4.123471e-05
+4.994741e-05
+5.950744e-05
+6.991788e-05
+8.118246e-05
+9.330397e-05
+1.062863e-04
+1.201327e-04
+1.348464e-04
+1.504312e-04
+1.668901e-04
+1.842272e-04
+2.024459e-04
+2.215493e-04
+2.415415e-04
+2.624267e-04
+2.842068e-04
+3.068871e-04
+3.304707e-04
+3.549438e-04
+3.802101e-04
+4.062578e-04
+4.330901e-04
+4.607108e-04
+4.891227e-04
+5.183297e-04
+5.483353e-04
+5.791422e-04
+6.107548e-04
+6.431760e-04
+6.764098e-04
+7.104601e-04
+7.453295e-04
+7.810220e-04
+8.175424e-04
+8.548363e-04
+8.928461e-04
+9.315752e-04
+9.710272e-04
+1.011204e-03
+1.052111e-03
+1.093750e-03
+1.136126e-03
+1.179241e-03
+1.223099e-03
+1.267705e-03
+1.313060e-03
+1.359168e-03
+1.406034e-03
+1.453662e-03
+1.502053e-03
+1.551213e-03
+1.601146e-03
+1.651853e-03
+1.703355e-03
+1.756198e-03
+1.810673e-03
+1.866788e-03
+1.924549e-03
+1.983964e-03
+2.045040e-03
+2.107784e-03
+2.172203e-03
+2.238305e-03
+2.306097e-03
+2.375586e-03
+2.446617e-03
+2.518776e-03
+2.592046e-03
+2.666435e-03
+2.741947e-03
+2.818587e-03
+2.896364e-03
+2.975278e-03
+3.055338e-03
+3.136550e-03
+3.218919e-03
+3.302449e-03
+3.387149e-03
+3.473023e-03
+3.560076e-03
+3.648316e-03
+3.737747e-03
+3.828377e-03
+3.920210e-03
+4.013254e-03
+4.107512e-03
+4.202995e-03
+4.299705e-03
+4.397650e-03
+4.496774e-03
+4.596715e-03
+4.697416e-03
+4.798883e-03
+4.901120e-03
+5.004131e-03
+5.107922e-03
+5.212497e-03
+5.317862e-03
+5.424019e-03
+5.530976e-03
+5.638734e-03
+5.747303e-03
+5.856685e-03
+5.966884e-03
+6.077906e-03
+6.189757e-03
+6.302441e-03
+6.415963e-03
+6.530329e-03
+6.645543e-03
+6.761612e-03
+6.878538e-03
+6.996329e-03
+7.114991e-03
+7.234525e-03
+7.354941e-03
+7.476243e-03
+7.598436e-03
+7.721525e-03
+7.845516e-03
+7.970415e-03
+8.096226e-03
+8.222957e-03
+8.350613e-03
+8.479197e-03
+8.608719e-03
+8.739181e-03
+8.870591e-03
+9.002954e-03
+9.136276e-03
+9.270562e-03
+9.405822e-03
+9.542057e-03
+9.679276e-03
+9.817482e-03
+9.956686e-03
+1.009689e-02
+1.023810e-02
+1.038033e-02
+1.052357e-02
+1.066775e-02
+1.081224e-02
+1.095692e-02
+1.110180e-02
+1.124687e-02
+1.139215e-02
+1.153763e-02
+1.168331e-02
+1.182921e-02
+1.197533e-02
+1.212166e-02
+1.226822e-02
+1.241499e-02
+1.256200e-02
+1.270924e-02
+1.285672e-02
+1.300443e-02
+1.315239e-02
+1.330059e-02
+1.344904e-02
+1.359775e-02
+1.374671e-02
+1.389593e-02
+1.404542e-02
+1.419517e-02
+1.434520e-02
+1.449550e-02
+1.464608e-02
+1.479694e-02
+1.494808e-02
+1.509952e-02
+1.525125e-02
+1.540328e-02
+1.555561e-02
+1.570825e-02
+1.586119e-02
+1.601445e-02
+1.616802e-02
+1.632191e-02
+1.647613e-02
+1.663067e-02
+1.678555e-02
+1.694077e-02
+1.709632e-02
+1.725222e-02
+1.740847e-02
+1.756507e-02
+1.772203e-02
+1.787935e-02
+
+# Mean WD Mass
+
+1.380000
+
+# SNIa Metal Ejection
+
+# Number of elements
+6
+
+# Ej
+0.0
+
+# Ejnp
+0.0
+
+# Fe
+7.434630e-01
+
+# Mg
+8.572300e-03
+
+# O
+1.430000e-01
+
+# Si
+1.526010e-01
+
+# Ca
+1.234416e-02
+
+# Metals
+1.370000e+00
+
+
+# Element Solar Abundances
+
+# Number of elements
+6
+
+# Fe
+0.00176604
+
+# Mg
+0.000924316
+
+# O
+0.0108169
+
+# Si
+0.000996529
+
+# Ca
+9.1818e-05
+
+# Metals
+0.02
+
diff --git a/PyChem/shared/chimie.yr.dat.1 b/PyChem/shared/chimie.yr.dat.1
new file mode 100644
index 0000000..6dbdaf0
--- /dev/null
+++ b/PyChem/shared/chimie.yr.dat.1
@@ -0,0 +1,2941 @@
+#### Livetime ####
+
+-40.1107251082866 5.50992173040633 0.782431795366473
+ 141.929566656232 -15.88948185575660 -3.255779246324010
+-261.365531429482 17.07350618651300 9.866058678313810
+
+#### IMF Parameters ####
+
+49 50
+0
+0
+-1.3
+
+#### SNIa Parameters ####
+
+8
+
+#### SNIa Parameters ####
+
+3 8
+-0.35
+0.9 1.5 0.02
+1.8 2.6 0.05
+
+#### Metal Parameters ####
+
+# Number of points / Number of elements
+200 5
+
+# Ej
+
+49 0.000531075
+9.490357e-01
+9.490792e-01
+9.491228e-01
+9.491665e-01
+9.492102e-01
+9.492539e-01
+9.492977e-01
+9.493416e-01
+9.493855e-01
+9.494295e-01
+9.494736e-01
+9.495176e-01
+9.495617e-01
+9.496059e-01
+9.496501e-01
+9.496945e-01
+9.497388e-01
+9.497832e-01
+9.498277e-01
+9.498721e-01
+9.499167e-01
+9.499614e-01
+9.500060e-01
+9.500507e-01
+9.500955e-01
+9.501404e-01
+9.501853e-01
+9.502302e-01
+9.502752e-01
+9.503202e-01
+9.503654e-01
+9.504105e-01
+9.504557e-01
+9.505010e-01
+9.505463e-01
+9.505917e-01
+9.506372e-01
+9.506826e-01
+9.507282e-01
+9.507738e-01
+9.508196e-01
+9.508652e-01
+9.509110e-01
+9.509568e-01
+9.510027e-01
+9.510487e-01
+9.510946e-01
+9.511408e-01
+9.511868e-01
+9.512330e-01
+9.512792e-01
+9.513255e-01
+9.513719e-01
+9.514183e-01
+9.514648e-01
+9.515112e-01
+9.515578e-01
+9.516045e-01
+9.516511e-01
+9.516979e-01
+9.517446e-01
+9.517915e-01
+9.518384e-01
+9.518854e-01
+9.519324e-01
+9.519795e-01
+9.520267e-01
+9.520738e-01
+9.521211e-01
+9.521684e-01
+9.522158e-01
+9.522632e-01
+9.523107e-01
+9.523582e-01
+9.524058e-01
+9.524535e-01
+9.525012e-01
+9.525490e-01
+9.525969e-01
+9.526448e-01
+9.526927e-01
+9.527407e-01
+9.527888e-01
+9.528369e-01
+9.528852e-01
+9.529334e-01
+9.529817e-01
+9.530300e-01
+9.530784e-01
+9.531270e-01
+9.531755e-01
+9.532241e-01
+9.532728e-01
+9.533215e-01
+9.533703e-01
+9.534191e-01
+9.534681e-01
+9.535170e-01
+9.535661e-01
+9.536151e-01
+9.536642e-01
+9.537134e-01
+9.537627e-01
+9.538120e-01
+9.538614e-01
+9.539109e-01
+9.539604e-01
+9.540100e-01
+9.540595e-01
+9.541093e-01
+9.541590e-01
+9.542088e-01
+9.542587e-01
+9.543086e-01
+9.543586e-01
+9.544086e-01
+9.544588e-01
+9.545089e-01
+9.545591e-01
+9.546095e-01
+9.546598e-01
+9.547102e-01
+9.547607e-01
+9.548112e-01
+9.548619e-01
+9.549125e-01
+9.549633e-01
+9.550141e-01
+9.550649e-01
+9.551159e-01
+9.551668e-01
+9.552179e-01
+9.552690e-01
+9.553202e-01
+9.553714e-01
+9.554226e-01
+9.554740e-01
+9.555254e-01
+9.555769e-01
+9.556285e-01
+9.556801e-01
+9.557317e-01
+9.557835e-01
+9.558352e-01
+9.558871e-01
+9.559390e-01
+9.559910e-01
+9.560431e-01
+9.560952e-01
+9.561474e-01
+9.561996e-01
+9.562519e-01
+9.563043e-01
+9.563567e-01
+9.564092e-01
+9.564617e-01
+9.565144e-01
+9.565671e-01
+9.566199e-01
+9.566726e-01
+9.567255e-01
+9.567785e-01
+9.568315e-01
+9.568846e-01
+9.569377e-01
+9.569910e-01
+9.570442e-01
+9.570976e-01
+9.571509e-01
+9.572045e-01
+9.572579e-01
+9.573116e-01
+9.573652e-01
+9.574190e-01
+9.574727e-01
+9.575266e-01
+9.575806e-01
+9.576345e-01
+9.576886e-01
+9.577428e-01
+9.577969e-01
+9.578512e-01
+9.579055e-01
+9.579599e-01
+9.580143e-01
+9.580689e-01
+9.581234e-01
+9.581782e-01
+9.582329e-01
+9.582877e-01
+9.583425e-01
+9.583974e-01
+9.584524e-01
+9.585075e-01
+9.585626e-01
+9.586179e-01
+9.586731e-01
+9.587284e-01
+9.587838e-01
+9.588393e-01
+
+# Ejnp
+
+49 0.000531075
+5.828571e-01
+5.827429e-01
+5.826286e-01
+5.825141e-01
+5.823995e-01
+5.822847e-01
+5.821698e-01
+5.820547e-01
+5.819396e-01
+5.818243e-01
+5.817088e-01
+5.815932e-01
+5.814775e-01
+5.813616e-01
+5.812455e-01
+5.811294e-01
+5.810131e-01
+5.808966e-01
+5.807800e-01
+5.806632e-01
+5.805464e-01
+5.804294e-01
+5.803121e-01
+5.801948e-01
+5.800774e-01
+5.799598e-01
+5.798420e-01
+5.797242e-01
+5.796061e-01
+5.794879e-01
+5.793696e-01
+5.792511e-01
+5.791325e-01
+5.790138e-01
+5.788948e-01
+5.787758e-01
+5.786566e-01
+5.785372e-01
+5.784178e-01
+5.782982e-01
+5.781783e-01
+5.780585e-01
+5.779383e-01
+5.778181e-01
+5.776978e-01
+5.775772e-01
+5.774566e-01
+5.773358e-01
+5.772148e-01
+5.770937e-01
+5.769724e-01
+5.768510e-01
+5.767295e-01
+5.766078e-01
+5.764860e-01
+5.763640e-01
+5.762419e-01
+5.761195e-01
+5.759971e-01
+5.758744e-01
+5.757517e-01
+5.756289e-01
+5.755059e-01
+5.753826e-01
+5.752592e-01
+5.751357e-01
+5.750121e-01
+5.748883e-01
+5.747643e-01
+5.746403e-01
+5.745160e-01
+5.743916e-01
+5.742670e-01
+5.741423e-01
+5.740174e-01
+5.738924e-01
+5.737672e-01
+5.736419e-01
+5.735164e-01
+5.733908e-01
+5.732651e-01
+5.731391e-01
+5.730130e-01
+5.728867e-01
+5.727603e-01
+5.726337e-01
+5.725070e-01
+5.723802e-01
+5.722532e-01
+5.721260e-01
+5.719987e-01
+5.718712e-01
+5.717435e-01
+5.716158e-01
+5.714878e-01
+5.713596e-01
+5.712314e-01
+5.711030e-01
+5.709743e-01
+5.708457e-01
+5.707167e-01
+5.705877e-01
+5.704585e-01
+5.703292e-01
+5.701995e-01
+5.700699e-01
+5.699400e-01
+5.698100e-01
+5.696799e-01
+5.695496e-01
+5.694190e-01
+5.692884e-01
+5.691576e-01
+5.690266e-01
+5.688955e-01
+5.687642e-01
+5.686328e-01
+5.685011e-01
+5.683694e-01
+5.682375e-01
+5.681053e-01
+5.679731e-01
+5.678407e-01
+5.677081e-01
+5.675754e-01
+5.674425e-01
+5.673094e-01
+5.671762e-01
+5.670428e-01
+5.669093e-01
+5.667755e-01
+5.666417e-01
+5.665076e-01
+5.663735e-01
+5.662391e-01
+5.661045e-01
+5.659698e-01
+5.658349e-01
+5.656999e-01
+5.655648e-01
+5.654294e-01
+5.652938e-01
+5.651582e-01
+5.650222e-01
+5.648863e-01
+5.647501e-01
+5.646137e-01
+5.644771e-01
+5.643405e-01
+5.642036e-01
+5.640666e-01
+5.639295e-01
+5.637920e-01
+5.636545e-01
+5.635168e-01
+5.633790e-01
+5.632409e-01
+5.631027e-01
+5.629644e-01
+5.628258e-01
+5.626871e-01
+5.625482e-01
+5.624092e-01
+5.622699e-01
+5.621305e-01
+5.619910e-01
+5.618513e-01
+5.617113e-01
+5.615712e-01
+5.614311e-01
+5.612906e-01
+5.611500e-01
+5.610093e-01
+5.608683e-01
+5.607272e-01
+5.605860e-01
+5.604445e-01
+5.603029e-01
+5.601610e-01
+5.600191e-01
+5.598769e-01
+5.597346e-01
+5.595921e-01
+5.594495e-01
+5.593066e-01
+5.591636e-01
+5.590204e-01
+5.588770e-01
+5.587335e-01
+5.585898e-01
+5.584459e-01
+5.583018e-01
+5.581576e-01
+5.580131e-01
+5.578685e-01
+5.577238e-01
+5.575787e-01
+5.574337e-01
+5.572883e-01
+5.571429e-01
+
+# Fe
+
+10 0.0039994
+0.000000e+00
+3.723316e-04
+7.481165e-04
+1.127377e-03
+1.510143e-03
+1.896445e-03
+2.286330e-03
+2.679817e-03
+3.076952e-03
+3.477752e-03
+3.882263e-03
+4.290514e-03
+4.702549e-03
+5.118392e-03
+5.538080e-03
+5.961653e-03
+6.389137e-03
+6.820589e-03
+7.256027e-03
+7.695485e-03
+8.139022e-03
+8.586653e-03
+9.038430e-03
+9.494383e-03
+9.954557e-03
+1.041899e-02
+1.088772e-02
+1.136078e-02
+1.183822e-02
+1.201732e-02
+1.190568e-02
+1.179300e-02
+1.167928e-02
+1.156451e-02
+1.144868e-02
+1.133178e-02
+1.121379e-02
+1.109472e-02
+1.097454e-02
+1.085325e-02
+1.073084e-02
+1.060729e-02
+1.048261e-02
+1.035677e-02
+1.022976e-02
+9.976223e-03
+9.716522e-03
+9.454418e-03
+9.189887e-03
+8.922912e-03
+8.653464e-03
+8.381523e-03
+8.107068e-03
+7.830072e-03
+7.550513e-03
+7.268367e-03
+6.983614e-03
+6.696224e-03
+6.406181e-03
+6.113447e-03
+5.818013e-03
+5.519841e-03
+5.218904e-03
+4.915189e-03
+4.651350e-03
+4.591124e-03
+4.530341e-03
+4.468996e-03
+4.407083e-03
+4.344599e-03
+4.281535e-03
+4.217888e-03
+4.153652e-03
+4.088821e-03
+4.023393e-03
+3.957357e-03
+3.896135e-03
+3.836351e-03
+3.776013e-03
+3.715118e-03
+3.653659e-03
+3.591630e-03
+3.529028e-03
+3.465848e-03
+3.402082e-03
+3.337726e-03
+3.272776e-03
+3.207224e-03
+3.141066e-03
+3.074296e-03
+3.006908e-03
+2.938897e-03
+2.870257e-03
+2.800980e-03
+2.731066e-03
+2.660501e-03
+2.589286e-03
+2.517410e-03
+2.444871e-03
+2.371659e-03
+2.333467e-03
+2.330783e-03
+2.328073e-03
+2.325339e-03
+2.322579e-03
+2.319794e-03
+2.316983e-03
+2.314146e-03
+2.311283e-03
+2.308393e-03
+2.305477e-03
+2.302533e-03
+2.299563e-03
+2.296565e-03
+2.293539e-03
+2.290485e-03
+2.287403e-03
+2.284292e-03
+2.281153e-03
+2.277985e-03
+2.274787e-03
+2.271559e-03
+2.268302e-03
+2.265015e-03
+2.261697e-03
+2.258349e-03
+2.254969e-03
+2.251558e-03
+2.248116e-03
+2.244642e-03
+2.241136e-03
+2.237597e-03
+2.234026e-03
+2.230421e-03
+2.226783e-03
+2.223112e-03
+2.219406e-03
+2.215667e-03
+2.211893e-03
+2.208083e-03
+2.204239e-03
+2.200359e-03
+2.196443e-03
+2.192491e-03
+2.188502e-03
+2.184476e-03
+2.180413e-03
+2.176313e-03
+2.172175e-03
+2.167998e-03
+2.163783e-03
+2.156083e-03
+2.144285e-03
+2.132378e-03
+2.120361e-03
+2.108233e-03
+2.095992e-03
+2.083639e-03
+2.071171e-03
+2.058588e-03
+2.045888e-03
+2.033071e-03
+2.020135e-03
+2.007079e-03
+1.993903e-03
+1.980605e-03
+1.967184e-03
+1.953639e-03
+1.939968e-03
+1.926170e-03
+1.912246e-03
+1.898192e-03
+1.884009e-03
+1.869694e-03
+1.855246e-03
+1.840665e-03
+1.825950e-03
+1.811098e-03
+1.796109e-03
+1.780980e-03
+1.765713e-03
+1.750303e-03
+1.734751e-03
+1.719056e-03
+1.703215e-03
+1.687227e-03
+1.671092e-03
+1.654807e-03
+1.638372e-03
+1.621785e-03
+1.605044e-03
+1.588148e-03
+1.571096e-03
+1.553887e-03
+1.536518e-03
+1.518988e-03
+1.501296e-03
+1.483441e-03
+1.465420e-03
+1.447232e-03
+
+# Mg
+
+10 0.0039994
+0.000000e+00
+2.729427e-05
+5.484093e-05
+8.264254e-05
+1.107017e-04
+1.390197e-04
+1.676001e-04
+1.964450e-04
+2.255568e-04
+2.549377e-04
+2.845905e-04
+3.145176e-04
+3.447214e-04
+3.752052e-04
+4.059703e-04
+4.370208e-04
+4.683577e-04
+4.999852e-04
+5.319051e-04
+5.641200e-04
+5.966332e-04
+6.294474e-04
+6.625648e-04
+6.959888e-04
+7.297220e-04
+7.637676e-04
+7.981276e-04
+8.328056e-04
+8.678043e-04
+9.317882e-04
+1.024040e-03
+1.117147e-03
+1.211116e-03
+1.305954e-03
+1.401668e-03
+1.498269e-03
+1.595763e-03
+1.694159e-03
+1.793465e-03
+1.893690e-03
+1.994842e-03
+2.096931e-03
+2.199961e-03
+2.303947e-03
+2.408895e-03
+2.427621e-03
+2.443863e-03
+2.460256e-03
+2.476800e-03
+2.493497e-03
+2.510348e-03
+2.527356e-03
+2.544520e-03
+2.561844e-03
+2.579328e-03
+2.596974e-03
+2.614783e-03
+2.632756e-03
+2.650896e-03
+2.669204e-03
+2.687681e-03
+2.706329e-03
+2.725150e-03
+2.744144e-03
+2.851233e-03
+3.383711e-03
+3.921118e-03
+4.463498e-03
+5.010888e-03
+5.563356e-03
+6.120924e-03
+6.683651e-03
+7.251590e-03
+7.824786e-03
+8.403283e-03
+8.987114e-03
+9.146377e-03
+9.148277e-03
+9.150195e-03
+9.152131e-03
+9.154084e-03
+9.156055e-03
+9.158044e-03
+9.160053e-03
+9.162080e-03
+9.164126e-03
+9.166189e-03
+9.168272e-03
+9.170374e-03
+9.172498e-03
+9.174638e-03
+9.176800e-03
+9.178982e-03
+9.181184e-03
+9.183406e-03
+9.185649e-03
+9.187912e-03
+9.190196e-03
+9.192501e-03
+9.194829e-03
+9.223163e-03
+9.277867e-03
+9.333077e-03
+9.388799e-03
+9.445035e-03
+9.501792e-03
+9.559073e-03
+9.616885e-03
+9.675231e-03
+9.734117e-03
+9.793549e-03
+9.853529e-03
+9.914066e-03
+9.975161e-03
+1.003682e-02
+1.009905e-02
+1.016186e-02
+1.022525e-02
+1.028922e-02
+1.035379e-02
+1.041896e-02
+1.048472e-02
+1.055110e-02
+1.061809e-02
+1.068570e-02
+1.075393e-02
+1.082280e-02
+1.089230e-02
+1.096245e-02
+1.103324e-02
+1.110469e-02
+1.117680e-02
+1.124958e-02
+1.132303e-02
+1.139716e-02
+1.147198e-02
+1.154749e-02
+1.162369e-02
+1.170061e-02
+1.177823e-02
+1.185657e-02
+1.193564e-02
+1.201544e-02
+1.209598e-02
+1.217726e-02
+1.225929e-02
+1.234208e-02
+1.242564e-02
+1.250997e-02
+1.259509e-02
+1.268099e-02
+1.275091e-02
+1.280189e-02
+1.285334e-02
+1.290527e-02
+1.295768e-02
+1.301058e-02
+1.306396e-02
+1.311783e-02
+1.317221e-02
+1.322709e-02
+1.328248e-02
+1.333837e-02
+1.339479e-02
+1.345173e-02
+1.350919e-02
+1.356719e-02
+1.362572e-02
+1.368479e-02
+1.374442e-02
+1.380459e-02
+1.386532e-02
+1.392661e-02
+1.398846e-02
+1.405089e-02
+1.411390e-02
+1.417749e-02
+1.424167e-02
+1.430644e-02
+1.437181e-02
+1.443779e-02
+1.450438e-02
+1.457158e-02
+1.463941e-02
+1.470786e-02
+1.477695e-02
+1.484667e-02
+1.491704e-02
+1.498806e-02
+1.505974e-02
+1.513208e-02
+1.520509e-02
+1.527877e-02
+1.535314e-02
+1.542820e-02
+1.550395e-02
+1.558040e-02
+1.565756e-02
+1.573543e-02
+1.581402e-02
+
+# O
+
+10 0.0039994
+0.000000e+00
+3.581978e-04
+7.197112e-04
+1.084566e-03
+1.452804e-03
+1.824435e-03
+2.199516e-03
+2.578061e-03
+2.960116e-03
+3.345698e-03
+3.734849e-03
+4.127599e-03
+4.523989e-03
+4.924040e-03
+5.327791e-03
+5.735282e-03
+6.146539e-03
+6.561607e-03
+6.980509e-03
+7.403284e-03
+7.829975e-03
+8.260611e-03
+8.695234e-03
+9.133875e-03
+9.576574e-03
+1.002337e-02
+1.047430e-02
+1.092941e-02
+1.138872e-02
+1.201160e-02
+1.279408e-02
+1.358380e-02
+1.438084e-02
+1.518524e-02
+1.599708e-02
+1.681644e-02
+1.764338e-02
+1.847796e-02
+1.932028e-02
+2.017038e-02
+2.102835e-02
+2.189425e-02
+2.276816e-02
+2.365016e-02
+2.454032e-02
+2.546063e-02
+2.639012e-02
+2.732821e-02
+2.827498e-02
+2.923050e-02
+3.019486e-02
+3.116815e-02
+3.215043e-02
+3.314182e-02
+3.414236e-02
+3.515217e-02
+3.617133e-02
+3.719991e-02
+3.823800e-02
+3.928570e-02
+4.034308e-02
+4.141025e-02
+4.248730e-02
+4.357432e-02
+4.490967e-02
+4.740754e-02
+4.992853e-02
+5.247284e-02
+5.504072e-02
+5.763231e-02
+6.024793e-02
+6.288771e-02
+6.555194e-02
+6.824079e-02
+7.095453e-02
+7.369339e-02
+7.566179e-02
+7.735445e-02
+7.906280e-02
+8.078691e-02
+8.252700e-02
+8.428320e-02
+8.605565e-02
+8.784446e-02
+8.964983e-02
+9.147193e-02
+9.331087e-02
+9.516682e-02
+9.703992e-02
+9.893038e-02
+1.008383e-01
+1.027639e-01
+1.047073e-01
+1.066687e-01
+1.086482e-01
+1.106461e-01
+1.126624e-01
+1.146974e-01
+1.167512e-01
+1.188240e-01
+1.206974e-01
+1.223686e-01
+1.240551e-01
+1.257574e-01
+1.274753e-01
+1.292091e-01
+1.309590e-01
+1.327251e-01
+1.345075e-01
+1.363064e-01
+1.381219e-01
+1.399542e-01
+1.418035e-01
+1.436699e-01
+1.455536e-01
+1.474547e-01
+1.493733e-01
+1.513098e-01
+1.532641e-01
+1.552365e-01
+1.572272e-01
+1.592363e-01
+1.612640e-01
+1.633104e-01
+1.653758e-01
+1.674602e-01
+1.695640e-01
+1.716872e-01
+1.738301e-01
+1.759928e-01
+1.781755e-01
+1.803783e-01
+1.826016e-01
+1.848455e-01
+1.871101e-01
+1.893956e-01
+1.917023e-01
+1.940303e-01
+1.963799e-01
+1.987512e-01
+2.011445e-01
+2.035598e-01
+2.059976e-01
+2.084579e-01
+2.109409e-01
+2.134469e-01
+2.159761e-01
+2.185287e-01
+2.211050e-01
+2.237050e-01
+2.263291e-01
+2.281939e-01
+2.291604e-01
+2.301358e-01
+2.311203e-01
+2.321138e-01
+2.331166e-01
+2.341286e-01
+2.351500e-01
+2.361808e-01
+2.372212e-01
+2.382712e-01
+2.393309e-01
+2.404005e-01
+2.414799e-01
+2.425693e-01
+2.436688e-01
+2.447784e-01
+2.458983e-01
+2.470286e-01
+2.481694e-01
+2.493207e-01
+2.504826e-01
+2.516553e-01
+2.528389e-01
+2.540333e-01
+2.552389e-01
+2.564555e-01
+2.576835e-01
+2.589228e-01
+2.601736e-01
+2.614359e-01
+2.627100e-01
+2.639958e-01
+2.652935e-01
+2.666032e-01
+2.679251e-01
+2.692591e-01
+2.706055e-01
+2.719644e-01
+2.733358e-01
+2.747199e-01
+2.761168e-01
+2.775267e-01
+2.789496e-01
+2.803856e-01
+2.818350e-01
+2.832977e-01
+2.847740e-01
+2.862639e-01
+
+# Ba
+
+10 0.0039994
+0.000000e+00
+1.097078e-08
+2.204297e-08
+3.321747e-08
+4.449566e-08
+5.587788e-08
+6.736559e-08
+7.895960e-08
+9.066082e-08
+1.024703e-07
+1.143891e-07
+1.264181e-07
+1.385582e-07
+1.508109e-07
+1.631769e-07
+1.756572e-07
+1.882529e-07
+2.009654e-07
+2.137953e-07
+2.267439e-07
+2.354499e-07
+2.268915e-07
+2.182539e-07
+2.095364e-07
+2.007382e-07
+1.918587e-07
+1.828970e-07
+1.738524e-07
+1.647242e-07
+1.555114e-07
+1.462134e-07
+1.368295e-07
+1.273587e-07
+1.178003e-07
+1.081535e-07
+9.841733e-08
+8.859115e-08
+7.867402e-08
+6.866526e-08
+5.856373e-08
+4.836897e-08
+3.807986e-08
+2.769548e-08
+1.721503e-08
+6.637606e-09
+6.268832e-09
+6.210778e-09
+6.152187e-09
+6.093053e-09
+6.033373e-09
+5.973141e-09
+5.912351e-09
+5.850999e-09
+5.789079e-09
+5.726587e-09
+5.663516e-09
+5.599862e-09
+5.535619e-09
+5.470782e-09
+5.405346e-09
+5.339303e-09
+5.272649e-09
+5.205378e-09
+5.137486e-09
+5.068965e-09
+4.999811e-09
+4.930016e-09
+4.859577e-09
+4.788485e-09
+4.716735e-09
+4.644322e-09
+4.571239e-09
+4.497480e-09
+4.423038e-09
+4.347908e-09
+4.272082e-09
+4.195556e-09
+4.118321e-09
+4.040371e-09
+3.961701e-09
+3.882302e-09
+3.802169e-09
+3.721294e-09
+3.639673e-09
+3.557296e-09
+3.474155e-09
+3.390246e-09
+3.305561e-09
+3.220093e-09
+3.133834e-09
+3.046775e-09
+2.958912e-09
+2.870237e-09
+2.780741e-09
+2.690417e-09
+2.599257e-09
+2.507254e-09
+2.414400e-09
+2.320687e-09
+2.226107e-09
+2.130652e-09
+2.034313e-09
+1.937084e-09
+1.838955e-09
+1.739918e-09
+1.639965e-09
+1.539087e-09
+1.437275e-09
+1.334523e-09
+1.230818e-09
+1.126155e-09
+1.020525e-09
+9.139161e-10
+8.063212e-10
+6.977308e-10
+5.881349e-10
+4.775265e-10
+3.658940e-10
+2.532285e-10
+1.395213e-10
+2.476330e-11
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+0.000000e+00
+
+# Metals
+
+10 0.0039994
+0.000000e+00
+1.070708e-03
+2.151318e-03
+3.241926e-03
+4.342638e-03
+5.453505e-03
+6.574661e-03
+7.706203e-03
+8.848213e-03
+1.000077e-02
+1.116401e-02
+1.233798e-02
+1.352285e-02
+1.471866e-02
+1.592553e-02
+1.714358e-02
+1.837287e-02
+1.961356e-02
+2.086573e-02
+2.212947e-02
+2.340491e-02
+2.469213e-02
+2.599125e-02
+2.730238e-02
+2.862566e-02
+2.996118e-02
+3.130905e-02
+3.266938e-02
+3.404230e-02
+3.533176e-02
+3.654025e-02
+3.775990e-02
+3.899088e-02
+4.023322e-02
+4.148704e-02
+4.275249e-02
+4.402962e-02
+4.531859e-02
+4.661947e-02
+4.793239e-02
+4.925746e-02
+5.059478e-02
+5.194445e-02
+5.330665e-02
+5.468144e-02
+5.589831e-02
+5.712123e-02
+5.835548e-02
+5.960116e-02
+6.085835e-02
+6.212717e-02
+6.340776e-02
+6.470016e-02
+6.600451e-02
+6.732095e-02
+6.864958e-02
+6.999048e-02
+7.134379e-02
+7.270962e-02
+7.408809e-02
+7.547931e-02
+7.688339e-02
+7.830047e-02
+7.973066e-02
+8.140108e-02
+8.418250e-02
+8.698966e-02
+8.982284e-02
+9.268221e-02
+9.556805e-02
+9.848054e-02
+1.014200e-01
+1.043867e-01
+1.073808e-01
+1.104026e-01
+1.134524e-01
+1.158151e-01
+1.179355e-01
+1.200755e-01
+1.222353e-01
+1.244151e-01
+1.266151e-01
+1.288354e-01
+1.310762e-01
+1.333378e-01
+1.356203e-01
+1.379240e-01
+1.402489e-01
+1.425953e-01
+1.449635e-01
+1.473536e-01
+1.497657e-01
+1.522002e-01
+1.546572e-01
+1.571369e-01
+1.596397e-01
+1.621655e-01
+1.647147e-01
+1.672875e-01
+1.698841e-01
+1.720806e-01
+1.738713e-01
+1.756786e-01
+1.775027e-01
+1.793436e-01
+1.812016e-01
+1.830767e-01
+1.849692e-01
+1.868792e-01
+1.888068e-01
+1.907524e-01
+1.927158e-01
+1.946975e-01
+1.966975e-01
+1.987160e-01
+2.007532e-01
+2.028092e-01
+2.048842e-01
+2.069785e-01
+2.090921e-01
+2.112253e-01
+2.133782e-01
+2.155510e-01
+2.177439e-01
+2.199571e-01
+2.221908e-01
+2.244451e-01
+2.267203e-01
+2.290166e-01
+2.313341e-01
+2.336730e-01
+2.360336e-01
+2.384160e-01
+2.408205e-01
+2.432472e-01
+2.456963e-01
+2.481682e-01
+2.506628e-01
+2.531806e-01
+2.557216e-01
+2.582862e-01
+2.608745e-01
+2.634867e-01
+2.661231e-01
+2.687839e-01
+2.714693e-01
+2.741796e-01
+2.769148e-01
+2.796755e-01
+2.824617e-01
+2.852736e-01
+2.873352e-01
+2.885089e-01
+2.896935e-01
+2.908890e-01
+2.920955e-01
+2.933132e-01
+2.945421e-01
+2.957825e-01
+2.970343e-01
+2.982977e-01
+2.995728e-01
+3.008597e-01
+3.021585e-01
+3.034693e-01
+3.047922e-01
+3.061274e-01
+3.074749e-01
+3.088349e-01
+3.102075e-01
+3.115928e-01
+3.129908e-01
+3.144018e-01
+3.158259e-01
+3.172632e-01
+3.187137e-01
+3.201777e-01
+3.216552e-01
+3.231463e-01
+3.246513e-01
+3.261702e-01
+3.277032e-01
+3.292503e-01
+3.308118e-01
+3.323877e-01
+3.339781e-01
+3.355833e-01
+3.372034e-01
+3.388384e-01
+3.404885e-01
+3.421539e-01
+3.438348e-01
+3.455311e-01
+3.472432e-01
+3.489711e-01
+3.507150e-01
+3.524750e-01
+3.542513e-01
+3.560441e-01
+3.578534e-01
+
+#### Metal Ejecta Parameters ####
+
+# Number of points / Number of elements
+200 5
+
+# IEj
+
+49 0.000531075
+9.613037e-04
+5.857086e-02
+1.161537e-01
+1.737289e-01
+2.312813e-01
+2.888145e-01
+3.463287e-01
+4.038277e-01
+4.613075e-01
+5.187645e-01
+5.762024e-01
+6.336327e-01
+6.910400e-01
+7.484169e-01
+8.057861e-01
+8.631325e-01
+9.204712e-01
+9.777832e-01
+1.035080e+00
+1.092350e+00
+1.149612e+00
+1.206848e+00
+1.264072e+00
+1.321274e+00
+1.378456e+00
+1.435623e+00
+1.492771e+00
+1.549904e+00
+1.607014e+00
+1.664108e+00
+1.721180e+00
+1.778240e+00
+1.835281e+00
+1.892296e+00
+1.949303e+00
+2.006287e+00
+2.063248e+00
+2.120201e+00
+2.177124e+00
+2.234039e+00
+2.290936e+00
+2.347809e+00
+2.404667e+00
+2.461502e+00
+2.518330e+00
+2.575130e+00
+2.631912e+00
+2.688683e+00
+2.745426e+00
+2.802155e+00
+2.858868e+00
+2.915565e+00
+2.972240e+00
+3.028900e+00
+3.085541e+00
+3.142162e+00
+3.198769e+00
+3.255356e+00
+3.311920e+00
+3.368469e+00
+3.425007e+00
+3.481518e+00
+3.538017e+00
+3.594498e+00
+3.650959e+00
+3.707394e+00
+3.763824e+00
+3.820229e+00
+3.876617e+00
+3.932991e+00
+3.989342e+00
+4.045677e+00
+4.101994e+00
+4.158298e+00
+4.214577e+00
+4.270840e+00
+4.327087e+00
+4.383312e+00
+4.439529e+00
+4.495716e+00
+4.551891e+00
+4.608051e+00
+4.664188e+00
+4.720310e+00
+4.776417e+00
+4.832500e+00
+4.888573e+00
+4.944622e+00
+5.000652e+00
+5.056671e+00
+5.112671e+00
+5.168644e+00
+5.224613e+00
+5.280552e+00
+5.336479e+00
+5.392391e+00
+5.448280e+00
+5.504154e+00
+5.560013e+00
+5.615852e+00
+5.671673e+00
+5.727474e+00
+5.783260e+00
+5.839031e+00
+5.894779e+00
+5.950512e+00
+6.006229e+00
+6.061928e+00
+6.117611e+00
+6.173271e+00
+6.228916e+00
+6.284546e+00
+6.340153e+00
+6.395748e+00
+6.451324e+00
+6.506889e+00
+6.562424e+00
+6.617954e+00
+6.673450e+00
+6.728943e+00
+6.784416e+00
+6.839867e+00
+6.895302e+00
+6.950722e+00
+7.006123e+00
+7.061512e+00
+7.116875e+00
+7.172222e+00
+7.227558e+00
+7.282867e+00
+7.338169e+00
+7.393444e+00
+7.448711e+00
+7.503960e+00
+7.559185e+00
+7.614395e+00
+7.669590e+00
+7.724762e+00
+7.779919e+00
+7.835068e+00
+7.890186e+00
+7.945297e+00
+8.000385e+00
+8.055458e+00
+8.110512e+00
+8.165554e+00
+8.220573e+00
+8.275578e+00
+8.330563e+00
+8.385529e+00
+8.440483e+00
+8.495422e+00
+8.550339e+00
+8.605240e+00
+8.660122e+00
+8.714985e+00
+8.769840e+00
+8.824673e+00
+8.879486e+00
+8.934284e+00
+8.989063e+00
+9.043831e+00
+9.098576e+00
+9.153305e+00
+9.208023e+00
+9.262714e+00
+9.317394e+00
+9.372059e+00
+9.426701e+00
+9.481327e+00
+9.535942e+00
+9.590534e+00
+9.645111e+00
+9.699669e+00
+9.754219e+00
+9.808739e+00
+9.863251e+00
+9.917740e+00
+9.972218e+00
+1.002668e+01
+1.008112e+01
+1.013554e+01
+1.018995e+01
+1.024434e+01
+1.029871e+01
+1.035307e+01
+1.040742e+01
+1.046173e+01
+1.051604e+01
+1.057034e+01
+1.062461e+01
+1.067886e+01
+1.073310e+01
+1.078733e+01
+1.084153e+01
+1.089572e+01
+1.094990e+01
+1.100405e+01
+1.105819e+01
+1.111231e+01
+
+# IEjnp
+
+49 0.000531075
+5.912781e-04
+3.596497e-02
+7.132149e-02
+1.066570e-01
+1.419735e-01
+1.772690e-01
+2.125454e-01
+2.478027e-01
+2.830410e-01
+3.182545e-01
+3.534527e-01
+3.886280e-01
+4.237843e-01
+4.589214e-01
+4.940376e-01
+5.291348e-01
+5.642147e-01
+5.992699e-01
+6.343079e-01
+6.693249e-01
+7.043209e-01
+7.392998e-01
+7.742615e-01
+8.091965e-01
+8.441143e-01
+8.790131e-01
+9.138908e-01
+9.487495e-01
+9.835892e-01
+1.018404e+00
+1.053205e+00
+1.087984e+00
+1.122744e+00
+1.157482e+00
+1.192202e+00
+1.226902e+00
+1.261580e+00
+1.296242e+00
+1.330879e+00
+1.365499e+00
+1.400103e+00
+1.434681e+00
+1.469242e+00
+1.503782e+00
+1.538303e+00
+1.572803e+00
+1.607285e+00
+1.641748e+00
+1.676188e+00
+1.710609e+00
+1.745012e+00
+1.779394e+00
+1.813755e+00
+1.848099e+00
+1.882418e+00
+1.916721e+00
+1.951004e+00
+1.985270e+00
+2.019508e+00
+2.053734e+00
+2.087938e+00
+2.122120e+00
+2.156284e+00
+2.190428e+00
+2.224554e+00
+2.258656e+00
+2.292742e+00
+2.326805e+00
+2.360849e+00
+2.394876e+00
+2.428877e+00
+2.462862e+00
+2.496828e+00
+2.530775e+00
+2.564697e+00
+2.598606e+00
+2.632490e+00
+2.666355e+00
+2.700207e+00
+2.734030e+00
+2.767836e+00
+2.801620e+00
+2.835390e+00
+2.869137e+00
+2.902866e+00
+2.936571e+00
+2.970263e+00
+3.003929e+00
+3.037577e+00
+3.071205e+00
+3.104813e+00
+3.138401e+00
+3.171972e+00
+3.205521e+00
+3.239050e+00
+3.272560e+00
+3.306047e+00
+3.339518e+00
+3.372971e+00
+3.406401e+00
+3.439812e+00
+3.473200e+00
+3.506569e+00
+3.539923e+00
+3.573254e+00
+3.606564e+00
+3.639854e+00
+3.673130e+00
+3.706381e+00
+3.739613e+00
+3.772825e+00
+3.806017e+00
+3.839190e+00
+3.872343e+00
+3.905476e+00
+3.938593e+00
+3.971687e+00
+4.004761e+00
+4.037815e+00
+4.070848e+00
+4.103861e+00
+4.136858e+00
+4.169834e+00
+4.202789e+00
+4.235722e+00
+4.268641e+00
+4.301535e+00
+4.334412e+00
+4.367268e+00
+4.400103e+00
+4.432920e+00
+4.465717e+00
+4.498497e+00
+4.531252e+00
+4.563990e+00
+4.596708e+00
+4.629406e+00
+4.662085e+00
+4.694744e+00
+4.727383e+00
+4.760002e+00
+4.792601e+00
+4.825178e+00
+4.857740e+00
+4.890278e+00
+4.922800e+00
+4.955301e+00
+4.987780e+00
+5.020241e+00
+5.052683e+00
+5.085102e+00
+5.117504e+00
+5.149889e+00
+5.182249e+00
+5.214592e+00
+5.246912e+00
+5.279217e+00
+5.311501e+00
+5.343763e+00
+5.376007e+00
+5.408230e+00
+5.440434e+00
+5.472620e+00
+5.504784e+00
+5.536926e+00
+5.569050e+00
+5.601158e+00
+5.633244e+00
+5.665308e+00
+5.697353e+00
+5.729382e+00
+5.761387e+00
+5.793371e+00
+5.825340e+00
+5.857285e+00
+5.889214e+00
+5.921124e+00
+5.953009e+00
+5.984877e+00
+6.016726e+00
+6.048555e+00
+6.080364e+00
+6.112152e+00
+6.143919e+00
+6.175671e+00
+6.207401e+00
+6.239111e+00
+6.270800e+00
+6.302471e+00
+6.334122e+00
+6.365751e+00
+6.397366e+00
+6.428957e+00
+6.460526e+00
+6.492079e+00
+6.523611e+00
+6.555124e+00
+6.586617e+00
+6.618090e+00
+6.649542e+00
+
+# IFe
+
+10 0.0039994
+1.609442e-08
+1.396127e-04
+5.531348e-04
+1.241617e-03
+2.206080e-03
+3.447562e-03
+4.967093e-03
+6.765723e-03
+8.844584e-03
+1.120466e-02
+1.384708e-02
+1.677293e-02
+1.998329e-02
+2.347925e-02
+2.726194e-02
+3.133258e-02
+3.569216e-02
+4.034188e-02
+4.528296e-02
+5.051649e-02
+5.604357e-02
+6.186563e-02
+6.798363e-02
+7.439888e-02
+8.111256e-02
+8.812588e-02
+9.544003e-02
+1.030564e-01
+1.109760e-01
+1.191462e-01
+1.272650e-01
+1.352855e-01
+1.432076e-01
+1.510308e-01
+1.587550e-01
+1.663800e-01
+1.739057e-01
+1.813316e-01
+1.886576e-01
+1.958834e-01
+2.030089e-01
+2.100338e-01
+2.169577e-01
+2.237806e-01
+2.305021e-01
+2.370818e-01
+2.434755e-01
+2.496825e-01
+2.557025e-01
+2.615346e-01
+2.671784e-01
+2.726332e-01
+2.778984e-01
+2.829735e-01
+2.878578e-01
+2.925508e-01
+2.970518e-01
+3.013600e-01
+3.054750e-01
+3.093961e-01
+3.131226e-01
+3.166538e-01
+3.199893e-01
+3.231282e-01
+3.260724e-01
+3.289199e-01
+3.317226e-01
+3.344800e-01
+3.371922e-01
+3.398590e-01
+3.424803e-01
+3.450559e-01
+3.475858e-01
+3.500699e-01
+3.525079e-01
+3.548998e-01
+3.572466e-01
+3.595513e-01
+3.618140e-01
+3.640345e-01
+3.662127e-01
+3.683485e-01
+3.704417e-01
+3.724923e-01
+3.745002e-01
+3.764651e-01
+3.783870e-01
+3.802658e-01
+3.821013e-01
+3.838934e-01
+3.856421e-01
+3.873470e-01
+3.890081e-01
+3.906254e-01
+3.921986e-01
+3.937276e-01
+3.952123e-01
+3.966526e-01
+3.980482e-01
+3.993991e-01
+4.007102e-01
+4.020114e-01
+4.033074e-01
+4.045984e-01
+4.058843e-01
+4.071651e-01
+4.084408e-01
+4.097115e-01
+4.109770e-01
+4.122376e-01
+4.134930e-01
+4.147435e-01
+4.159888e-01
+4.172291e-01
+4.184644e-01
+4.196947e-01
+4.209199e-01
+4.221401e-01
+4.233552e-01
+4.245653e-01
+4.257704e-01
+4.269705e-01
+4.281656e-01
+4.293556e-01
+4.305406e-01
+4.317207e-01
+4.328957e-01
+4.340657e-01
+4.352307e-01
+4.363907e-01
+4.375457e-01
+4.386958e-01
+4.398408e-01
+4.409809e-01
+4.421159e-01
+4.432459e-01
+4.443710e-01
+4.454911e-01
+4.466062e-01
+4.477163e-01
+4.488215e-01
+4.499216e-01
+4.510168e-01
+4.521071e-01
+4.531923e-01
+4.542726e-01
+4.553479e-01
+4.564182e-01
+4.574835e-01
+4.585439e-01
+4.595993e-01
+4.606494e-01
+4.616914e-01
+4.627247e-01
+4.637495e-01
+4.647656e-01
+4.657731e-01
+4.667720e-01
+4.677621e-01
+4.687436e-01
+4.697164e-01
+4.706804e-01
+4.716358e-01
+4.725824e-01
+4.735202e-01
+4.744493e-01
+4.753695e-01
+4.762810e-01
+4.771836e-01
+4.780775e-01
+4.789623e-01
+4.798384e-01
+4.807056e-01
+4.815639e-01
+4.824132e-01
+4.832536e-01
+4.840850e-01
+4.849074e-01
+4.857209e-01
+4.865254e-01
+4.873208e-01
+4.881071e-01
+4.888844e-01
+4.896525e-01
+4.904116e-01
+4.911615e-01
+4.919024e-01
+4.926339e-01
+4.933563e-01
+4.940695e-01
+4.947735e-01
+4.954682e-01
+4.961536e-01
+4.968297e-01
+4.974965e-01
+4.981539e-01
+4.988019e-01
+4.994406e-01
+5.000699e-01
+5.006897e-01
+
+# IMg
+
+10 0.0039994
+1.178705e-09
+1.023430e-05
+4.054792e-05
+9.101676e-05
+1.617167e-04
+2.527237e-04
+3.641145e-04
+4.959637e-04
+6.483551e-04
+8.213595e-04
+1.015065e-03
+1.229543e-03
+1.464879e-03
+1.721153e-03
+1.998445e-03
+2.296843e-03
+2.616420e-03
+2.957277e-03
+3.319480e-03
+3.703125e-03
+4.108295e-03
+4.535079e-03
+4.983559e-03
+5.453825e-03
+5.945981e-03
+6.460093e-03
+6.996259e-03
+7.554580e-03
+8.135129e-03
+8.743145e-03
+9.407401e-03
+1.013257e-02
+1.091888e-02
+1.176657e-02
+1.267587e-02
+1.364704e-02
+1.468034e-02
+1.577599e-02
+1.693426e-02
+1.815538e-02
+1.943960e-02
+2.078722e-02
+2.219845e-02
+2.367358e-02
+2.521287e-02
+2.678868e-02
+2.837063e-02
+2.995878e-02
+3.155322e-02
+3.315395e-02
+3.476103e-02
+3.637452e-02
+3.799449e-02
+3.962097e-02
+4.125401e-02
+4.289372e-02
+4.454006e-02
+4.619314e-02
+4.785298e-02
+4.951970e-02
+5.119328e-02
+5.287382e-02
+5.456139e-02
+5.625600e-02
+5.796276e-02
+5.988552e-02
+6.213173e-02
+6.470263e-02
+6.759945e-02
+7.082343e-02
+7.437587e-02
+7.825798e-02
+8.247119e-02
+8.701664e-02
+9.189570e-02
+9.710971e-02
+1.025647e-01
+1.080180e-01
+1.134573e-01
+1.188828e-01
+1.242945e-01
+1.296923e-01
+1.350766e-01
+1.404471e-01
+1.458038e-01
+1.511471e-01
+1.564769e-01
+1.617931e-01
+1.670958e-01
+1.723853e-01
+1.776612e-01
+1.829239e-01
+1.881733e-01
+1.934095e-01
+1.986325e-01
+2.038424e-01
+2.090392e-01
+2.142228e-01
+2.193936e-01
+2.245513e-01
+2.296998e-01
+2.348610e-01
+2.400384e-01
+2.452324e-01
+2.504430e-01
+2.556704e-01
+2.609147e-01
+2.661763e-01
+2.714550e-01
+2.767512e-01
+2.820649e-01
+2.873965e-01
+2.927459e-01
+2.981134e-01
+3.034991e-01
+3.089032e-01
+3.143259e-01
+3.197672e-01
+3.252276e-01
+3.307069e-01
+3.362055e-01
+3.417234e-01
+3.472609e-01
+3.528181e-01
+3.583953e-01
+3.639925e-01
+3.696100e-01
+3.752480e-01
+3.809065e-01
+3.865857e-01
+3.922860e-01
+3.980074e-01
+4.037502e-01
+4.095144e-01
+4.153003e-01
+4.211080e-01
+4.269379e-01
+4.327899e-01
+4.386644e-01
+4.445614e-01
+4.504814e-01
+4.564241e-01
+4.623902e-01
+4.683796e-01
+4.743926e-01
+4.804293e-01
+4.864900e-01
+4.925748e-01
+4.986840e-01
+5.048178e-01
+5.109763e-01
+5.171577e-01
+5.233493e-01
+5.295485e-01
+5.357555e-01
+5.419704e-01
+5.481936e-01
+5.544249e-01
+5.606645e-01
+5.669128e-01
+5.731696e-01
+5.794353e-01
+5.857099e-01
+5.919936e-01
+5.982866e-01
+6.045887e-01
+6.109006e-01
+6.172222e-01
+6.235535e-01
+6.298949e-01
+6.362462e-01
+6.426080e-01
+6.489801e-01
+6.553628e-01
+6.617563e-01
+6.681607e-01
+6.745759e-01
+6.810026e-01
+6.874405e-01
+6.938899e-01
+7.003511e-01
+7.068239e-01
+7.133089e-01
+7.198059e-01
+7.263153e-01
+7.328371e-01
+7.393714e-01
+7.459188e-01
+7.524789e-01
+7.590522e-01
+7.656388e-01
+7.722388e-01
+7.788525e-01
+7.854800e-01
+7.921213e-01
+7.987769e-01
+8.054467e-01
+8.121310e-01
+8.188299e-01
+8.255436e-01
+
+# IO
+
+10 0.0039994
+1.548324e-08
+1.343135e-04
+5.321354e-04
+1.194477e-03
+2.122313e-03
+3.316656e-03
+4.778475e-03
+6.508842e-03
+8.508757e-03
+1.077920e-02
+1.332131e-02
+1.613602e-02
+1.922446e-02
+2.258772e-02
+2.622679e-02
+3.014287e-02
+3.433689e-02
+3.881016e-02
+4.356351e-02
+4.859835e-02
+5.391562e-02
+5.951655e-02
+6.540227e-02
+7.157391e-02
+7.803261e-02
+8.477968e-02
+9.181613e-02
+9.914321e-02
+1.067622e-01
+1.147027e-01
+1.231256e-01
+1.320572e-01
+1.414999e-01
+1.514556e-01
+1.619263e-01
+1.729141e-01
+1.844213e-01
+1.964498e-01
+2.090018e-01
+2.220794e-01
+2.356849e-01
+2.498205e-01
+2.644882e-01
+2.796904e-01
+2.954296e-01
+3.117146e-01
+3.285555e-01
+3.459548e-01
+3.639148e-01
+3.824377e-01
+4.015266e-01
+4.211828e-01
+4.414096e-01
+4.622095e-01
+4.835844e-01
+5.055373e-01
+5.280704e-01
+5.511866e-01
+5.748880e-01
+5.991776e-01
+6.240578e-01
+6.495309e-01
+6.756005e-01
+7.022686e-01
+7.295516e-01
+7.580042e-01
+7.879207e-01
+8.193069e-01
+8.521686e-01
+8.865120e-01
+9.223430e-01
+9.596677e-01
+9.984932e-01
+1.038825e+00
+1.080668e+00
+1.124031e+00
+1.168742e+00
+1.214357e+00
+1.260858e+00
+1.308248e+00
+1.356531e+00
+1.405711e+00
+1.455794e+00
+1.506782e+00
+1.558681e+00
+1.611493e+00
+1.665225e+00
+1.719880e+00
+1.775462e+00
+1.831976e+00
+1.889427e+00
+1.947818e+00
+2.007155e+00
+2.067442e+00
+2.128684e+00
+2.190884e+00
+2.254048e+00
+2.318181e+00
+2.383287e+00
+2.449371e+00
+2.516407e+00
+2.584216e+00
+2.652771e+00
+2.722077e+00
+2.792139e+00
+2.862960e+00
+2.934543e+00
+3.006895e+00
+3.080017e+00
+3.153915e+00
+3.228592e+00
+3.304054e+00
+3.380304e+00
+3.457345e+00
+3.535184e+00
+3.613824e+00
+3.693270e+00
+3.773524e+00
+3.854593e+00
+3.936480e+00
+4.019191e+00
+4.102730e+00
+4.187100e+00
+4.272307e+00
+4.358356e+00
+4.445251e+00
+4.532996e+00
+4.621596e+00
+4.711059e+00
+4.801383e+00
+4.892579e+00
+4.984648e+00
+5.077598e+00
+5.171432e+00
+5.266154e+00
+5.361772e+00
+5.458289e+00
+5.555709e+00
+5.654039e+00
+5.753284e+00
+5.853448e+00
+5.954535e+00
+6.056556e+00
+6.159509e+00
+6.263404e+00
+6.368245e+00
+6.474037e+00
+6.580783e+00
+6.688495e+00
+6.797172e+00
+6.906823e+00
+7.017363e+00
+7.128183e+00
+7.239166e+00
+7.350314e+00
+7.461631e+00
+7.573121e+00
+7.684782e+00
+7.796621e+00
+7.908639e+00
+8.020841e+00
+8.133224e+00
+8.245797e+00
+8.358559e+00
+8.471514e+00
+8.584663e+00
+8.698013e+00
+8.811561e+00
+8.925313e+00
+9.039273e+00
+9.153440e+00
+9.267821e+00
+9.382416e+00
+9.497229e+00
+9.612263e+00
+9.727519e+00
+9.843000e+00
+9.958714e+00
+1.007466e+01
+1.019084e+01
+1.030725e+01
+1.042391e+01
+1.054081e+01
+1.065796e+01
+1.077536e+01
+1.089301e+01
+1.101092e+01
+1.112909e+01
+1.124752e+01
+1.136621e+01
+1.148517e+01
+1.160440e+01
+1.172391e+01
+1.184370e+01
+1.196376e+01
+1.208411e+01
+1.220475e+01
+1.232567e+01
+1.244690e+01
+1.256841e+01
+
+# IBa
+
+10 0.0039994
+4.742873e-13
+4.113645e-09
+1.629792e-08
+3.658374e-08
+6.500136e-08
+1.015810e-07
+1.463527e-07
+1.993490e-07
+2.606012e-07
+3.301393e-07
+4.079975e-07
+4.942058e-07
+5.887978e-07
+6.918053e-07
+8.032612e-07
+9.231990e-07
+1.051651e-06
+1.188656e-06
+1.334241e-06
+1.488444e-06
+1.650962e-06
+1.811784e-06
+1.966192e-06
+2.114168e-06
+2.255694e-06
+2.390747e-06
+2.519303e-06
+2.641344e-06
+2.756845e-06
+2.865787e-06
+2.968145e-06
+3.063898e-06
+3.153023e-06
+3.235497e-06
+3.311297e-06
+3.380400e-06
+3.442783e-06
+3.498420e-06
+3.547290e-06
+3.589367e-06
+3.624626e-06
+3.653045e-06
+3.674597e-06
+3.689259e-06
+3.697004e-06
+3.701106e-06
+3.705159e-06
+3.709162e-06
+3.713116e-06
+3.717021e-06
+3.720877e-06
+3.724683e-06
+3.728440e-06
+3.732147e-06
+3.735805e-06
+3.739412e-06
+3.742970e-06
+3.746478e-06
+3.749935e-06
+3.753342e-06
+3.756698e-06
+3.760004e-06
+3.763260e-06
+3.766464e-06
+3.769617e-06
+3.772720e-06
+3.775771e-06
+3.778770e-06
+3.781718e-06
+3.784615e-06
+3.787459e-06
+3.790252e-06
+3.792992e-06
+3.795681e-06
+3.798317e-06
+3.800900e-06
+3.803431e-06
+3.805909e-06
+3.808334e-06
+3.810706e-06
+3.813024e-06
+3.815290e-06
+3.817501e-06
+3.819659e-06
+3.821763e-06
+3.823813e-06
+3.825809e-06
+3.827750e-06
+3.829637e-06
+3.831469e-06
+3.833246e-06
+3.834968e-06
+3.836635e-06
+3.838246e-06
+3.839803e-06
+3.841302e-06
+3.842747e-06
+3.844134e-06
+3.845466e-06
+3.846741e-06
+3.847960e-06
+3.849122e-06
+3.850226e-06
+3.851274e-06
+3.852263e-06
+3.853196e-06
+3.854070e-06
+3.854887e-06
+3.855645e-06
+3.856345e-06
+3.856986e-06
+3.857569e-06
+3.858092e-06
+3.858556e-06
+3.858961e-06
+3.859305e-06
+3.859590e-06
+3.859815e-06
+3.859980e-06
+3.860084e-06
+3.860127e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+3.860129e-06
+
+# IMetals
+
+10 0.0039994
+4.633330e-08
+4.014745e-04
+1.590624e-03
+3.570437e-03
+6.343901e-03
+9.913921e-03
+1.428360e-02
+1.945579e-02
+2.543384e-02
+3.222060e-02
+3.981930e-02
+4.823291e-02
+5.746472e-02
+6.751788e-02
+7.839572e-02
+9.010136e-02
+1.026380e-01
+1.160089e-01
+1.302177e-01
+1.452674e-01
+1.611614e-01
+1.779033e-01
+1.954967e-01
+2.139444e-01
+2.332507e-01
+2.534182e-01
+2.744510e-01
+2.963529e-01
+3.191268e-01
+3.427598e-01
+3.671589e-01
+3.923125e-01
+4.182239e-01
+4.448965e-01
+4.723332e-01
+5.005374e-01
+5.295126e-01
+5.592623e-01
+5.897899e-01
+6.210983e-01
+6.531913e-01
+6.860726e-01
+7.197449e-01
+7.542126e-01
+7.894793e-01
+8.254931e-01
+8.621979e-01
+8.995979e-01
+9.376955e-01
+9.764936e-01
+1.015996e+00
+1.056206e+00
+1.097127e+00
+1.138762e+00
+1.181115e+00
+1.224189e+00
+1.267987e+00
+1.312513e+00
+1.357771e+00
+1.403763e+00
+1.450493e+00
+1.497966e+00
+1.546184e+00
+1.595151e+00
+1.644886e+00
+1.695914e+00
+1.748519e+00
+1.802708e+00
+1.858486e+00
+1.915862e+00
+1.974841e+00
+2.035432e+00
+2.097641e+00
+2.161473e+00
+2.226938e+00
+2.294042e+00
+2.362634e+00
+2.432316e+00
+2.503072e+00
+2.574906e+00
+2.647827e+00
+2.721836e+00
+2.796943e+00
+2.873148e+00
+2.950460e+00
+3.028884e+00
+3.108426e+00
+3.189089e+00
+3.270881e+00
+3.353807e+00
+3.437873e+00
+3.523083e+00
+3.609445e+00
+3.696963e+00
+3.785644e+00
+3.875494e+00
+3.966517e+00
+4.058722e+00
+4.152112e+00
+4.246696e+00
+4.342418e+00
+4.438928e+00
+4.536171e+00
+4.634156e+00
+4.732883e+00
+4.832357e+00
+4.932586e+00
+5.033572e+00
+5.135320e+00
+5.237833e+00
+5.341118e+00
+5.445178e+00
+5.550020e+00
+5.655647e+00
+5.762063e+00
+5.869275e+00
+5.977286e+00
+6.086102e+00
+6.195728e+00
+6.306168e+00
+6.417427e+00
+6.529510e+00
+6.642424e+00
+6.756171e+00
+6.870759e+00
+6.986192e+00
+7.102474e+00
+7.219611e+00
+7.337611e+00
+7.456473e+00
+7.576210e+00
+7.696819e+00
+7.818314e+00
+7.940693e+00
+8.063968e+00
+8.188139e+00
+8.313214e+00
+8.439197e+00
+8.566096e+00
+8.693916e+00
+8.822662e+00
+8.952339e+00
+9.082955e+00
+9.214515e+00
+9.347023e+00
+9.480485e+00
+9.614911e+00
+9.750301e+00
+9.886665e+00
+1.002401e+01
+1.016234e+01
+1.030157e+01
+1.044110e+01
+1.058081e+01
+1.072071e+01
+1.086081e+01
+1.100110e+01
+1.114158e+01
+1.128227e+01
+1.142316e+01
+1.156426e+01
+1.170557e+01
+1.184709e+01
+1.198883e+01
+1.213080e+01
+1.227298e+01
+1.241539e+01
+1.255804e+01
+1.270091e+01
+1.284403e+01
+1.298739e+01
+1.313099e+01
+1.327484e+01
+1.341894e+01
+1.356329e+01
+1.370791e+01
+1.385278e+01
+1.399792e+01
+1.414333e+01
+1.428901e+01
+1.443497e+01
+1.458121e+01
+1.472774e+01
+1.487455e+01
+1.502165e+01
+1.516904e+01
+1.531673e+01
+1.546473e+01
+1.561303e+01
+1.576164e+01
+1.591057e+01
+1.605980e+01
+1.620937e+01
+1.635925e+01
+1.650947e+01
+1.666002e+01
+1.681090e+01
+1.696213e+01
+1.711370e+01
+1.726562e+01
+
+# Mean WD Mass
+
+1.380000
+
+# SNIa Metal Ejection
+
+# Number of elements
+5
+
+# Ej
+0.0
+
+# Ejnp
+0.0
+
+# Fe
+7.434630e-01
+
+# Mg
+8.572300e-03
+
+# O
+1.430000e-01
+
+# Ba
+0.000000e+00
+
+# Metals
+1.370000e+00
+
+
+# Element Solar Abundances
+
+# Number of elements
+5
+
+# Fe
+0.00176604
+
+# Mg
+0.000924316
+
+# O
+0.0108169
+
+# Ba
+1.85267e-08
+
+# Metals
+0.02
+
diff --git a/PyChem/shared/examples/Readme b/PyChem/shared/examples/Readme
new file mode 100644
index 0000000..7ab5f0f
--- /dev/null
+++ b/PyChem/shared/examples/Readme
@@ -0,0 +1,18 @@
+
+##########
+# SNII ()
+##########
+
+from PyChem import chemistry
+chemistry.init_chimie("../chemistry.simple.dat")
+chemistry.SNII_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())
+chemistry.get_allelts_labels()
+
+##########
+# SNIa ()
+##########
+
+from PyChem import chemistry
+chemistry.init_chimie("../chemistry.simple.dat")
+chemistry.SNIa_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())[2:]
+chemistry.get_allelts_labels()
diff --git a/PyChem/shared/tables/Francois/FrancoisYields.dat b/PyChem/shared/tables/Francois/FrancoisYields.dat
new file mode 100644
index 0000000..b0a734a
--- /dev/null
+++ b/PyChem/shared/tables/Francois/FrancoisYields.dat
@@ -0,0 +1,19 @@
+ massa Hecore Ztot Remn O16 Mg Si Fe
+ 0.11000E+02 0.27100E+01 0.32204E+00 0.13200E+01 0.43000E-01 0.64400E-01 0.21700E-01 0.80000E-01
+ 0.12000E+02 0.30106E+01 0.51760E+00 0.13200E+01 0.11000E+00 0.57400E-01 0.90900E-01 0.55000E-01
+ 0.13000E+02 0.34806E+01 0.68464E+00 0.14600E+01 0.16100E+00 0.11480E+00 0.58500E-01 0.14600E+00
+ 0.15000E+02 0.42212E+01 0.12832E+01 0.14300E+01 0.55000E+00 0.18690E+00 0.11000E+00 0.12970E+00
+ 0.18000E+02 0.57414E+01 0.21674E+01 0.17600E+01 0.97400E+00 0.38640E+00 0.13700E+00 0.83000E-01
+ 0.19000E+02 0.61381E+01 0.23791E+01 0.19800E+01 0.12700E+01 0.17570E+00 0.27700E+00 0.11700E+00
+ 0.20000E+02 0.67321E+01 0.28856E+01 0.20600E+01 0.17700E+01 0.21910E+00 0.28800E+00 0.10600E+00
+ 0.22000E+02 0.76149E+01 0.35794E+01 0.20200E+01 0.21900E+01 0.29120E+00 0.35600E+00 0.22247E+00
+ 0.25000E+02 0.88465E+01 0.44425E+01 0.20700E+01 0.30300E+01 0.70000E-01 0.31500E+00 0.15000E+00
+ 0.30000E+02 0.10512E+02 0.58886E+01 0.19400E+01 0.46100E+01 0.70000E-01 0.31600E+00 0.25000E-01
+ 0.35000E+02 0.14156E+02 0.69598E+01 0.38600E+01 0.55200E+01 0.70000E-01 0.11200E+00 0.27700E-01
+ 0.40000E+02 0.16429E+02 0.74799E+01 0.54500E+01 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.50000E+02 0.13963E+02 0.80129E+01 0.24500E+01 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.60000E+02 0.14329E+02 0.83788E+01 0.24500E+01 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.70000E+02 0.14597E+02 0.86468E+01 0.24500E+01 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.80000E+02 0.14808E+02 0.88578E+01 0.24500E+01 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.90000E+02 0.14966E+02 0.90158E+01 0.24500E+01 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.10000E+03 0.15103E+02 0.91528E+01 0.24500E+01 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01
diff --git a/PyChem/shared/tables/Francois/HeliumCore.dat b/PyChem/shared/tables/Francois/HeliumCore.dat
new file mode 100644
index 0000000..2436e65
--- /dev/null
+++ b/PyChem/shared/tables/Francois/HeliumCore.dat
@@ -0,0 +1,35 @@
+# Mass Residu Helium Core
+0.80 0.459 0.459
+1.00 0.473 0.473
+1.50 0.480 0.480
+1.75 0.487 0.487
+2.00 0.404 0.404
+2.50 0.501 0.501
+3.00 0.508 0.508
+3.50 0.515 0.515
+4.00 0.550 0.550
+4.30 0.620 0.620
+4.60 0.675 0.675
+4.80 0.730 0.730
+5.00 0.870 0.870
+6.00 1.010 1.010
+8.00 1.120 1.120
+10.0 1.150 1.150
+ 0.11000E+02 0.13200E+01 0.27100E+01
+ 0.12000E+02 0.13200E+01 0.30106E+01
+ 0.13000E+02 0.14600E+01 0.34806E+01
+ 0.15000E+02 0.14300E+01 0.42212E+01
+ 0.18000E+02 0.17600E+01 0.57414E+01
+ 0.19000E+02 0.19800E+01 0.61381E+01
+ 0.20000E+02 0.20600E+01 0.67321E+01
+ 0.22000E+02 0.20200E+01 0.76149E+01
+ 0.25000E+02 0.20700E+01 0.88465E+01
+ 0.30000E+02 0.19400E+01 0.10512E+02
+ 0.35000E+02 0.38600E+01 0.14156E+02
+ 0.40000E+02 0.54500E+01 0.16429E+02
+ 0.50000E+02 0.24500E+01 0.13963E+02
+ 0.60000E+02 0.24500E+01 0.14329E+02
+ 0.70000E+02 0.24500E+01 0.14597E+02
+ 0.80000E+02 0.24500E+01 0.14808E+02
+ 0.90000E+02 0.24500E+01 0.14966E+02
+ 0.10000E+03 0.24500E+01 0.15103E+02
diff --git a/PyChem/shared/tables/Francois/Readme b/PyChem/shared/tables/Francois/Readme
new file mode 100644
index 0000000..a06987a
--- /dev/null
+++ b/PyChem/shared/tables/Francois/Readme
@@ -0,0 +1,27 @@
+Dear Yves,
+
+I send you the table with the mass ejecta for the elements O, Mg, Si, and Fe,
+plus the mass in the He_core, in the remnant and the total metal ejection.
+This table is based on the work by François et al (2004) who changed the
+the tables by WW95 (the ones for solar metallicity) in order to best match
+the observational data at low metallicity in our Galaxy (the so-called observational yields)
+
+To stay in his same "scenario" I guess it is better to use his same yields for SNIa
+which are for these elements (or at least for the next future)
+
+ QIa(3)= 0.143 ! 3)O16
+ QIa(7)= 0.0425 ! 7)Mg
+ QIa(8)= 0.154 ! 8)Si
+ QIa(9)= 0.4 (*) ! 9)Fe
+
+
+I hope the table is fine, let me know! Of course I am ready to change format
+or, for example put the mass fraction rather than the mass.
+...then please send we the integral you obtain, just to have a cross check!
+
+Ciao!
+
+Gabriele
+
+(*) this is a bit weird but it is what he uses in that paper...
+I prefer the value 0.6 that is closer to the observational values.
diff --git a/PyChem/shared/tables/Francois/yieldsSNII.txt b/PyChem/shared/tables/Francois/yieldsSNII.txt
new file mode 100644
index 0000000..2c091ec
--- /dev/null
+++ b/PyChem/shared/tables/Francois/yieldsSNII.txt
@@ -0,0 +1,20 @@
+# M O16 Mg Si Fe Metals
+ 10 0 0 0 0 0
+ 0.11000E+02 0.43000E-01 0.64400E-01 0.21700E-01 0.80000E-01 0.32204E+00
+ 0.12000E+02 0.11000E+00 0.57400E-01 0.90900E-01 0.55000E-01 0.51760E+00
+ 0.13000E+02 0.16100E+00 0.11480E+00 0.58500E-01 0.14600E+00 0.68464E+00
+ 0.15000E+02 0.55000E+00 0.18690E+00 0.11000E+00 0.12970E+00 0.12832E+01
+ 0.18000E+02 0.97400E+00 0.38640E+00 0.13700E+00 0.83000E-01 0.21674E+01
+ 0.19000E+02 0.12700E+01 0.17570E+00 0.27700E+00 0.11700E+00 0.23791E+01
+ 0.20000E+02 0.17700E+01 0.21910E+00 0.28800E+00 0.10600E+00 0.28856E+01
+ 0.22000E+02 0.21900E+01 0.29120E+00 0.35600E+00 0.22247E+00 0.35794E+01
+ 0.25000E+02 0.30300E+01 0.70000E-01 0.31500E+00 0.15000E+00 0.44425E+01
+ 0.30000E+02 0.46100E+01 0.70000E-01 0.31600E+00 0.25000E-01 0.58886E+01
+ 0.35000E+02 0.55200E+01 0.70000E-01 0.11200E+00 0.27700E-01 0.69598E+01
+ 0.40000E+02 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01 0.74799E+01
+ 0.50000E+02 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01 0.80129E+01
+ 0.60000E+02 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01 0.83788E+01
+ 0.70000E+02 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01 0.86468E+01
+ 0.80000E+02 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01 0.88578E+01
+ 0.90000E+02 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01 0.90158E+01
+ 0.10000E+03 0.57000E+01 0.70000E-01 0.54600E-01 0.28300E-01 0.91528E+01
diff --git a/PyChem/shared/tables/Francois/yields_SNIa_francois.txt b/PyChem/shared/tables/Francois/yields_SNIa_francois.txt
new file mode 100644
index 0000000..e23dad0
--- /dev/null
+++ b/PyChem/shared/tables/Francois/yields_SNIa_francois.txt
@@ -0,0 +1,2 @@
+# C12 C13 N14 N15 O16 O17 O18 F19 Ne20 Ne21 Ne22 Na23 Mg Al27 Si P31 S32 S33 S34 S36 Cl35 Cl37 Ar36 Ar38 Ar40 K39 K41 Ca40 Ca42 Ca43 Ca44 Ca46 Ca48 Sc45 Ti46 Ti47 Ti48 Ti49 Ti50 V50 V51 Cr50 Cr52 Cr53 Cr54 Mn55 Fe Co59 Ni58 Ni60 Ni61 Ni62 Ni64 Cu63 Cu65 Zn64 Zn66 Zn67 Zn68 Ba Eu Metals
+4.83E-02 1.40E-06 1.16E-06 1.32E-09 1.43E-01 3.54E-08 8.25E-10 5.67E-10 2.02E-03 8.46E-06 2.49E-03 6.32E-05 0.0425 9.86E-04 0.154 4.18E-04 8.41E-02 4.50E-04 1.90E-03 3.15E-07 1.34E-04 3.98E-05 1.49E-02 1.06E-03 1.26E-08 8.52E-05 7.44E-06 1.23E-02 3.52E-05 1.03E-07 8.86E-06 1.99E-09 7.10E-12 2.47E-07 1.71E-05 6.04E-07 2.03E-04 1.69E-05 1.26E-05 8.28E-09 5.15E-05 2.71E-04 5.15E-03 7.85E-04 1.90E-04 8.23E-03 0.4 1.02E-03 1.28E-01 1.05E-02 2.51E-04 2.66E-03 1.31E-06 1.79E-06 6.83E-07 1.22E-05 2.12E-05 1.34E-08 1.02E-08 0.00E-00 0.00E-00 1.37E+00
diff --git a/PyChem/shared/tables/Francois/yields_tsujimoto95bis.txt b/PyChem/shared/tables/Francois/yields_tsujimoto95bis.txt
new file mode 100644
index 0000000..6791c73
--- /dev/null
+++ b/PyChem/shared/tables/Francois/yields_tsujimoto95bis.txt
@@ -0,0 +1,9 @@
+# M C12 C13 N14 N15 O17 O18 F19 Ne20 Ne21 Ne22 Na23 Al27 P31 S32 S33 S34 S36 Cl35 Cl37 Ar36 Ar38 Ar40 K39 K41 Ca40 Ca42 Ca43 Ca44 Ca46 Ca48 Sc45 Ti46 Ti47 Ti48 Ti49 Ti50 V50 V51 Cr50 Cr52 Cr53 Cr54 Mn55 Co59 Ni58 Ni60 Ni61 Ni62 Ni64 Cu63 Cu65 Zn64 Zn66 Zn67 Zn68
+10 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00
+13 2.68E-03 9.47E-09 3.75E-08 2.08E-08 6.07E-08 9.44E-09 8.06E-10 2.25E-02 2.08E-04 1.01E-04 7.27E-04 1.04E-03 2.95E-04 1.46E-02 1.19E-04 1.83E-03 3.04E-07 3.70E-05 6.73E-06 2.36E-03 4.85E-04 4.82E-09 1.95E-05 1.42E-06 2.53E-03 1.02E-05 1.91E-06 1.22E-04 2.06E-10 1.13E-13 4.26E-08 2.56E-06 5.13E-06 1.68E-04 3.45E-06 3.56E-10 8.65E-10 9.34E-06 2.30E-05 1.15E-03 9.34E-05 3.35E-08 3.65E-04 1.39E-04 5.82E-03 3.72E-03 1.58E-04 1.05E-03 2.02E-15 1.18E-06 9.11E-07 2.14E-05 1.63E-05 2.13E-08 6.63E-09
+15 8.26E-02 4.97E-10 5.37E-03 1.36E-10 4.41E-09 1.35E-02 2.12E-11 2.08E-02 3.93E-05 1.25E-02 1.53E-04 4.01E-03 6.55E-04 3.01E-02 9.60E-05 1.49E-03 3.34E-07 3.45E-05 9.60E-06 5.63E-03 6.49E-04 3.24E-09 3.31E-05 2.37E-06 5.29E-03 1.63E-05 1.30E-06 7.49E-05 6.23E-11 3.99E-16 7.44E-08 6.26E-06 3.75E-06 1.58E-04 6.10E-06 1.21E-09 8.57E-10 1.25E-05 5.15E-05 1.36E-03 1.35E-04 4.09E-08 4.74E-04 1.22E-04 7.50E-03 3.36E-03 1.43E-04 9.50E-04 4.28E-15 1.01E-06 7.17E-07 1.99E-05 1.30E-05 1.54E-08 7.35E-09
+18 1.65E-01 7.73E-10 3.39E-03 9.05E-08 4.01E-07 8.67E-03 7.67E-09 1.61E-01 2.19E-03 2.74E-02 7.25E-03 5.44E-03 4.11E-04 3.76E-02 1.48E-04 1.89E-03 8.08E-07 8.95E-05 1.04E-05 6.13E-03 6.29E-04 1.42E-08 3.66E-05 2.23E-06 5.11E-03 1.45E-05 3.99E-07 1.43E-05 3.23E-11 1.07E-15 1.18E-07 6.72E-06 3.11E-07 8.59E-05 7.54E-06 1.17E-10 4.64E-10 1.25E-05 7.49E-05 1.44E-03 1.50E-04 2.53E-08 5.48E-04 4.82E-05 3.08E-03 8.71E-04 4.77E-05 2.52E-04 2.93E-16 4.32E-07 8.40E-08 3.89E-06 4.47E-06 3.39E-09 8.36E-10
+20 1.14E-01 1.17E-10 2.72E-03 6.48E-10 9.86E-09 8.68E-03 7.84E-11 2.29E-01 3.03E-04 2.93E-02 1.15E-03 1.55E-02 1.05E-03 2.29E-02 8.84E-05 1.26E-03 4.23E-07 6.05E-05 4.96E-06 3.78E-03 3.25E-04 4.65E-09 3.24E-05 1.28E-06 3.25E-03 9.45E-06 3.38E-06 9.15E-05 1.12E-11 2.41E-16 1.04E-07 6.81E-06 1.73E-06 1.85E-04 4.89E-06 1.12E-10 2.15E-10 6.40E-06 3.54E-05 8.64E-04 7.12E-05 6.26E-09 2.27E-04 1.31E-04 3.71E-03 2.18E-03 1.59E-04 7.26E-04 2.06E-15 3.00E-06 7.02E-07 1.78E-05 2.08E-05 6.39E-08 5.33E-09
+25 1.48E-01 1.03E-08 9.53E-04 1.04E-08 7.86E-08 6.69E-03 8.17E-10 5.94E-01 3.22E-03 3.39E-02 1.81E-02 1.95E-02 9.02E-04 3.84E-02 2.20E-04 2.77E-03 7.51E-07 6.72E-05 1.32E-05 6.71E-03 7.24E-04 8.92E-09 3.47E-05 2.79E-06 6.15E-03 1.77E-05 2.78E-07 2.11E-05 2.60E-10 1.70E-14 8.96E-08 6.84E-06 9.11E-07 8.98E-05 6.01E-06 5.90E-10 7.99E-10 9.96E-06 5.01E-05 1.31E-03 1.39E-04 2.41E-08 5.02E-04 2.19E-05 1.33E-03 6.67E-04 2.75E-05 1.70E-04 6.08E-15 1.50E-07 1.42E-07 3.10E-06 2.58E-06 2.95E-09 9.29E-10
+40 1.48E-01 3.02E-10 7.08E-05 1.19E-08 3.13E-07 1.79E-06 7.38E-10 6.58E-01 2.36E-03 5.66E-02 2.37E-02 8.05E-02 5.99E-03 1.77E-01 7.49E-04 1.14E-02 1.40E-05 4.75E-04 1.17E-04 3.11E-02 9.14E-03 1.74E-07 3.83E-04 3.43E-05 2.56E-02 3.13E-04 4.02E-07 2.00E-05 4.39E-10 2.48E-13 1.53E-06 3.56E-05 9.74E-07 1.58E-04 2.17E-05 2.00E-10 2.14E-09 2.73E-05 1.49E-04 2.77E-03 3.56E-04 2.81E-08 8.41E-04 2.51E-05 3.31E-03 3.88E-04 2.57E-05 1.11E-04 6.49E-16 1.62E-07 1.89E-08 8.79E-07 9.99E-07 2.51E-10 1.20E-10
+70 4.67E-01 2.57E-10 7.68E-03 2.36E-10 6.64E-10 3.80E-03 2.63E-15 2.00E+00 1.14E-02 5.23E-02 6.98E-02 1.44E-01 2.57E-02 2.05E-01 1.02E-03 1.98E-02 2.17E-06 1.76E-03 1.01E-04 2.92E-02 6.16E-03 5.07E-08 3.84E-04 2.84E-05 2.14E-02 1.64E-04 4.09E-06 2.97E-04 2.23E-10 2.36E-14 2.78E-06 1.44E-05 6.26E-07 1.42E-04 6.97E-06 2.56E-10 1.52E-09 1.15E-05 1.01E-04 6.86E-04 1.00E-04 7.61E-08 3.64E-04 1.59E-04 9.25E-03 1.77E-03 1.55E-04 1.28E-03 4.33E-12 9.09E-06 5.34E-07 1.02E-05 3.09E-05 1.95E-07 9.51E-08
diff --git a/PyChem/shared/tables/HeliumCore.dat b/PyChem/shared/tables/HeliumCore.dat
new file mode 100644
index 0000000..73945f9
--- /dev/null
+++ b/PyChem/shared/tables/HeliumCore.dat
@@ -0,0 +1,24 @@
+# Mass Residu Helium Core
+0.80 0.459 0.459
+1.00 0.473 0.473
+1.50 0.480 0.480
+1.75 0.487 0.487
+2.00 0.404 0.404
+2.50 0.501 0.501
+3.00 0.508 0.508
+3.50 0.515 0.515
+4.00 0.550 0.550
+4.30 0.620 0.620
+4.60 0.675 0.675
+4.80 0.730 0.730
+5.00 0.870 0.870
+6.00 1.010 1.010
+8.00 1.120 1.120
+10.0 1.150 1.150
+13.0 1.500 3.300
+15.0 1.500 4.000
+18.0 1.500 5.000
+20.0 1.600 6.000
+25.0 2.000 8.000
+40.0 2.300 16.00
+70.0 2.500 32.00
diff --git a/PyChem/shared/tables/Lifetime/.svn/all-wcprops b/PyChem/shared/tables/Lifetime/.svn/all-wcprops
new file mode 100644
index 0000000..9562ef3
--- /dev/null
+++ b/PyChem/shared/tables/Lifetime/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 34
+/svn/chemistry/!svn/ver/2/Lifetime
+END
+liblifetime.py
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/svn/chemistry/!svn/ver/2/Lifetime/liblifetime.py
+END
diff --git a/PyChem/shared/tables/Lifetime/.svn/entries b/PyChem/shared/tables/Lifetime/.svn/entries
new file mode 100644
index 0000000..1a07a7c
--- /dev/null
+++ b/PyChem/shared/tables/Lifetime/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+2
+https://svn.epfl.ch/svn/chemistry/Lifetime
+https://svn.epfl.ch/svn/chemistry
+
+
+
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3206ecf2-eaf6-43ec-8d24-0b1ce831b07a
+
+liblifetime.py
+file
+
+
+
+
+2011-06-11T17:21:38.192641Z
+5968ec05e841b4de5d6f55a141ad64fc
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+309
+
diff --git a/PyChem/shared/tables/Lifetime/.svn/text-base/liblifetime.py.svn-base b/PyChem/shared/tables/Lifetime/.svn/text-base/liblifetime.py.svn-base
new file mode 100644
index 0000000..e6161ad
--- /dev/null
+++ b/PyChem/shared/tables/Lifetime/.svn/text-base/liblifetime.py.svn-base
@@ -0,0 +1,9 @@
+
+def WriteParams(f):
+
+ f.write("#### Livetime ####\n")
+ f.write("\n")
+ f.write("-40.1107251082866 5.50992173040633 0.782431795366473\n")
+ f.write(" 141.929566656232 -15.88948185575660 -3.255779246324010\n")
+ f.write("-261.365531429482 17.07350618651300 9.866058678313810\n")
+ f.write("\n")
diff --git a/PyChem/shared/tables/Lifetime/liblifetime.py b/PyChem/shared/tables/Lifetime/liblifetime.py
new file mode 100644
index 0000000..e6161ad
--- /dev/null
+++ b/PyChem/shared/tables/Lifetime/liblifetime.py
@@ -0,0 +1,9 @@
+
+def WriteParams(f):
+
+ f.write("#### Livetime ####\n")
+ f.write("\n")
+ f.write("-40.1107251082866 5.50992173040633 0.782431795366473\n")
+ f.write(" 141.929566656232 -15.88948185575660 -3.255779246324010\n")
+ f.write("-261.365531429482 17.07350618651300 9.866058678313810\n")
+ f.write("\n")
diff --git a/PyChem/shared/tables/MetalEjection.dat b/PyChem/shared/tables/MetalEjection.dat
new file mode 100644
index 0000000..d2b675d
--- /dev/null
+++ b/PyChem/shared/tables/MetalEjection.dat
@@ -0,0 +1,9 @@
+# M Fe56 Mg24 O16 Metals
+10 0.0 0.0 0.0 0.0
+13 1.50e-1 9.23e-3 1.51e-1 4.51e-1
+15 1.44e-1 3.16e-2 3.55e-1 8.20e-1
+18 7.57e-2 3.62e-2 7.92e-1 1.45
+20 7.32e-2 1.47e-1 1.48 2.28
+25 5.24e-2 1.59e-1 2.99 4.28
+40 7.50e-2 3.54e-1 9.11 11.47
+70 7.50e-2 7.87e-1 21.4 26.71
diff --git a/PyChem/shared/tables/MetalSNII/.svn/all-wcprops b/PyChem/shared/tables/MetalSNII/.svn/all-wcprops
new file mode 100644
index 0000000..10a7a29
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/all-wcprops
@@ -0,0 +1,161 @@
+K 25
+svn:wc:ra_dav:version-url
+V 35
+/svn/chemistry/!svn/ver/2/MetalSNII
+END
+convert_yields.py
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/svn/chemistry/!svn/ver/2/MetalSNII/convert_yields.py
+END
+plot_both.py
+K 25
+svn:wc:ra_dav:version-url
+V 48
+/svn/chemistry/!svn/ver/2/MetalSNII/plot_both.py
+END
+tsujimoto95.pdf
+K 25
+svn:wc:ra_dav:version-url
+V 51
+/svn/chemistry/!svn/ver/2/MetalSNII/tsujimoto95.pdf
+END
+plot_P.py
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/svn/chemistry/!svn/ver/2/MetalSNII/plot_P.py
+END
+libmetalsSNII.py
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/chemistry/!svn/ver/2/MetalSNII/libmetalsSNII.py
+END
+woosley95.pdf
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/svn/chemistry/!svn/ver/2/MetalSNII/woosley95.pdf
+END
+libimf.py
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/svn/chemistry/!svn/ver/2/MetalSNII/libimf.py
+END
+chemyves.dat
+K 25
+svn:wc:ra_dav:version-url
+V 48
+/svn/chemistry/!svn/ver/2/MetalSNII/chemyves.dat
+END
+MetalEjection.dat
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/svn/chemistry/!svn/ver/2/MetalSNII/MetalEjection.dat
+END
+sto.libmetalsSNII.py
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svn/chemistry/!svn/ver/2/MetalSNII/sto.libmetalsSNII.py
+END
+Readme
+K 25
+svn:wc:ra_dav:version-url
+V 42
+/svn/chemistry/!svn/ver/2/MetalSNII/Readme
+END
+woosley95.txt
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/svn/chemistry/!svn/ver/2/MetalSNII/woosley95.txt
+END
+yields_tsujimoto95bis.txt
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svn/chemistry/!svn/ver/2/MetalSNII/yields_tsujimoto95bis.txt
+END
+cescutti06.pdf
+K 25
+svn:wc:ra_dav:version-url
+V 50
+/svn/chemistry/!svn/ver/2/MetalSNII/cescutti06.pdf
+END
+yields_tsujimoto95.txt
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svn/chemistry/!svn/ver/2/MetalSNII/yields_tsujimoto95.txt
+END
+HeliumCore.dat
+K 25
+svn:wc:ra_dav:version-url
+V 50
+/svn/chemistry/!svn/ver/2/MetalSNII/HeliumCore.dat
+END
+image.png
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/svn/chemistry/!svn/ver/2/MetalSNII/image.png
+END
+chimie.dat
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/svn/chemistry/!svn/ver/2/MetalSNII/chimie.dat
+END
+plot.py
+K 25
+svn:wc:ra_dav:version-url
+V 43
+/svn/chemistry/!svn/ver/2/MetalSNII/plot.py
+END
+barium.py
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/svn/chemistry/!svn/ver/2/MetalSNII/barium.py
+END
+convert.py
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/svn/chemistry/!svn/ver/2/MetalSNII/convert.py
+END
+cescutti2006bis.txt
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svn/chemistry/!svn/ver/2/MetalSNII/cescutti2006bis.txt
+END
+cescutti2006.txt
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/chemistry/!svn/ver/2/MetalSNII/cescutti2006.txt
+END
+computeIntegrals.py
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svn/chemistry/!svn/ver/2/MetalSNII/computeIntegrals.py
+END
+ComputeIntegrals.py
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svn/chemistry/!svn/ver/2/MetalSNII/ComputeIntegrals.py
+END
+chemseb.dat
+K 25
+svn:wc:ra_dav:version-url
+V 47
+/svn/chemistry/!svn/ver/2/MetalSNII/chemseb.dat
+END
diff --git a/PyChem/shared/tables/MetalSNII/.svn/entries b/PyChem/shared/tables/MetalSNII/.svn/entries
new file mode 100644
index 0000000..76c0d75
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/entries
@@ -0,0 +1,912 @@
+10
+
+dir
+2
+https://svn.epfl.ch/svn/chemistry/MetalSNII
+https://svn.epfl.ch/svn/chemistry
+
+
+
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3206ecf2-eaf6-43ec-8d24-0b1ce831b07a
+
+convert_yields.py
+file
+
+
+
+
+2011-06-11T17:22:09.079427Z
+074da418baefc7b2bfb3005543aef618
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+758
+
+plot_both.py
+file
+
+
+
+
+2011-06-11T17:22:09.236948Z
+aa6732eb2698fc1c76cbb162623b2879
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6586
+
+tsujimoto95.pdf
+file
+
+
+
+
+2011-06-11T17:22:09.417271Z
+457612f3aa4be86e996190c0a7599470
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1835553
+
+plot_P.py
+file
+
+
+
+
+2011-06-11T17:22:09.565082Z
+98b454497e9f0c83f005c14039f2a194
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5717
+
+libmetalsSNII.py
+file
+
+
+
+
+2011-06-11T17:22:09.705554Z
+9a50c1df85b30ea243db695ded552b11
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8731
+
+woosley95.pdf
+file
+
+
+
+
+2011-06-11T17:22:09.881637Z
+114852f86560fce51ee555ccdf6d1dfb
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1435149
+
+libimf.py
+file
+
+
+
+
+2011-06-11T17:22:10.042145Z
+b05b6acf4eaedfc92551ba145039076a
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+svn:special
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16
+
+chemyves.dat
+file
+
+
+
+
+2011-06-11T17:22:10.487518Z
+9ac271a5a59b0b47441b47719b52d3a9
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8566
+
+MetalEjection.dat
+file
+
+
+
+
+2011-06-11T17:22:10.341916Z
+30fa86da4ebb022ac69fea08ac08296b
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+267
+
+sto.libmetalsSNII.py
+file
+
+
+
+
+2011-06-11T17:22:10.182540Z
+ca5a5c99d9847c0729523ff1903b6c9a
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7466
+
+Readme
+file
+
+
+
+
+2011-06-11T17:22:10.976965Z
+2963723c35e2375e43bdacbd6560c0c7
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1132
+
+woosley95.txt
+file
+
+
+
+
+2011-06-11T17:22:10.676017Z
+96f272cff8ef2083a115b9152d725264
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1142
+
+yields_tsujimoto95bis.txt
+file
+
+
+
+
+2011-06-11T17:22:11.282392Z
+1eb099e9be5b1e9d07ca96d12a58a268
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5168
+
+cescutti06.pdf
+file
+
+
+
+
+2011-06-11T17:22:11.570825Z
+83d6ce7d397c3780f8d74334a935850e
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+472151
+
+yields_tsujimoto95.txt
+file
+
+
+
+
+2011-06-11T17:22:11.722717Z
+b52a67b2c33445cffc443ad89d3910f9
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5459
+
+HeliumCore.dat
+file
+
+
+
+
+2011-06-11T17:22:11.874222Z
+4ca54e0c9f55e3fa025d8bde04f019b2
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+417
+
+image.png
+file
+
+
+
+
+2011-06-11T17:22:12.074087Z
+ab09abe576fcaf12573a1498b72b4364
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16645
+
+chimie.dat
+file
+
+
+
+
+2011-06-11T17:22:12.234263Z
+03a29f6244a9c0d288cd2c1dca66739a
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16971
+
+plot.py
+file
+
+
+
+
+2011-06-11T17:22:12.438058Z
+f42c1bff8ca72608d88df4db36463aa9
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+583
+
+barium.py
+file
+
+
+
+
+2011-06-11T17:22:12.690340Z
+37add228137cc13245c36d1af1f02401
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+586
+
+convert.py
+file
+
+
+
+
+2011-06-11T17:22:13.108465Z
+6000cccdd905f50be8802c5071ef1a06
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5498
+
+cescutti2006bis.txt
+file
+
+
+
+
+2011-06-11T17:22:13.322582Z
+3b4116b75fb16586bc24a65a39f2d1fb
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+89
+
+cescutti2006.txt
+file
+
+
+
+
+2011-06-11T17:22:13.470033Z
+15e617e84b01c2ea58d11203b341f5fc
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+60
+
+computeIntegrals.py
+file
+
+
+
+
+2011-06-11T17:22:13.607690Z
+9bf88d9e9b3a163791fadd3f8e8ace55
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1101
+
+ComputeIntegrals.py
+file
+
+
+
+
+2011-06-11T17:22:13.744231Z
+ddcac9e2f33907e060509f7fcee82025
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4944
+
+chemseb.dat
+file
+
+
+
+
+2011-06-11T17:22:13.895087Z
+2cdd4c0658b80974133e8cebb9c99308
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10929
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/prop-base/barium.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/prop-base/barium.py.svn-base
new file mode 100644
index 0000000..a669705
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/prop-base/barium.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
diff --git a/PyChem/shared/tables/MetalSNII/.svn/prop-base/convert.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/prop-base/convert.py.svn-base
new file mode 100644
index 0000000..a669705
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/prop-base/convert.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
diff --git a/PyChem/shared/tables/MetalSNII/.svn/prop-base/convert_yields.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/prop-base/convert_yields.py.svn-base
new file mode 100644
index 0000000..a669705
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/prop-base/convert_yields.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
diff --git a/PyChem/shared/tables/MetalSNII/.svn/prop-base/image.png.svn-base b/PyChem/shared/tables/MetalSNII/.svn/prop-base/image.png.svn-base
new file mode 100644
index 0000000..5e9587e
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/prop-base/image.png.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
diff --git a/PyChem/shared/tables/MetalSNII/.svn/prop-base/libimf.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/prop-base/libimf.py.svn-base
new file mode 100644
index 0000000..d222469
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/prop-base/libimf.py.svn-base
@@ -0,0 +1,5 @@
+K 11
+svn:special
+V 1
+*
+END
diff --git a/PyChem/shared/tables/MetalSNII/.svn/prop-base/plot.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/prop-base/plot.py.svn-base
new file mode 100644
index 0000000..a669705
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/prop-base/plot.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/ComputeIntegrals.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/ComputeIntegrals.py.svn-base
new file mode 100644
index 0000000..d3ee5e2
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/ComputeIntegrals.py.svn-base
@@ -0,0 +1,237 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+
+
+
+######################################################
+# Parameters
+######################################################
+
+# IMF
+Mmin = 0.05
+Mmax = 50.
+a = -1.35
+
+
+# files
+MetalFile = 'MetalEjection.dat'
+HeliumCoreFile = 'HeliumCore.dat'
+OutputFile = 'chemyves.dat'
+
+
+# number of elements to follow
+nelts = 4
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+lStep1 = (log10(Mmax*1.25) - log10(Mmin1) )/float(n-1)
+lStep2 = (log10(Mmax*1.25) - log10(Mmin2) )/float(n-1)
+
+
+
+b = (a+1)/( Mmax**(a+1) - Mmin**(a+1) )
+
+
+
+
+
+######################################################
+#
+######################################################
+
+
+
+
+M1,Fe,Mg,Ox,Me = pt.io.read_ascii(MetalFile,[0,1,2,3,4])
+Fe = Fe/M1
+Mg = Mg/M1
+Ox = Ox/M1
+Me = Me/M1
+
+
+# read residual and helium core
+M2,Res,Hco = pt.io.read_ascii(HeliumCoreFile,[0,1,2])
+Res = Res/M2
+Hco = Hco/M2
+
+# linear interpolation
+Mi1 = arange(Mmin1,Mmax1+dM,dM)
+Mi2 = arange(Mmin2,Mmax2+dM,dM)
+
+#myNumeric.lininterp1d = myNumeric.quadinterp1d
+
+Fei = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Fe.astype(float32))
+Mgi = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Mg.astype(float32))
+Oxi = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Ox.astype(float32))
+Mei = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Me.astype(float32))
+
+Resi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Res.astype(float32))
+Hcoi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Hco.astype(float32))
+
+Fei = where(Fei<=0,0,Fei)
+Mgi = where(Mgi<=0,0,Mgi)
+Oxi = where(Oxi<=0,0,Oxi)
+Mei = where(Mei<=0,0,Mei)
+
+Resi = where(Resi<=0,0,Resi)
+Hcoi = where(Hcoi<=0,0,Hcoi)
+
+
+# compute integral
+IFe = cumtrapz(b*Mi1**a * Fei,Mi1)
+IMg = cumtrapz(b*Mi1**a * Mgi,Mi1)
+IOx = cumtrapz(b*Mi1**a * Oxi,Mi1)
+IMe = cumtrapz(b*Mi1**a * Mei,Mi1)
+
+IRes = cumtrapz(b*Mi2**a * (1-Resi),Mi2)
+IHco = cumtrapz(b*Mi2**a * (1-Hcoi),Mi2)
+
+
+
+###############################################
+# output
+###############################################
+
+
+Ms1 = 10**(arange(n)*lStep1 + log10(Mmin1))
+Ms2 = 10**(arange(n)*lStep2 + log10(Mmin2))
+
+
+# find corresponding values
+
+IFes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IFe.astype(float32))
+IMgs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IMg.astype(float32))
+IOxs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IOx.astype(float32))
+IMes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IMe.astype(float32))
+
+IRess = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IRes.astype(float32))
+IHcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IHco.astype(float32))
+
+f = open(OutputFile,'w')
+
+f.write("###########################################\n")
+f.write("# Metal Injection #\n")
+f.write("###########################################\n")
+
+f.write("\n# Number of points / Number of elements\n")
+f.write("%d %d\n"%(n,nelts))
+
+f.write("\n# Int ( 1- Residual ) m^a\n")
+f.write("\n%g %g\n"%(Mmin2,lStep2))
+for i in range(len(IRess)):
+ f.write("%e\n"%IRess[i])
+
+f.write("\n# Int ( 1- Helium Core ) m^a\n")
+f.write("\n%g %g\n"%(Mmin2,lStep2))
+for i in range(len(IHcos)):
+ f.write("%e\n"%IHcos[i])
+
+f.write("\n# Int ( Fe ) m^a\n")
+f.write("\n%g %g\n"%(Mmin1,lStep1))
+for i in range(len(IFes)):
+ f.write("%e\n"%IFes[i])
+
+f.write("\n# Int ( Mg ) m^a\n")
+f.write("\n%g %g\n"%(Mmin1,lStep1))
+for i in range(len(IMgs)):
+ f.write("%e\n"%IMgs[i])
+
+f.write("\n# Int ( O ) m^a\n")
+f.write("\n%g %g\n"%(Mmin1,lStep1))
+for i in range(len(IOxs)):
+ f.write("%e\n"%IOxs[i])
+
+f.write("\n# Int ( Metals ) m^a\n")
+f.write("\n%g %g\n"%(Mmin1,lStep1))
+for i in range(len(IMes)):
+ f.write("%e\n"%IMes[i])
+
+
+f.close()
+
+
+###############################################
+# plot
+###############################################
+
+
+# plot 1
+
+pt.subplot(211)
+
+pt.plot(M2,Res,'ko')
+pt.plot(Mi2,Resi,'k-')
+
+pt.plot(M2,Hco,'ro')
+pt.plot(Mi2,Hcoi,'r-')
+
+
+pt.plot(M1,Fe,'yo')
+pt.plot(Mi1,Fei,'y-')
+
+pt.plot(M1,Mg,'go')
+pt.plot(Mi1,Mgi,'g-')
+
+pt.plot(M1,Ox,'bo')
+pt.plot(Mi1,Oxi,'b-')
+
+pt.plot(M1,Me,'co')
+pt.plot(Mi1,Mei,'c-')
+
+pt.semilogx()
+pt.semilogy()
+
+pt.axis([Mmin,Mmax1,1e-4,1e0])
+
+# plot 2
+
+pt.subplot(212)
+
+
+pt.plot(Mi1[1:],IFe*500,'y')
+pt.plot(Mi1[1:],IMg*500,'g')
+pt.plot(Mi1[1:],IOx*10,'b')
+pt.plot(Mi1[1:],IMe*10,'c')
+pt.plot(Mi2[1:],IRes,'k')
+pt.plot(Mi2[1:],IHco,'r')
+
+'''
+pt.plot(Ms1,IFes*500,'o')
+pt.plot(Ms1,IMgs*500,'o')
+pt.plot(Ms1,IOxs*10 ,'o')
+pt.plot(Ms1,IMes*10 ,'o')
+pt.plot(Ms2,IRess,'o')
+pt.plot(Ms2,IHcos,'o')
+'''
+
+
+
+pt.semilogx()
+pt.axis([Mmin,Mmax1,0.,4*b])
+
+pt.show()
+
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/HeliumCore.dat.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/HeliumCore.dat.svn-base
new file mode 100644
index 0000000..73945f9
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/HeliumCore.dat.svn-base
@@ -0,0 +1,24 @@
+# Mass Residu Helium Core
+0.80 0.459 0.459
+1.00 0.473 0.473
+1.50 0.480 0.480
+1.75 0.487 0.487
+2.00 0.404 0.404
+2.50 0.501 0.501
+3.00 0.508 0.508
+3.50 0.515 0.515
+4.00 0.550 0.550
+4.30 0.620 0.620
+4.60 0.675 0.675
+4.80 0.730 0.730
+5.00 0.870 0.870
+6.00 1.010 1.010
+8.00 1.120 1.120
+10.0 1.150 1.150
+13.0 1.500 3.300
+15.0 1.500 4.000
+18.0 1.500 5.000
+20.0 1.600 6.000
+25.0 2.000 8.000
+40.0 2.300 16.00
+70.0 2.500 32.00
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/MetalEjection.dat.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/MetalEjection.dat.svn-base
new file mode 100644
index 0000000..d2b675d
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/MetalEjection.dat.svn-base
@@ -0,0 +1,9 @@
+# M Fe56 Mg24 O16 Metals
+10 0.0 0.0 0.0 0.0
+13 1.50e-1 9.23e-3 1.51e-1 4.51e-1
+15 1.44e-1 3.16e-2 3.55e-1 8.20e-1
+18 7.57e-2 3.62e-2 7.92e-1 1.45
+20 7.32e-2 1.47e-1 1.48 2.28
+25 5.24e-2 1.59e-1 2.99 4.28
+40 7.50e-2 3.54e-1 9.11 11.47
+70 7.50e-2 7.87e-1 21.4 26.71
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/Readme.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/Readme.svn-base
new file mode 100644
index 0000000..7506fba
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/Readme.svn-base
@@ -0,0 +1,78 @@
+MetalEjection.dat Stellar Mass,Fe,Mg,Ox,Metals [in Msol]
+HeliumCore.dat Stellar Mass,Residu,Helium Core [in Msol]
+
+
+(4) calcul de la masse ejectée par SNII
+
+(Poirier : 3.44) : on tabulte I(m) = Int_0^m [1-w(m)] Phi(m) dm
+
+ 3.44 = I(m2) - I(m1)
+
+
+(5) productionde métaux (a) : helium core therm
+
+(Poirier : 3.49) : on tabule I(m) = Int_0^m [1-alph(m)] Phi(m) dm
+
+ 3.49a = I(m2) - I(m1)
+
+
+
+(0,1,2,3) productionde métaux (b)
+
+(Poirier : 3.49) : on tabule I(m) = Int_0^m pk Phi(m) dm
+
+ 3.49b = I(m2) - I(m1)
+
+
+
+-----------------------------------------------------------------------
+
+python computeIntegrals.py
+
+
+python plot_P.py
+
+
+python plot_both.py
+
+
+
+-----------------------------------------------------------------------
+
+Thu Feb 25 14:13:20 CET 2010
+
+elements a ajouter :
+
+FeI
+FeII
+Al
+Ba
+C
+Ca
+Co
+Cr
+Mg
+Mn
+Na
+Ni
+O
+Sc
+Si
+SrII
+TiI
+TiII
+Y
+
+
+-----------------------------------------------------------------------
+# creation des tables
+
+# table brut de tsujimoto95 -> reformatage
+./convert_yields.py yields_tsujimoto95.txt yields_tsujimoto95bis.txt
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/barium.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/barium.py.svn-base
new file mode 100644
index 0000000..69642e5
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/barium.py.svn-base
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+# data from Cescutti 2006, tab 3
+
+import Ptools as pt
+from numpy import *
+import scipy.interpolate
+from pNbody import myNumeric
+
+ms = array([10,12. ,15. ,30.,])
+Ba = array([0,9e-7 ,3e-8 ,1e-9])
+Eu = array([0,4.5e-8,3e-9 ,5e-10])
+
+
+pt.plot(ms,Ba,'o')
+#pt.plot(ms,Eu)
+
+# interpolation
+msi = array([10.,13.,15.,18.,20.,25.,40.,70.])
+
+tck = scipy.interpolate.fitpack.splrep(ms,Ba,k=1,s=0)
+Bai = scipy.interpolate.fitpack.splev(msi,tck)
+#Bai = myNumeric.lininterp1d(msi.astype(float32),ms.astype(float32),Ba.astype(float32))
+
+pt.plot(msi,Bai,':')
+
+pt.show()
\ No newline at end of file
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti06.pdf.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti06.pdf.svn-base
new file mode 100644
index 0000000..a9060fc
Binary files /dev/null and b/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti06.pdf.svn-base differ
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti2006.txt.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti2006.txt.svn-base
new file mode 100644
index 0000000..1823206
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti2006.txt.svn-base
@@ -0,0 +1,5 @@
+# M Ba Eu
+10 0 0
+12 9e-7 4.5e-8
+15 3e-8 3e-9
+30 1e-9 5e-10
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti2006bis.txt.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti2006bis.txt.svn-base
new file mode 100644
index 0000000..b2fe7e6
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/cescutti2006bis.txt.svn-base
@@ -0,0 +1,5 @@
+# M Ba Eu
+10 0 0
+12 2.846e-06 1.423e-07
+15 9.487e-08 9.487e-09
+30 3.162e-09 1.581e-09
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/chemseb.dat.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/chemseb.dat.svn-base
new file mode 100644
index 0000000..a3199cd
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/chemseb.dat.svn-base
@@ -0,0 +1,664 @@
+#### Metal Parameters ####
+
+# Number of points / Number of elements
+106 4
+
+# Int ( 1- Residual ) m^a
+
+0.05 0.03000
+0.0
+2.62343832019e-05
+0.000105697486956
+0.000239591063354
+0.000429201738196
+0.000675904199618
+0.000981164550087
+0.00134654382887
+0.0017737017124
+0.00226440040035
+0.00282050869552
+0.00344400628608
+0.00413698823921
+0.0049016697153
+0.00574039091264
+0.00665562225286
+0.00764996981773
+0.00872618104867
+0.00988715072067
+0.0111359272029
+0.0124757190189
+0.01390990172
+0.0154420250854
+0.0170758206648
+0.0188152096781
+0.020664311288
+0.0226274512643
+0.0247091710548
+0.0269142372836
+0.0292476516953
+0.0317146615649
+0.0343207705956
+0.0370717503253
+0.0399736520668
+0.0430328194037
+0.0462559012701
+0.0496498656375
+0.0532220138394
+0.0569799955612
+0.0609318245263
+0.0650858949095
+0.0694375606741
+0.0739732419317
+0.0787014221951
+0.0836058028368
+0.0886013096193
+0.0936865844744
+0.0988690855907
+0.104156533984
+0.109556927468
+0.115044534112
+0.120546967518
+0.126085326996
+0.131763229247
+0.13754946554
+0.143224706603
+0.148767807858
+0.154186738219
+0.159535646769
+0.164832896346
+0.170077006182
+0.17525616007
+0.180369296145
+0.185393050614
+0.190315881957
+0.195094533494
+0.199737541147
+0.204162545833
+0.208470337678
+0.212674645505
+0.216794134437
+0.220844165386
+0.224828561912
+0.228750320504
+0.232611849835
+0.236412991604
+0.240156184724
+0.243842698423
+0.247449434441
+0.250969630064
+0.254405334799
+0.257761899476
+0.261061525295
+0.264309275546
+0.267501620026
+0.270639578518
+0.273720323473
+0.276734743937
+0.279679129331
+0.282553181551
+0.285358585265
+0.288101174986
+0.290786337563
+0.293415816097
+0.2959913291
+0.298514571873
+0.300987217875
+0.303410774797
+0.305783137336
+0.30810419088
+0.310375407217
+0.312598234279
+0.314774097239
+0.316904399591
+0.318990524236
+0.321033834574
+
+# Int ( 1- Helium Core ) m^a
+
+0.05 0.03000
+0.0
+2.62343832019e-05
+0.000105697486956
+0.000239591063354
+0.000429201738196
+0.000675904199618
+0.000981164550087
+0.00134654382887
+0.0017737017124
+0.00226440040035
+0.00282050869552
+0.00344400628608
+0.00413698823921
+0.0049016697153
+0.00574039091264
+0.00665562225286
+0.00764996981773
+0.00872618104867
+0.00988715072067
+0.0111359272029
+0.0124757190189
+0.01390990172
+0.0154420250854
+0.0170758206648
+0.0188152096781
+0.020664311288
+0.0226274512643
+0.0247091710548
+0.0269142372836
+0.0292476516953
+0.0317146615649
+0.0343207705956
+0.0370717503253
+0.0399736520668
+0.0430328194037
+0.0462559012701
+0.0496498656375
+0.0532220138394
+0.0569799955612
+0.0609318245263
+0.0650858949095
+0.0694375606741
+0.0739732419317
+0.0787014221951
+0.0836058028368
+0.0886013096193
+0.0936865844744
+0.0988690855907
+0.104156533984
+0.109556927468
+0.115044534112
+0.120546967518
+0.126085326996
+0.131763229247
+0.13754946554
+0.143224706603
+0.148767807858
+0.154186738219
+0.159535646769
+0.164832896346
+0.170077006182
+0.17525616007
+0.180369296145
+0.185393050614
+0.190315881957
+0.195094533494
+0.199737541147
+0.204162545833
+0.208470337678
+0.212674645505
+0.216794134437
+0.220844165386
+0.224828561912
+0.228750320504
+0.232611849835
+0.236412991604
+0.240156184724
+0.243836764467
+0.2473366391
+0.250613743711
+0.25366700856
+0.256512181052
+0.259250890696
+0.261902047117
+0.264474333774
+0.266970595502
+0.269382205338
+0.271690152274
+0.273916541829
+0.276070904572
+0.278154091518
+0.28016316909
+0.282095506255
+0.283951615863
+0.28573193788
+0.287436838347
+0.289066608234
+0.290622061278
+0.292118751538
+0.29356387321
+0.294957931756
+0.296301387209
+0.297594653721
+0.298838099063
+0.30003204405
+0.301176761915
+
+# Int ( Fe ) m^a
+
+10.0 0.00805
+0.0
+3.98177582575e-07
+1.59570060777e-06
+3.59712027577e-06
+6.40707617622e-06
+1.00302971447e-05
+1.44716021312e-05
+1.97359010801e-05
+2.58281958227e-05
+3.27535809812e-05
+4.05172448861e-05
+4.91244705049e-05
+5.85806363841e-05
+6.88912176037e-05
+8.00617867447e-05
+9.16754495518e-05
+0.000102988780825
+0.00011398684042
+0.000124668732357
+0.000135033530878
+0.000145080280208
+0.000154807994313
+0.000164213905676
+0.000173160749286
+0.000181561034814
+0.000189412372955
+0.000196712318052
+0.000203458367592
+0.000209647961694
+0.000215278482584
+0.000220347254069
+0.000224851541005
+0.000228807866791
+0.000232540174492
+0.000236164718745
+0.000239681182734
+0.000243089239406
+0.000246388551387
+0.000249576393137
+0.000252642773007
+0.000255586236459
+0.000258406328797
+0.000261102583118
+0.000263674520209
+0.000266121648444
+0.000268443463668
+0.000270639449095
+0.000272709075195
+0.000274651799579
+0.000276467066889
+0.000278172256413
+0.000279850449735
+0.000281512180087
+0.000283157485917
+0.000284786404601
+0.000286398972436
+0.000287995224643
+0.00028957519536
+0.000291138917638
+0.000292686423439
+0.000294217743634
+0.000295732907994
+0.000297231945193
+0.0002987148828
+0.000300181747273
+0.000301632563962
+0.000303067357098
+0.000304486149792
+0.000305888964028
+0.000307275820664
+0.000308646739418
+0.000310001738874
+0.000311340836469
+0.000312664048492
+0.000313971390076
+0.000315262739986
+0.000316534017213
+0.000317783287458
+0.000319010525928
+0.000320215705959
+0.000321398799014
+0.000322559774663
+0.000323698600574
+0.000324815242499
+0.000325909664258
+0.000326981827729
+0.000328031692834
+0.000329059217522
+0.000330064357756
+0.0003310470675
+0.000332007298704
+0.000332945001287
+0.000333860123122
+0.000334752610023
+0.000335622405727
+0.000336469451879
+0.000337293688016
+0.000338095051547
+0.000338873477743
+0.000339628899715
+0.000340361248396
+0.000341070452527
+0.000341756438639
+0.00034241913103
+0.000343058451752
+0.000343674320591
+
+# Int ( Mg ) m^a
+
+10.0 0.00805
+0.0
+2.45011939145e-08
+9.8188777398e-08
+2.21342800969e-07
+3.94248754043e-07
+6.17197617639e-07
+8.90485917808e-07
+1.2144157798e-06
+1.58929498295e-06
+2.01543701638e-06
+2.49316113533e-06
+3.0227924184e-06
+3.6046618255e-06
+4.23910625655e-06
+4.92646861103e-06
+5.70761056686e-06
+6.65471504929e-06
+7.770138556e-06
+9.05490710196e-06
+1.0510065697e-05
+1.21366785338e-05
+1.39358291778e-05
+1.59070783405e-05
+1.79315560645e-05
+1.99342856955e-05
+2.19153029389e-05
+2.3874641997e-05
+2.58123355638e-05
+2.7728414819e-05
+2.9622909422e-05
+3.14958475056e-05
+3.33472556702e-05
+3.52113695247e-05
+3.76669425666e-05
+4.09250361949e-05
+4.49903808263e-05
+4.98677965295e-05
+5.55621939025e-05
+6.1908217341e-05
+6.82207650439e-05
+7.44272387986e-05
+8.0527533587e-05
+8.65215354827e-05
+9.24091215927e-05
+9.81901599978e-05
+0.000103864509691
+0.000109432020518
+0.000114892533112
+0.000120245878831
+0.000125491879692
+0.00013065226614
+0.000135829011133
+0.000141035498069
+0.000146272300891
+0.000151539999115
+0.000156839177916
+0.000162170428195
+0.000167534346662
+0.000172931535919
+0.00017836260453
+0.000183828167114
+0.000189328844417
+0.0001948652634
+0.000200438057322
+0.000206047865824
+0.000211695335014
+0.000217381117557
+0.000223105872758
+0.000228870266656
+0.000234674972108
+0.000240520668885
+0.00024640804376
+0.000252337790603
+0.000258310610475
+0.000264327211722
+0.000270387342604
+0.000276462433927
+0.000282539292765
+0.00028861840529
+0.000294700260563
+0.000300785350582
+0.000306874170348
+0.00031296721791
+0.000319064994428
+0.000325168004227
+0.000331276754854
+0.000337391757136
+0.000343513525239
+0.000349642576727
+0.000355779432618
+0.000361924617451
+0.00036807865934
+0.00037424209004
+0.000380415445006
+0.000386599263456
+0.000392794088437
+0.000399000466885
+0.000405218949693
+0.000411450091772
+0.000417694452124
+0.0004239525939
+0.000430225084472
+0.000436512495504
+0.000442815403013
+0.000449134387446
+0.000455470033743
+
+# Int ( O ) m^a
+
+10.0 0.00805
+0.0
+4.00832099792e-07
+1.60633861182e-06
+3.62110107761e-06
+6.44979001739e-06
+1.00971657924e-05
+1.45680794788e-05
+1.9867473754e-05
+2.60003837948e-05
+3.29719381877e-05
+4.0787359852e-05
+4.9451966975e-05
+5.897117396e-05
+6.93504923878e-05
+8.05955319897e-05
+9.29010084867e-05
+0.000106607834411
+0.000121731228431
+0.000138280275058
+0.000156264221209
+0.00017569247783
+0.000196574621557
+0.000218921985171
+0.000242868081922
+0.000268501403524
+0.000295833367524
+0.000324875588275
+0.00035563987895
+0.000388138253573
+0.000422382929081
+0.000458386327415
+0.000496161077635
+0.000535824148342
+0.000579150131165
+0.000626794652636
+0.000678785528395
+0.000735151069865
+0.000795920089236
+0.000860772568078
+0.000928323014693
+0.000998442266109
+0.00107115014266
+0.00114646677809
+0.0012244126229
+0.00130500844773
+0.00138827534671
+0.001474234741
+0.00156290838223
+0.00165431835607
+0.00174848708584
+0.00184532232769
+0.00194431108032
+0.00204540549283
+0.00214862523084
+0.00225399023621
+0.00236152073015
+0.00247123721636
+0.00258316048424
+0.00269731161205
+0.00281371197024
+0.00293238322471
+0.00305334734018
+0.00317662658356
+0.00330224352741
+0.00343022105336
+0.00356058235569
+0.00369335094485
+0.00382855065106
+0.00396620562802
+0.00410634035653
+0.00424897964827
+0.00439414864961
+0.00454187284541
+0.00469217806292
+0.00484509047571
+0.00500058487686
+0.00515712186636
+0.00531398417386
+0.00547118590858
+0.00562874128499
+0.00578666462456
+0.00594497035746
+0.0061036730243
+0.00626278727789
+0.00642232788499
+0.00658230972813
+0.00674274780742
+0.00690365724237
+0.00706505327375
+0.00722695126545
+0.00738936670637
+0.00755231521236
+0.0077158125281
+0.00787987452913
+0.00804451722372
+0.00820975675496
+0.00837560940272
+0.00854209158573
+0.00870921986359
+0.00887701093891
+0.00904548165936
+0.00921464901986
+0.00938453016467
+0.00955514238961
+0.00972650314428
+0.00989863003419
+
+# Int ( Metals ) m^a
+
+10.0 0.00805
+0.0
+1.19813224101e-06
+4.80152682832e-06
+1.0823878505e-05
+1.92791479814e-05
+3.01815645128e-05
+4.35456285118e-05
+5.93861141972e-05
+7.77180722787e-05
+9.85568326786e-05
+0.00012191800729
+0.000147817492773
+0.000176271473389
+0.000207296423872
+0.00024090911234
+0.000276988653252
+0.000315307829144
+0.00035587751217
+0.000398713431608
+0.000443831582077
+0.000491248226271
+0.000540979897731
+0.000593040727114
+0.000647239576947
+0.000703461721651
+0.000761722850383
+0.000822038899608
+0.000884426055722
+0.000948900757719
+0.00101547969989
+0.00108417983454
+0.00115501837477
+0.00122811338056
+0.0013051841331
+0.001386869127
+0.00147320049497
+0.00156421091308
+0.00165993360637
+0.00176008786736
+0.00186343390583
+0.00196986303225
+0.00207940078075
+0.00219207307149
+0.00230790621487
+0.00242692691577
+0.00254916227779
+0.00267463980768
+0.00280338741966
+0.00293543343996
+0.00307080661128
+0.00320931475956
+0.00334995570966
+0.00349262224447
+0.00363733684158
+0.00378412226446
+0.00393300156582
+0.00408399809104
+0.00423713548166
+0.00439243767881
+0.00454992892685
+0.00470963377687
+0.00487157709039
+0.00503578404303
+0.0052022801282
+0.00537109116091
+0.00554224328156
+0.00571576295982
+0.00589167699854
+0.00607001253768
+0.00625079705837
+0.00643405838692
+0.00661982469895
+0.00680812452352
+0.00699898674739
+0.00719244061921
+0.00738846472186
+0.00758554391966
+0.00778297412281
+0.00798077276357
+0.00817895740023
+0.00837754571927
+0.00857655553745
+0.00877600480388
+0.00897591160225
+0.0091762941529
+0.00937717081511
+0.00957856008923
+0.00978048061897
+0.00998295119363
+0.0101859907504
+0.0103896183767
+0.0105938533124
+0.0107987149524
+0.0110042228486
+0.011210396713
+0.0114172564193
+0.011624822006
+0.0118331136786
+0.0120421518123
+0.0122519569542
+0.0124625498264
+0.012673951328
+0.0128861825382
+0.0130992647187
+0.0133132193164
+0.0135280679664
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/chemyves.dat.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/chemyves.dat.svn-base
new file mode 100644
index 0000000..50f127f
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/chemyves.dat.svn-base
@@ -0,0 +1,664 @@
+#### Metal Parameters ####
+
+# Number of points / Number of elements
+106 4
+
+# Int ( 1- Residual ) m^a
+
+0.05 0.0294944
+3.692117e-04
+1.620403e-03
+2.890097e-03
+4.178872e-03
+5.488506e-03
+6.820900e-03
+8.177621e-03
+9.560390e-03
+1.097164e-02
+1.241285e-02
+1.388625e-02
+1.539418e-02
+1.693889e-02
+1.852247e-02
+2.014746e-02
+2.181650e-02
+2.353219e-02
+2.529719e-02
+2.711444e-02
+2.898685e-02
+3.091755e-02
+3.290978e-02
+3.496683e-02
+3.709223e-02
+3.928966e-02
+4.156287e-02
+4.391579e-02
+4.635260e-02
+4.887756e-02
+5.149515e-02
+5.421006e-02
+5.702716e-02
+5.995151e-02
+6.298843e-02
+6.614342e-02
+6.942229e-02
+7.283103e-02
+7.637594e-02
+8.006354e-02
+8.390070e-02
+8.789457e-02
+9.205259e-02
+9.638254e-02
+1.008926e-01
+1.055911e-01
+1.104367e-01
+1.153646e-01
+1.203811e-01
+1.254933e-01
+1.307086e-01
+1.360346e-01
+1.414306e-01
+1.468391e-01
+1.522926e-01
+1.578884e-01
+1.635723e-01
+1.691400e-01
+1.745804e-01
+1.799020e-01
+1.851578e-01
+1.903638e-01
+1.955188e-01
+2.006111e-01
+2.056404e-01
+2.105842e-01
+2.154331e-01
+2.201441e-01
+2.247243e-01
+2.291156e-01
+2.333524e-01
+2.375001e-01
+2.415636e-01
+2.455582e-01
+2.494888e-01
+2.533582e-01
+2.571692e-01
+2.609218e-01
+2.646175e-01
+2.682593e-01
+2.718327e-01
+2.753218e-01
+2.787287e-01
+2.820553e-01
+2.853193e-01
+2.885329e-01
+2.916946e-01
+2.948027e-01
+2.978587e-01
+3.008531e-01
+3.037821e-01
+3.066424e-01
+3.094357e-01
+3.121642e-01
+3.148353e-01
+3.174517e-01
+3.200149e-01
+3.225267e-01
+3.249885e-01
+3.274020e-01
+3.297679e-01
+3.320838e-01
+3.343505e-01
+3.365695e-01
+3.387420e-01
+3.408696e-01
+3.429535e-01
+
+# Int ( 1- Helium Core ) m^a
+
+0.05 0.0294944
+3.692117e-04
+1.620403e-03
+2.890097e-03
+4.178872e-03
+5.488506e-03
+6.820900e-03
+8.177621e-03
+9.560390e-03
+1.097164e-02
+1.241285e-02
+1.388625e-02
+1.539418e-02
+1.693889e-02
+1.852247e-02
+2.014746e-02
+2.181650e-02
+2.353219e-02
+2.529719e-02
+2.711444e-02
+2.898685e-02
+3.091755e-02
+3.290978e-02
+3.496683e-02
+3.709223e-02
+3.928966e-02
+4.156287e-02
+4.391579e-02
+4.635260e-02
+4.887756e-02
+5.149515e-02
+5.421006e-02
+5.702716e-02
+5.995151e-02
+6.298843e-02
+6.614342e-02
+6.942229e-02
+7.283103e-02
+7.637594e-02
+8.006354e-02
+8.390070e-02
+8.789457e-02
+9.205259e-02
+9.638254e-02
+1.008926e-01
+1.055911e-01
+1.104367e-01
+1.153646e-01
+1.203811e-01
+1.254933e-01
+1.307086e-01
+1.360346e-01
+1.414306e-01
+1.468391e-01
+1.522926e-01
+1.578884e-01
+1.635723e-01
+1.691400e-01
+1.745804e-01
+1.799020e-01
+1.851578e-01
+1.903638e-01
+1.955188e-01
+2.006111e-01
+2.056404e-01
+2.105842e-01
+2.154331e-01
+2.201441e-01
+2.247243e-01
+2.291156e-01
+2.333524e-01
+2.375001e-01
+2.415636e-01
+2.455582e-01
+2.494888e-01
+2.533582e-01
+2.571692e-01
+2.609218e-01
+2.646175e-01
+2.682593e-01
+2.717701e-01
+2.750660e-01
+2.781458e-01
+2.810097e-01
+2.837362e-01
+2.863768e-01
+2.889375e-01
+2.914243e-01
+2.938367e-01
+2.961536e-01
+2.983782e-01
+3.005320e-01
+3.026166e-01
+3.046319e-01
+3.065737e-01
+3.084415e-01
+3.102358e-01
+3.119571e-01
+3.136056e-01
+3.151815e-01
+3.166889e-01
+3.181457e-01
+3.195544e-01
+3.209157e-01
+3.222299e-01
+3.234975e-01
+3.247189e-01
+
+# Int ( Fe ) m^a
+
+10 0.00757981
+1.156764e-11
+3.569730e-07
+1.422275e-06
+3.199719e-06
+5.693175e-06
+8.906558e-06
+1.284390e-05
+1.750924e-05
+2.290678e-05
+2.904070e-05
+3.591535e-05
+4.353496e-05
+5.190415e-05
+6.102733e-05
+7.090915e-05
+8.155429e-05
+9.247236e-05
+1.031121e-04
+1.134724e-04
+1.235526e-04
+1.333517e-04
+1.428690e-04
+1.521037e-04
+1.610550e-04
+1.696629e-04
+1.777923e-04
+1.854361e-04
+1.925922e-04
+1.992585e-04
+2.054330e-04
+2.111135e-04
+2.162978e-04
+2.209837e-04
+2.251688e-04
+2.288726e-04
+2.323879e-04
+2.358077e-04
+2.391318e-04
+2.423598e-04
+2.454914e-04
+2.485260e-04
+2.514550e-04
+2.542752e-04
+2.569862e-04
+2.595877e-04
+2.620792e-04
+2.644604e-04
+2.667307e-04
+2.688899e-04
+2.709374e-04
+2.728728e-04
+2.746957e-04
+2.764056e-04
+2.780145e-04
+2.795965e-04
+2.811639e-04
+2.827168e-04
+2.842550e-04
+2.857789e-04
+2.872882e-04
+2.887831e-04
+2.902636e-04
+2.917296e-04
+2.931813e-04
+2.946187e-04
+2.960418e-04
+2.974506e-04
+2.988451e-04
+3.002253e-04
+3.015913e-04
+3.029431e-04
+3.042808e-04
+3.056042e-04
+3.069136e-04
+3.082087e-04
+3.094898e-04
+3.107568e-04
+3.120096e-04
+3.132484e-04
+3.144732e-04
+3.156830e-04
+3.168737e-04
+3.180450e-04
+3.191968e-04
+3.203290e-04
+3.214415e-04
+3.225345e-04
+3.236079e-04
+3.246616e-04
+3.256956e-04
+3.267099e-04
+3.277044e-04
+3.286790e-04
+3.296339e-04
+3.305690e-04
+3.314841e-04
+3.323792e-04
+3.332544e-04
+3.341096e-04
+3.349446e-04
+3.357595e-04
+3.365543e-04
+3.373288e-04
+3.380830e-04
+3.388170e-04
+3.395305e-04
+
+# Int ( Mg ) m^a
+
+10 0.00757981
+7.123191e-13
+2.196566e-08
+8.751704e-08
+1.968892e-07
+3.503201e-07
+5.480497e-07
+7.903272e-07
+1.077400e-06
+1.409531e-06
+1.786972e-06
+2.209990e-06
+2.678853e-06
+3.193836e-06
+3.755213e-06
+4.363279e-06
+5.018301e-06
+5.768048e-06
+6.666127e-06
+7.713435e-06
+8.910807e-06
+1.025914e-05
+1.175930e-05
+1.341219e-05
+1.521873e-05
+1.712790e-05
+1.902228e-05
+2.089739e-05
+2.275329e-05
+2.458997e-05
+2.640747e-05
+2.820584e-05
+2.998507e-05
+3.174520e-05
+3.348626e-05
+3.524662e-05
+3.754946e-05
+4.056357e-05
+4.429290e-05
+4.874144e-05
+5.391327e-05
+5.977837e-05
+6.575813e-05
+7.164388e-05
+7.743560e-05
+8.313314e-05
+8.873636e-05
+9.424525e-05
+9.965958e-05
+1.049794e-04
+1.102044e-04
+1.153346e-04
+1.203697e-04
+1.253097e-04
+1.301696e-04
+1.350404e-04
+1.399375e-04
+1.448613e-04
+1.498124e-04
+1.547913e-04
+1.597983e-04
+1.648342e-04
+1.698992e-04
+1.749940e-04
+1.801190e-04
+1.852748e-04
+1.904618e-04
+1.956807e-04
+2.009318e-04
+2.062159e-04
+2.115334e-04
+2.168848e-04
+2.222707e-04
+2.276917e-04
+2.331483e-04
+2.386411e-04
+2.441706e-04
+2.497375e-04
+2.553423e-04
+2.609856e-04
+2.666680e-04
+2.723837e-04
+2.781042e-04
+2.838265e-04
+2.895508e-04
+2.952777e-04
+3.010074e-04
+3.067405e-04
+3.124773e-04
+3.182183e-04
+3.239639e-04
+3.297144e-04
+3.354704e-04
+3.412322e-04
+3.470003e-04
+3.527752e-04
+3.585572e-04
+3.643468e-04
+3.701445e-04
+3.759506e-04
+3.817657e-04
+3.875901e-04
+3.934244e-04
+3.992690e-04
+4.051243e-04
+4.109908e-04
+4.168691e-04
+
+# Int ( O ) m^a
+
+10 0.00757981
+1.165290e-11
+3.593523e-07
+1.431763e-06
+3.221052e-06
+5.731141e-06
+8.965944e-06
+1.292954e-05
+1.762598e-05
+2.305949e-05
+2.923433e-05
+3.615476e-05
+4.382522e-05
+5.225019e-05
+6.143420e-05
+7.138192e-05
+8.209795e-05
+9.380857e-05
+1.067673e-04
+1.209820e-04
+1.364601e-04
+1.532093e-04
+1.712374e-04
+1.905526e-04
+2.111627e-04
+2.331298e-04
+2.565838e-04
+2.815390e-04
+3.080053e-04
+3.359918e-04
+3.655090e-04
+3.965668e-04
+4.291754e-04
+4.633453e-04
+4.990869e-04
+5.365282e-04
+5.772720e-04
+6.218429e-04
+6.702649e-04
+7.225613e-04
+7.787547e-04
+8.388015e-04
+9.015300e-04
+9.665291e-04
+1.033815e-03
+1.103404e-03
+1.175315e-03
+1.249563e-03
+1.326166e-03
+1.405142e-03
+1.486509e-03
+1.570284e-03
+1.656488e-03
+1.745137e-03
+1.836171e-03
+1.929133e-03
+2.023958e-03
+2.120663e-03
+2.219267e-03
+2.319784e-03
+2.422231e-03
+2.526627e-03
+2.632989e-03
+2.741334e-03
+2.851681e-03
+2.964047e-03
+3.078450e-03
+3.194911e-03
+3.313447e-03
+3.434078e-03
+3.556824e-03
+3.681701e-03
+3.808733e-03
+3.937938e-03
+4.069337e-03
+4.202952e-03
+4.338802e-03
+4.476908e-03
+4.617292e-03
+4.759977e-03
+4.904983e-03
+5.051994e-03
+5.199473e-03
+5.347247e-03
+5.495323e-03
+5.643714e-03
+5.792433e-03
+5.941492e-03
+6.090902e-03
+6.240676e-03
+6.390826e-03
+6.541365e-03
+6.692306e-03
+6.843660e-03
+6.995440e-03
+7.147659e-03
+7.300330e-03
+7.453467e-03
+7.607082e-03
+7.761187e-03
+7.915798e-03
+8.070926e-03
+8.226587e-03
+8.382792e-03
+8.539556e-03
+8.696891e-03
+8.854815e-03
+
+# Int ( Metals ) m^a
+
+10 0.00757981
+3.478817e-11
+1.073306e-06
+4.276313e-06
+9.620504e-06
+1.711748e-05
+2.677907e-05
+3.861729e-05
+5.264446e-05
+6.887299e-05
+8.731568e-05
+1.079855e-04
+1.308953e-04
+1.560586e-04
+1.834888e-04
+2.132003e-04
+2.452064e-04
+2.793598e-04
+3.154925e-04
+3.536174e-04
+3.937483e-04
+4.358974e-04
+4.800786e-04
+5.263062e-04
+5.745934e-04
+6.248583e-04
+6.768950e-04
+7.307080e-04
+7.863103e-04
+8.437156e-04
+9.029368e-04
+9.639880e-04
+1.026882e-03
+1.091635e-03
+1.158259e-03
+1.226885e-03
+1.299093e-03
+1.375406e-03
+1.455850e-03
+1.540451e-03
+1.629237e-03
+1.722175e-03
+1.818218e-03
+1.917003e-03
+2.018553e-03
+2.122888e-03
+2.230029e-03
+2.340000e-03
+2.452822e-03
+2.568520e-03
+2.687114e-03
+2.808630e-03
+2.933091e-03
+3.060522e-03
+3.190789e-03
+3.322982e-03
+3.456967e-03
+3.592763e-03
+3.730388e-03
+3.869861e-03
+4.011202e-03
+4.154430e-03
+4.299566e-03
+4.446628e-03
+4.595638e-03
+4.746617e-03
+4.899585e-03
+5.054563e-03
+5.211572e-03
+5.370635e-03
+5.531773e-03
+5.695007e-03
+5.860360e-03
+6.027856e-03
+6.197515e-03
+6.369364e-03
+6.543424e-03
+6.719719e-03
+6.898271e-03
+7.079110e-03
+7.262254e-03
+7.447397e-03
+7.633029e-03
+7.818979e-03
+8.005260e-03
+8.191885e-03
+8.378873e-03
+8.566235e-03
+8.753989e-03
+8.942149e-03
+9.130730e-03
+9.319747e-03
+9.509215e-03
+9.699151e-03
+9.889571e-03
+1.008049e-02
+1.027192e-02
+1.046388e-02
+1.065639e-02
+1.084946e-02
+1.104312e-02
+1.123736e-02
+1.143222e-02
+1.162771e-02
+1.182385e-02
+1.202065e-02
+1.221812e-02
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/chimie.dat.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/chimie.dat.svn-base
new file mode 100644
index 0000000..b17f848
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/chimie.dat.svn-base
@@ -0,0 +1,714 @@
+#### Livetime ####
+
+-40.1107251082866 5.50992173040633 0.782431795366473
+ 141.929566656232 -15.88948185575660 -3.255779246324010
+-261.365531429482 17.07350618651300 9.866058678313810
+
+#### Mass interval ####
+
+0.05
+50.0
+
+#### IMFs Power ####
+
+-1.35
+-0.35
+
+#### Mass Parameters for SNe Rates ####
+
+0.9 1.5
+1.8 2.6
+3.0 8.0
+
+1.38
+
+#### b Parameters for SNIa Rates ####
+
+0.02
+0.05
+
+#### Array size and step ####
+
+106
+
++++ >>>Matter<<<< ejection and Helium core +++
+
+0.05 0.03000
+
++++ >>>Metal<<<< ejections +++
+
+10.0 0.00805
+
+#### Matter ejection for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 1.948148461584278E-004
+ 7.849027553695851E-004
+ 1.779187861552281E-003
+ 3.187224565336232E-003
+ 5.019221212595564E-003
+ 7.286064986169615E-003
+ 9.999348063480538E-003
+ 1.317139509524892E-002
+ 1.681529206311515E-002
+ 2.094491657669624E-002
+ 2.557496967345443E-002
+ 3.072100918773040E-002
+ 3.639948475840345E-002
+ 4.262777454789425E-002
+ 4.942422374862439E-002
+ 5.680818495660336E-002
+ 6.480006049552767E-002
+ 7.342134677866560E-002
+ 8.269468079986046E-002
+ 9.264388884923654E-002
+ 0.103294037553632
+ 0.114671487346427
+ 0.126803948476297
+ 0.139720539669488
+ 0.153451849565542
+ 0.168030001051925
+ 0.183488718628849
+ 0.199863398941626
+ 0.217191184624264
+ 0.235511041604632
+ 0.254863840028497
+ 0.275292438966970
+ 0.296841775079514
+ 0.319558955412601
+ 0.343493354522415
+ 0.368696716118689
+ 0.395223259435849
+ 0.423129790547134
+ 0.452475818847317
+ 0.483323678940019
+ 0.515638869654887
+ 0.549320547612586
+ 0.584431710834625
+ 0.620851326758361
+ 0.657947639556310
+ 0.695710564300615
+ 0.734195485021332
+ 0.773459737483288
+ 0.813562712951118
+ 0.854313327735044
+ 0.895174045113107
+ 0.936301547191643
+ 0.978465284945171
+ 1.02143350435011
+ 1.06357748029207
+ 1.10474019450224
+ 1.14498082362232
+ 1.18470147526954
+ 1.22403851069698
+ 1.26298093381754
+ 1.30144099823254
+ 1.33941081861095
+ 1.37671689691561
+ 1.41327352656396
+ 1.44875948622491
+ 1.48323816310838
+ 1.51609796394282
+ 1.54808734974527
+ 1.57930826987217
+ 1.60989933032963
+ 1.63997460025811
+ 1.66956247317551
+ 1.69868520081668
+ 1.72736066982806
+ 1.75558770468420
+ 1.78338441658081
+ 1.81076023074636
+ 1.83754362096287
+ 1.86368436776538
+ 1.88919769064914
+ 1.91412332454551
+ 1.93862613413969
+ 1.96274371908897
+ 1.98644986434214
+ 2.00975214273279
+ 2.03262955706970
+ 2.05501444999736
+ 2.07687926699109
+ 2.09822179434416
+ 2.11905454229509
+ 2.13942083756861
+ 2.15936068255780
+ 2.17888702140820
+ 2.19801261569731
+ 2.21675005461101
+ 2.23511176514401
+ 2.25310894332572
+ 2.27072595530223
+ 2.28796194997655
+ 2.30482785674285
+ 2.32133442786874
+ 2.33749224658145
+ 2.35331173513791
+ 2.36880316288718
+ 2.38397665433405
+
+#### Integral (( 1 - Helium core )*m^x) for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 1.948148461584278E-004
+ 7.849027553695851E-004
+ 1.779187861552281E-003
+ 3.187224565336232E-003
+ 5.019221212595564E-003
+ 7.286064986169615E-003
+ 9.999348063480538E-003
+ 1.317139509524892E-002
+ 1.681529206311515E-002
+ 2.094491657669624E-002
+ 2.557496967345443E-002
+ 3.072100918773040E-002
+ 3.639948475840345E-002
+ 4.262777454789425E-002
+ 4.942422374862439E-002
+ 5.680818495660336E-002
+ 6.480006049552767E-002
+ 7.342134677866560E-002
+ 8.269468079986046E-002
+ 9.264388884923654E-002
+ 0.103294037553632
+ 0.114671487346427
+ 0.126803948476297
+ 0.139720539669488
+ 0.153451849565542
+ 0.168030001051925
+ 0.183488718628849
+ 0.199863398941626
+ 0.217191184624264
+ 0.235511041604632
+ 0.254863840028497
+ 0.275292438966970
+ 0.296841775079514
+ 0.319558955412601
+ 0.343493354522415
+ 0.368696716118689
+ 0.395223259435849
+ 0.423129790547134
+ 0.452475818847317
+ 0.483323678940019
+ 0.515638869654887
+ 0.549320547612586
+ 0.584431710834625
+ 0.620851326758361
+ 0.657947639556310
+ 0.695710564300615
+ 0.734195485021332
+ 0.773459737483288
+ 0.813562712951118
+ 0.854313327735044
+ 0.895174045113107
+ 0.936301547191643
+ 0.978465284945171
+ 1.02143350435011
+ 1.06357748029207
+ 1.10474019450224
+ 1.14498082362232
+ 1.18470147526954
+ 1.22403851069698
+ 1.26298093381754
+ 1.30144099823254
+ 1.33941081861095
+ 1.37671689691561
+ 1.41327352656396
+ 1.44875948622491
+ 1.48323816310838
+ 1.51609796394282
+ 1.54808734974527
+ 1.57930826987217
+ 1.60989933032963
+ 1.63997460025811
+ 1.66956247317551
+ 1.69868520081668
+ 1.72736066982806
+ 1.75558770468420
+ 1.78338441658081
+ 1.81071616556485
+ 1.83670600999954
+ 1.86104157854762
+ 1.88371492738163
+ 1.90484299572985
+ 1.92518047779587
+ 1.94486779525062
+ 1.96396943089998
+ 1.98250651029805
+ 2.00041497018969
+ 2.01755363603033
+ 2.03408666199520
+ 2.05008482147464
+ 2.06555443405543
+ 2.08047371517568
+ 2.09482312696596
+ 2.10860647780629
+ 2.12182703485943
+ 2.13448751632217
+ 2.14659008291206
+ 2.15814077740630
+ 2.16925510323094
+ 2.17998648402747
+ 2.19033867333341
+ 2.20031508731443
+ 2.20991880144748
+ 2.21915254676071
+ 2.22801870561681
+ 2.23651930702553
+
+#### Number of elements ####
+
+4
+
+#### Global metals ejection for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 8.897253135854732E-006
+ 3.565583010606147E-005
+ 8.037742719377121E-005
+ 1.431657157387295E-004
+ 2.241263612766181E-004
+ 3.233670429414094E-004
+ 4.409974731337761E-004
+ 5.771294174584804E-004
+ 7.318767149339434E-004
+ 9.053552984769282E-004
+ 1.097683215665787E-003
+ 1.308980649784902E-003
+ 1.539369941154163E-003
+ 1.788975608746417E-003
+ 2.056899964276174E-003
+ 2.341455705452620E-003
+ 2.642723568188662E-003
+ 2.960820357089825E-003
+ 3.295864847173348E-003
+ 3.647977804165578E-003
+ 4.017282005068346E-003
+ 4.403882383252232E-003
+ 4.806359564088637E-003
+ 5.223861602799551E-003
+ 5.656505006063677E-003
+ 6.104408117036040E-003
+ 6.567691134864435E-003
+ 7.046476134460491E-003
+ 7.540887086527641E-003
+ 8.051049877849695E-003
+ 8.577092331842466E-003
+ 9.119891154224343E-003
+ 9.692213616823108E-003
+ 1.029880113968753E-002
+ 1.093989233820789E-002
+ 1.161572986281088E-002
+ 1.232656044047916E-002
+ 1.307029955558859E-002
+ 1.383774060539543E-002
+ 1.462807646847552E-002
+ 1.544149675960897E-002
+ 1.627819396031193E-002
+ 1.713836344990908E-002
+ 1.802220353700684E-002
+ 1.892991549137133E-002
+ 1.986170357621650E-002
+ 2.081777508090681E-002
+ 2.179834035407945E-002
+ 2.280361283719104E-002
+ 2.383216545801203E-002
+ 2.487655612836635E-002
+ 2.593598866073771E-002
+ 2.701062997231396E-002
+ 2.810064910314413E-002
+ 2.920621724122559E-002
+ 3.032750774789945E-002
+ 3.146469618355814E-002
+ 3.261796033366855E-002
+ 3.378748023511465E-002
+ 3.497343820286358E-002
+ 3.617601885695899E-002
+ 3.739540914984546E-002
+ 3.863179839402824E-002
+ 3.988537829007218E-002
+ 4.115634295494388E-002
+ 4.244488895070137E-002
+ 4.375121531353549E-002
+ 4.507552358316691E-002
+ 4.641801783260356E-002
+ 4.777890469826242E-002
+ 4.915839341046017E-002
+ 5.055669582427733E-002
+ 5.197402645080004E-002
+ 5.341060248874441E-002
+ 5.486626489585046E-002
+ 5.632976237180887E-002
+ 5.779586639107656E-002
+ 5.926470640426895E-002
+ 6.073641279830042E-002
+ 6.221111691182542E-002
+ 6.368895105083984E-002
+ 6.517004850444591E-002
+ 6.665454356078143E-002
+ 6.814257152311638E-002
+ 6.963426872611900E-002
+ 7.112977255229307E-002
+ 7.262922144858935E-002
+ 7.413275494319280E-002
+ 7.564051366248836E-002
+ 7.715263934820724E-002
+ 7.866927487475635E-002
+ 8.019056426673313E-002
+ 8.171665271662820E-002
+ 8.324768660271827E-002
+ 8.478381350715172E-002
+ 8.632518223422943E-002
+ 8.787194282888339E-002
+ 8.942424659535547E-002
+ 9.098224611607922E-002
+ 9.254609527076696E-002
+ 9.411594925570514E-002
+ 9.569196460326047E-002
+ 9.727429920159936E-002
+ 9.886311231462394E-002
+ 0.100458564602127
+
++++ SN Ia ejection +++
+
+1.37434165658910
+
+#### Iron ejection (Fe 56) for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 2.956841176560512E-006
+ 1.184957031481829E-005
+ 2.671198433534344E-005
+ 4.757853653304705E-005
+ 7.448434293779550E-005
+ 1.074651887624319E-004
+ 1.465575349392165E-004
+ 1.917985247456573E-004
+ 2.432259905207950E-004
+ 3.008784604729170E-004
+ 3.647951655798472E-004
+ 4.350160465826850E-004
+ 5.115817610742712E-004
+ 5.945336906833583E-004
+ 6.807760054228812E-004
+ 7.647880774633296E-004
+ 8.464589622547035E-004
+ 9.257820063061017E-004
+ 1.002750334997153E-003
+ 1.077356850806078E-003
+ 1.149594231510450E-003
+ 1.219441925701428E-003
+ 1.285880612218336E-003
+ 1.348260593490127E-003
+ 1.406564126689602E-003
+ 1.460773050531925E-003
+ 1.510868781517747E-003
+ 1.556832310122166E-003
+ 1.598644196929169E-003
+ 1.636284568710711E-003
+ 1.669733114450022E-003
+ 1.699112535851976E-003
+ 1.726828413329182E-003
+ 1.753744046358577E-003
+ 1.779857082287675E-003
+ 1.805165092436012E-003
+ 1.829665571480846E-003
+ 1.853338279750892E-003
+ 1.876109019892992E-003
+ 1.897966990601563E-003
+ 1.918908815329765E-003
+ 1.938931026893145E-003
+ 1.958030066692454E-003
+ 1.976202283924965E-003
+ 1.993443934784179E-003
+ 2.009751181647758E-003
+ 2.025120092253587E-003
+ 2.039546638863828E-003
+ 2.053026697416816E-003
+ 2.065689325400583E-003
+ 2.078151481319033E-003
+ 2.090491384277475E-003
+ 2.102709319789206E-003
+ 2.114805565399577E-003
+ 2.126780390663318E-003
+ 2.138634057121111E-003
+ 2.150366818275400E-003
+ 2.161978919565437E-003
+ 2.173470598341558E-003
+ 2.184842083838686E-003
+ 2.196093597149037E-003
+ 2.207225351194051E-003
+ 2.218237550695516E-003
+ 2.229130392145890E-003
+ 2.239904063777819E-003
+ 2.250558745532826E-003
+ 2.261094609029186E-003
+ 2.271511817528965E-003
+ 2.281810525904219E-003
+ 2.291990880602348E-003
+ 2.302053019610601E-003
+ 2.311997072419712E-003
+ 2.321823159986673E-003
+ 2.331531394696627E-003
+ 2.341120876262565E-003
+ 2.350561299366451E-003
+ 2.359838300044014E-003
+ 2.368951694162124E-003
+ 2.377901283737103E-003
+ 2.386686856841968E-003
+ 2.395308187512068E-003
+ 2.403765035649100E-003
+ 2.412057146923474E-003
+ 2.420184252675018E-003
+ 2.428146069812017E-003
+ 2.435942300708544E-003
+ 2.443572633100085E-003
+ 2.451036739977441E-003
+ 2.458334279478871E-003
+ 2.465464894780476E-003
+ 2.472428213984800E-003
+ 2.479223850007626E-003
+ 2.485851400462947E-003
+ 2.492310447546105E-003
+ 2.498600557915061E-003
+ 2.504721282569793E-003
+ 2.510672156729784E-003
+ 2.516452699709602E-003
+ 2.522062414792528E-003
+ 2.527500789102234E-003
+ 2.532767293472467E-003
+ 2.537861382314741E-003
+ 2.542782493483995E-003
+ 2.547530048142210E-003
+ 2.552103450619951E-003
+
++++ SN Ia ejection +++
+
+6.13E-01
+
+#### Magnesium ejection (Mg 24) for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 1.819442937310254E-007
+ 7.291435600384900E-007
+ 1.643677436101472E-006
+ 2.927665948000166E-006
+ 4.583269902105687E-006
+ 6.612691281848316E-006
+ 9.018173649926460E-006
+ 1.180200255601612E-005
+ 1.496650595004626E-005
+ 1.851405460110017E-005
+ 2.244706252201328E-005
+ 2.676798739972123E-005
+ 3.147933103143684E-005
+ 3.658363976671600E-005
+ 4.238434980373224E-005
+ 4.941748691312122E-005
+ 5.770055029556047E-005
+ 6.724115907242803E-005
+ 7.804707341980689E-005
+ 9.012619596330489E-005
+ 1.034865731917986E-004
+ 1.181249429757805E-004
+ 1.331585846402729E-004
+ 1.480307263624304E-004
+ 1.627416332867669E-004
+ 1.772915593984231E-004
+ 1.916807474808496E-004
+ 2.059094290723710E-004
+ 2.199778244216313E-004
+ 2.338861424419015E-004
+ 2.476345806642475E-004
+ 2.614773705249866E-004
+ 2.797122983562738E-004
+ 3.039066925630227E-004
+ 3.340956809170936E-004
+ 3.703150569382891E-004
+ 4.126012864122325E-004
+ 4.597264492329210E-004
+ 5.066030233885785E-004
+ 5.526918992124166E-004
+ 5.979922968459649E-004
+ 6.425033702797147E-004
+ 6.862242069179286E-004
+ 7.291538271358102E-004
+ 7.712911838289599E-004
+ 8.126351619550072E-004
+ 8.531845780673756E-004
+ 8.929381798410914E-004
+ 9.318946455905320E-004
+ 9.702153442100753E-004
+ 1.008657520327678E-003
+ 1.047320558206630E-003
+ 1.086208719903354E-003
+ 1.125326308886108E-003
+ 1.164677670603224E-003
+ 1.204267193057797E-003
+ 1.244099307388927E-003
+ 1.284178488459572E-003
+ 1.324509255451111E-003
+ 1.365096172464694E-003
+ 1.405943849129473E-003
+ 1.447056941217783E-003
+ 1.488440151267375E-003
+ 1.530098229210789E-003
+ 1.572035973011942E-003
+ 1.614258229310037E-003
+ 1.656769894070877E-003
+ 1.699575913245673E-003
+ 1.742681283437455E-003
+ 1.786091052575152E-003
+ 1.829810320595468E-003
+ 1.873844240132630E-003
+ 1.918198017216116E-003
+ 1.962876911976458E-003
+ 2.007879055024797E-003
+ 2.052992293336366E-003
+ 2.098118657107999E-003
+ 2.143261756617522E-003
+ 2.188425223586288E-003
+ 2.233612711583413E-003
+ 2.278827896433972E-003
+ 2.324074476631232E-003
+ 2.369356173752939E-003
+ 2.414676732881754E-003
+ 2.460039923029865E-003
+ 2.505449537567846E-003
+ 2.550909394657815E-003
+ 2.596423337690957E-003
+ 2.641995235729453E-003
+ 2.687628983952897E-003
+ 2.733328504109238E-003
+ 2.779097744970332E-003
+ 2.824940682792141E-003
+ 2.870861321779656E-003
+ 2.916863694556613E-003
+ 2.962951862640033E-003
+ 3.009129916919698E-003
+ 3.055401978142588E-003
+ 3.101772197402363E-003
+ 3.148244756633953E-003
+ 3.194823869113327E-003
+ 3.241513779962500E-003
+ 3.288318766659852E-003
+ 3.335243139555834E-003
+ 3.382291242394126E-003
+
++++ SN Ia ejection +++
+
+ 8.50E-03
+
+#### Oxygen ejection (O 16) for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 2.976553451070855E-006
+ 1.192856745025033E-005
+ 2.689006423091226E-005
+ 4.789572677660044E-005
+ 7.498090522404713E-005
+ 1.081816233541810E-004
+ 1.475345851721441E-004
+ 1.930771815772945E-004
+ 2.448474971242664E-004
+ 3.028843168760691E-004
+ 3.672271333503788E-004
+ 4.379161535599020E-004
+ 5.149923061480987E-004
+ 5.984972486212462E-004
+ 6.898769274273264E-004
+ 7.916629371565685E-004
+ 9.039682906565435E-004
+ 1.026860448934943E-003
+ 1.160408078990883E-003
+ 1.304681065922115E-003
+ 1.459750525195066E-003
+ 1.625700613333661E-003
+ 1.803522791146854E-003
+ 1.993874192438966E-003
+ 2.196839603166924E-003
+ 2.412505270783129E-003
+ 2.640958919145200E-003
+ 2.882289763624883E-003
+ 3.136588526417780E-003
+ 3.403947452056856E-003
+ 3.684460323131529E-003
+ 3.978995740964198E-003
+ 4.300731709113910E-003
+ 4.654536868133661E-003
+ 5.040617775189566E-003
+ 5.459184669091019E-003
+ 5.910451507299084E-003
+ 6.392041853499599E-003
+ 6.893667135248234E-003
+ 7.414368196611116E-003
+ 7.954292222077688E-003
+ 8.513588723603584E-003
+ 9.092409565308089E-003
+ 9.690908988493832E-003
+ 1.030924363699205E-002
+ 1.094757258283783E-002
+ 1.160605735227868E-002
+ 1.228486195212044E-002
+ 1.298415289641468E-002
+ 1.370324518837255E-002
+ 1.443832931314354E-002
+ 1.518904993307708E-002
+ 1.595555308376755E-002
+ 1.673798685220159E-002
+ 1.753650139980432E-002
+ 1.835124898577689E-002
+ 1.918238399072850E-002
+ 2.003006294060656E-002
+ 2.089444453092829E-002
+ 2.177568965131766E-002
+ 2.267396141035107E-002
+ 2.358942516071541E-002
+ 2.452224852468250E-002
+ 2.547260141990331E-002
+ 2.644065608552597E-002
+ 2.742658710864140E-002
+ 2.843057145106052E-002
+ 2.945278847642671E-002
+ 3.049341997766793E-002
+ 3.155265020479225E-002
+ 3.263066589303079E-002
+ 3.372765629133283E-002
+ 3.484381319121629E-002
+ 3.597933095597885E-002
+ 3.713402240061904E-002
+ 3.829645603944328E-002
+ 3.946130546889339E-002
+ 4.062867546301585E-002
+ 4.179867157766808E-002
+ 4.297140016315173E-002
+ 4.414696837697843E-002
+ 4.532548419677040E-002
+ 4.650705643329696E-002
+ 4.769179474364910E-002
+ 4.887980964455397E-002
+ 5.007121252583087E-002
+ 5.126611566399074E-002
+ 5.246463223598105E-002
+ 5.366687633307785E-002
+ 5.487296297492691E-002
+ 5.608300812373603E-002
+ 5.729712869862028E-002
+ 5.851544259010228E-002
+ 5.973806867476952E-002
+ 6.096512683009059E-002
+ 6.219673794939256E-002
+ 6.343302395700150E-002
+ 6.467410782354817E-002
+ 6.592011358144122E-002
+ 6.717116634050971E-002
+ 6.842739230381742E-002
+ 6.968891878365104E-002
+ 7.095587421768432E-002
+ 7.222838818532087E-002
+ 7.350659142421721E-002
+
++++ SN Ia ejection +++
+
+1.43E-01
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/computeIntegrals.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/computeIntegrals.py.svn-base
new file mode 100644
index 0000000..d7098ee
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/computeIntegrals.py.svn-base
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+import libmetalsSNII
+
+
+
+######################################################
+# Parameters
+######################################################
+
+# IMF
+Mmin = 0.05
+Mmax = 50.
+#m_s = []
+#a_s = [-1.35]
+m_s = [0.08, 0.5, 1.0]
+#a_s = [0.7, -0.8, -1.7, -1.3]
+a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# files
+MetalFile = 'MetalEjection.dat'
+HeliumCoreFile = 'HeliumCore.dat'
+OutputFile = 'chemyves.dat'
+
+
+# number of elements to follow
+nelts = 4
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 106
+
+
+
+
+IRess,IHcos,IFes,IMgs,IOxs,IMes,Mmin1,lStep1,Mmin2,lStep2 = libmetals.ComputeIntegrals(Mmin,Mmax,m_s,a_s,MetalFile,HeliumCoreFile,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n)
+
+
+# output
+
+f = open(OutputFile,'w')
+libmetalsSNII.WriteOutput(f,IRess,IHcos,IFes,IMgs,IOxs,IMes,n,nelts,Mmin1,lStep1,Mmin2,lStep2)
+f.close()
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/convert.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/convert.py.svn-base
new file mode 100644
index 0000000..b8ea733
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/convert.py.svn-base
@@ -0,0 +1,270 @@
+#!/usr/bin/env python
+
+import string
+from numpy import *
+import sys
+import pylab as pl
+
+import libtreeasph
+import libmetalsSNII
+
+import Ptools as pt
+
+
+unit_length = 1.0
+unit_mass = 1.e10
+u_lt = -log10( 4.7287e11*sqrt(unit_length**3/unit_mass))
+
+NbElement=4
+
+feedback_energy = 1.1682615e13*(unit_length/unit_mass**2) # Energy released by each supernova by solar mass (10^(51)erg (in TREEASPH units))
+# UnitLength_in_cm = 3.085e+21
+# UnitMass_in_g = 1.989e+43
+# UnitTime_in_s = 148849920000000.0
+# feedback_energy = 10**51 /UnitMass_in_g * (UnitTime_in_s/UnitLength_in_cm)**2
+
+
+
+def read_chemistry(file):
+
+
+ f = open(file)
+
+ ######################
+ # Livetime
+ ######################
+
+ f.readline()
+ f.readline()
+ coeff_z1 = array(string.split(f.readline()))
+ coeff_z2 = array(string.split(f.readline()))
+ coeff_z3 = array(string.split(f.readline()))
+
+ coeff_z = concatenate( (coeff_z1,coeff_z2,coeff_z3))
+ coeff_z.shape = (3,3)
+ coeff_z = coeff_z.astype(float)
+
+ # Conversion into program time unit
+ coeff_z[3-1,3-1] = coeff_z[3-1,3-1] + u_lt
+
+ # Transform log(timelive) polynomial expression log(t) = a(z) log(m)^2 + b(z) log(m) + c(z)
+ # into log(t) = a(z) log(m)^2 + 2b(z) log(m) + c(z)
+ coeff_z[2-1,:] = coeff_z[2-1,:] / 2.0
+
+
+ ######################
+ # Mass interval
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Mmin = float(f.readline())
+ Mmax = float(f.readline())
+
+ LogMmax2 = log10(Mmax)
+ TwoLogMmax = 2.0 * LogMmax2
+ LogMmax2 = LogMmax2**2
+
+ ######################
+ # IMFs Power
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ PowSN1 = float(f.readline())
+ PowSN2 = float(f.readline())
+
+
+ ######################
+ # Mass Parameters for SNe Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Msn1 = array(string.split(f.readline()))
+ Msn2 = array(string.split(f.readline()))
+ Msn3 = array(string.split(f.readline()))
+
+ Msn = concatenate( (Msn1,Msn2,Msn3))
+ Msn.shape = (3,2)
+ Msn = Msn.astype(float)
+
+ f.readline()
+ Mco = float(f.readline()) / unit_mass
+
+ ######################
+ # b Parameters for SNIa Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ b1 = float(f.readline())
+ b2 = float(f.readline())
+
+ ConstSN = array([0,0,0],float)
+ ConstSN[3-1] = (1.0+PowSN1)/(Mmax**(1.0+PowSN1)-Mmin**(1.0+PowSN1))
+ ConstSN[1-1] = (1.0+PowSN2)/(Msn[1-1,2-1]**(1.0+PowSN2)-Msn[1-1,1-1]**(1.0+PowSN2))
+ ConstSN[2-1] = (1.0+PowSN2)/(Msn[2-1,2-1]**(1.0+PowSN2)-Msn[2-1,1-1]**(1.0+PowSN2))
+ ConstSN[1-1] = b1*ConstSN[1-1]*ConstSN[3-1]
+ ConstSN[2-1] = b2*ConstSN[2-1]*ConstSN[3-1]
+
+
+
+ ######################
+ # Array size and step
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ ChemArraySize = int(f.readline())
+
+
+ ######################
+ # >>>Matter<<<< ejection and Helium core
+ ######################
+
+ ArrayOrigin = array([0,0],float)
+ ArrayStep = array([0,0],float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ line = array(string.split(f.readline()))
+
+ ArrayOrigin[p] = float(line[0])
+ ArrayStep[p] = float(line[1])
+
+ ArrayOrigin = log10(ArrayOrigin)
+
+ ######################
+ # Matter ejection for IMF power x=-1.35
+ # Integral (( 1 - Helium core )*m^x) for IMF power x=-1.35
+ ######################
+
+ '''
+ ChemArray[:,0] metal
+ ChemArray[:,1] Fe
+ ChemArray[:,2] Mg
+ ChemArray[:,3] Ox
+
+ ChemArray[:,4] Matter ejection
+ ChemArray[:,5] Integral (( 1 - Helium core )*m^x)
+ '''
+
+
+ ChemArray = zeros((110,NbElement+2),float)
+ MIa = zeros(NbElement,float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+
+ for j in xrange(ChemArraySize):
+
+ ChemArray[j,NbElement+p] = float(f.readline()) * ConstSN[3-1]
+
+
+
+ #########################
+ # Number of elements ####
+ #########################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ nelt = int(f.readline())
+
+ if nelt != NbElement:
+ raise "nelt != NbElement"
+
+
+ #########################
+ # Global metals ejection for IMF power x=-1.35
+ #########################
+
+ for p in xrange(NbElement):
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ for j in xrange(ChemArraySize):
+ ChemArray[j,p] = float(f.readline()) * ConstSN[3-1]
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ MIa[p] = float(f.readline())
+ MIa[p] = MIa[p] / unit_mass
+
+
+
+
+ ConstSN[1-1] = ( ConstSN[1-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[2-1] = ( ConstSN[2-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[3-1] = ( ConstSN[3-1]/PowSN1 ) * unit_mass
+
+ return coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa
+
+
+
+
+
+
+
+
+
+##################################
+# poirier
+##################################
+
+
+coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa = read_chemistry('chimie.dat')
+
+#b = 0.13466316207
+#ChemArray = ChemArray/b
+
+n = len(ChemArray)
+n = 106
+
+
+IFe = ChemArray[0:n,1] # Fe
+IMg = ChemArray[0:n:,2] # Mg
+IOx = ChemArray[0:n:,3] # Ox
+IMe = ChemArray[0:n:,0] # metal
+
+IRes = ChemArray[0:n:,4] # Matter ejection
+IHco = ChemArray[0:n:,5] # Integral (( 1 - Helium core )*m^x)
+
+
+
+for elt in ChemArray[0:n:,0]:
+ print elt
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/convert_yields.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/convert_yields.py.svn-base
new file mode 100644
index 0000000..5b5db37
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/convert_yields.py.svn-base
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+
+import sys,string
+from numpy import *
+
+file1 = sys.argv[1]
+file2 = sys.argv[2]
+
+
+f = open(file1,'r')
+lines = f.readlines()
+f.close()
+
+
+data = array([])
+
+for line in lines:
+ line = string.split(line)
+ data = concatenate((data,array(line)))
+
+data.shape = (len(lines),len(data)/len(lines))
+
+data[0,0] = '# M'
+
+f = open(file2,'w')
+
+# header
+f.write("%s\t"%data[0,0])
+
+for j in xrange(1,data.shape[0]):
+ f.write("%s\t\t"%data[j,0])
+
+f.write("\n")
+
+
+# 10 M
+f.write("%s\t"%"10")
+for j in xrange(1,data.shape[0]):
+ f.write("%s\t"%"0.00E-00")
+
+f.write("\n")
+
+
+
+for i in xrange(1,data.shape[1]):
+ f.write("%s\t"%data[0,i])
+
+ for j in xrange(1,data.shape[0]):
+ f.write("%s\t"%data[j,i])
+
+ f.write("\n")
+
+
+f.close()
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/image.png.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/image.png.svn-base
new file mode 100644
index 0000000..fba6c87
Binary files /dev/null and b/PyChem/shared/tables/MetalSNII/.svn/text-base/image.png.svn-base differ
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/libimf.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/libimf.py.svn-base
new file mode 100644
index 0000000..8bccfba
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/libimf.py.svn-base
@@ -0,0 +1 @@
+link ../Imf/libimf.py
\ No newline at end of file
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/libmetalsSNII.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/libmetalsSNII.py.svn-base
new file mode 100644
index 0000000..a5156df
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/libmetalsSNII.py.svn-base
@@ -0,0 +1,434 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+import string,types,sys
+
+import libimf
+
+
+
+
+#####################################################
+def read_MetalFile(file,columns=None,lines=None,dtype=float,skipheader=False,cchar='#'):
+#####################################################
+ """[X,Y,Z] = READ('FILE',[1,4,13],lines=[10,1000])
+ Read columns 1,4 and 13 from 'FILE' from line 10 to 1000
+ into array X,Y and Z
+
+ file is either fd or name file
+
+ """
+
+ def RemoveComments(l):
+ if l[0]==cchar:
+ return None
+ else:
+ return l
+
+ def toNumList(l):
+ return map(dtype,l)
+
+ if type(file) != types.FileType:
+ f = open(file,'r')
+ else:
+ f = file
+
+
+ # read header while there is one
+ while 1:
+ fpos = f.tell()
+ header = f.readline()
+ if header[0] != cchar:
+ f.seek(fpos)
+ header = None
+ break
+ else:
+ if skipheader:
+ header = None
+ else:
+ # create dict from header
+ header = string.strip(header[2:])
+ elts = string.split(header)
+ break
+
+
+ # now, read the file content
+ lines = f.readlines()
+
+ # remove trailing
+ lines = map(string.strip, lines)
+
+
+ # remove comments
+ #lines = map(RemoveComments, lines)
+
+ # split
+ lines = map(string.split, lines)
+
+ # convert into float
+ lines = map(toNumList, lines)
+
+ # convert into array
+ lines = array(map(array, lines))
+
+ # transpose
+ lines = transpose(lines)
+
+ if header != None:
+ iobs = {}
+ i = 0
+ for elt in elts:
+ iobs[elt]=i
+ i = i + 1
+
+ vals = {}
+ for key in iobs.keys():
+ vals[key] = lines[iobs[key]]
+
+ return elts,vals
+
+
+ # return
+ if columns == None:
+ return lines
+ else:
+ return lines.take(axis=0,indices=columns)
+
+
+
+
+
+
+
+
+def WriteParams(f,Mmin,Mmax,m_s,a_s,MetalFiles,HeliumCoreFile,elts,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n):
+
+
+ Mi2,Resi,Hcoi = ReadAndInterpolateHeliumCore(HeliumCoreFile,Mmin2,Mmax2,dM)
+
+
+ datai = {}
+ eltbs = []
+ for MetalFile in MetalFiles:
+ Mi1_f,datai_f,elts_f = ReadAndInterpolate(MetalFile,Mmin1,Mmax1,dM)
+
+ Mi1 = Mi1_f
+ for elt in elts_f:
+ eltbs.append(elt)
+ datai[elt] = datai_f[elt]
+
+
+ # check if we have an entry for Metals
+ try:
+ eltbs.index('Metals')
+ compute_metals=False
+ except ValueError:
+ compute_metals=True
+
+
+ # compute metals
+ # here, we sum the contribution of all elements
+ if compute_metals:
+ print "compute Metals :"
+ metals = zeros(len(Mi1))
+ for elt in eltbs:
+ print "add ",elt
+ metals = metals + datai[elt]
+ print "--------"
+ eltbs.append('Metals')
+ datai['Metals'] = metals
+
+
+ if elts==None:
+ elts=eltbs
+ else:
+ nelts = len(elts)
+ # create a new data and elts
+ dataif = {}
+ for elt in elts:
+
+ # check if exists
+ if datai.has_key(elt):
+ dataif[elt] = datai[elt]
+ else:
+ # try to find isotopes
+ dataiso = zeros(len(Mi1))
+ for key in datai.keys():
+ if key[:len(elt)] == elt:
+ dataiso = dataiso+datai[key]
+ print "add",key,"to",elt
+ dataif[elt] = dataiso
+
+ datai = dataif
+
+ ## check length of elts
+ if len(elts)!=nelts: # nelts-1 because metals is not present
+ raise "nelts(=%d) != len(elts)(=%d) !!!"%(nelts,len(elts))
+
+
+
+
+ # output steps
+ lStep1 = (log10(Mmax*1.25) - log10(Mmin1) )/float(n-1)
+ lStep2 = (log10(Mmax*1.25) - log10(Mmin2) )/float(n-1)
+ Ms1 = 10**(arange(n)*lStep1 + log10(Mmin1))
+ Ms2 = 10**(arange(n)*lStep2 + log10(Mmin2))
+
+ datas,Ress, Hcos = ComputeEjectats(Mi1,datai,elts, Mi2,Resi,Hcoi, Ms1,Ms2)
+ Idatas,IRess,IHcos = ComputeIntegrals(Mi1,datai,elts, Mi2,Resi,Hcoi ,Mmin,Mmax,m_s,a_s, Ms1,Ms2)
+
+
+
+ label = "#### Metal Parameters ####\n"
+
+ eltList = [ ("Ej",Ress,Mmin2,lStep2),("Ejnp",Hcos,Mmin2,lStep2) ]
+ for elt in elts:
+ eltList.append( (elt,datas[elt],Mmin1,lStep1) )
+ WriteOutput(f,label,eltList, n,nelts)
+
+
+ f.write("\n")
+
+ label = "#### Metal Ejecta Parameters ####\n"
+
+ eltList = [ ("IEj",IRess,Mmin2,lStep2),("IEjnp",IHcos,Mmin2,lStep2) ]
+ for elt in elts:
+ eltList.append( ("I%s"%elt,Idatas[elt],Mmin1,lStep1) )
+ WriteOutput(f,label,eltList, n,nelts)
+
+ return elts
+
+
+def WriteOutput(f,label,eltsList,n,nelts):
+
+
+ f.write(label)
+
+ f.write("\n# Number of points / Number of elements\n")
+ f.write("%d %d\n"%(n,nelts))
+
+
+ for elt,data,Mmin,lStep in eltsList:
+
+
+ f.write("\n# %s\n"%elt)
+ f.write("\n%g %g\n"%(Mmin,lStep))
+ for i in range(len(data)):
+ f.write("%e\n"%data[i])
+
+
+def ReadAndInterpolate(MetalFile,Mmin1,Mmax1,dM):
+
+ '''
+ Read data
+ and compute linear interpolation, using
+ Mmin1,dM
+ Mmin2,dM
+ '''
+
+
+ # read ejecta
+ elts,data = read_MetalFile(MetalFile,cchar='#')
+
+ # devide by mass ...
+ for elt in elts[1:]:
+ data[elt] = data[elt]/data['M']
+
+ # ... and remove mass from dict
+ M1 = data['M']
+ del data['M']
+ elts = elts[1:]
+
+
+ # linear interpolation
+ Mi1 = arange(Mmin1,Mmax1+dM,dM)
+
+ # interpolate elements
+ datai = {}
+ for elt in elts:
+ datai[elt] = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),data[elt].astype(float32))
+ datai[elt] = where(datai[elt]<=0,0,datai[elt])
+
+ return Mi1,datai,elts
+
+
+
+def ReadAndInterpolateHeliumCore(HeliumCoreFile,Mmin2,Mmax2,dM):
+
+ '''
+ Read data
+ and compute linear interpolation, using
+ Mmin1,dM
+ Mmin2,dM
+
+ return *i
+
+ '''
+
+ # read residual and helium core
+ M2,Res,Hco = pt.io.read_ascii(HeliumCoreFile,[0,1,2],skipheader=True,cchar='#')
+ Res = Res/M2
+ Hco = Hco/M2
+
+ # linear interpolation
+ Mi2 = arange(Mmin2,Mmax2+dM,dM)
+
+ # interpolate
+ # interpolate residual and helium core
+ Resi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Res.astype(float32))
+ Hcoi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Hco.astype(float32))
+ Resi = where(Resi<=0,0,Resi)
+ Hcoi = where(Hcoi<=0,0,Hcoi)
+
+ return Mi2,Resi,Hcoi
+
+
+
+
+
+
+def ComputeEjectats(Mi1,datai,elts, Mi2,Resi,Hcoi, Ms1,Ms2):
+
+ '''
+ From the interpolated values *i,
+ return interpolation of ejectats
+ '''
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ Ress = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Resi).astype(float32))
+ Hcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Hcoi).astype(float32))
+
+ datas = {}
+ for elt in elts:
+ datas[elt] = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),datai[elt].astype(float32))
+
+
+
+
+ return datas,Ress,Hcos
+
+
+
+
+
+
+
+def ComputeIntegrals(Mi1,datai,elts, Mi2,Resi,Hcoi, Mmin,Mmax,m_s,a_s, Ms1,Ms2):
+
+ '''
+ From the interpolated values *i,
+ integrate and return interpolation
+ '''
+
+ # imf
+ b_s = libimf.ComputeConstants(m_s,a_s,Mmin,Mmax)
+ imf1 = libimf.imfv(Mi1,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+ imf2 = libimf.imfv(Mi2,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+
+ Idata = {}
+ for elt in elts:
+ Idata[elt] = cumtrapz(imf1 * datai[elt],Mi1)
+
+
+ IRes = cumtrapz(imf2 * (1-Resi),Mi2)
+ IHco = cumtrapz(imf2 * (1-Hcoi),Mi2)
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ Idatas = {}
+ for elt in elts:
+ Idatas[elt] = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Idata[elt].astype(float32))
+
+ IRess = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IRes.astype(float32))
+ IHcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IHco.astype(float32))
+
+ return Idatas,IRess,IHcos
+
+
+
+
+
+
+
+
+
+
+def Plot():
+
+ ###############################################
+ # plot
+ ###############################################
+
+
+ # plot 1
+
+ pt.subplot(211)
+
+ pt.plot(M2,Res,'ko')
+ pt.plot(Mi2,Resi,'k-')
+
+ pt.plot(M2,Hco,'ro')
+ pt.plot(Mi2,Hcoi,'r-')
+
+
+ pt.plot(M1,Fe,'yo')
+ pt.plot(Mi1,Fei,'y-')
+
+ pt.plot(M1,Mg,'go')
+ pt.plot(Mi1,Mgi,'g-')
+
+ pt.plot(M1,Ox,'bo')
+ pt.plot(Mi1,Oxi,'b-')
+
+ pt.plot(M1,Me,'co')
+ pt.plot(Mi1,Mei,'c-')
+
+ pt.semilogx()
+ pt.semilogy()
+
+ pt.axis([Mmin,Mmax1,1e-4,1e0])
+
+ # plot 2
+
+ pt.subplot(212)
+
+
+ pt.plot(Mi1[1:],IFe*500,'y')
+ pt.plot(Mi1[1:],IMg*500,'g')
+ pt.plot(Mi1[1:],IOx*10,'b')
+ pt.plot(Mi1[1:],IMe*10,'c')
+ pt.plot(Mi2[1:],IRes,'k')
+ pt.plot(Mi2[1:],IHco,'r')
+
+ '''
+ pt.plot(Ms1,IFes*500,'o')
+ pt.plot(Ms1,IMgs*500,'o')
+ pt.plot(Ms1,IOxs*10 ,'o')
+ pt.plot(Ms1,IMes*10 ,'o')
+ pt.plot(Ms2,IRess,'o')
+ pt.plot(Ms2,IHcos,'o')
+ '''
+
+
+
+ pt.semilogx()
+ pt.axis([Mmin,Mmax1,0.,4*b])
+
+ pt.show()
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/plot.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/plot.py.svn-base
new file mode 100644
index 0000000..506f771
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/plot.py.svn-base
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+
+
+import Ptools as pt
+
+M,Fe,Mg,Ox,Me = pt.io.read_ascii('MetalEjection.dat',[0,1,2,3,4],skipheader=True)
+
+M1,Res,Hco = pt.io.read_ascii('HeliumCore.dat',[0,1,2],skipheader=True)
+
+print Ox
+
+Fe = Fe/M
+Mg = Mg/M
+Ox = Ox/M
+Me = Me/M
+
+Res = Res/M1
+Hco = Hco/M1
+
+
+
+pt.plot(M,Fe,'y')
+pt.plot(M,Mg,'b')
+pt.plot(M,Ox,'g')
+pt.plot(M,Me,'c')
+
+pt.plot(M1,Res,'k')
+pt.plot(M1,Hco,'r')
+
+pt.plot(M,Fe,'yo')
+pt.plot(M,Mg,'bo')
+pt.plot(M,Ox,'go')
+pt.plot(M,Me,'co')
+
+pt.plot(M1,Res,'ko')
+pt.plot(M1,Hco,'ro')
+
+
+pt.semilogx()
+pt.semilogy()
+pt.axis([1e0,1e2,1e-4,1e0])
+
+pt.show()
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/plot_P.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/plot_P.py.svn-base
new file mode 100644
index 0000000..11a8816
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/plot_P.py.svn-base
@@ -0,0 +1,290 @@
+#!/usr/bin/env python
+
+import string
+from numpy import *
+import sys
+import pylab as pl
+
+import libtreeasph
+
+import Ptools as pt
+
+
+unit_length = 1.0
+unit_mass = 1.e10
+u_lt = -log10( 4.7287e11*sqrt(unit_length**3/unit_mass))
+
+NbElement=4
+
+feedback_energy = 1.1682615e13*(unit_length/unit_mass**2) # Energy released by each supernova by solar mass (10^(51)erg (in TREEASPH units))
+# UnitLength_in_cm = 3.085e+21
+# UnitMass_in_g = 1.989e+43
+# UnitTime_in_s = 148849920000000.0
+# feedback_energy = 10**51 /UnitMass_in_g * (UnitTime_in_s/UnitLength_in_cm)**2
+
+
+
+def read_chemistry(file):
+
+
+ f = open(file)
+
+ ######################
+ # Livetime
+ ######################
+
+ f.readline()
+ f.readline()
+ coeff_z1 = array(string.split(f.readline()))
+ coeff_z2 = array(string.split(f.readline()))
+ coeff_z3 = array(string.split(f.readline()))
+
+ coeff_z = concatenate( (coeff_z1,coeff_z2,coeff_z3))
+ coeff_z.shape = (3,3)
+ coeff_z = coeff_z.astype(float)
+
+ # Conversion into program time unit
+ coeff_z[3-1,3-1] = coeff_z[3-1,3-1] + u_lt
+
+ # Transform log(timelive) polynomial expression log(t) = a(z) log(m)^2 + b(z) log(m) + c(z)
+ # into log(t) = a(z) log(m)^2 + 2b(z) log(m) + c(z)
+ coeff_z[2-1,:] = coeff_z[2-1,:] / 2.0
+
+
+ ######################
+ # Mass interval
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Mmin = float(f.readline())
+ Mmax = float(f.readline())
+
+ LogMmax2 = log10(Mmax)
+ TwoLogMmax = 2.0 * LogMmax2
+ LogMmax2 = LogMmax2**2
+
+ ######################
+ # IMFs Power
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ PowSN1 = float(f.readline())
+ PowSN2 = float(f.readline())
+
+
+ ######################
+ # Mass Parameters for SNe Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Msn1 = array(string.split(f.readline()))
+ Msn2 = array(string.split(f.readline()))
+ Msn3 = array(string.split(f.readline()))
+
+ Msn = concatenate( (Msn1,Msn2,Msn3))
+ Msn.shape = (3,2)
+ Msn = Msn.astype(float)
+
+ f.readline()
+ Mco = float(f.readline()) / unit_mass
+
+ ######################
+ # b Parameters for SNIa Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ b1 = float(f.readline())
+ b2 = float(f.readline())
+
+ ConstSN = array([0,0,0],float)
+ ConstSN[3-1] = (1.0+PowSN1)/(Mmax**(1.0+PowSN1)-Mmin**(1.0+PowSN1))
+ ConstSN[1-1] = (1.0+PowSN2)/(Msn[1-1,2-1]**(1.0+PowSN2)-Msn[1-1,1-1]**(1.0+PowSN2))
+ ConstSN[2-1] = (1.0+PowSN2)/(Msn[2-1,2-1]**(1.0+PowSN2)-Msn[2-1,1-1]**(1.0+PowSN2))
+ ConstSN[1-1] = b1*ConstSN[1-1]*ConstSN[3-1]
+ ConstSN[2-1] = b2*ConstSN[2-1]*ConstSN[3-1]
+
+
+
+ ######################
+ # Array size and step
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ ChemArraySize = int(f.readline())
+
+
+ ######################
+ # >>>Matter<<<< ejection and Helium core
+ ######################
+
+ ArrayOrigin = array([0,0],float)
+ ArrayStep = array([0,0],float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ line = array(string.split(f.readline()))
+
+ ArrayOrigin[p] = float(line[0])
+ ArrayStep[p] = float(line[1])
+
+ ArrayOrigin = log10(ArrayOrigin)
+
+ ######################
+ # Matter ejection for IMF power x=-1.35
+ # Integral (( 1 - Helium core )*m^x) for IMF power x=-1.35
+ ######################
+
+ '''
+ ChemArray[:,0] metal
+ ChemArray[:,1] Fe
+ ChemArray[:,2] Mg
+ ChemArray[:,3] Ox
+
+ ChemArray[:,4] Matter ejection
+ ChemArray[:,5] Integral (( 1 - Helium core )*m^x)
+ '''
+
+
+ ChemArray = zeros((110,NbElement+2),float)
+ MIa = zeros(NbElement,float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+
+ for j in xrange(ChemArraySize):
+
+ ChemArray[j,NbElement+p] = float(f.readline()) * ConstSN[3-1]
+
+
+
+ #########################
+ # Number of elements ####
+ #########################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ nelt = int(f.readline())
+
+ if nelt != NbElement:
+ raise "nelt != NbElement"
+
+
+ #########################
+ # Global metals ejection for IMF power x=-1.35
+ #########################
+
+ for p in xrange(NbElement):
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ for j in xrange(ChemArraySize):
+ ChemArray[j,p] = float(f.readline()) * ConstSN[3-1]
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ MIa[p] = float(f.readline())
+ MIa[p] = MIa[p] / unit_mass
+
+
+
+
+ ConstSN[1-1] = ( ConstSN[1-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[2-1] = ( ConstSN[2-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[3-1] = ( ConstSN[3-1]/PowSN1 ) * unit_mass
+
+ return coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa
+
+
+
+
+
+coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa = read_chemistry('chimie.dat')
+
+'''
+ChemArray[:,0] metal
+ChemArray[:,1] Fe
+ChemArray[:,2] Mg
+ChemArray[:,3] Ox
+
+ChemArray[:,4] Matter ejection
+ChemArray[:,5] Integral (( 1 - Helium core )*m^x)
+'''
+
+
+#b = 0.13466316207
+#ChemArray = ChemArray/b
+
+n = len(ChemArray)
+n = 106
+
+
+IFe = ChemArray[0:n,1]
+IMg = ChemArray[0:n:,2]
+IOx = ChemArray[0:n:,3]
+IMe = ChemArray[0:n:,0]
+
+IRes = ChemArray[0:n:,4]
+IHco = ChemArray[0:n:,5]
+
+M1 = 10**( ArrayOrigin[0]+ arange(n)*ArrayStep[0] )
+M2 = 10**( ArrayOrigin[1]+ arange(n)*ArrayStep[1] )
+
+print ArrayStep[0]
+
+
+pt.plot(M1,IRes)
+pt.plot(M1,IHco)
+
+pt.plot(M2,IFe*500)
+pt.plot(M2,IMg*500)
+pt.plot(M2,IOx*10)
+pt.plot(M2,IMe*10)
+
+pt.semilogx()
+
+pt.show()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/plot_both.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/plot_both.py.svn-base
new file mode 100644
index 0000000..63c4c34
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/plot_both.py.svn-base
@@ -0,0 +1,334 @@
+#!/usr/bin/env python
+
+import string
+from numpy import *
+import sys
+import pylab as pl
+
+import libtreeasph
+import libmetalsSNII
+
+import Ptools as pt
+
+
+unit_length = 1.0
+unit_mass = 1.e10
+u_lt = -log10( 4.7287e11*sqrt(unit_length**3/unit_mass))
+
+NbElement=4
+
+feedback_energy = 1.1682615e13*(unit_length/unit_mass**2) # Energy released by each supernova by solar mass (10^(51)erg (in TREEASPH units))
+# UnitLength_in_cm = 3.085e+21
+# UnitMass_in_g = 1.989e+43
+# UnitTime_in_s = 148849920000000.0
+# feedback_energy = 10**51 /UnitMass_in_g * (UnitTime_in_s/UnitLength_in_cm)**2
+
+
+
+def read_chemistry(file):
+
+
+ f = open(file)
+
+ ######################
+ # Livetime
+ ######################
+
+ f.readline()
+ f.readline()
+ coeff_z1 = array(string.split(f.readline()))
+ coeff_z2 = array(string.split(f.readline()))
+ coeff_z3 = array(string.split(f.readline()))
+
+ coeff_z = concatenate( (coeff_z1,coeff_z2,coeff_z3))
+ coeff_z.shape = (3,3)
+ coeff_z = coeff_z.astype(float)
+
+ # Conversion into program time unit
+ coeff_z[3-1,3-1] = coeff_z[3-1,3-1] + u_lt
+
+ # Transform log(timelive) polynomial expression log(t) = a(z) log(m)^2 + b(z) log(m) + c(z)
+ # into log(t) = a(z) log(m)^2 + 2b(z) log(m) + c(z)
+ coeff_z[2-1,:] = coeff_z[2-1,:] / 2.0
+
+
+ ######################
+ # Mass interval
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Mmin = float(f.readline())
+ Mmax = float(f.readline())
+
+ LogMmax2 = log10(Mmax)
+ TwoLogMmax = 2.0 * LogMmax2
+ LogMmax2 = LogMmax2**2
+
+ ######################
+ # IMFs Power
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ PowSN1 = float(f.readline())
+ PowSN2 = float(f.readline())
+
+
+ ######################
+ # Mass Parameters for SNe Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Msn1 = array(string.split(f.readline()))
+ Msn2 = array(string.split(f.readline()))
+ Msn3 = array(string.split(f.readline()))
+
+ Msn = concatenate( (Msn1,Msn2,Msn3))
+ Msn.shape = (3,2)
+ Msn = Msn.astype(float)
+
+ f.readline()
+ Mco = float(f.readline()) / unit_mass
+
+ ######################
+ # b Parameters for SNIa Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ b1 = float(f.readline())
+ b2 = float(f.readline())
+
+ ConstSN = array([0,0,0],float)
+ ConstSN[3-1] = (1.0+PowSN1)/(Mmax**(1.0+PowSN1)-Mmin**(1.0+PowSN1))
+ ConstSN[1-1] = (1.0+PowSN2)/(Msn[1-1,2-1]**(1.0+PowSN2)-Msn[1-1,1-1]**(1.0+PowSN2))
+ ConstSN[2-1] = (1.0+PowSN2)/(Msn[2-1,2-1]**(1.0+PowSN2)-Msn[2-1,1-1]**(1.0+PowSN2))
+ ConstSN[1-1] = b1*ConstSN[1-1]*ConstSN[3-1]
+ ConstSN[2-1] = b2*ConstSN[2-1]*ConstSN[3-1]
+
+
+
+ ######################
+ # Array size and step
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ ChemArraySize = int(f.readline())
+
+
+ ######################
+ # >>>Matter<<<< ejection and Helium core
+ ######################
+
+ ArrayOrigin = array([0,0],float)
+ ArrayStep = array([0,0],float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ line = array(string.split(f.readline()))
+
+ ArrayOrigin[p] = float(line[0])
+ ArrayStep[p] = float(line[1])
+
+ ArrayOrigin = log10(ArrayOrigin)
+
+ ######################
+ # Matter ejection for IMF power x=-1.35
+ # Integral (( 1 - Helium core )*m^x) for IMF power x=-1.35
+ ######################
+
+ '''
+ ChemArray[:,0] metal
+ ChemArray[:,1] Fe
+ ChemArray[:,2] Mg
+ ChemArray[:,3] Ox
+
+ ChemArray[:,4] Matter ejection
+ ChemArray[:,5] Integral (( 1 - Helium core )*m^x)
+ '''
+
+
+ ChemArray = zeros((110,NbElement+2),float)
+ MIa = zeros(NbElement,float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+
+ for j in xrange(ChemArraySize):
+
+ ChemArray[j,NbElement+p] = float(f.readline()) * ConstSN[3-1]
+
+
+
+ #########################
+ # Number of elements ####
+ #########################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ nelt = int(f.readline())
+
+ if nelt != NbElement:
+ raise "nelt != NbElement"
+
+
+ #########################
+ # Global metals ejection for IMF power x=-1.35
+ #########################
+
+ for p in xrange(NbElement):
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ for j in xrange(ChemArraySize):
+ ChemArray[j,p] = float(f.readline()) * ConstSN[3-1]
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ MIa[p] = float(f.readline())
+ MIa[p] = MIa[p] / unit_mass
+
+
+
+
+ ConstSN[1-1] = ( ConstSN[1-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[2-1] = ( ConstSN[2-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[3-1] = ( ConstSN[3-1]/PowSN1 ) * unit_mass
+
+ return coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa
+
+
+
+
+
+
+
+
+
+##################################
+# poirier
+##################################
+
+
+coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa = read_chemistry('chimie.dat')
+
+#b = 0.13466316207
+#ChemArray = ChemArray/b
+
+n = len(ChemArray)
+n = 106
+
+
+IFe = ChemArray[0:n,1] # Fe
+IMg = ChemArray[0:n:,2] # Mg
+IOx = ChemArray[0:n:,3] # Ox
+IMe = ChemArray[0:n:,0] # metal
+
+IRes = ChemArray[0:n:,4] # Matter ejection
+IHco = ChemArray[0:n:,5] # Integral (( 1 - Helium core )*m^x)
+
+M1 = 10**( ArrayOrigin[0]+ arange(n)*ArrayStep[0] )
+M2 = 10**( ArrayOrigin[1]+ arange(n)*ArrayStep[1] )
+
+
+##################################
+# yves
+##################################
+
+
+ChAr,PaAr = libmetalsSNII.Read('chemyves.dat')
+
+n = len(ChAr[0,:])
+
+j = 0
+MyRes = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyRes = ChAr[j]
+
+j = 1
+MyHco = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyHco = ChAr[j]
+
+j = 2
+MyFe = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyFe = ChAr[j]
+
+j = 3
+MyMg = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyMg = ChAr[j]
+
+j = 4
+MyOx = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyOx = ChAr[j]
+
+j = 5
+MyMe = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyMe = ChAr[j]
+
+##################################
+# plot
+##################################
+
+
+pt.plot(M1,IRes,'k')
+pt.plot(M1,IHco,'r')
+
+pt.plot(M2,IFe*500,'y')
+pt.plot(M2,IMg*500,'g')
+pt.plot(M2,IOx*10,'b')
+pt.plot(M2,IMe*10,'c')
+
+
+pt.plot(MyRes,IyRes,'k--')
+pt.plot(MyHco,IyHco,'r--')
+pt.plot(MyFe,IyFe*500,'y--')
+pt.plot(MyMg,IyMg*500,'g--')
+pt.plot(MyOx,IyOx*10,'b--')
+pt.plot(MyMe,IyMe*10,'c--')
+
+
+pt.semilogx()
+
+pt.show()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/sto.libmetalsSNII.py.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/sto.libmetalsSNII.py.svn-base
new file mode 100644
index 0000000..62254e4
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/sto.libmetalsSNII.py.svn-base
@@ -0,0 +1,301 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+import string
+
+import libimf
+
+
+def WriteParams(f,Mmin,Mmax,m_s,a_s,MetalFile,HeliumCoreFile,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n):
+
+ Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi = ReadAndInterpolate(MetalFile,HeliumCoreFile,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n)
+
+
+
+
+
+ # output steps
+ lStep1 = (log10(Mmax*1.25) - log10(Mmin1) )/float(n-1)
+ lStep2 = (log10(Mmax*1.25) - log10(Mmin2) )/float(n-1)
+ Ms1 = 10**(arange(n)*lStep1 + log10(Mmin1))
+ Ms2 = 10**(arange(n)*lStep2 + log10(Mmin2))
+
+
+ Ress, Hcos, Fes, Mgs, Oxs, Mes = ComputeEjectats(Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi, Ms1,Ms2)
+ IRess,IHcos,IFes,IMgs,IOxs,IMes = ComputeIntegrals(Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi ,Mmin,Mmax,m_s,a_s, Ms1,Ms2)
+
+
+
+ label = "#### Metal Parameters ####\n"
+
+ #WriteOutput(f,label,Ress, Hcos, Fes, Mgs, Oxs, Mes, n,nelts,Mmin1,lStep1,Mmin2,lStep2)
+ eltList = [ ("Re",Ress,Mmin2,lStep2),("Hc",Hcos,Mmin2,lStep2),("Fe",Fes,Mmin1,lStep1),("Mg",Mgs,Mmin1,lStep1),("Ox",Oxs,Mmin1,lStep1),("Me",Mes,Mmin1,lStep1) ]
+ WriteOutput2(f,label,eltList, n,nelts)
+
+
+ f.write("\n")
+
+ label = "#### Metal Ejecta Parameters ####\n"
+ #WriteOutput(f,label,IRess,IHcos,IFes,IMgs,IOxs,IMes,n,nelts,Mmin1,lStep1,Mmin2,lStep2)
+ eltList = [ ("IRe",IRess,Mmin2,lStep2),("IHc",IHcos,Mmin2,lStep2),("IFe",IFes,Mmin1,lStep1),("IMg",IMgs,Mmin1,lStep1),("IOx",IOxs,Mmin1,lStep1),("IMe",IMes,Mmin1,lStep1) ]
+ WriteOutput2(f,label,eltList, n,nelts)
+
+
+
+
+def WriteOutput(f,label,IRess,IHcos,IFes,IMgs,IOxs,IMes,n,nelts,Mmin1,lStep1,Mmin2,lStep2):
+
+
+ f.write(label)
+
+ f.write("\n# Number of points / Number of elements\n")
+ f.write("%d %d\n"%(n,nelts))
+
+ f.write("\n# Int ( 1- Residual ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin2,lStep2))
+ for i in range(len(IRess)):
+ f.write("%e\n"%IRess[i])
+
+ f.write("\n# Int ( 1- Helium Core ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin2,lStep2))
+ for i in range(len(IHcos)):
+ f.write("%e\n"%IHcos[i])
+
+ f.write("\n# Int ( Fe ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin1,lStep1))
+ for i in range(len(IFes)):
+ f.write("%e\n"%IFes[i])
+
+ f.write("\n# Int ( Mg ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin1,lStep1))
+ for i in range(len(IMgs)):
+ f.write("%e\n"%IMgs[i])
+
+ f.write("\n# Int ( O ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin1,lStep1))
+ for i in range(len(IOxs)):
+ f.write("%e\n"%IOxs[i])
+
+ f.write("\n# Int ( Metals ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin1,lStep1))
+ for i in range(len(IMes)):
+ f.write("%e\n"%IMes[i])
+
+
+def WriteOutput2(f,label,eltsList,n,nelts):
+
+
+ f.write(label)
+
+ f.write("\n# Number of points / Number of elements\n")
+ f.write("%d %d\n"%(n,nelts))
+
+
+ for elt,data,Mmin,lStep in eltsList:
+
+
+ f.write("\n# %s\n"%elt)
+ f.write("\n%g %g\n"%(Mmin,lStep))
+ for i in range(len(data)):
+ f.write("%e\n"%data[i])
+
+
+def ReadAndInterpolate(MetalFile,HeliumCoreFile,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n):
+
+ '''
+ Read data
+ and compute linear interpolation, using
+ Mmin1,dM
+ Mmin2,dM
+
+ return *i
+
+ '''
+
+ # read ejecta
+ M1,Fe,Mg,Ox,Me = pt.io.read_ascii(MetalFile,[0,1,2,3,4],skipheader=True,cchar='#')
+ Fe = Fe/M1
+ Mg = Mg/M1
+ Ox = Ox/M1
+ Me = Me/M1
+
+
+ # read residual and helium core
+ M2,Res,Hco = pt.io.read_ascii(HeliumCoreFile,[0,1,2],skipheader=True,cchar='#')
+ Res = Res/M2
+ Hco = Hco/M2
+
+ # linear interpolation
+ Mi1 = arange(Mmin1,Mmax1+dM,dM)
+ Mi2 = arange(Mmin2,Mmax2+dM,dM)
+
+ # interpolate
+ Fei = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Fe.astype(float32))
+ Mgi = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Mg.astype(float32))
+ Oxi = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Ox.astype(float32))
+ Mei = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Me.astype(float32))
+
+ Resi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Res.astype(float32))
+ Hcoi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Hco.astype(float32))
+
+ Fei = where(Fei<=0,0,Fei)
+ Mgi = where(Mgi<=0,0,Mgi)
+ Oxi = where(Oxi<=0,0,Oxi)
+ Mei = where(Mei<=0,0,Mei)
+
+ Resi = where(Resi<=0,0,Resi)
+ Hcoi = where(Hcoi<=0,0,Hcoi)
+
+ return Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi
+
+
+
+
+
+
+
+
+def ComputeEjectats(Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi, Ms1,Ms2):
+
+ '''
+ From the interpolated values *i,
+ return interpolation of ejectats
+ '''
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ Fes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Fei.astype(float32))
+ Mgs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Mgi.astype(float32))
+ Oxs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Oxi.astype(float32))
+ Mes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Mei.astype(float32))
+
+ Ress = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Resi).astype(float32))
+ Hcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Hcoi).astype(float32))
+
+ return Ress,Hcos,Fes,Mgs,Oxs,Mes
+
+
+
+
+
+
+
+def ComputeIntegrals(Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi, Mmin,Mmax,m_s,a_s, Ms1,Ms2):
+
+ '''
+ From the interpolated values *i,
+ integrate and return interpolation
+ '''
+
+ # imf
+ b_s = libimf.ComputeConstants(m_s,a_s,Mmin,Mmax)
+ imf1 = libimf.imfv(Mi1,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+ imf2 = libimf.imfv(Mi2,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+
+ IFe = cumtrapz(imf1 * Fei,Mi1)
+ IMg = cumtrapz(imf1 * Mgi,Mi1)
+ IOx = cumtrapz(imf1 * Oxi,Mi1)
+ IMe = cumtrapz(imf1 * Mei,Mi1)
+
+ IRes = cumtrapz(imf2 * (1-Resi),Mi2)
+ IHco = cumtrapz(imf2 * (1-Hcoi),Mi2)
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ IFes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IFe.astype(float32))
+ IMgs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IMg.astype(float32))
+ IOxs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IOx.astype(float32))
+ IMes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IMe.astype(float32))
+
+ IRess = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IRes.astype(float32))
+ IHcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IHco.astype(float32))
+
+ return IRess,IHcos,IFes,IMgs,IOxs,IMes
+
+
+
+
+
+
+
+
+
+
+def Plot():
+
+ ###############################################
+ # plot
+ ###############################################
+
+
+ # plot 1
+
+ pt.subplot(211)
+
+ pt.plot(M2,Res,'ko')
+ pt.plot(Mi2,Resi,'k-')
+
+ pt.plot(M2,Hco,'ro')
+ pt.plot(Mi2,Hcoi,'r-')
+
+
+ pt.plot(M1,Fe,'yo')
+ pt.plot(Mi1,Fei,'y-')
+
+ pt.plot(M1,Mg,'go')
+ pt.plot(Mi1,Mgi,'g-')
+
+ pt.plot(M1,Ox,'bo')
+ pt.plot(Mi1,Oxi,'b-')
+
+ pt.plot(M1,Me,'co')
+ pt.plot(Mi1,Mei,'c-')
+
+ pt.semilogx()
+ pt.semilogy()
+
+ pt.axis([Mmin,Mmax1,1e-4,1e0])
+
+ # plot 2
+
+ pt.subplot(212)
+
+
+ pt.plot(Mi1[1:],IFe*500,'y')
+ pt.plot(Mi1[1:],IMg*500,'g')
+ pt.plot(Mi1[1:],IOx*10,'b')
+ pt.plot(Mi1[1:],IMe*10,'c')
+ pt.plot(Mi2[1:],IRes,'k')
+ pt.plot(Mi2[1:],IHco,'r')
+
+ '''
+ pt.plot(Ms1,IFes*500,'o')
+ pt.plot(Ms1,IMgs*500,'o')
+ pt.plot(Ms1,IOxs*10 ,'o')
+ pt.plot(Ms1,IMes*10 ,'o')
+ pt.plot(Ms2,IRess,'o')
+ pt.plot(Ms2,IHcos,'o')
+ '''
+
+
+
+ pt.semilogx()
+ pt.axis([Mmin,Mmax1,0.,4*b])
+
+ pt.show()
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/tsujimoto95.pdf.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/tsujimoto95.pdf.svn-base
new file mode 100644
index 0000000..02f631c
Binary files /dev/null and b/PyChem/shared/tables/MetalSNII/.svn/text-base/tsujimoto95.pdf.svn-base differ
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/woosley95.pdf.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/woosley95.pdf.svn-base
new file mode 100644
index 0000000..188922f
Binary files /dev/null and b/PyChem/shared/tables/MetalSNII/.svn/text-base/woosley95.pdf.svn-base differ
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/woosley95.txt.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/woosley95.txt.svn-base
new file mode 100644
index 0000000..a0f65f9
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/woosley95.txt.svn-base
@@ -0,0 +1,14 @@
+# M QQ52 QQ53 QQ54 QQ55 QQ56 QQ57 QQ58 QQ59 QQ60
+10 0 0 0 0 0 0 0 0 0
+11 2.54e-4 9.12e-6 1.53e-3 1.47e-5 1.11e-2 3.08e-4 7.28e-5 1.10e-5 8.78e-6
+12 4.58e-4 1.89e-5 2.97e-3 1.05e-4 1.22e-2 3.46e-4 8.80e-5 1.80e-6 2.91e-6
+13 8.69e-4 4.44e-5 4.33e-3 4.19e-5 1.28e-2 3.72e-4 1.59e-4 7.04e-5 1.05e-4
+15 1.42e-3 7.83e-5 7.59e-3 7.93e-5 1.47e-2 4.68e-4 3.08e-4 5.15e-5 2.66e-5
+18 1.59e-3 1.00e-4 8.77e-3 7.45e-5 1.71e-2 6.47e-4 5.36e-4 8.21e-5 2.54e-5
+19 2.54e-3 1.42e-4 1.32e-2 1.37e-4 1.77e-2 6.32e-4 4.46e-4 9.62e-5 4.69e-5
+20 2.62e-3 1.22e-4 1.27e-2 1.38e-4 1.83e-2 6.29e-4 3.94e-4 4.08e-5 1.12e-5
+22 3.24e-3 1.39e-4 1.52e-2 1.92e-4 1.97e-2 7.59e-4 6.27e-4 1.01e-4 5.19e-5
+25 1.93e-3 1.85e-5 1.64e-2 4.25e-4 2.19e-2 9.05e-4 9.22e-4 8.52e-5 2.10e-5
+30 1.62e-12 4.09e-10 1.49e-3 1.25e-5 2.50e-2 9.98e-4 9.92e-4 3.97e-5 1.88e-5
+35 3.13e-13 4.59e-10 1.65e-3 2.58e-5 2.77e-2 1.17e-3 9.16e-4 5.46e-5 2.51e-5
+40 1.02e-13 4.27e-10 1.67e-3 3.76e-5 2.83e-2 1.27e-3 8.79e-4 9.62e-5 3.09e-5
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/yields_tsujimoto95.txt.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/yields_tsujimoto95.txt.svn-base
new file mode 100644
index 0000000..cd15967
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/yields_tsujimoto95.txt.svn-base
@@ -0,0 +1,67 @@
+Species 13 15 18 20 25 40 70
+C12 2.68E-03 8.26E-02 1.65E-01 1.14E-01 1.48E-01 1.48E-01 4.67E-01
+C13 9.47E-09 4.97E-10 7.73E-10 1.17E-10 1.03E-08 3.02E-10 2.57E-10
+N14 3.75E-08 5.37E-03 3.39E-03 2.72E-03 9.53E-04 7.08E-05 7.68E-03
+N15 2.08E-08 1.36E-10 9.05E-08 6.48E-10 1.04E-08 1.19E-08 2.36E-10
+O16 1.51E-01 3.55E-01 7.92E-01 1.48E+00 2.99E+00 9.11E+00 2.14E+01
+O17 6.07E-08 4.41E-09 4.01E-07 9.86E-09 7.86E-08 3.13E-07 6.64E-10
+O18 9.44E-09 1.35E-02 8.67E-03 8.68E-03 6.69E-03 1.79E-06 3.80E-03
+F19 8.06E-10 2.12E-11 7.67E-09 7.84E-11 8.17E-10 7.38E-10 2.63E-15
+Ne20 2.25E-02 2.08E-02 1.61E-01 2.29E-01 5.94E-01 6.58E-01 2.00E+00
+Ne21 2.08E-04 3.93E-05 2.19E-03 3.03E-04 3.22E-03 2.36E-03 1.14E-02
+Ne22 1.01E-04 1.25E-02 2.74E-02 2.93E-02 3.39E-02 5.66E-02 5.23E-02
+Na23 7.27E-04 1.53E-04 7.25E-03 1.15E-03 1.81E-02 2.37E-02 6.98E-02
+Mg24 9.23E-03 3.16E-02 3.62E-02 1.47E-01 1.59E-01 3.54E-01 7.87E-01
+Mg25 1.38E-03 2.55E-03 7.54E-03 1.85E-02 3.92E-02 4.81E-02 1.01E-01
+Mg26 8.96E-04 2.03E-03 5.94E-03 1.74E-02 3.17E-02 1.07E-01 2.91E-01
+Al27 1.04E-03 4.01E-03 5.44E-03 1.55E-02 1.95E-02 8.05E-02 1.44E-01
+Si28 6.68E-02 7.16E-02 8.69E-02 8.50E-02 1.03E-01 4.29E-01 7.55E-01
+Si29 7.99E-04 3.25E-03 1.76E-03 9.80E-03 6.97E-03 5.43E-02 1.08E-01
+Si30 1.87E-03 4.04E-03 3.33E-03 7.19E-03 6.81E-03 4.32E-02 1.00E-01
+P31 2.95E-04 6.55E-04 4.11E-04 1.05E-03 9.02E-04 5.99E-03 2.57E-02
+S32 1.46E-02 3.01E-02 3.76E-02 2.29E-02 3.84E-02 1.77E-01 2.05E-01
+S33 1.19E-04 9.60E-05 1.48E-04 8.84E-05 2.20E-04 7.49E-04 1.02E-03
+S34 1.83E-03 1.49E-03 1.89E-03 1.26E-03 2.77E-03 1.14E-02 1.98E-02
+S36 3.04E-07 3.34E-07 8.08E-07 4.23E-07 7.51E-07 1.40E-05 2.17E-06
+Cl35 3.70E-05 3.45E-05 8.95E-05 6.05E-05 6.72E-05 4.75E-04 1.76E-03
+Cl37 6.73E-06 9.60E-06 1.04E-05 4.96E-06 1.32E-05 1.17E-04 1.01E-04
+Ar36 2.36E-03 5.63E-03 6.13E-03 3.78E-03 6.71E-03 3.11E-02 2.92E-02
+Ar38 4.85E-04 6.49E-04 6.29E-04 3.25E-04 7.24E-04 9.14E-03 6.16E-03
+Ar40 4.82E-09 3.24E-09 1.42E-08 4.65E-09 8.92E-09 1.74E-07 5.07E-08
+K39 1.95E-05 3.31E-05 3.66E-05 3.24E-05 3.47E-05 3.83E-04 3.84E-04
+K41 1.42E-06 2.37E-06 2.23E-06 1.28E-06 2.79E-06 3.43E-05 2.84E-05
+Ca40 2.53E-03 5.29E-03 5.11E-03 3.25E-03 6.15E-03 2.56E-02 2.14E-02
+Ca42 1.02E-05 1.63E-05 1.45E-05 9.45E-06 1.77E-05 3.13E-04 1.64E-04
+Ca43 1.91E-06 1.30E-06 3.99E-07 3.38E-06 2.78E-07 4.02E-07 4.09E-06
+Ca44 1.22E-04 7.49E-05 1.43E-05 9.15E-05 2.11E-05 2.00E-05 2.97E-04
+Ca46 2.06E-10 6.23E-11 3.23E-11 1.12E-11 2.60E-10 4.39E-10 2.23E-10
+Ca48 1.13E-13 3.99E-16 1.07E-15 2.41E-16 1.70E-14 2.48E-13 2.36E-14
+Sc45 4.26E-08 7.44E-08 1.18E-07 1.04E-07 8.96E-08 1.53E-06 2.78E-06
+Ti46 2.56E-06 6.26E-06 6.72E-06 6.81E-06 6.84E-06 3.56E-05 1.44E-05
+Ti47 5.13E-06 3.75E-06 3.11E-07 1.73E-06 9.11E-07 9.74E-07 6.26E-07
+Ti48 1.68E-04 1.58E-04 8.59E-05 1.85E-04 8.98E-05 1.58E-04 1.42E-04
+Ti49 3.45E-06 6.10E-06 7.54E-06 4.89E-06 6.01E-06 2.17E-05 6.97E-06
+Ti50 3.56E-10 1.21E-09 1.17E-10 1.12E-10 5.90E-10 2.00E-10 2.56E-10
+V50 8.65E-10 8.57E-10 4.64E-10 2.15E-10 7.99E-10 2.14E-09 1.52E-09
+V51 9.34E-06 1.25E-05 1.25E-05 6.40E-06 9.96E-06 2.73E-05 1.15E-05
+Cr50 2.30E-05 5.15E-05 7.49E-05 3.54E-05 5.01E-05 1.49E-04 1.01E-04
+Cr52 1.15E-03 1.36E-03 1.44E-03 8.64E-04 1.31E-03 2.77E-03 6.86E-04
+Cr53 9.34E-05 1.35E-04 1.50E-04 7.12E-05 1.39E-04 3.56E-04 1.00E-04
+Cr54 3.35E-08 4.09E-08 2.53E-08 6.26E-09 2.41E-08 2.81E-08 7.61E-08
+Mn55 3.65E-04 4.74E-04 5.48E-04 2.27E-04 5.02E-04 8.41E-04 3.64E-04
+Fe54 2.10E-03 4.49E-03 6.04E-03 2.52E-03 4.81E-03 9.17E-03 5.81E-03
+Fe56 1.50E-01 1.44E-01 7.57E-02 7.32E-02 5.24E-02 7.50E-02 7.50E-02
+Fe57 4.86E-03 4.90E-03 2.17E-03 3.07E-03 1.16E-03 2.29E-03 3.83E-03
+Fe58 3.93E-09 1.27E-08 1.37E-08 3.70E-09 8.34E-09 1.29E-08 4.17E-08
+Co59 1.39E-04 1.22E-04 4.82E-05 1.31E-04 2.19E-05 2.51E-05 1.59E-04
+Ni58 5.82E-03 7.50E-03 3.08E-03 3.71E-03 1.33E-03 3.31E-03 9.25E-03
+Ni60 3.72E-03 3.36E-03 8.71E-04 2.18E-03 6.67E-04 3.88E-04 1.77E-03
+Ni61 1.58E-04 1.43E-04 4.77E-05 1.59E-04 2.75E-05 2.57E-05 1.55E-04
+Ni62 1.05E-03 9.50E-04 2.52E-04 7.26E-04 1.70E-04 1.11E-04 1.28E-03
+Ni64 2.02E-15 4.28E-15 2.93E-16 2.06E-15 6.08E-15 6.49E-16 4.33E-12
+Cu63 1.18E-06 1.01E-06 4.32E-07 3.00E-06 1.50E-07 1.62E-07 9.09E-06
+Cu65 9.11E-07 7.17E-07 8.40E-08 7.02E-07 1.42E-07 1.89E-08 5.34E-07
+Zn64 2.14E-05 1.99E-05 3.89E-06 1.78E-05 3.10E-06 8.79E-07 1.02E-05
+Zn66 1.63E-05 1.30E-05 4.47E-06 2.08E-05 2.58E-06 9.99E-07 3.09E-05
+Zn67 2.13E-08 1.54E-08 3.39E-09 6.39E-08 2.95E-09 2.51E-10 1.95E-07
+Zn68 6.63E-09 7.35E-09 8.36E-10 5.33E-09 9.29E-10 1.20E-10 9.51E-08
diff --git a/PyChem/shared/tables/MetalSNII/.svn/text-base/yields_tsujimoto95bis.txt.svn-base b/PyChem/shared/tables/MetalSNII/.svn/text-base/yields_tsujimoto95bis.txt.svn-base
new file mode 100644
index 0000000..48f851d
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/.svn/text-base/yields_tsujimoto95bis.txt.svn-base
@@ -0,0 +1,9 @@
+# M C12 C13 N14 N15 O16 O17 O18 F19 Ne20 Ne21 Ne22 Na23 Mg24 Mg25 Mg26 Al27 Si28 Si29 Si30 P31 S32 S33 S34 S36 Cl35 Cl37 Ar36 Ar38 Ar40 K39 K41 Ca40 Ca42 Ca43 Ca44 Ca46 Ca48 Sc45 Ti46 Ti47 Ti48 Ti49 Ti50 V50 V51 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Co59 Ni58 Ni60 Ni61 Ni62 Ni64 Cu63 Cu65 Zn64 Zn66 Zn67 Zn68
+10 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00
+13 2.68E-03 9.47E-09 3.75E-08 2.08E-08 1.51E-01 6.07E-08 9.44E-09 8.06E-10 2.25E-02 2.08E-04 1.01E-04 7.27E-04 9.23E-03 1.38E-03 8.96E-04 1.04E-03 6.68E-02 7.99E-04 1.87E-03 2.95E-04 1.46E-02 1.19E-04 1.83E-03 3.04E-07 3.70E-05 6.73E-06 2.36E-03 4.85E-04 4.82E-09 1.95E-05 1.42E-06 2.53E-03 1.02E-05 1.91E-06 1.22E-04 2.06E-10 1.13E-13 4.26E-08 2.56E-06 5.13E-06 1.68E-04 3.45E-06 3.56E-10 8.65E-10 9.34E-06 2.30E-05 1.15E-03 9.34E-05 3.35E-08 3.65E-04 2.10E-03 1.50E-01 4.86E-03 3.93E-09 1.39E-04 5.82E-03 3.72E-03 1.58E-04 1.05E-03 2.02E-15 1.18E-06 9.11E-07 2.14E-05 1.63E-05 2.13E-08 6.63E-09
+15 8.26E-02 4.97E-10 5.37E-03 1.36E-10 3.55E-01 4.41E-09 1.35E-02 2.12E-11 2.08E-02 3.93E-05 1.25E-02 1.53E-04 3.16E-02 2.55E-03 2.03E-03 4.01E-03 7.16E-02 3.25E-03 4.04E-03 6.55E-04 3.01E-02 9.60E-05 1.49E-03 3.34E-07 3.45E-05 9.60E-06 5.63E-03 6.49E-04 3.24E-09 3.31E-05 2.37E-06 5.29E-03 1.63E-05 1.30E-06 7.49E-05 6.23E-11 3.99E-16 7.44E-08 6.26E-06 3.75E-06 1.58E-04 6.10E-06 1.21E-09 8.57E-10 1.25E-05 5.15E-05 1.36E-03 1.35E-04 4.09E-08 4.74E-04 4.49E-03 1.44E-01 4.90E-03 1.27E-08 1.22E-04 7.50E-03 3.36E-03 1.43E-04 9.50E-04 4.28E-15 1.01E-06 7.17E-07 1.99E-05 1.30E-05 1.54E-08 7.35E-09
+18 1.65E-01 7.73E-10 3.39E-03 9.05E-08 7.92E-01 4.01E-07 8.67E-03 7.67E-09 1.61E-01 2.19E-03 2.74E-02 7.25E-03 3.62E-02 7.54E-03 5.94E-03 5.44E-03 8.69E-02 1.76E-03 3.33E-03 4.11E-04 3.76E-02 1.48E-04 1.89E-03 8.08E-07 8.95E-05 1.04E-05 6.13E-03 6.29E-04 1.42E-08 3.66E-05 2.23E-06 5.11E-03 1.45E-05 3.99E-07 1.43E-05 3.23E-11 1.07E-15 1.18E-07 6.72E-06 3.11E-07 8.59E-05 7.54E-06 1.17E-10 4.64E-10 1.25E-05 7.49E-05 1.44E-03 1.50E-04 2.53E-08 5.48E-04 6.04E-03 7.57E-02 2.17E-03 1.37E-08 4.82E-05 3.08E-03 8.71E-04 4.77E-05 2.52E-04 2.93E-16 4.32E-07 8.40E-08 3.89E-06 4.47E-06 3.39E-09 8.36E-10
+20 1.14E-01 1.17E-10 2.72E-03 6.48E-10 1.48E+00 9.86E-09 8.68E-03 7.84E-11 2.29E-01 3.03E-04 2.93E-02 1.15E-03 1.47E-01 1.85E-02 1.74E-02 1.55E-02 8.50E-02 9.80E-03 7.19E-03 1.05E-03 2.29E-02 8.84E-05 1.26E-03 4.23E-07 6.05E-05 4.96E-06 3.78E-03 3.25E-04 4.65E-09 3.24E-05 1.28E-06 3.25E-03 9.45E-06 3.38E-06 9.15E-05 1.12E-11 2.41E-16 1.04E-07 6.81E-06 1.73E-06 1.85E-04 4.89E-06 1.12E-10 2.15E-10 6.40E-06 3.54E-05 8.64E-04 7.12E-05 6.26E-09 2.27E-04 2.52E-03 7.32E-02 3.07E-03 3.70E-09 1.31E-04 3.71E-03 2.18E-03 1.59E-04 7.26E-04 2.06E-15 3.00E-06 7.02E-07 1.78E-05 2.08E-05 6.39E-08 5.33E-09
+25 1.48E-01 1.03E-08 9.53E-04 1.04E-08 2.99E+00 7.86E-08 6.69E-03 8.17E-10 5.94E-01 3.22E-03 3.39E-02 1.81E-02 1.59E-01 3.92E-02 3.17E-02 1.95E-02 1.03E-01 6.97E-03 6.81E-03 9.02E-04 3.84E-02 2.20E-04 2.77E-03 7.51E-07 6.72E-05 1.32E-05 6.71E-03 7.24E-04 8.92E-09 3.47E-05 2.79E-06 6.15E-03 1.77E-05 2.78E-07 2.11E-05 2.60E-10 1.70E-14 8.96E-08 6.84E-06 9.11E-07 8.98E-05 6.01E-06 5.90E-10 7.99E-10 9.96E-06 5.01E-05 1.31E-03 1.39E-04 2.41E-08 5.02E-04 4.81E-03 5.24E-02 1.16E-03 8.34E-09 2.19E-05 1.33E-03 6.67E-04 2.75E-05 1.70E-04 6.08E-15 1.50E-07 1.42E-07 3.10E-06 2.58E-06 2.95E-09 9.29E-10
+40 1.48E-01 3.02E-10 7.08E-05 1.19E-08 9.11E+00 3.13E-07 1.79E-06 7.38E-10 6.58E-01 2.36E-03 5.66E-02 2.37E-02 3.54E-01 4.81E-02 1.07E-01 8.05E-02 4.29E-01 5.43E-02 4.32E-02 5.99E-03 1.77E-01 7.49E-04 1.14E-02 1.40E-05 4.75E-04 1.17E-04 3.11E-02 9.14E-03 1.74E-07 3.83E-04 3.43E-05 2.56E-02 3.13E-04 4.02E-07 2.00E-05 4.39E-10 2.48E-13 1.53E-06 3.56E-05 9.74E-07 1.58E-04 2.17E-05 2.00E-10 2.14E-09 2.73E-05 1.49E-04 2.77E-03 3.56E-04 2.81E-08 8.41E-04 9.17E-03 7.50E-02 2.29E-03 1.29E-08 2.51E-05 3.31E-03 3.88E-04 2.57E-05 1.11E-04 6.49E-16 1.62E-07 1.89E-08 8.79E-07 9.99E-07 2.51E-10 1.20E-10
+70 4.67E-01 2.57E-10 7.68E-03 2.36E-10 2.14E+01 6.64E-10 3.80E-03 2.63E-15 2.00E+00 1.14E-02 5.23E-02 6.98E-02 7.87E-01 1.01E-01 2.91E-01 1.44E-01 7.55E-01 1.08E-01 1.00E-01 2.57E-02 2.05E-01 1.02E-03 1.98E-02 2.17E-06 1.76E-03 1.01E-04 2.92E-02 6.16E-03 5.07E-08 3.84E-04 2.84E-05 2.14E-02 1.64E-04 4.09E-06 2.97E-04 2.23E-10 2.36E-14 2.78E-06 1.44E-05 6.26E-07 1.42E-04 6.97E-06 2.56E-10 1.52E-09 1.15E-05 1.01E-04 6.86E-04 1.00E-04 7.61E-08 3.64E-04 5.81E-03 7.50E-02 3.83E-03 4.17E-08 1.59E-04 9.25E-03 1.77E-03 1.55E-04 1.28E-03 4.33E-12 9.09E-06 5.34E-07 1.02E-05 3.09E-05 1.95E-07 9.51E-08
diff --git a/PyChem/shared/tables/MetalSNII/ComputeIntegrals.py b/PyChem/shared/tables/MetalSNII/ComputeIntegrals.py
new file mode 100644
index 0000000..d3ee5e2
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/ComputeIntegrals.py
@@ -0,0 +1,237 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+
+
+
+######################################################
+# Parameters
+######################################################
+
+# IMF
+Mmin = 0.05
+Mmax = 50.
+a = -1.35
+
+
+# files
+MetalFile = 'MetalEjection.dat'
+HeliumCoreFile = 'HeliumCore.dat'
+OutputFile = 'chemyves.dat'
+
+
+# number of elements to follow
+nelts = 4
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 200
+
+
+
+
+
+
+
+lStep1 = (log10(Mmax*1.25) - log10(Mmin1) )/float(n-1)
+lStep2 = (log10(Mmax*1.25) - log10(Mmin2) )/float(n-1)
+
+
+
+b = (a+1)/( Mmax**(a+1) - Mmin**(a+1) )
+
+
+
+
+
+######################################################
+#
+######################################################
+
+
+
+
+M1,Fe,Mg,Ox,Me = pt.io.read_ascii(MetalFile,[0,1,2,3,4])
+Fe = Fe/M1
+Mg = Mg/M1
+Ox = Ox/M1
+Me = Me/M1
+
+
+# read residual and helium core
+M2,Res,Hco = pt.io.read_ascii(HeliumCoreFile,[0,1,2])
+Res = Res/M2
+Hco = Hco/M2
+
+# linear interpolation
+Mi1 = arange(Mmin1,Mmax1+dM,dM)
+Mi2 = arange(Mmin2,Mmax2+dM,dM)
+
+#myNumeric.lininterp1d = myNumeric.quadinterp1d
+
+Fei = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Fe.astype(float32))
+Mgi = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Mg.astype(float32))
+Oxi = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Ox.astype(float32))
+Mei = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Me.astype(float32))
+
+Resi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Res.astype(float32))
+Hcoi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Hco.astype(float32))
+
+Fei = where(Fei<=0,0,Fei)
+Mgi = where(Mgi<=0,0,Mgi)
+Oxi = where(Oxi<=0,0,Oxi)
+Mei = where(Mei<=0,0,Mei)
+
+Resi = where(Resi<=0,0,Resi)
+Hcoi = where(Hcoi<=0,0,Hcoi)
+
+
+# compute integral
+IFe = cumtrapz(b*Mi1**a * Fei,Mi1)
+IMg = cumtrapz(b*Mi1**a * Mgi,Mi1)
+IOx = cumtrapz(b*Mi1**a * Oxi,Mi1)
+IMe = cumtrapz(b*Mi1**a * Mei,Mi1)
+
+IRes = cumtrapz(b*Mi2**a * (1-Resi),Mi2)
+IHco = cumtrapz(b*Mi2**a * (1-Hcoi),Mi2)
+
+
+
+###############################################
+# output
+###############################################
+
+
+Ms1 = 10**(arange(n)*lStep1 + log10(Mmin1))
+Ms2 = 10**(arange(n)*lStep2 + log10(Mmin2))
+
+
+# find corresponding values
+
+IFes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IFe.astype(float32))
+IMgs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IMg.astype(float32))
+IOxs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IOx.astype(float32))
+IMes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IMe.astype(float32))
+
+IRess = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IRes.astype(float32))
+IHcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IHco.astype(float32))
+
+f = open(OutputFile,'w')
+
+f.write("###########################################\n")
+f.write("# Metal Injection #\n")
+f.write("###########################################\n")
+
+f.write("\n# Number of points / Number of elements\n")
+f.write("%d %d\n"%(n,nelts))
+
+f.write("\n# Int ( 1- Residual ) m^a\n")
+f.write("\n%g %g\n"%(Mmin2,lStep2))
+for i in range(len(IRess)):
+ f.write("%e\n"%IRess[i])
+
+f.write("\n# Int ( 1- Helium Core ) m^a\n")
+f.write("\n%g %g\n"%(Mmin2,lStep2))
+for i in range(len(IHcos)):
+ f.write("%e\n"%IHcos[i])
+
+f.write("\n# Int ( Fe ) m^a\n")
+f.write("\n%g %g\n"%(Mmin1,lStep1))
+for i in range(len(IFes)):
+ f.write("%e\n"%IFes[i])
+
+f.write("\n# Int ( Mg ) m^a\n")
+f.write("\n%g %g\n"%(Mmin1,lStep1))
+for i in range(len(IMgs)):
+ f.write("%e\n"%IMgs[i])
+
+f.write("\n# Int ( O ) m^a\n")
+f.write("\n%g %g\n"%(Mmin1,lStep1))
+for i in range(len(IOxs)):
+ f.write("%e\n"%IOxs[i])
+
+f.write("\n# Int ( Metals ) m^a\n")
+f.write("\n%g %g\n"%(Mmin1,lStep1))
+for i in range(len(IMes)):
+ f.write("%e\n"%IMes[i])
+
+
+f.close()
+
+
+###############################################
+# plot
+###############################################
+
+
+# plot 1
+
+pt.subplot(211)
+
+pt.plot(M2,Res,'ko')
+pt.plot(Mi2,Resi,'k-')
+
+pt.plot(M2,Hco,'ro')
+pt.plot(Mi2,Hcoi,'r-')
+
+
+pt.plot(M1,Fe,'yo')
+pt.plot(Mi1,Fei,'y-')
+
+pt.plot(M1,Mg,'go')
+pt.plot(Mi1,Mgi,'g-')
+
+pt.plot(M1,Ox,'bo')
+pt.plot(Mi1,Oxi,'b-')
+
+pt.plot(M1,Me,'co')
+pt.plot(Mi1,Mei,'c-')
+
+pt.semilogx()
+pt.semilogy()
+
+pt.axis([Mmin,Mmax1,1e-4,1e0])
+
+# plot 2
+
+pt.subplot(212)
+
+
+pt.plot(Mi1[1:],IFe*500,'y')
+pt.plot(Mi1[1:],IMg*500,'g')
+pt.plot(Mi1[1:],IOx*10,'b')
+pt.plot(Mi1[1:],IMe*10,'c')
+pt.plot(Mi2[1:],IRes,'k')
+pt.plot(Mi2[1:],IHco,'r')
+
+'''
+pt.plot(Ms1,IFes*500,'o')
+pt.plot(Ms1,IMgs*500,'o')
+pt.plot(Ms1,IOxs*10 ,'o')
+pt.plot(Ms1,IMes*10 ,'o')
+pt.plot(Ms2,IRess,'o')
+pt.plot(Ms2,IHcos,'o')
+'''
+
+
+
+pt.semilogx()
+pt.axis([Mmin,Mmax1,0.,4*b])
+
+pt.show()
+
+
diff --git a/PyChem/shared/tables/MetalSNII/HeliumCore.dat b/PyChem/shared/tables/MetalSNII/HeliumCore.dat
new file mode 100644
index 0000000..73945f9
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/HeliumCore.dat
@@ -0,0 +1,24 @@
+# Mass Residu Helium Core
+0.80 0.459 0.459
+1.00 0.473 0.473
+1.50 0.480 0.480
+1.75 0.487 0.487
+2.00 0.404 0.404
+2.50 0.501 0.501
+3.00 0.508 0.508
+3.50 0.515 0.515
+4.00 0.550 0.550
+4.30 0.620 0.620
+4.60 0.675 0.675
+4.80 0.730 0.730
+5.00 0.870 0.870
+6.00 1.010 1.010
+8.00 1.120 1.120
+10.0 1.150 1.150
+13.0 1.500 3.300
+15.0 1.500 4.000
+18.0 1.500 5.000
+20.0 1.600 6.000
+25.0 2.000 8.000
+40.0 2.300 16.00
+70.0 2.500 32.00
diff --git a/PyChem/shared/tables/MetalSNII/MetalEjection.dat b/PyChem/shared/tables/MetalSNII/MetalEjection.dat
new file mode 100644
index 0000000..d2b675d
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/MetalEjection.dat
@@ -0,0 +1,9 @@
+# M Fe56 Mg24 O16 Metals
+10 0.0 0.0 0.0 0.0
+13 1.50e-1 9.23e-3 1.51e-1 4.51e-1
+15 1.44e-1 3.16e-2 3.55e-1 8.20e-1
+18 7.57e-2 3.62e-2 7.92e-1 1.45
+20 7.32e-2 1.47e-1 1.48 2.28
+25 5.24e-2 1.59e-1 2.99 4.28
+40 7.50e-2 3.54e-1 9.11 11.47
+70 7.50e-2 7.87e-1 21.4 26.71
diff --git a/PyChem/shared/tables/MetalSNII/Readme b/PyChem/shared/tables/MetalSNII/Readme
new file mode 100644
index 0000000..7506fba
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/Readme
@@ -0,0 +1,78 @@
+MetalEjection.dat Stellar Mass,Fe,Mg,Ox,Metals [in Msol]
+HeliumCore.dat Stellar Mass,Residu,Helium Core [in Msol]
+
+
+(4) calcul de la masse ejectée par SNII
+
+(Poirier : 3.44) : on tabulte I(m) = Int_0^m [1-w(m)] Phi(m) dm
+
+ 3.44 = I(m2) - I(m1)
+
+
+(5) productionde métaux (a) : helium core therm
+
+(Poirier : 3.49) : on tabule I(m) = Int_0^m [1-alph(m)] Phi(m) dm
+
+ 3.49a = I(m2) - I(m1)
+
+
+
+(0,1,2,3) productionde métaux (b)
+
+(Poirier : 3.49) : on tabule I(m) = Int_0^m pk Phi(m) dm
+
+ 3.49b = I(m2) - I(m1)
+
+
+
+-----------------------------------------------------------------------
+
+python computeIntegrals.py
+
+
+python plot_P.py
+
+
+python plot_both.py
+
+
+
+-----------------------------------------------------------------------
+
+Thu Feb 25 14:13:20 CET 2010
+
+elements a ajouter :
+
+FeI
+FeII
+Al
+Ba
+C
+Ca
+Co
+Cr
+Mg
+Mn
+Na
+Ni
+O
+Sc
+Si
+SrII
+TiI
+TiII
+Y
+
+
+-----------------------------------------------------------------------
+# creation des tables
+
+# table brut de tsujimoto95 -> reformatage
+./convert_yields.py yields_tsujimoto95.txt yields_tsujimoto95bis.txt
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/barium.py b/PyChem/shared/tables/MetalSNII/barium.py
new file mode 100755
index 0000000..69642e5
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/barium.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+# data from Cescutti 2006, tab 3
+
+import Ptools as pt
+from numpy import *
+import scipy.interpolate
+from pNbody import myNumeric
+
+ms = array([10,12. ,15. ,30.,])
+Ba = array([0,9e-7 ,3e-8 ,1e-9])
+Eu = array([0,4.5e-8,3e-9 ,5e-10])
+
+
+pt.plot(ms,Ba,'o')
+#pt.plot(ms,Eu)
+
+# interpolation
+msi = array([10.,13.,15.,18.,20.,25.,40.,70.])
+
+tck = scipy.interpolate.fitpack.splrep(ms,Ba,k=1,s=0)
+Bai = scipy.interpolate.fitpack.splev(msi,tck)
+#Bai = myNumeric.lininterp1d(msi.astype(float32),ms.astype(float32),Ba.astype(float32))
+
+pt.plot(msi,Bai,':')
+
+pt.show()
\ No newline at end of file
diff --git a/PyChem/shared/tables/MetalSNII/cescutti06.pdf b/PyChem/shared/tables/MetalSNII/cescutti06.pdf
new file mode 100644
index 0000000..a9060fc
Binary files /dev/null and b/PyChem/shared/tables/MetalSNII/cescutti06.pdf differ
diff --git a/PyChem/shared/tables/MetalSNII/cescutti2006.txt b/PyChem/shared/tables/MetalSNII/cescutti2006.txt
new file mode 100644
index 0000000..1823206
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/cescutti2006.txt
@@ -0,0 +1,5 @@
+# M Ba Eu
+10 0 0
+12 9e-7 4.5e-8
+15 3e-8 3e-9
+30 1e-9 5e-10
diff --git a/PyChem/shared/tables/MetalSNII/cescutti2006bis.txt b/PyChem/shared/tables/MetalSNII/cescutti2006bis.txt
new file mode 100644
index 0000000..b2fe7e6
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/cescutti2006bis.txt
@@ -0,0 +1,5 @@
+# M Ba Eu
+10 0 0
+12 2.846e-06 1.423e-07
+15 9.487e-08 9.487e-09
+30 3.162e-09 1.581e-09
diff --git a/PyChem/shared/tables/MetalSNII/chemseb.dat b/PyChem/shared/tables/MetalSNII/chemseb.dat
new file mode 100644
index 0000000..a3199cd
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/chemseb.dat
@@ -0,0 +1,664 @@
+#### Metal Parameters ####
+
+# Number of points / Number of elements
+106 4
+
+# Int ( 1- Residual ) m^a
+
+0.05 0.03000
+0.0
+2.62343832019e-05
+0.000105697486956
+0.000239591063354
+0.000429201738196
+0.000675904199618
+0.000981164550087
+0.00134654382887
+0.0017737017124
+0.00226440040035
+0.00282050869552
+0.00344400628608
+0.00413698823921
+0.0049016697153
+0.00574039091264
+0.00665562225286
+0.00764996981773
+0.00872618104867
+0.00988715072067
+0.0111359272029
+0.0124757190189
+0.01390990172
+0.0154420250854
+0.0170758206648
+0.0188152096781
+0.020664311288
+0.0226274512643
+0.0247091710548
+0.0269142372836
+0.0292476516953
+0.0317146615649
+0.0343207705956
+0.0370717503253
+0.0399736520668
+0.0430328194037
+0.0462559012701
+0.0496498656375
+0.0532220138394
+0.0569799955612
+0.0609318245263
+0.0650858949095
+0.0694375606741
+0.0739732419317
+0.0787014221951
+0.0836058028368
+0.0886013096193
+0.0936865844744
+0.0988690855907
+0.104156533984
+0.109556927468
+0.115044534112
+0.120546967518
+0.126085326996
+0.131763229247
+0.13754946554
+0.143224706603
+0.148767807858
+0.154186738219
+0.159535646769
+0.164832896346
+0.170077006182
+0.17525616007
+0.180369296145
+0.185393050614
+0.190315881957
+0.195094533494
+0.199737541147
+0.204162545833
+0.208470337678
+0.212674645505
+0.216794134437
+0.220844165386
+0.224828561912
+0.228750320504
+0.232611849835
+0.236412991604
+0.240156184724
+0.243842698423
+0.247449434441
+0.250969630064
+0.254405334799
+0.257761899476
+0.261061525295
+0.264309275546
+0.267501620026
+0.270639578518
+0.273720323473
+0.276734743937
+0.279679129331
+0.282553181551
+0.285358585265
+0.288101174986
+0.290786337563
+0.293415816097
+0.2959913291
+0.298514571873
+0.300987217875
+0.303410774797
+0.305783137336
+0.30810419088
+0.310375407217
+0.312598234279
+0.314774097239
+0.316904399591
+0.318990524236
+0.321033834574
+
+# Int ( 1- Helium Core ) m^a
+
+0.05 0.03000
+0.0
+2.62343832019e-05
+0.000105697486956
+0.000239591063354
+0.000429201738196
+0.000675904199618
+0.000981164550087
+0.00134654382887
+0.0017737017124
+0.00226440040035
+0.00282050869552
+0.00344400628608
+0.00413698823921
+0.0049016697153
+0.00574039091264
+0.00665562225286
+0.00764996981773
+0.00872618104867
+0.00988715072067
+0.0111359272029
+0.0124757190189
+0.01390990172
+0.0154420250854
+0.0170758206648
+0.0188152096781
+0.020664311288
+0.0226274512643
+0.0247091710548
+0.0269142372836
+0.0292476516953
+0.0317146615649
+0.0343207705956
+0.0370717503253
+0.0399736520668
+0.0430328194037
+0.0462559012701
+0.0496498656375
+0.0532220138394
+0.0569799955612
+0.0609318245263
+0.0650858949095
+0.0694375606741
+0.0739732419317
+0.0787014221951
+0.0836058028368
+0.0886013096193
+0.0936865844744
+0.0988690855907
+0.104156533984
+0.109556927468
+0.115044534112
+0.120546967518
+0.126085326996
+0.131763229247
+0.13754946554
+0.143224706603
+0.148767807858
+0.154186738219
+0.159535646769
+0.164832896346
+0.170077006182
+0.17525616007
+0.180369296145
+0.185393050614
+0.190315881957
+0.195094533494
+0.199737541147
+0.204162545833
+0.208470337678
+0.212674645505
+0.216794134437
+0.220844165386
+0.224828561912
+0.228750320504
+0.232611849835
+0.236412991604
+0.240156184724
+0.243836764467
+0.2473366391
+0.250613743711
+0.25366700856
+0.256512181052
+0.259250890696
+0.261902047117
+0.264474333774
+0.266970595502
+0.269382205338
+0.271690152274
+0.273916541829
+0.276070904572
+0.278154091518
+0.28016316909
+0.282095506255
+0.283951615863
+0.28573193788
+0.287436838347
+0.289066608234
+0.290622061278
+0.292118751538
+0.29356387321
+0.294957931756
+0.296301387209
+0.297594653721
+0.298838099063
+0.30003204405
+0.301176761915
+
+# Int ( Fe ) m^a
+
+10.0 0.00805
+0.0
+3.98177582575e-07
+1.59570060777e-06
+3.59712027577e-06
+6.40707617622e-06
+1.00302971447e-05
+1.44716021312e-05
+1.97359010801e-05
+2.58281958227e-05
+3.27535809812e-05
+4.05172448861e-05
+4.91244705049e-05
+5.85806363841e-05
+6.88912176037e-05
+8.00617867447e-05
+9.16754495518e-05
+0.000102988780825
+0.00011398684042
+0.000124668732357
+0.000135033530878
+0.000145080280208
+0.000154807994313
+0.000164213905676
+0.000173160749286
+0.000181561034814
+0.000189412372955
+0.000196712318052
+0.000203458367592
+0.000209647961694
+0.000215278482584
+0.000220347254069
+0.000224851541005
+0.000228807866791
+0.000232540174492
+0.000236164718745
+0.000239681182734
+0.000243089239406
+0.000246388551387
+0.000249576393137
+0.000252642773007
+0.000255586236459
+0.000258406328797
+0.000261102583118
+0.000263674520209
+0.000266121648444
+0.000268443463668
+0.000270639449095
+0.000272709075195
+0.000274651799579
+0.000276467066889
+0.000278172256413
+0.000279850449735
+0.000281512180087
+0.000283157485917
+0.000284786404601
+0.000286398972436
+0.000287995224643
+0.00028957519536
+0.000291138917638
+0.000292686423439
+0.000294217743634
+0.000295732907994
+0.000297231945193
+0.0002987148828
+0.000300181747273
+0.000301632563962
+0.000303067357098
+0.000304486149792
+0.000305888964028
+0.000307275820664
+0.000308646739418
+0.000310001738874
+0.000311340836469
+0.000312664048492
+0.000313971390076
+0.000315262739986
+0.000316534017213
+0.000317783287458
+0.000319010525928
+0.000320215705959
+0.000321398799014
+0.000322559774663
+0.000323698600574
+0.000324815242499
+0.000325909664258
+0.000326981827729
+0.000328031692834
+0.000329059217522
+0.000330064357756
+0.0003310470675
+0.000332007298704
+0.000332945001287
+0.000333860123122
+0.000334752610023
+0.000335622405727
+0.000336469451879
+0.000337293688016
+0.000338095051547
+0.000338873477743
+0.000339628899715
+0.000340361248396
+0.000341070452527
+0.000341756438639
+0.00034241913103
+0.000343058451752
+0.000343674320591
+
+# Int ( Mg ) m^a
+
+10.0 0.00805
+0.0
+2.45011939145e-08
+9.8188777398e-08
+2.21342800969e-07
+3.94248754043e-07
+6.17197617639e-07
+8.90485917808e-07
+1.2144157798e-06
+1.58929498295e-06
+2.01543701638e-06
+2.49316113533e-06
+3.0227924184e-06
+3.6046618255e-06
+4.23910625655e-06
+4.92646861103e-06
+5.70761056686e-06
+6.65471504929e-06
+7.770138556e-06
+9.05490710196e-06
+1.0510065697e-05
+1.21366785338e-05
+1.39358291778e-05
+1.59070783405e-05
+1.79315560645e-05
+1.99342856955e-05
+2.19153029389e-05
+2.3874641997e-05
+2.58123355638e-05
+2.7728414819e-05
+2.9622909422e-05
+3.14958475056e-05
+3.33472556702e-05
+3.52113695247e-05
+3.76669425666e-05
+4.09250361949e-05
+4.49903808263e-05
+4.98677965295e-05
+5.55621939025e-05
+6.1908217341e-05
+6.82207650439e-05
+7.44272387986e-05
+8.0527533587e-05
+8.65215354827e-05
+9.24091215927e-05
+9.81901599978e-05
+0.000103864509691
+0.000109432020518
+0.000114892533112
+0.000120245878831
+0.000125491879692
+0.00013065226614
+0.000135829011133
+0.000141035498069
+0.000146272300891
+0.000151539999115
+0.000156839177916
+0.000162170428195
+0.000167534346662
+0.000172931535919
+0.00017836260453
+0.000183828167114
+0.000189328844417
+0.0001948652634
+0.000200438057322
+0.000206047865824
+0.000211695335014
+0.000217381117557
+0.000223105872758
+0.000228870266656
+0.000234674972108
+0.000240520668885
+0.00024640804376
+0.000252337790603
+0.000258310610475
+0.000264327211722
+0.000270387342604
+0.000276462433927
+0.000282539292765
+0.00028861840529
+0.000294700260563
+0.000300785350582
+0.000306874170348
+0.00031296721791
+0.000319064994428
+0.000325168004227
+0.000331276754854
+0.000337391757136
+0.000343513525239
+0.000349642576727
+0.000355779432618
+0.000361924617451
+0.00036807865934
+0.00037424209004
+0.000380415445006
+0.000386599263456
+0.000392794088437
+0.000399000466885
+0.000405218949693
+0.000411450091772
+0.000417694452124
+0.0004239525939
+0.000430225084472
+0.000436512495504
+0.000442815403013
+0.000449134387446
+0.000455470033743
+
+# Int ( O ) m^a
+
+10.0 0.00805
+0.0
+4.00832099792e-07
+1.60633861182e-06
+3.62110107761e-06
+6.44979001739e-06
+1.00971657924e-05
+1.45680794788e-05
+1.9867473754e-05
+2.60003837948e-05
+3.29719381877e-05
+4.0787359852e-05
+4.9451966975e-05
+5.897117396e-05
+6.93504923878e-05
+8.05955319897e-05
+9.29010084867e-05
+0.000106607834411
+0.000121731228431
+0.000138280275058
+0.000156264221209
+0.00017569247783
+0.000196574621557
+0.000218921985171
+0.000242868081922
+0.000268501403524
+0.000295833367524
+0.000324875588275
+0.00035563987895
+0.000388138253573
+0.000422382929081
+0.000458386327415
+0.000496161077635
+0.000535824148342
+0.000579150131165
+0.000626794652636
+0.000678785528395
+0.000735151069865
+0.000795920089236
+0.000860772568078
+0.000928323014693
+0.000998442266109
+0.00107115014266
+0.00114646677809
+0.0012244126229
+0.00130500844773
+0.00138827534671
+0.001474234741
+0.00156290838223
+0.00165431835607
+0.00174848708584
+0.00184532232769
+0.00194431108032
+0.00204540549283
+0.00214862523084
+0.00225399023621
+0.00236152073015
+0.00247123721636
+0.00258316048424
+0.00269731161205
+0.00281371197024
+0.00293238322471
+0.00305334734018
+0.00317662658356
+0.00330224352741
+0.00343022105336
+0.00356058235569
+0.00369335094485
+0.00382855065106
+0.00396620562802
+0.00410634035653
+0.00424897964827
+0.00439414864961
+0.00454187284541
+0.00469217806292
+0.00484509047571
+0.00500058487686
+0.00515712186636
+0.00531398417386
+0.00547118590858
+0.00562874128499
+0.00578666462456
+0.00594497035746
+0.0061036730243
+0.00626278727789
+0.00642232788499
+0.00658230972813
+0.00674274780742
+0.00690365724237
+0.00706505327375
+0.00722695126545
+0.00738936670637
+0.00755231521236
+0.0077158125281
+0.00787987452913
+0.00804451722372
+0.00820975675496
+0.00837560940272
+0.00854209158573
+0.00870921986359
+0.00887701093891
+0.00904548165936
+0.00921464901986
+0.00938453016467
+0.00955514238961
+0.00972650314428
+0.00989863003419
+
+# Int ( Metals ) m^a
+
+10.0 0.00805
+0.0
+1.19813224101e-06
+4.80152682832e-06
+1.0823878505e-05
+1.92791479814e-05
+3.01815645128e-05
+4.35456285118e-05
+5.93861141972e-05
+7.77180722787e-05
+9.85568326786e-05
+0.00012191800729
+0.000147817492773
+0.000176271473389
+0.000207296423872
+0.00024090911234
+0.000276988653252
+0.000315307829144
+0.00035587751217
+0.000398713431608
+0.000443831582077
+0.000491248226271
+0.000540979897731
+0.000593040727114
+0.000647239576947
+0.000703461721651
+0.000761722850383
+0.000822038899608
+0.000884426055722
+0.000948900757719
+0.00101547969989
+0.00108417983454
+0.00115501837477
+0.00122811338056
+0.0013051841331
+0.001386869127
+0.00147320049497
+0.00156421091308
+0.00165993360637
+0.00176008786736
+0.00186343390583
+0.00196986303225
+0.00207940078075
+0.00219207307149
+0.00230790621487
+0.00242692691577
+0.00254916227779
+0.00267463980768
+0.00280338741966
+0.00293543343996
+0.00307080661128
+0.00320931475956
+0.00334995570966
+0.00349262224447
+0.00363733684158
+0.00378412226446
+0.00393300156582
+0.00408399809104
+0.00423713548166
+0.00439243767881
+0.00454992892685
+0.00470963377687
+0.00487157709039
+0.00503578404303
+0.0052022801282
+0.00537109116091
+0.00554224328156
+0.00571576295982
+0.00589167699854
+0.00607001253768
+0.00625079705837
+0.00643405838692
+0.00661982469895
+0.00680812452352
+0.00699898674739
+0.00719244061921
+0.00738846472186
+0.00758554391966
+0.00778297412281
+0.00798077276357
+0.00817895740023
+0.00837754571927
+0.00857655553745
+0.00877600480388
+0.00897591160225
+0.0091762941529
+0.00937717081511
+0.00957856008923
+0.00978048061897
+0.00998295119363
+0.0101859907504
+0.0103896183767
+0.0105938533124
+0.0107987149524
+0.0110042228486
+0.011210396713
+0.0114172564193
+0.011624822006
+0.0118331136786
+0.0120421518123
+0.0122519569542
+0.0124625498264
+0.012673951328
+0.0128861825382
+0.0130992647187
+0.0133132193164
+0.0135280679664
diff --git a/PyChem/shared/tables/MetalSNII/chemyves.dat b/PyChem/shared/tables/MetalSNII/chemyves.dat
new file mode 100644
index 0000000..50f127f
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/chemyves.dat
@@ -0,0 +1,664 @@
+#### Metal Parameters ####
+
+# Number of points / Number of elements
+106 4
+
+# Int ( 1- Residual ) m^a
+
+0.05 0.0294944
+3.692117e-04
+1.620403e-03
+2.890097e-03
+4.178872e-03
+5.488506e-03
+6.820900e-03
+8.177621e-03
+9.560390e-03
+1.097164e-02
+1.241285e-02
+1.388625e-02
+1.539418e-02
+1.693889e-02
+1.852247e-02
+2.014746e-02
+2.181650e-02
+2.353219e-02
+2.529719e-02
+2.711444e-02
+2.898685e-02
+3.091755e-02
+3.290978e-02
+3.496683e-02
+3.709223e-02
+3.928966e-02
+4.156287e-02
+4.391579e-02
+4.635260e-02
+4.887756e-02
+5.149515e-02
+5.421006e-02
+5.702716e-02
+5.995151e-02
+6.298843e-02
+6.614342e-02
+6.942229e-02
+7.283103e-02
+7.637594e-02
+8.006354e-02
+8.390070e-02
+8.789457e-02
+9.205259e-02
+9.638254e-02
+1.008926e-01
+1.055911e-01
+1.104367e-01
+1.153646e-01
+1.203811e-01
+1.254933e-01
+1.307086e-01
+1.360346e-01
+1.414306e-01
+1.468391e-01
+1.522926e-01
+1.578884e-01
+1.635723e-01
+1.691400e-01
+1.745804e-01
+1.799020e-01
+1.851578e-01
+1.903638e-01
+1.955188e-01
+2.006111e-01
+2.056404e-01
+2.105842e-01
+2.154331e-01
+2.201441e-01
+2.247243e-01
+2.291156e-01
+2.333524e-01
+2.375001e-01
+2.415636e-01
+2.455582e-01
+2.494888e-01
+2.533582e-01
+2.571692e-01
+2.609218e-01
+2.646175e-01
+2.682593e-01
+2.718327e-01
+2.753218e-01
+2.787287e-01
+2.820553e-01
+2.853193e-01
+2.885329e-01
+2.916946e-01
+2.948027e-01
+2.978587e-01
+3.008531e-01
+3.037821e-01
+3.066424e-01
+3.094357e-01
+3.121642e-01
+3.148353e-01
+3.174517e-01
+3.200149e-01
+3.225267e-01
+3.249885e-01
+3.274020e-01
+3.297679e-01
+3.320838e-01
+3.343505e-01
+3.365695e-01
+3.387420e-01
+3.408696e-01
+3.429535e-01
+
+# Int ( 1- Helium Core ) m^a
+
+0.05 0.0294944
+3.692117e-04
+1.620403e-03
+2.890097e-03
+4.178872e-03
+5.488506e-03
+6.820900e-03
+8.177621e-03
+9.560390e-03
+1.097164e-02
+1.241285e-02
+1.388625e-02
+1.539418e-02
+1.693889e-02
+1.852247e-02
+2.014746e-02
+2.181650e-02
+2.353219e-02
+2.529719e-02
+2.711444e-02
+2.898685e-02
+3.091755e-02
+3.290978e-02
+3.496683e-02
+3.709223e-02
+3.928966e-02
+4.156287e-02
+4.391579e-02
+4.635260e-02
+4.887756e-02
+5.149515e-02
+5.421006e-02
+5.702716e-02
+5.995151e-02
+6.298843e-02
+6.614342e-02
+6.942229e-02
+7.283103e-02
+7.637594e-02
+8.006354e-02
+8.390070e-02
+8.789457e-02
+9.205259e-02
+9.638254e-02
+1.008926e-01
+1.055911e-01
+1.104367e-01
+1.153646e-01
+1.203811e-01
+1.254933e-01
+1.307086e-01
+1.360346e-01
+1.414306e-01
+1.468391e-01
+1.522926e-01
+1.578884e-01
+1.635723e-01
+1.691400e-01
+1.745804e-01
+1.799020e-01
+1.851578e-01
+1.903638e-01
+1.955188e-01
+2.006111e-01
+2.056404e-01
+2.105842e-01
+2.154331e-01
+2.201441e-01
+2.247243e-01
+2.291156e-01
+2.333524e-01
+2.375001e-01
+2.415636e-01
+2.455582e-01
+2.494888e-01
+2.533582e-01
+2.571692e-01
+2.609218e-01
+2.646175e-01
+2.682593e-01
+2.717701e-01
+2.750660e-01
+2.781458e-01
+2.810097e-01
+2.837362e-01
+2.863768e-01
+2.889375e-01
+2.914243e-01
+2.938367e-01
+2.961536e-01
+2.983782e-01
+3.005320e-01
+3.026166e-01
+3.046319e-01
+3.065737e-01
+3.084415e-01
+3.102358e-01
+3.119571e-01
+3.136056e-01
+3.151815e-01
+3.166889e-01
+3.181457e-01
+3.195544e-01
+3.209157e-01
+3.222299e-01
+3.234975e-01
+3.247189e-01
+
+# Int ( Fe ) m^a
+
+10 0.00757981
+1.156764e-11
+3.569730e-07
+1.422275e-06
+3.199719e-06
+5.693175e-06
+8.906558e-06
+1.284390e-05
+1.750924e-05
+2.290678e-05
+2.904070e-05
+3.591535e-05
+4.353496e-05
+5.190415e-05
+6.102733e-05
+7.090915e-05
+8.155429e-05
+9.247236e-05
+1.031121e-04
+1.134724e-04
+1.235526e-04
+1.333517e-04
+1.428690e-04
+1.521037e-04
+1.610550e-04
+1.696629e-04
+1.777923e-04
+1.854361e-04
+1.925922e-04
+1.992585e-04
+2.054330e-04
+2.111135e-04
+2.162978e-04
+2.209837e-04
+2.251688e-04
+2.288726e-04
+2.323879e-04
+2.358077e-04
+2.391318e-04
+2.423598e-04
+2.454914e-04
+2.485260e-04
+2.514550e-04
+2.542752e-04
+2.569862e-04
+2.595877e-04
+2.620792e-04
+2.644604e-04
+2.667307e-04
+2.688899e-04
+2.709374e-04
+2.728728e-04
+2.746957e-04
+2.764056e-04
+2.780145e-04
+2.795965e-04
+2.811639e-04
+2.827168e-04
+2.842550e-04
+2.857789e-04
+2.872882e-04
+2.887831e-04
+2.902636e-04
+2.917296e-04
+2.931813e-04
+2.946187e-04
+2.960418e-04
+2.974506e-04
+2.988451e-04
+3.002253e-04
+3.015913e-04
+3.029431e-04
+3.042808e-04
+3.056042e-04
+3.069136e-04
+3.082087e-04
+3.094898e-04
+3.107568e-04
+3.120096e-04
+3.132484e-04
+3.144732e-04
+3.156830e-04
+3.168737e-04
+3.180450e-04
+3.191968e-04
+3.203290e-04
+3.214415e-04
+3.225345e-04
+3.236079e-04
+3.246616e-04
+3.256956e-04
+3.267099e-04
+3.277044e-04
+3.286790e-04
+3.296339e-04
+3.305690e-04
+3.314841e-04
+3.323792e-04
+3.332544e-04
+3.341096e-04
+3.349446e-04
+3.357595e-04
+3.365543e-04
+3.373288e-04
+3.380830e-04
+3.388170e-04
+3.395305e-04
+
+# Int ( Mg ) m^a
+
+10 0.00757981
+7.123191e-13
+2.196566e-08
+8.751704e-08
+1.968892e-07
+3.503201e-07
+5.480497e-07
+7.903272e-07
+1.077400e-06
+1.409531e-06
+1.786972e-06
+2.209990e-06
+2.678853e-06
+3.193836e-06
+3.755213e-06
+4.363279e-06
+5.018301e-06
+5.768048e-06
+6.666127e-06
+7.713435e-06
+8.910807e-06
+1.025914e-05
+1.175930e-05
+1.341219e-05
+1.521873e-05
+1.712790e-05
+1.902228e-05
+2.089739e-05
+2.275329e-05
+2.458997e-05
+2.640747e-05
+2.820584e-05
+2.998507e-05
+3.174520e-05
+3.348626e-05
+3.524662e-05
+3.754946e-05
+4.056357e-05
+4.429290e-05
+4.874144e-05
+5.391327e-05
+5.977837e-05
+6.575813e-05
+7.164388e-05
+7.743560e-05
+8.313314e-05
+8.873636e-05
+9.424525e-05
+9.965958e-05
+1.049794e-04
+1.102044e-04
+1.153346e-04
+1.203697e-04
+1.253097e-04
+1.301696e-04
+1.350404e-04
+1.399375e-04
+1.448613e-04
+1.498124e-04
+1.547913e-04
+1.597983e-04
+1.648342e-04
+1.698992e-04
+1.749940e-04
+1.801190e-04
+1.852748e-04
+1.904618e-04
+1.956807e-04
+2.009318e-04
+2.062159e-04
+2.115334e-04
+2.168848e-04
+2.222707e-04
+2.276917e-04
+2.331483e-04
+2.386411e-04
+2.441706e-04
+2.497375e-04
+2.553423e-04
+2.609856e-04
+2.666680e-04
+2.723837e-04
+2.781042e-04
+2.838265e-04
+2.895508e-04
+2.952777e-04
+3.010074e-04
+3.067405e-04
+3.124773e-04
+3.182183e-04
+3.239639e-04
+3.297144e-04
+3.354704e-04
+3.412322e-04
+3.470003e-04
+3.527752e-04
+3.585572e-04
+3.643468e-04
+3.701445e-04
+3.759506e-04
+3.817657e-04
+3.875901e-04
+3.934244e-04
+3.992690e-04
+4.051243e-04
+4.109908e-04
+4.168691e-04
+
+# Int ( O ) m^a
+
+10 0.00757981
+1.165290e-11
+3.593523e-07
+1.431763e-06
+3.221052e-06
+5.731141e-06
+8.965944e-06
+1.292954e-05
+1.762598e-05
+2.305949e-05
+2.923433e-05
+3.615476e-05
+4.382522e-05
+5.225019e-05
+6.143420e-05
+7.138192e-05
+8.209795e-05
+9.380857e-05
+1.067673e-04
+1.209820e-04
+1.364601e-04
+1.532093e-04
+1.712374e-04
+1.905526e-04
+2.111627e-04
+2.331298e-04
+2.565838e-04
+2.815390e-04
+3.080053e-04
+3.359918e-04
+3.655090e-04
+3.965668e-04
+4.291754e-04
+4.633453e-04
+4.990869e-04
+5.365282e-04
+5.772720e-04
+6.218429e-04
+6.702649e-04
+7.225613e-04
+7.787547e-04
+8.388015e-04
+9.015300e-04
+9.665291e-04
+1.033815e-03
+1.103404e-03
+1.175315e-03
+1.249563e-03
+1.326166e-03
+1.405142e-03
+1.486509e-03
+1.570284e-03
+1.656488e-03
+1.745137e-03
+1.836171e-03
+1.929133e-03
+2.023958e-03
+2.120663e-03
+2.219267e-03
+2.319784e-03
+2.422231e-03
+2.526627e-03
+2.632989e-03
+2.741334e-03
+2.851681e-03
+2.964047e-03
+3.078450e-03
+3.194911e-03
+3.313447e-03
+3.434078e-03
+3.556824e-03
+3.681701e-03
+3.808733e-03
+3.937938e-03
+4.069337e-03
+4.202952e-03
+4.338802e-03
+4.476908e-03
+4.617292e-03
+4.759977e-03
+4.904983e-03
+5.051994e-03
+5.199473e-03
+5.347247e-03
+5.495323e-03
+5.643714e-03
+5.792433e-03
+5.941492e-03
+6.090902e-03
+6.240676e-03
+6.390826e-03
+6.541365e-03
+6.692306e-03
+6.843660e-03
+6.995440e-03
+7.147659e-03
+7.300330e-03
+7.453467e-03
+7.607082e-03
+7.761187e-03
+7.915798e-03
+8.070926e-03
+8.226587e-03
+8.382792e-03
+8.539556e-03
+8.696891e-03
+8.854815e-03
+
+# Int ( Metals ) m^a
+
+10 0.00757981
+3.478817e-11
+1.073306e-06
+4.276313e-06
+9.620504e-06
+1.711748e-05
+2.677907e-05
+3.861729e-05
+5.264446e-05
+6.887299e-05
+8.731568e-05
+1.079855e-04
+1.308953e-04
+1.560586e-04
+1.834888e-04
+2.132003e-04
+2.452064e-04
+2.793598e-04
+3.154925e-04
+3.536174e-04
+3.937483e-04
+4.358974e-04
+4.800786e-04
+5.263062e-04
+5.745934e-04
+6.248583e-04
+6.768950e-04
+7.307080e-04
+7.863103e-04
+8.437156e-04
+9.029368e-04
+9.639880e-04
+1.026882e-03
+1.091635e-03
+1.158259e-03
+1.226885e-03
+1.299093e-03
+1.375406e-03
+1.455850e-03
+1.540451e-03
+1.629237e-03
+1.722175e-03
+1.818218e-03
+1.917003e-03
+2.018553e-03
+2.122888e-03
+2.230029e-03
+2.340000e-03
+2.452822e-03
+2.568520e-03
+2.687114e-03
+2.808630e-03
+2.933091e-03
+3.060522e-03
+3.190789e-03
+3.322982e-03
+3.456967e-03
+3.592763e-03
+3.730388e-03
+3.869861e-03
+4.011202e-03
+4.154430e-03
+4.299566e-03
+4.446628e-03
+4.595638e-03
+4.746617e-03
+4.899585e-03
+5.054563e-03
+5.211572e-03
+5.370635e-03
+5.531773e-03
+5.695007e-03
+5.860360e-03
+6.027856e-03
+6.197515e-03
+6.369364e-03
+6.543424e-03
+6.719719e-03
+6.898271e-03
+7.079110e-03
+7.262254e-03
+7.447397e-03
+7.633029e-03
+7.818979e-03
+8.005260e-03
+8.191885e-03
+8.378873e-03
+8.566235e-03
+8.753989e-03
+8.942149e-03
+9.130730e-03
+9.319747e-03
+9.509215e-03
+9.699151e-03
+9.889571e-03
+1.008049e-02
+1.027192e-02
+1.046388e-02
+1.065639e-02
+1.084946e-02
+1.104312e-02
+1.123736e-02
+1.143222e-02
+1.162771e-02
+1.182385e-02
+1.202065e-02
+1.221812e-02
diff --git a/PyChem/shared/tables/MetalSNII/chimie.dat b/PyChem/shared/tables/MetalSNII/chimie.dat
new file mode 100644
index 0000000..b17f848
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/chimie.dat
@@ -0,0 +1,714 @@
+#### Livetime ####
+
+-40.1107251082866 5.50992173040633 0.782431795366473
+ 141.929566656232 -15.88948185575660 -3.255779246324010
+-261.365531429482 17.07350618651300 9.866058678313810
+
+#### Mass interval ####
+
+0.05
+50.0
+
+#### IMFs Power ####
+
+-1.35
+-0.35
+
+#### Mass Parameters for SNe Rates ####
+
+0.9 1.5
+1.8 2.6
+3.0 8.0
+
+1.38
+
+#### b Parameters for SNIa Rates ####
+
+0.02
+0.05
+
+#### Array size and step ####
+
+106
+
++++ >>>Matter<<<< ejection and Helium core +++
+
+0.05 0.03000
+
++++ >>>Metal<<<< ejections +++
+
+10.0 0.00805
+
+#### Matter ejection for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 1.948148461584278E-004
+ 7.849027553695851E-004
+ 1.779187861552281E-003
+ 3.187224565336232E-003
+ 5.019221212595564E-003
+ 7.286064986169615E-003
+ 9.999348063480538E-003
+ 1.317139509524892E-002
+ 1.681529206311515E-002
+ 2.094491657669624E-002
+ 2.557496967345443E-002
+ 3.072100918773040E-002
+ 3.639948475840345E-002
+ 4.262777454789425E-002
+ 4.942422374862439E-002
+ 5.680818495660336E-002
+ 6.480006049552767E-002
+ 7.342134677866560E-002
+ 8.269468079986046E-002
+ 9.264388884923654E-002
+ 0.103294037553632
+ 0.114671487346427
+ 0.126803948476297
+ 0.139720539669488
+ 0.153451849565542
+ 0.168030001051925
+ 0.183488718628849
+ 0.199863398941626
+ 0.217191184624264
+ 0.235511041604632
+ 0.254863840028497
+ 0.275292438966970
+ 0.296841775079514
+ 0.319558955412601
+ 0.343493354522415
+ 0.368696716118689
+ 0.395223259435849
+ 0.423129790547134
+ 0.452475818847317
+ 0.483323678940019
+ 0.515638869654887
+ 0.549320547612586
+ 0.584431710834625
+ 0.620851326758361
+ 0.657947639556310
+ 0.695710564300615
+ 0.734195485021332
+ 0.773459737483288
+ 0.813562712951118
+ 0.854313327735044
+ 0.895174045113107
+ 0.936301547191643
+ 0.978465284945171
+ 1.02143350435011
+ 1.06357748029207
+ 1.10474019450224
+ 1.14498082362232
+ 1.18470147526954
+ 1.22403851069698
+ 1.26298093381754
+ 1.30144099823254
+ 1.33941081861095
+ 1.37671689691561
+ 1.41327352656396
+ 1.44875948622491
+ 1.48323816310838
+ 1.51609796394282
+ 1.54808734974527
+ 1.57930826987217
+ 1.60989933032963
+ 1.63997460025811
+ 1.66956247317551
+ 1.69868520081668
+ 1.72736066982806
+ 1.75558770468420
+ 1.78338441658081
+ 1.81076023074636
+ 1.83754362096287
+ 1.86368436776538
+ 1.88919769064914
+ 1.91412332454551
+ 1.93862613413969
+ 1.96274371908897
+ 1.98644986434214
+ 2.00975214273279
+ 2.03262955706970
+ 2.05501444999736
+ 2.07687926699109
+ 2.09822179434416
+ 2.11905454229509
+ 2.13942083756861
+ 2.15936068255780
+ 2.17888702140820
+ 2.19801261569731
+ 2.21675005461101
+ 2.23511176514401
+ 2.25310894332572
+ 2.27072595530223
+ 2.28796194997655
+ 2.30482785674285
+ 2.32133442786874
+ 2.33749224658145
+ 2.35331173513791
+ 2.36880316288718
+ 2.38397665433405
+
+#### Integral (( 1 - Helium core )*m^x) for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 1.948148461584278E-004
+ 7.849027553695851E-004
+ 1.779187861552281E-003
+ 3.187224565336232E-003
+ 5.019221212595564E-003
+ 7.286064986169615E-003
+ 9.999348063480538E-003
+ 1.317139509524892E-002
+ 1.681529206311515E-002
+ 2.094491657669624E-002
+ 2.557496967345443E-002
+ 3.072100918773040E-002
+ 3.639948475840345E-002
+ 4.262777454789425E-002
+ 4.942422374862439E-002
+ 5.680818495660336E-002
+ 6.480006049552767E-002
+ 7.342134677866560E-002
+ 8.269468079986046E-002
+ 9.264388884923654E-002
+ 0.103294037553632
+ 0.114671487346427
+ 0.126803948476297
+ 0.139720539669488
+ 0.153451849565542
+ 0.168030001051925
+ 0.183488718628849
+ 0.199863398941626
+ 0.217191184624264
+ 0.235511041604632
+ 0.254863840028497
+ 0.275292438966970
+ 0.296841775079514
+ 0.319558955412601
+ 0.343493354522415
+ 0.368696716118689
+ 0.395223259435849
+ 0.423129790547134
+ 0.452475818847317
+ 0.483323678940019
+ 0.515638869654887
+ 0.549320547612586
+ 0.584431710834625
+ 0.620851326758361
+ 0.657947639556310
+ 0.695710564300615
+ 0.734195485021332
+ 0.773459737483288
+ 0.813562712951118
+ 0.854313327735044
+ 0.895174045113107
+ 0.936301547191643
+ 0.978465284945171
+ 1.02143350435011
+ 1.06357748029207
+ 1.10474019450224
+ 1.14498082362232
+ 1.18470147526954
+ 1.22403851069698
+ 1.26298093381754
+ 1.30144099823254
+ 1.33941081861095
+ 1.37671689691561
+ 1.41327352656396
+ 1.44875948622491
+ 1.48323816310838
+ 1.51609796394282
+ 1.54808734974527
+ 1.57930826987217
+ 1.60989933032963
+ 1.63997460025811
+ 1.66956247317551
+ 1.69868520081668
+ 1.72736066982806
+ 1.75558770468420
+ 1.78338441658081
+ 1.81071616556485
+ 1.83670600999954
+ 1.86104157854762
+ 1.88371492738163
+ 1.90484299572985
+ 1.92518047779587
+ 1.94486779525062
+ 1.96396943089998
+ 1.98250651029805
+ 2.00041497018969
+ 2.01755363603033
+ 2.03408666199520
+ 2.05008482147464
+ 2.06555443405543
+ 2.08047371517568
+ 2.09482312696596
+ 2.10860647780629
+ 2.12182703485943
+ 2.13448751632217
+ 2.14659008291206
+ 2.15814077740630
+ 2.16925510323094
+ 2.17998648402747
+ 2.19033867333341
+ 2.20031508731443
+ 2.20991880144748
+ 2.21915254676071
+ 2.22801870561681
+ 2.23651930702553
+
+#### Number of elements ####
+
+4
+
+#### Global metals ejection for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 8.897253135854732E-006
+ 3.565583010606147E-005
+ 8.037742719377121E-005
+ 1.431657157387295E-004
+ 2.241263612766181E-004
+ 3.233670429414094E-004
+ 4.409974731337761E-004
+ 5.771294174584804E-004
+ 7.318767149339434E-004
+ 9.053552984769282E-004
+ 1.097683215665787E-003
+ 1.308980649784902E-003
+ 1.539369941154163E-003
+ 1.788975608746417E-003
+ 2.056899964276174E-003
+ 2.341455705452620E-003
+ 2.642723568188662E-003
+ 2.960820357089825E-003
+ 3.295864847173348E-003
+ 3.647977804165578E-003
+ 4.017282005068346E-003
+ 4.403882383252232E-003
+ 4.806359564088637E-003
+ 5.223861602799551E-003
+ 5.656505006063677E-003
+ 6.104408117036040E-003
+ 6.567691134864435E-003
+ 7.046476134460491E-003
+ 7.540887086527641E-003
+ 8.051049877849695E-003
+ 8.577092331842466E-003
+ 9.119891154224343E-003
+ 9.692213616823108E-003
+ 1.029880113968753E-002
+ 1.093989233820789E-002
+ 1.161572986281088E-002
+ 1.232656044047916E-002
+ 1.307029955558859E-002
+ 1.383774060539543E-002
+ 1.462807646847552E-002
+ 1.544149675960897E-002
+ 1.627819396031193E-002
+ 1.713836344990908E-002
+ 1.802220353700684E-002
+ 1.892991549137133E-002
+ 1.986170357621650E-002
+ 2.081777508090681E-002
+ 2.179834035407945E-002
+ 2.280361283719104E-002
+ 2.383216545801203E-002
+ 2.487655612836635E-002
+ 2.593598866073771E-002
+ 2.701062997231396E-002
+ 2.810064910314413E-002
+ 2.920621724122559E-002
+ 3.032750774789945E-002
+ 3.146469618355814E-002
+ 3.261796033366855E-002
+ 3.378748023511465E-002
+ 3.497343820286358E-002
+ 3.617601885695899E-002
+ 3.739540914984546E-002
+ 3.863179839402824E-002
+ 3.988537829007218E-002
+ 4.115634295494388E-002
+ 4.244488895070137E-002
+ 4.375121531353549E-002
+ 4.507552358316691E-002
+ 4.641801783260356E-002
+ 4.777890469826242E-002
+ 4.915839341046017E-002
+ 5.055669582427733E-002
+ 5.197402645080004E-002
+ 5.341060248874441E-002
+ 5.486626489585046E-002
+ 5.632976237180887E-002
+ 5.779586639107656E-002
+ 5.926470640426895E-002
+ 6.073641279830042E-002
+ 6.221111691182542E-002
+ 6.368895105083984E-002
+ 6.517004850444591E-002
+ 6.665454356078143E-002
+ 6.814257152311638E-002
+ 6.963426872611900E-002
+ 7.112977255229307E-002
+ 7.262922144858935E-002
+ 7.413275494319280E-002
+ 7.564051366248836E-002
+ 7.715263934820724E-002
+ 7.866927487475635E-002
+ 8.019056426673313E-002
+ 8.171665271662820E-002
+ 8.324768660271827E-002
+ 8.478381350715172E-002
+ 8.632518223422943E-002
+ 8.787194282888339E-002
+ 8.942424659535547E-002
+ 9.098224611607922E-002
+ 9.254609527076696E-002
+ 9.411594925570514E-002
+ 9.569196460326047E-002
+ 9.727429920159936E-002
+ 9.886311231462394E-002
+ 0.100458564602127
+
++++ SN Ia ejection +++
+
+1.37434165658910
+
+#### Iron ejection (Fe 56) for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 2.956841176560512E-006
+ 1.184957031481829E-005
+ 2.671198433534344E-005
+ 4.757853653304705E-005
+ 7.448434293779550E-005
+ 1.074651887624319E-004
+ 1.465575349392165E-004
+ 1.917985247456573E-004
+ 2.432259905207950E-004
+ 3.008784604729170E-004
+ 3.647951655798472E-004
+ 4.350160465826850E-004
+ 5.115817610742712E-004
+ 5.945336906833583E-004
+ 6.807760054228812E-004
+ 7.647880774633296E-004
+ 8.464589622547035E-004
+ 9.257820063061017E-004
+ 1.002750334997153E-003
+ 1.077356850806078E-003
+ 1.149594231510450E-003
+ 1.219441925701428E-003
+ 1.285880612218336E-003
+ 1.348260593490127E-003
+ 1.406564126689602E-003
+ 1.460773050531925E-003
+ 1.510868781517747E-003
+ 1.556832310122166E-003
+ 1.598644196929169E-003
+ 1.636284568710711E-003
+ 1.669733114450022E-003
+ 1.699112535851976E-003
+ 1.726828413329182E-003
+ 1.753744046358577E-003
+ 1.779857082287675E-003
+ 1.805165092436012E-003
+ 1.829665571480846E-003
+ 1.853338279750892E-003
+ 1.876109019892992E-003
+ 1.897966990601563E-003
+ 1.918908815329765E-003
+ 1.938931026893145E-003
+ 1.958030066692454E-003
+ 1.976202283924965E-003
+ 1.993443934784179E-003
+ 2.009751181647758E-003
+ 2.025120092253587E-003
+ 2.039546638863828E-003
+ 2.053026697416816E-003
+ 2.065689325400583E-003
+ 2.078151481319033E-003
+ 2.090491384277475E-003
+ 2.102709319789206E-003
+ 2.114805565399577E-003
+ 2.126780390663318E-003
+ 2.138634057121111E-003
+ 2.150366818275400E-003
+ 2.161978919565437E-003
+ 2.173470598341558E-003
+ 2.184842083838686E-003
+ 2.196093597149037E-003
+ 2.207225351194051E-003
+ 2.218237550695516E-003
+ 2.229130392145890E-003
+ 2.239904063777819E-003
+ 2.250558745532826E-003
+ 2.261094609029186E-003
+ 2.271511817528965E-003
+ 2.281810525904219E-003
+ 2.291990880602348E-003
+ 2.302053019610601E-003
+ 2.311997072419712E-003
+ 2.321823159986673E-003
+ 2.331531394696627E-003
+ 2.341120876262565E-003
+ 2.350561299366451E-003
+ 2.359838300044014E-003
+ 2.368951694162124E-003
+ 2.377901283737103E-003
+ 2.386686856841968E-003
+ 2.395308187512068E-003
+ 2.403765035649100E-003
+ 2.412057146923474E-003
+ 2.420184252675018E-003
+ 2.428146069812017E-003
+ 2.435942300708544E-003
+ 2.443572633100085E-003
+ 2.451036739977441E-003
+ 2.458334279478871E-003
+ 2.465464894780476E-003
+ 2.472428213984800E-003
+ 2.479223850007626E-003
+ 2.485851400462947E-003
+ 2.492310447546105E-003
+ 2.498600557915061E-003
+ 2.504721282569793E-003
+ 2.510672156729784E-003
+ 2.516452699709602E-003
+ 2.522062414792528E-003
+ 2.527500789102234E-003
+ 2.532767293472467E-003
+ 2.537861382314741E-003
+ 2.542782493483995E-003
+ 2.547530048142210E-003
+ 2.552103450619951E-003
+
++++ SN Ia ejection +++
+
+6.13E-01
+
+#### Magnesium ejection (Mg 24) for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 1.819442937310254E-007
+ 7.291435600384900E-007
+ 1.643677436101472E-006
+ 2.927665948000166E-006
+ 4.583269902105687E-006
+ 6.612691281848316E-006
+ 9.018173649926460E-006
+ 1.180200255601612E-005
+ 1.496650595004626E-005
+ 1.851405460110017E-005
+ 2.244706252201328E-005
+ 2.676798739972123E-005
+ 3.147933103143684E-005
+ 3.658363976671600E-005
+ 4.238434980373224E-005
+ 4.941748691312122E-005
+ 5.770055029556047E-005
+ 6.724115907242803E-005
+ 7.804707341980689E-005
+ 9.012619596330489E-005
+ 1.034865731917986E-004
+ 1.181249429757805E-004
+ 1.331585846402729E-004
+ 1.480307263624304E-004
+ 1.627416332867669E-004
+ 1.772915593984231E-004
+ 1.916807474808496E-004
+ 2.059094290723710E-004
+ 2.199778244216313E-004
+ 2.338861424419015E-004
+ 2.476345806642475E-004
+ 2.614773705249866E-004
+ 2.797122983562738E-004
+ 3.039066925630227E-004
+ 3.340956809170936E-004
+ 3.703150569382891E-004
+ 4.126012864122325E-004
+ 4.597264492329210E-004
+ 5.066030233885785E-004
+ 5.526918992124166E-004
+ 5.979922968459649E-004
+ 6.425033702797147E-004
+ 6.862242069179286E-004
+ 7.291538271358102E-004
+ 7.712911838289599E-004
+ 8.126351619550072E-004
+ 8.531845780673756E-004
+ 8.929381798410914E-004
+ 9.318946455905320E-004
+ 9.702153442100753E-004
+ 1.008657520327678E-003
+ 1.047320558206630E-003
+ 1.086208719903354E-003
+ 1.125326308886108E-003
+ 1.164677670603224E-003
+ 1.204267193057797E-003
+ 1.244099307388927E-003
+ 1.284178488459572E-003
+ 1.324509255451111E-003
+ 1.365096172464694E-003
+ 1.405943849129473E-003
+ 1.447056941217783E-003
+ 1.488440151267375E-003
+ 1.530098229210789E-003
+ 1.572035973011942E-003
+ 1.614258229310037E-003
+ 1.656769894070877E-003
+ 1.699575913245673E-003
+ 1.742681283437455E-003
+ 1.786091052575152E-003
+ 1.829810320595468E-003
+ 1.873844240132630E-003
+ 1.918198017216116E-003
+ 1.962876911976458E-003
+ 2.007879055024797E-003
+ 2.052992293336366E-003
+ 2.098118657107999E-003
+ 2.143261756617522E-003
+ 2.188425223586288E-003
+ 2.233612711583413E-003
+ 2.278827896433972E-003
+ 2.324074476631232E-003
+ 2.369356173752939E-003
+ 2.414676732881754E-003
+ 2.460039923029865E-003
+ 2.505449537567846E-003
+ 2.550909394657815E-003
+ 2.596423337690957E-003
+ 2.641995235729453E-003
+ 2.687628983952897E-003
+ 2.733328504109238E-003
+ 2.779097744970332E-003
+ 2.824940682792141E-003
+ 2.870861321779656E-003
+ 2.916863694556613E-003
+ 2.962951862640033E-003
+ 3.009129916919698E-003
+ 3.055401978142588E-003
+ 3.101772197402363E-003
+ 3.148244756633953E-003
+ 3.194823869113327E-003
+ 3.241513779962500E-003
+ 3.288318766659852E-003
+ 3.335243139555834E-003
+ 3.382291242394126E-003
+
++++ SN Ia ejection +++
+
+ 8.50E-03
+
+#### Oxygen ejection (O 16) for IMF power x=-1.35 ####
+
+ 0.000000000000000E+000
+ 2.976553451070855E-006
+ 1.192856745025033E-005
+ 2.689006423091226E-005
+ 4.789572677660044E-005
+ 7.498090522404713E-005
+ 1.081816233541810E-004
+ 1.475345851721441E-004
+ 1.930771815772945E-004
+ 2.448474971242664E-004
+ 3.028843168760691E-004
+ 3.672271333503788E-004
+ 4.379161535599020E-004
+ 5.149923061480987E-004
+ 5.984972486212462E-004
+ 6.898769274273264E-004
+ 7.916629371565685E-004
+ 9.039682906565435E-004
+ 1.026860448934943E-003
+ 1.160408078990883E-003
+ 1.304681065922115E-003
+ 1.459750525195066E-003
+ 1.625700613333661E-003
+ 1.803522791146854E-003
+ 1.993874192438966E-003
+ 2.196839603166924E-003
+ 2.412505270783129E-003
+ 2.640958919145200E-003
+ 2.882289763624883E-003
+ 3.136588526417780E-003
+ 3.403947452056856E-003
+ 3.684460323131529E-003
+ 3.978995740964198E-003
+ 4.300731709113910E-003
+ 4.654536868133661E-003
+ 5.040617775189566E-003
+ 5.459184669091019E-003
+ 5.910451507299084E-003
+ 6.392041853499599E-003
+ 6.893667135248234E-003
+ 7.414368196611116E-003
+ 7.954292222077688E-003
+ 8.513588723603584E-003
+ 9.092409565308089E-003
+ 9.690908988493832E-003
+ 1.030924363699205E-002
+ 1.094757258283783E-002
+ 1.160605735227868E-002
+ 1.228486195212044E-002
+ 1.298415289641468E-002
+ 1.370324518837255E-002
+ 1.443832931314354E-002
+ 1.518904993307708E-002
+ 1.595555308376755E-002
+ 1.673798685220159E-002
+ 1.753650139980432E-002
+ 1.835124898577689E-002
+ 1.918238399072850E-002
+ 2.003006294060656E-002
+ 2.089444453092829E-002
+ 2.177568965131766E-002
+ 2.267396141035107E-002
+ 2.358942516071541E-002
+ 2.452224852468250E-002
+ 2.547260141990331E-002
+ 2.644065608552597E-002
+ 2.742658710864140E-002
+ 2.843057145106052E-002
+ 2.945278847642671E-002
+ 3.049341997766793E-002
+ 3.155265020479225E-002
+ 3.263066589303079E-002
+ 3.372765629133283E-002
+ 3.484381319121629E-002
+ 3.597933095597885E-002
+ 3.713402240061904E-002
+ 3.829645603944328E-002
+ 3.946130546889339E-002
+ 4.062867546301585E-002
+ 4.179867157766808E-002
+ 4.297140016315173E-002
+ 4.414696837697843E-002
+ 4.532548419677040E-002
+ 4.650705643329696E-002
+ 4.769179474364910E-002
+ 4.887980964455397E-002
+ 5.007121252583087E-002
+ 5.126611566399074E-002
+ 5.246463223598105E-002
+ 5.366687633307785E-002
+ 5.487296297492691E-002
+ 5.608300812373603E-002
+ 5.729712869862028E-002
+ 5.851544259010228E-002
+ 5.973806867476952E-002
+ 6.096512683009059E-002
+ 6.219673794939256E-002
+ 6.343302395700150E-002
+ 6.467410782354817E-002
+ 6.592011358144122E-002
+ 6.717116634050971E-002
+ 6.842739230381742E-002
+ 6.968891878365104E-002
+ 7.095587421768432E-002
+ 7.222838818532087E-002
+ 7.350659142421721E-002
+
++++ SN Ia ejection +++
+
+1.43E-01
diff --git a/PyChem/shared/tables/MetalSNII/computeIntegrals.py b/PyChem/shared/tables/MetalSNII/computeIntegrals.py
new file mode 100644
index 0000000..d7098ee
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/computeIntegrals.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+import libmetalsSNII
+
+
+
+######################################################
+# Parameters
+######################################################
+
+# IMF
+Mmin = 0.05
+Mmax = 50.
+#m_s = []
+#a_s = [-1.35]
+m_s = [0.08, 0.5, 1.0]
+#a_s = [0.7, -0.8, -1.7, -1.3]
+a_s = [-1.35, -1.35, -1.35, -1.35]
+
+# files
+MetalFile = 'MetalEjection.dat'
+HeliumCoreFile = 'HeliumCore.dat'
+OutputFile = 'chemyves.dat'
+
+
+# number of elements to follow
+nelts = 4
+
+# masses for metal injection
+Mmin1 = 10.
+Mmax1 = Mmax*1.5
+
+# masses for helium core
+Mmin2 = Mmin
+Mmax2 = Mmax*1.5
+
+# resolution in mass for integration
+dM = 0.001
+
+# number of output points
+n = 106
+
+
+
+
+IRess,IHcos,IFes,IMgs,IOxs,IMes,Mmin1,lStep1,Mmin2,lStep2 = libmetals.ComputeIntegrals(Mmin,Mmax,m_s,a_s,MetalFile,HeliumCoreFile,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n)
+
+
+# output
+
+f = open(OutputFile,'w')
+libmetalsSNII.WriteOutput(f,IRess,IHcos,IFes,IMgs,IOxs,IMes,n,nelts,Mmin1,lStep1,Mmin2,lStep2)
+f.close()
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/convert.py b/PyChem/shared/tables/MetalSNII/convert.py
new file mode 100755
index 0000000..b8ea733
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/convert.py
@@ -0,0 +1,270 @@
+#!/usr/bin/env python
+
+import string
+from numpy import *
+import sys
+import pylab as pl
+
+import libtreeasph
+import libmetalsSNII
+
+import Ptools as pt
+
+
+unit_length = 1.0
+unit_mass = 1.e10
+u_lt = -log10( 4.7287e11*sqrt(unit_length**3/unit_mass))
+
+NbElement=4
+
+feedback_energy = 1.1682615e13*(unit_length/unit_mass**2) # Energy released by each supernova by solar mass (10^(51)erg (in TREEASPH units))
+# UnitLength_in_cm = 3.085e+21
+# UnitMass_in_g = 1.989e+43
+# UnitTime_in_s = 148849920000000.0
+# feedback_energy = 10**51 /UnitMass_in_g * (UnitTime_in_s/UnitLength_in_cm)**2
+
+
+
+def read_chemistry(file):
+
+
+ f = open(file)
+
+ ######################
+ # Livetime
+ ######################
+
+ f.readline()
+ f.readline()
+ coeff_z1 = array(string.split(f.readline()))
+ coeff_z2 = array(string.split(f.readline()))
+ coeff_z3 = array(string.split(f.readline()))
+
+ coeff_z = concatenate( (coeff_z1,coeff_z2,coeff_z3))
+ coeff_z.shape = (3,3)
+ coeff_z = coeff_z.astype(float)
+
+ # Conversion into program time unit
+ coeff_z[3-1,3-1] = coeff_z[3-1,3-1] + u_lt
+
+ # Transform log(timelive) polynomial expression log(t) = a(z) log(m)^2 + b(z) log(m) + c(z)
+ # into log(t) = a(z) log(m)^2 + 2b(z) log(m) + c(z)
+ coeff_z[2-1,:] = coeff_z[2-1,:] / 2.0
+
+
+ ######################
+ # Mass interval
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Mmin = float(f.readline())
+ Mmax = float(f.readline())
+
+ LogMmax2 = log10(Mmax)
+ TwoLogMmax = 2.0 * LogMmax2
+ LogMmax2 = LogMmax2**2
+
+ ######################
+ # IMFs Power
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ PowSN1 = float(f.readline())
+ PowSN2 = float(f.readline())
+
+
+ ######################
+ # Mass Parameters for SNe Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Msn1 = array(string.split(f.readline()))
+ Msn2 = array(string.split(f.readline()))
+ Msn3 = array(string.split(f.readline()))
+
+ Msn = concatenate( (Msn1,Msn2,Msn3))
+ Msn.shape = (3,2)
+ Msn = Msn.astype(float)
+
+ f.readline()
+ Mco = float(f.readline()) / unit_mass
+
+ ######################
+ # b Parameters for SNIa Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ b1 = float(f.readline())
+ b2 = float(f.readline())
+
+ ConstSN = array([0,0,0],float)
+ ConstSN[3-1] = (1.0+PowSN1)/(Mmax**(1.0+PowSN1)-Mmin**(1.0+PowSN1))
+ ConstSN[1-1] = (1.0+PowSN2)/(Msn[1-1,2-1]**(1.0+PowSN2)-Msn[1-1,1-1]**(1.0+PowSN2))
+ ConstSN[2-1] = (1.0+PowSN2)/(Msn[2-1,2-1]**(1.0+PowSN2)-Msn[2-1,1-1]**(1.0+PowSN2))
+ ConstSN[1-1] = b1*ConstSN[1-1]*ConstSN[3-1]
+ ConstSN[2-1] = b2*ConstSN[2-1]*ConstSN[3-1]
+
+
+
+ ######################
+ # Array size and step
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ ChemArraySize = int(f.readline())
+
+
+ ######################
+ # >>>Matter<<<< ejection and Helium core
+ ######################
+
+ ArrayOrigin = array([0,0],float)
+ ArrayStep = array([0,0],float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ line = array(string.split(f.readline()))
+
+ ArrayOrigin[p] = float(line[0])
+ ArrayStep[p] = float(line[1])
+
+ ArrayOrigin = log10(ArrayOrigin)
+
+ ######################
+ # Matter ejection for IMF power x=-1.35
+ # Integral (( 1 - Helium core )*m^x) for IMF power x=-1.35
+ ######################
+
+ '''
+ ChemArray[:,0] metal
+ ChemArray[:,1] Fe
+ ChemArray[:,2] Mg
+ ChemArray[:,3] Ox
+
+ ChemArray[:,4] Matter ejection
+ ChemArray[:,5] Integral (( 1 - Helium core )*m^x)
+ '''
+
+
+ ChemArray = zeros((110,NbElement+2),float)
+ MIa = zeros(NbElement,float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+
+ for j in xrange(ChemArraySize):
+
+ ChemArray[j,NbElement+p] = float(f.readline()) * ConstSN[3-1]
+
+
+
+ #########################
+ # Number of elements ####
+ #########################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ nelt = int(f.readline())
+
+ if nelt != NbElement:
+ raise "nelt != NbElement"
+
+
+ #########################
+ # Global metals ejection for IMF power x=-1.35
+ #########################
+
+ for p in xrange(NbElement):
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ for j in xrange(ChemArraySize):
+ ChemArray[j,p] = float(f.readline()) * ConstSN[3-1]
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ MIa[p] = float(f.readline())
+ MIa[p] = MIa[p] / unit_mass
+
+
+
+
+ ConstSN[1-1] = ( ConstSN[1-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[2-1] = ( ConstSN[2-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[3-1] = ( ConstSN[3-1]/PowSN1 ) * unit_mass
+
+ return coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa
+
+
+
+
+
+
+
+
+
+##################################
+# poirier
+##################################
+
+
+coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa = read_chemistry('chimie.dat')
+
+#b = 0.13466316207
+#ChemArray = ChemArray/b
+
+n = len(ChemArray)
+n = 106
+
+
+IFe = ChemArray[0:n,1] # Fe
+IMg = ChemArray[0:n:,2] # Mg
+IOx = ChemArray[0:n:,3] # Ox
+IMe = ChemArray[0:n:,0] # metal
+
+IRes = ChemArray[0:n:,4] # Matter ejection
+IHco = ChemArray[0:n:,5] # Integral (( 1 - Helium core )*m^x)
+
+
+
+for elt in ChemArray[0:n:,0]:
+ print elt
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/convert_yields.py b/PyChem/shared/tables/MetalSNII/convert_yields.py
new file mode 100755
index 0000000..5b5db37
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/convert_yields.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+
+import sys,string
+from numpy import *
+
+file1 = sys.argv[1]
+file2 = sys.argv[2]
+
+
+f = open(file1,'r')
+lines = f.readlines()
+f.close()
+
+
+data = array([])
+
+for line in lines:
+ line = string.split(line)
+ data = concatenate((data,array(line)))
+
+data.shape = (len(lines),len(data)/len(lines))
+
+data[0,0] = '# M'
+
+f = open(file2,'w')
+
+# header
+f.write("%s\t"%data[0,0])
+
+for j in xrange(1,data.shape[0]):
+ f.write("%s\t\t"%data[j,0])
+
+f.write("\n")
+
+
+# 10 M
+f.write("%s\t"%"10")
+for j in xrange(1,data.shape[0]):
+ f.write("%s\t"%"0.00E-00")
+
+f.write("\n")
+
+
+
+for i in xrange(1,data.shape[1]):
+ f.write("%s\t"%data[0,i])
+
+ for j in xrange(1,data.shape[0]):
+ f.write("%s\t"%data[j,i])
+
+ f.write("\n")
+
+
+f.close()
diff --git a/PyChem/shared/tables/MetalSNII/image.png b/PyChem/shared/tables/MetalSNII/image.png
new file mode 100644
index 0000000..fba6c87
Binary files /dev/null and b/PyChem/shared/tables/MetalSNII/image.png differ
diff --git a/PyChem/shared/tables/MetalSNII/libimf.py b/PyChem/shared/tables/MetalSNII/libimf.py
new file mode 120000
index 0000000..ccff59a
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/libimf.py
@@ -0,0 +1 @@
+../Imf/libimf.py
\ No newline at end of file
diff --git a/PyChem/shared/tables/MetalSNII/libmetalsSNII.py b/PyChem/shared/tables/MetalSNII/libmetalsSNII.py
new file mode 100644
index 0000000..a5156df
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/libmetalsSNII.py
@@ -0,0 +1,434 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+import string,types,sys
+
+import libimf
+
+
+
+
+#####################################################
+def read_MetalFile(file,columns=None,lines=None,dtype=float,skipheader=False,cchar='#'):
+#####################################################
+ """[X,Y,Z] = READ('FILE',[1,4,13],lines=[10,1000])
+ Read columns 1,4 and 13 from 'FILE' from line 10 to 1000
+ into array X,Y and Z
+
+ file is either fd or name file
+
+ """
+
+ def RemoveComments(l):
+ if l[0]==cchar:
+ return None
+ else:
+ return l
+
+ def toNumList(l):
+ return map(dtype,l)
+
+ if type(file) != types.FileType:
+ f = open(file,'r')
+ else:
+ f = file
+
+
+ # read header while there is one
+ while 1:
+ fpos = f.tell()
+ header = f.readline()
+ if header[0] != cchar:
+ f.seek(fpos)
+ header = None
+ break
+ else:
+ if skipheader:
+ header = None
+ else:
+ # create dict from header
+ header = string.strip(header[2:])
+ elts = string.split(header)
+ break
+
+
+ # now, read the file content
+ lines = f.readlines()
+
+ # remove trailing
+ lines = map(string.strip, lines)
+
+
+ # remove comments
+ #lines = map(RemoveComments, lines)
+
+ # split
+ lines = map(string.split, lines)
+
+ # convert into float
+ lines = map(toNumList, lines)
+
+ # convert into array
+ lines = array(map(array, lines))
+
+ # transpose
+ lines = transpose(lines)
+
+ if header != None:
+ iobs = {}
+ i = 0
+ for elt in elts:
+ iobs[elt]=i
+ i = i + 1
+
+ vals = {}
+ for key in iobs.keys():
+ vals[key] = lines[iobs[key]]
+
+ return elts,vals
+
+
+ # return
+ if columns == None:
+ return lines
+ else:
+ return lines.take(axis=0,indices=columns)
+
+
+
+
+
+
+
+
+def WriteParams(f,Mmin,Mmax,m_s,a_s,MetalFiles,HeliumCoreFile,elts,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n):
+
+
+ Mi2,Resi,Hcoi = ReadAndInterpolateHeliumCore(HeliumCoreFile,Mmin2,Mmax2,dM)
+
+
+ datai = {}
+ eltbs = []
+ for MetalFile in MetalFiles:
+ Mi1_f,datai_f,elts_f = ReadAndInterpolate(MetalFile,Mmin1,Mmax1,dM)
+
+ Mi1 = Mi1_f
+ for elt in elts_f:
+ eltbs.append(elt)
+ datai[elt] = datai_f[elt]
+
+
+ # check if we have an entry for Metals
+ try:
+ eltbs.index('Metals')
+ compute_metals=False
+ except ValueError:
+ compute_metals=True
+
+
+ # compute metals
+ # here, we sum the contribution of all elements
+ if compute_metals:
+ print "compute Metals :"
+ metals = zeros(len(Mi1))
+ for elt in eltbs:
+ print "add ",elt
+ metals = metals + datai[elt]
+ print "--------"
+ eltbs.append('Metals')
+ datai['Metals'] = metals
+
+
+ if elts==None:
+ elts=eltbs
+ else:
+ nelts = len(elts)
+ # create a new data and elts
+ dataif = {}
+ for elt in elts:
+
+ # check if exists
+ if datai.has_key(elt):
+ dataif[elt] = datai[elt]
+ else:
+ # try to find isotopes
+ dataiso = zeros(len(Mi1))
+ for key in datai.keys():
+ if key[:len(elt)] == elt:
+ dataiso = dataiso+datai[key]
+ print "add",key,"to",elt
+ dataif[elt] = dataiso
+
+ datai = dataif
+
+ ## check length of elts
+ if len(elts)!=nelts: # nelts-1 because metals is not present
+ raise "nelts(=%d) != len(elts)(=%d) !!!"%(nelts,len(elts))
+
+
+
+
+ # output steps
+ lStep1 = (log10(Mmax*1.25) - log10(Mmin1) )/float(n-1)
+ lStep2 = (log10(Mmax*1.25) - log10(Mmin2) )/float(n-1)
+ Ms1 = 10**(arange(n)*lStep1 + log10(Mmin1))
+ Ms2 = 10**(arange(n)*lStep2 + log10(Mmin2))
+
+ datas,Ress, Hcos = ComputeEjectats(Mi1,datai,elts, Mi2,Resi,Hcoi, Ms1,Ms2)
+ Idatas,IRess,IHcos = ComputeIntegrals(Mi1,datai,elts, Mi2,Resi,Hcoi ,Mmin,Mmax,m_s,a_s, Ms1,Ms2)
+
+
+
+ label = "#### Metal Parameters ####\n"
+
+ eltList = [ ("Ej",Ress,Mmin2,lStep2),("Ejnp",Hcos,Mmin2,lStep2) ]
+ for elt in elts:
+ eltList.append( (elt,datas[elt],Mmin1,lStep1) )
+ WriteOutput(f,label,eltList, n,nelts)
+
+
+ f.write("\n")
+
+ label = "#### Metal Ejecta Parameters ####\n"
+
+ eltList = [ ("IEj",IRess,Mmin2,lStep2),("IEjnp",IHcos,Mmin2,lStep2) ]
+ for elt in elts:
+ eltList.append( ("I%s"%elt,Idatas[elt],Mmin1,lStep1) )
+ WriteOutput(f,label,eltList, n,nelts)
+
+ return elts
+
+
+def WriteOutput(f,label,eltsList,n,nelts):
+
+
+ f.write(label)
+
+ f.write("\n# Number of points / Number of elements\n")
+ f.write("%d %d\n"%(n,nelts))
+
+
+ for elt,data,Mmin,lStep in eltsList:
+
+
+ f.write("\n# %s\n"%elt)
+ f.write("\n%g %g\n"%(Mmin,lStep))
+ for i in range(len(data)):
+ f.write("%e\n"%data[i])
+
+
+def ReadAndInterpolate(MetalFile,Mmin1,Mmax1,dM):
+
+ '''
+ Read data
+ and compute linear interpolation, using
+ Mmin1,dM
+ Mmin2,dM
+ '''
+
+
+ # read ejecta
+ elts,data = read_MetalFile(MetalFile,cchar='#')
+
+ # devide by mass ...
+ for elt in elts[1:]:
+ data[elt] = data[elt]/data['M']
+
+ # ... and remove mass from dict
+ M1 = data['M']
+ del data['M']
+ elts = elts[1:]
+
+
+ # linear interpolation
+ Mi1 = arange(Mmin1,Mmax1+dM,dM)
+
+ # interpolate elements
+ datai = {}
+ for elt in elts:
+ datai[elt] = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),data[elt].astype(float32))
+ datai[elt] = where(datai[elt]<=0,0,datai[elt])
+
+ return Mi1,datai,elts
+
+
+
+def ReadAndInterpolateHeliumCore(HeliumCoreFile,Mmin2,Mmax2,dM):
+
+ '''
+ Read data
+ and compute linear interpolation, using
+ Mmin1,dM
+ Mmin2,dM
+
+ return *i
+
+ '''
+
+ # read residual and helium core
+ M2,Res,Hco = pt.io.read_ascii(HeliumCoreFile,[0,1,2],skipheader=True,cchar='#')
+ Res = Res/M2
+ Hco = Hco/M2
+
+ # linear interpolation
+ Mi2 = arange(Mmin2,Mmax2+dM,dM)
+
+ # interpolate
+ # interpolate residual and helium core
+ Resi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Res.astype(float32))
+ Hcoi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Hco.astype(float32))
+ Resi = where(Resi<=0,0,Resi)
+ Hcoi = where(Hcoi<=0,0,Hcoi)
+
+ return Mi2,Resi,Hcoi
+
+
+
+
+
+
+def ComputeEjectats(Mi1,datai,elts, Mi2,Resi,Hcoi, Ms1,Ms2):
+
+ '''
+ From the interpolated values *i,
+ return interpolation of ejectats
+ '''
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ Ress = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Resi).astype(float32))
+ Hcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Hcoi).astype(float32))
+
+ datas = {}
+ for elt in elts:
+ datas[elt] = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),datai[elt].astype(float32))
+
+
+
+
+ return datas,Ress,Hcos
+
+
+
+
+
+
+
+def ComputeIntegrals(Mi1,datai,elts, Mi2,Resi,Hcoi, Mmin,Mmax,m_s,a_s, Ms1,Ms2):
+
+ '''
+ From the interpolated values *i,
+ integrate and return interpolation
+ '''
+
+ # imf
+ b_s = libimf.ComputeConstants(m_s,a_s,Mmin,Mmax)
+ imf1 = libimf.imfv(Mi1,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+ imf2 = libimf.imfv(Mi2,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+
+ Idata = {}
+ for elt in elts:
+ Idata[elt] = cumtrapz(imf1 * datai[elt],Mi1)
+
+
+ IRes = cumtrapz(imf2 * (1-Resi),Mi2)
+ IHco = cumtrapz(imf2 * (1-Hcoi),Mi2)
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ Idatas = {}
+ for elt in elts:
+ Idatas[elt] = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Idata[elt].astype(float32))
+
+ IRess = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IRes.astype(float32))
+ IHcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IHco.astype(float32))
+
+ return Idatas,IRess,IHcos
+
+
+
+
+
+
+
+
+
+
+def Plot():
+
+ ###############################################
+ # plot
+ ###############################################
+
+
+ # plot 1
+
+ pt.subplot(211)
+
+ pt.plot(M2,Res,'ko')
+ pt.plot(Mi2,Resi,'k-')
+
+ pt.plot(M2,Hco,'ro')
+ pt.plot(Mi2,Hcoi,'r-')
+
+
+ pt.plot(M1,Fe,'yo')
+ pt.plot(Mi1,Fei,'y-')
+
+ pt.plot(M1,Mg,'go')
+ pt.plot(Mi1,Mgi,'g-')
+
+ pt.plot(M1,Ox,'bo')
+ pt.plot(Mi1,Oxi,'b-')
+
+ pt.plot(M1,Me,'co')
+ pt.plot(Mi1,Mei,'c-')
+
+ pt.semilogx()
+ pt.semilogy()
+
+ pt.axis([Mmin,Mmax1,1e-4,1e0])
+
+ # plot 2
+
+ pt.subplot(212)
+
+
+ pt.plot(Mi1[1:],IFe*500,'y')
+ pt.plot(Mi1[1:],IMg*500,'g')
+ pt.plot(Mi1[1:],IOx*10,'b')
+ pt.plot(Mi1[1:],IMe*10,'c')
+ pt.plot(Mi2[1:],IRes,'k')
+ pt.plot(Mi2[1:],IHco,'r')
+
+ '''
+ pt.plot(Ms1,IFes*500,'o')
+ pt.plot(Ms1,IMgs*500,'o')
+ pt.plot(Ms1,IOxs*10 ,'o')
+ pt.plot(Ms1,IMes*10 ,'o')
+ pt.plot(Ms2,IRess,'o')
+ pt.plot(Ms2,IHcos,'o')
+ '''
+
+
+
+ pt.semilogx()
+ pt.axis([Mmin,Mmax1,0.,4*b])
+
+ pt.show()
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/plot.py b/PyChem/shared/tables/MetalSNII/plot.py
new file mode 100755
index 0000000..506f771
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/plot.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+
+
+import Ptools as pt
+
+M,Fe,Mg,Ox,Me = pt.io.read_ascii('MetalEjection.dat',[0,1,2,3,4],skipheader=True)
+
+M1,Res,Hco = pt.io.read_ascii('HeliumCore.dat',[0,1,2],skipheader=True)
+
+print Ox
+
+Fe = Fe/M
+Mg = Mg/M
+Ox = Ox/M
+Me = Me/M
+
+Res = Res/M1
+Hco = Hco/M1
+
+
+
+pt.plot(M,Fe,'y')
+pt.plot(M,Mg,'b')
+pt.plot(M,Ox,'g')
+pt.plot(M,Me,'c')
+
+pt.plot(M1,Res,'k')
+pt.plot(M1,Hco,'r')
+
+pt.plot(M,Fe,'yo')
+pt.plot(M,Mg,'bo')
+pt.plot(M,Ox,'go')
+pt.plot(M,Me,'co')
+
+pt.plot(M1,Res,'ko')
+pt.plot(M1,Hco,'ro')
+
+
+pt.semilogx()
+pt.semilogy()
+pt.axis([1e0,1e2,1e-4,1e0])
+
+pt.show()
diff --git a/PyChem/shared/tables/MetalSNII/plot_P.py b/PyChem/shared/tables/MetalSNII/plot_P.py
new file mode 100644
index 0000000..11a8816
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/plot_P.py
@@ -0,0 +1,290 @@
+#!/usr/bin/env python
+
+import string
+from numpy import *
+import sys
+import pylab as pl
+
+import libtreeasph
+
+import Ptools as pt
+
+
+unit_length = 1.0
+unit_mass = 1.e10
+u_lt = -log10( 4.7287e11*sqrt(unit_length**3/unit_mass))
+
+NbElement=4
+
+feedback_energy = 1.1682615e13*(unit_length/unit_mass**2) # Energy released by each supernova by solar mass (10^(51)erg (in TREEASPH units))
+# UnitLength_in_cm = 3.085e+21
+# UnitMass_in_g = 1.989e+43
+# UnitTime_in_s = 148849920000000.0
+# feedback_energy = 10**51 /UnitMass_in_g * (UnitTime_in_s/UnitLength_in_cm)**2
+
+
+
+def read_chemistry(file):
+
+
+ f = open(file)
+
+ ######################
+ # Livetime
+ ######################
+
+ f.readline()
+ f.readline()
+ coeff_z1 = array(string.split(f.readline()))
+ coeff_z2 = array(string.split(f.readline()))
+ coeff_z3 = array(string.split(f.readline()))
+
+ coeff_z = concatenate( (coeff_z1,coeff_z2,coeff_z3))
+ coeff_z.shape = (3,3)
+ coeff_z = coeff_z.astype(float)
+
+ # Conversion into program time unit
+ coeff_z[3-1,3-1] = coeff_z[3-1,3-1] + u_lt
+
+ # Transform log(timelive) polynomial expression log(t) = a(z) log(m)^2 + b(z) log(m) + c(z)
+ # into log(t) = a(z) log(m)^2 + 2b(z) log(m) + c(z)
+ coeff_z[2-1,:] = coeff_z[2-1,:] / 2.0
+
+
+ ######################
+ # Mass interval
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Mmin = float(f.readline())
+ Mmax = float(f.readline())
+
+ LogMmax2 = log10(Mmax)
+ TwoLogMmax = 2.0 * LogMmax2
+ LogMmax2 = LogMmax2**2
+
+ ######################
+ # IMFs Power
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ PowSN1 = float(f.readline())
+ PowSN2 = float(f.readline())
+
+
+ ######################
+ # Mass Parameters for SNe Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Msn1 = array(string.split(f.readline()))
+ Msn2 = array(string.split(f.readline()))
+ Msn3 = array(string.split(f.readline()))
+
+ Msn = concatenate( (Msn1,Msn2,Msn3))
+ Msn.shape = (3,2)
+ Msn = Msn.astype(float)
+
+ f.readline()
+ Mco = float(f.readline()) / unit_mass
+
+ ######################
+ # b Parameters for SNIa Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ b1 = float(f.readline())
+ b2 = float(f.readline())
+
+ ConstSN = array([0,0,0],float)
+ ConstSN[3-1] = (1.0+PowSN1)/(Mmax**(1.0+PowSN1)-Mmin**(1.0+PowSN1))
+ ConstSN[1-1] = (1.0+PowSN2)/(Msn[1-1,2-1]**(1.0+PowSN2)-Msn[1-1,1-1]**(1.0+PowSN2))
+ ConstSN[2-1] = (1.0+PowSN2)/(Msn[2-1,2-1]**(1.0+PowSN2)-Msn[2-1,1-1]**(1.0+PowSN2))
+ ConstSN[1-1] = b1*ConstSN[1-1]*ConstSN[3-1]
+ ConstSN[2-1] = b2*ConstSN[2-1]*ConstSN[3-1]
+
+
+
+ ######################
+ # Array size and step
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ ChemArraySize = int(f.readline())
+
+
+ ######################
+ # >>>Matter<<<< ejection and Helium core
+ ######################
+
+ ArrayOrigin = array([0,0],float)
+ ArrayStep = array([0,0],float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ line = array(string.split(f.readline()))
+
+ ArrayOrigin[p] = float(line[0])
+ ArrayStep[p] = float(line[1])
+
+ ArrayOrigin = log10(ArrayOrigin)
+
+ ######################
+ # Matter ejection for IMF power x=-1.35
+ # Integral (( 1 - Helium core )*m^x) for IMF power x=-1.35
+ ######################
+
+ '''
+ ChemArray[:,0] metal
+ ChemArray[:,1] Fe
+ ChemArray[:,2] Mg
+ ChemArray[:,3] Ox
+
+ ChemArray[:,4] Matter ejection
+ ChemArray[:,5] Integral (( 1 - Helium core )*m^x)
+ '''
+
+
+ ChemArray = zeros((110,NbElement+2),float)
+ MIa = zeros(NbElement,float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+
+ for j in xrange(ChemArraySize):
+
+ ChemArray[j,NbElement+p] = float(f.readline()) * ConstSN[3-1]
+
+
+
+ #########################
+ # Number of elements ####
+ #########################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ nelt = int(f.readline())
+
+ if nelt != NbElement:
+ raise "nelt != NbElement"
+
+
+ #########################
+ # Global metals ejection for IMF power x=-1.35
+ #########################
+
+ for p in xrange(NbElement):
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ for j in xrange(ChemArraySize):
+ ChemArray[j,p] = float(f.readline()) * ConstSN[3-1]
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ MIa[p] = float(f.readline())
+ MIa[p] = MIa[p] / unit_mass
+
+
+
+
+ ConstSN[1-1] = ( ConstSN[1-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[2-1] = ( ConstSN[2-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[3-1] = ( ConstSN[3-1]/PowSN1 ) * unit_mass
+
+ return coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa
+
+
+
+
+
+coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa = read_chemistry('chimie.dat')
+
+'''
+ChemArray[:,0] metal
+ChemArray[:,1] Fe
+ChemArray[:,2] Mg
+ChemArray[:,3] Ox
+
+ChemArray[:,4] Matter ejection
+ChemArray[:,5] Integral (( 1 - Helium core )*m^x)
+'''
+
+
+#b = 0.13466316207
+#ChemArray = ChemArray/b
+
+n = len(ChemArray)
+n = 106
+
+
+IFe = ChemArray[0:n,1]
+IMg = ChemArray[0:n:,2]
+IOx = ChemArray[0:n:,3]
+IMe = ChemArray[0:n:,0]
+
+IRes = ChemArray[0:n:,4]
+IHco = ChemArray[0:n:,5]
+
+M1 = 10**( ArrayOrigin[0]+ arange(n)*ArrayStep[0] )
+M2 = 10**( ArrayOrigin[1]+ arange(n)*ArrayStep[1] )
+
+print ArrayStep[0]
+
+
+pt.plot(M1,IRes)
+pt.plot(M1,IHco)
+
+pt.plot(M2,IFe*500)
+pt.plot(M2,IMg*500)
+pt.plot(M2,IOx*10)
+pt.plot(M2,IMe*10)
+
+pt.semilogx()
+
+pt.show()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/plot_both.py b/PyChem/shared/tables/MetalSNII/plot_both.py
new file mode 100644
index 0000000..63c4c34
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/plot_both.py
@@ -0,0 +1,334 @@
+#!/usr/bin/env python
+
+import string
+from numpy import *
+import sys
+import pylab as pl
+
+import libtreeasph
+import libmetalsSNII
+
+import Ptools as pt
+
+
+unit_length = 1.0
+unit_mass = 1.e10
+u_lt = -log10( 4.7287e11*sqrt(unit_length**3/unit_mass))
+
+NbElement=4
+
+feedback_energy = 1.1682615e13*(unit_length/unit_mass**2) # Energy released by each supernova by solar mass (10^(51)erg (in TREEASPH units))
+# UnitLength_in_cm = 3.085e+21
+# UnitMass_in_g = 1.989e+43
+# UnitTime_in_s = 148849920000000.0
+# feedback_energy = 10**51 /UnitMass_in_g * (UnitTime_in_s/UnitLength_in_cm)**2
+
+
+
+def read_chemistry(file):
+
+
+ f = open(file)
+
+ ######################
+ # Livetime
+ ######################
+
+ f.readline()
+ f.readline()
+ coeff_z1 = array(string.split(f.readline()))
+ coeff_z2 = array(string.split(f.readline()))
+ coeff_z3 = array(string.split(f.readline()))
+
+ coeff_z = concatenate( (coeff_z1,coeff_z2,coeff_z3))
+ coeff_z.shape = (3,3)
+ coeff_z = coeff_z.astype(float)
+
+ # Conversion into program time unit
+ coeff_z[3-1,3-1] = coeff_z[3-1,3-1] + u_lt
+
+ # Transform log(timelive) polynomial expression log(t) = a(z) log(m)^2 + b(z) log(m) + c(z)
+ # into log(t) = a(z) log(m)^2 + 2b(z) log(m) + c(z)
+ coeff_z[2-1,:] = coeff_z[2-1,:] / 2.0
+
+
+ ######################
+ # Mass interval
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Mmin = float(f.readline())
+ Mmax = float(f.readline())
+
+ LogMmax2 = log10(Mmax)
+ TwoLogMmax = 2.0 * LogMmax2
+ LogMmax2 = LogMmax2**2
+
+ ######################
+ # IMFs Power
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ PowSN1 = float(f.readline())
+ PowSN2 = float(f.readline())
+
+
+ ######################
+ # Mass Parameters for SNe Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ Msn1 = array(string.split(f.readline()))
+ Msn2 = array(string.split(f.readline()))
+ Msn3 = array(string.split(f.readline()))
+
+ Msn = concatenate( (Msn1,Msn2,Msn3))
+ Msn.shape = (3,2)
+ Msn = Msn.astype(float)
+
+ f.readline()
+ Mco = float(f.readline()) / unit_mass
+
+ ######################
+ # b Parameters for SNIa Rates
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ b1 = float(f.readline())
+ b2 = float(f.readline())
+
+ ConstSN = array([0,0,0],float)
+ ConstSN[3-1] = (1.0+PowSN1)/(Mmax**(1.0+PowSN1)-Mmin**(1.0+PowSN1))
+ ConstSN[1-1] = (1.0+PowSN2)/(Msn[1-1,2-1]**(1.0+PowSN2)-Msn[1-1,1-1]**(1.0+PowSN2))
+ ConstSN[2-1] = (1.0+PowSN2)/(Msn[2-1,2-1]**(1.0+PowSN2)-Msn[2-1,1-1]**(1.0+PowSN2))
+ ConstSN[1-1] = b1*ConstSN[1-1]*ConstSN[3-1]
+ ConstSN[2-1] = b2*ConstSN[2-1]*ConstSN[3-1]
+
+
+
+ ######################
+ # Array size and step
+ ######################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ ChemArraySize = int(f.readline())
+
+
+ ######################
+ # >>>Matter<<<< ejection and Helium core
+ ######################
+
+ ArrayOrigin = array([0,0],float)
+ ArrayStep = array([0,0],float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ line = array(string.split(f.readline()))
+
+ ArrayOrigin[p] = float(line[0])
+ ArrayStep[p] = float(line[1])
+
+ ArrayOrigin = log10(ArrayOrigin)
+
+ ######################
+ # Matter ejection for IMF power x=-1.35
+ # Integral (( 1 - Helium core )*m^x) for IMF power x=-1.35
+ ######################
+
+ '''
+ ChemArray[:,0] metal
+ ChemArray[:,1] Fe
+ ChemArray[:,2] Mg
+ ChemArray[:,3] Ox
+
+ ChemArray[:,4] Matter ejection
+ ChemArray[:,5] Integral (( 1 - Helium core )*m^x)
+ '''
+
+
+ ChemArray = zeros((110,NbElement+2),float)
+ MIa = zeros(NbElement,float)
+
+ for p in [0,1]:
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+
+ for j in xrange(ChemArraySize):
+
+ ChemArray[j,NbElement+p] = float(f.readline()) * ConstSN[3-1]
+
+
+
+ #########################
+ # Number of elements ####
+ #########################
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ nelt = int(f.readline())
+
+ if nelt != NbElement:
+ raise "nelt != NbElement"
+
+
+ #########################
+ # Global metals ejection for IMF power x=-1.35
+ #########################
+
+ for p in xrange(NbElement):
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ for j in xrange(ChemArraySize):
+ ChemArray[j,p] = float(f.readline()) * ConstSN[3-1]
+
+ f.readline()
+ f.readline()
+ f.readline()
+
+ MIa[p] = float(f.readline())
+ MIa[p] = MIa[p] / unit_mass
+
+
+
+
+ ConstSN[1-1] = ( ConstSN[1-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[2-1] = ( ConstSN[2-1]/PowSN2/PowSN1 ) * unit_mass
+ ConstSN[3-1] = ( ConstSN[3-1]/PowSN1 ) * unit_mass
+
+ return coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa
+
+
+
+
+
+
+
+
+
+##################################
+# poirier
+##################################
+
+
+coeff_z,Mmin,Mmax,PowSN1,PowSN2,ConstSN,Msn,ArrayOrigin,ArrayStep,ChemArray,Mco,MIa = read_chemistry('chimie.dat')
+
+#b = 0.13466316207
+#ChemArray = ChemArray/b
+
+n = len(ChemArray)
+n = 106
+
+
+IFe = ChemArray[0:n,1] # Fe
+IMg = ChemArray[0:n:,2] # Mg
+IOx = ChemArray[0:n:,3] # Ox
+IMe = ChemArray[0:n:,0] # metal
+
+IRes = ChemArray[0:n:,4] # Matter ejection
+IHco = ChemArray[0:n:,5] # Integral (( 1 - Helium core )*m^x)
+
+M1 = 10**( ArrayOrigin[0]+ arange(n)*ArrayStep[0] )
+M2 = 10**( ArrayOrigin[1]+ arange(n)*ArrayStep[1] )
+
+
+##################################
+# yves
+##################################
+
+
+ChAr,PaAr = libmetalsSNII.Read('chemyves.dat')
+
+n = len(ChAr[0,:])
+
+j = 0
+MyRes = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyRes = ChAr[j]
+
+j = 1
+MyHco = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyHco = ChAr[j]
+
+j = 2
+MyFe = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyFe = ChAr[j]
+
+j = 3
+MyMg = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyMg = ChAr[j]
+
+j = 4
+MyOx = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyOx = ChAr[j]
+
+j = 5
+MyMe = 10**( log10(PaAr[j,0])+ arange(n)* PaAr[j,1] )
+IyMe = ChAr[j]
+
+##################################
+# plot
+##################################
+
+
+pt.plot(M1,IRes,'k')
+pt.plot(M1,IHco,'r')
+
+pt.plot(M2,IFe*500,'y')
+pt.plot(M2,IMg*500,'g')
+pt.plot(M2,IOx*10,'b')
+pt.plot(M2,IMe*10,'c')
+
+
+pt.plot(MyRes,IyRes,'k--')
+pt.plot(MyHco,IyHco,'r--')
+pt.plot(MyFe,IyFe*500,'y--')
+pt.plot(MyMg,IyMg*500,'g--')
+pt.plot(MyOx,IyOx*10,'b--')
+pt.plot(MyMe,IyMe*10,'c--')
+
+
+pt.semilogx()
+
+pt.show()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/sto.libmetalsSNII.py b/PyChem/shared/tables/MetalSNII/sto.libmetalsSNII.py
new file mode 100644
index 0000000..62254e4
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/sto.libmetalsSNII.py
@@ -0,0 +1,301 @@
+#!/usr/bin/env python
+
+import Ptools as pt
+from pNbody import myNumeric
+from numpy import *
+from scipy.integrate import cumtrapz
+
+import string
+
+import libimf
+
+
+def WriteParams(f,Mmin,Mmax,m_s,a_s,MetalFile,HeliumCoreFile,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n):
+
+ Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi = ReadAndInterpolate(MetalFile,HeliumCoreFile,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n)
+
+
+
+
+
+ # output steps
+ lStep1 = (log10(Mmax*1.25) - log10(Mmin1) )/float(n-1)
+ lStep2 = (log10(Mmax*1.25) - log10(Mmin2) )/float(n-1)
+ Ms1 = 10**(arange(n)*lStep1 + log10(Mmin1))
+ Ms2 = 10**(arange(n)*lStep2 + log10(Mmin2))
+
+
+ Ress, Hcos, Fes, Mgs, Oxs, Mes = ComputeEjectats(Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi, Ms1,Ms2)
+ IRess,IHcos,IFes,IMgs,IOxs,IMes = ComputeIntegrals(Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi ,Mmin,Mmax,m_s,a_s, Ms1,Ms2)
+
+
+
+ label = "#### Metal Parameters ####\n"
+
+ #WriteOutput(f,label,Ress, Hcos, Fes, Mgs, Oxs, Mes, n,nelts,Mmin1,lStep1,Mmin2,lStep2)
+ eltList = [ ("Re",Ress,Mmin2,lStep2),("Hc",Hcos,Mmin2,lStep2),("Fe",Fes,Mmin1,lStep1),("Mg",Mgs,Mmin1,lStep1),("Ox",Oxs,Mmin1,lStep1),("Me",Mes,Mmin1,lStep1) ]
+ WriteOutput2(f,label,eltList, n,nelts)
+
+
+ f.write("\n")
+
+ label = "#### Metal Ejecta Parameters ####\n"
+ #WriteOutput(f,label,IRess,IHcos,IFes,IMgs,IOxs,IMes,n,nelts,Mmin1,lStep1,Mmin2,lStep2)
+ eltList = [ ("IRe",IRess,Mmin2,lStep2),("IHc",IHcos,Mmin2,lStep2),("IFe",IFes,Mmin1,lStep1),("IMg",IMgs,Mmin1,lStep1),("IOx",IOxs,Mmin1,lStep1),("IMe",IMes,Mmin1,lStep1) ]
+ WriteOutput2(f,label,eltList, n,nelts)
+
+
+
+
+def WriteOutput(f,label,IRess,IHcos,IFes,IMgs,IOxs,IMes,n,nelts,Mmin1,lStep1,Mmin2,lStep2):
+
+
+ f.write(label)
+
+ f.write("\n# Number of points / Number of elements\n")
+ f.write("%d %d\n"%(n,nelts))
+
+ f.write("\n# Int ( 1- Residual ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin2,lStep2))
+ for i in range(len(IRess)):
+ f.write("%e\n"%IRess[i])
+
+ f.write("\n# Int ( 1- Helium Core ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin2,lStep2))
+ for i in range(len(IHcos)):
+ f.write("%e\n"%IHcos[i])
+
+ f.write("\n# Int ( Fe ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin1,lStep1))
+ for i in range(len(IFes)):
+ f.write("%e\n"%IFes[i])
+
+ f.write("\n# Int ( Mg ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin1,lStep1))
+ for i in range(len(IMgs)):
+ f.write("%e\n"%IMgs[i])
+
+ f.write("\n# Int ( O ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin1,lStep1))
+ for i in range(len(IOxs)):
+ f.write("%e\n"%IOxs[i])
+
+ f.write("\n# Int ( Metals ) m^a\n")
+ f.write("\n%g %g\n"%(Mmin1,lStep1))
+ for i in range(len(IMes)):
+ f.write("%e\n"%IMes[i])
+
+
+def WriteOutput2(f,label,eltsList,n,nelts):
+
+
+ f.write(label)
+
+ f.write("\n# Number of points / Number of elements\n")
+ f.write("%d %d\n"%(n,nelts))
+
+
+ for elt,data,Mmin,lStep in eltsList:
+
+
+ f.write("\n# %s\n"%elt)
+ f.write("\n%g %g\n"%(Mmin,lStep))
+ for i in range(len(data)):
+ f.write("%e\n"%data[i])
+
+
+def ReadAndInterpolate(MetalFile,HeliumCoreFile,nelts,Mmin1,Mmax1,Mmin2,Mmax2,dM,n):
+
+ '''
+ Read data
+ and compute linear interpolation, using
+ Mmin1,dM
+ Mmin2,dM
+
+ return *i
+
+ '''
+
+ # read ejecta
+ M1,Fe,Mg,Ox,Me = pt.io.read_ascii(MetalFile,[0,1,2,3,4],skipheader=True,cchar='#')
+ Fe = Fe/M1
+ Mg = Mg/M1
+ Ox = Ox/M1
+ Me = Me/M1
+
+
+ # read residual and helium core
+ M2,Res,Hco = pt.io.read_ascii(HeliumCoreFile,[0,1,2],skipheader=True,cchar='#')
+ Res = Res/M2
+ Hco = Hco/M2
+
+ # linear interpolation
+ Mi1 = arange(Mmin1,Mmax1+dM,dM)
+ Mi2 = arange(Mmin2,Mmax2+dM,dM)
+
+ # interpolate
+ Fei = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Fe.astype(float32))
+ Mgi = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Mg.astype(float32))
+ Oxi = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Ox.astype(float32))
+ Mei = myNumeric.lininterp1d(Mi1.astype(float32),M1.astype(float32),Me.astype(float32))
+
+ Resi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Res.astype(float32))
+ Hcoi = myNumeric.lininterp1d(Mi2.astype(float32),M2.astype(float32),Hco.astype(float32))
+
+ Fei = where(Fei<=0,0,Fei)
+ Mgi = where(Mgi<=0,0,Mgi)
+ Oxi = where(Oxi<=0,0,Oxi)
+ Mei = where(Mei<=0,0,Mei)
+
+ Resi = where(Resi<=0,0,Resi)
+ Hcoi = where(Hcoi<=0,0,Hcoi)
+
+ return Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi
+
+
+
+
+
+
+
+
+def ComputeEjectats(Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi, Ms1,Ms2):
+
+ '''
+ From the interpolated values *i,
+ return interpolation of ejectats
+ '''
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ Fes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Fei.astype(float32))
+ Mgs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Mgi.astype(float32))
+ Oxs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Oxi.astype(float32))
+ Mes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),Mei.astype(float32))
+
+ Ress = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Resi).astype(float32))
+ Hcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),(1-Hcoi).astype(float32))
+
+ return Ress,Hcos,Fes,Mgs,Oxs,Mes
+
+
+
+
+
+
+
+def ComputeIntegrals(Mi1,Fei,Mgi,Oxi,Mei, Mi2,Resi,Hcoi, Mmin,Mmax,m_s,a_s, Ms1,Ms2):
+
+ '''
+ From the interpolated values *i,
+ integrate and return interpolation
+ '''
+
+ # imf
+ b_s = libimf.ComputeConstants(m_s,a_s,Mmin,Mmax)
+ imf1 = libimf.imfv(Mi1,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+ imf2 = libimf.imfv(Mi2,array(m_s),array(a_s),array(b_s),Mmin,Mmax)
+
+ IFe = cumtrapz(imf1 * Fei,Mi1)
+ IMg = cumtrapz(imf1 * Mgi,Mi1)
+ IOx = cumtrapz(imf1 * Oxi,Mi1)
+ IMe = cumtrapz(imf1 * Mei,Mi1)
+
+ IRes = cumtrapz(imf2 * (1-Resi),Mi2)
+ IHco = cumtrapz(imf2 * (1-Hcoi),Mi2)
+
+
+ ###############################################
+ # output
+ ###############################################
+
+ IFes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IFe.astype(float32))
+ IMgs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IMg.astype(float32))
+ IOxs = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IOx.astype(float32))
+ IMes = myNumeric.lininterp1d(Ms1.astype(float32),Mi1.astype(float32),IMe.astype(float32))
+
+ IRess = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IRes.astype(float32))
+ IHcos = myNumeric.lininterp1d(Ms2.astype(float32),Mi2.astype(float32),IHco.astype(float32))
+
+ return IRess,IHcos,IFes,IMgs,IOxs,IMes
+
+
+
+
+
+
+
+
+
+
+def Plot():
+
+ ###############################################
+ # plot
+ ###############################################
+
+
+ # plot 1
+
+ pt.subplot(211)
+
+ pt.plot(M2,Res,'ko')
+ pt.plot(Mi2,Resi,'k-')
+
+ pt.plot(M2,Hco,'ro')
+ pt.plot(Mi2,Hcoi,'r-')
+
+
+ pt.plot(M1,Fe,'yo')
+ pt.plot(Mi1,Fei,'y-')
+
+ pt.plot(M1,Mg,'go')
+ pt.plot(Mi1,Mgi,'g-')
+
+ pt.plot(M1,Ox,'bo')
+ pt.plot(Mi1,Oxi,'b-')
+
+ pt.plot(M1,Me,'co')
+ pt.plot(Mi1,Mei,'c-')
+
+ pt.semilogx()
+ pt.semilogy()
+
+ pt.axis([Mmin,Mmax1,1e-4,1e0])
+
+ # plot 2
+
+ pt.subplot(212)
+
+
+ pt.plot(Mi1[1:],IFe*500,'y')
+ pt.plot(Mi1[1:],IMg*500,'g')
+ pt.plot(Mi1[1:],IOx*10,'b')
+ pt.plot(Mi1[1:],IMe*10,'c')
+ pt.plot(Mi2[1:],IRes,'k')
+ pt.plot(Mi2[1:],IHco,'r')
+
+ '''
+ pt.plot(Ms1,IFes*500,'o')
+ pt.plot(Ms1,IMgs*500,'o')
+ pt.plot(Ms1,IOxs*10 ,'o')
+ pt.plot(Ms1,IMes*10 ,'o')
+ pt.plot(Ms2,IRess,'o')
+ pt.plot(Ms2,IHcos,'o')
+ '''
+
+
+
+ pt.semilogx()
+ pt.axis([Mmin,Mmax1,0.,4*b])
+
+ pt.show()
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNII/tsujimoto95.pdf b/PyChem/shared/tables/MetalSNII/tsujimoto95.pdf
new file mode 100644
index 0000000..02f631c
Binary files /dev/null and b/PyChem/shared/tables/MetalSNII/tsujimoto95.pdf differ
diff --git a/PyChem/shared/tables/MetalSNII/woosley95.pdf b/PyChem/shared/tables/MetalSNII/woosley95.pdf
new file mode 100644
index 0000000..188922f
Binary files /dev/null and b/PyChem/shared/tables/MetalSNII/woosley95.pdf differ
diff --git a/PyChem/shared/tables/MetalSNII/woosley95.txt b/PyChem/shared/tables/MetalSNII/woosley95.txt
new file mode 100644
index 0000000..a0f65f9
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/woosley95.txt
@@ -0,0 +1,14 @@
+# M QQ52 QQ53 QQ54 QQ55 QQ56 QQ57 QQ58 QQ59 QQ60
+10 0 0 0 0 0 0 0 0 0
+11 2.54e-4 9.12e-6 1.53e-3 1.47e-5 1.11e-2 3.08e-4 7.28e-5 1.10e-5 8.78e-6
+12 4.58e-4 1.89e-5 2.97e-3 1.05e-4 1.22e-2 3.46e-4 8.80e-5 1.80e-6 2.91e-6
+13 8.69e-4 4.44e-5 4.33e-3 4.19e-5 1.28e-2 3.72e-4 1.59e-4 7.04e-5 1.05e-4
+15 1.42e-3 7.83e-5 7.59e-3 7.93e-5 1.47e-2 4.68e-4 3.08e-4 5.15e-5 2.66e-5
+18 1.59e-3 1.00e-4 8.77e-3 7.45e-5 1.71e-2 6.47e-4 5.36e-4 8.21e-5 2.54e-5
+19 2.54e-3 1.42e-4 1.32e-2 1.37e-4 1.77e-2 6.32e-4 4.46e-4 9.62e-5 4.69e-5
+20 2.62e-3 1.22e-4 1.27e-2 1.38e-4 1.83e-2 6.29e-4 3.94e-4 4.08e-5 1.12e-5
+22 3.24e-3 1.39e-4 1.52e-2 1.92e-4 1.97e-2 7.59e-4 6.27e-4 1.01e-4 5.19e-5
+25 1.93e-3 1.85e-5 1.64e-2 4.25e-4 2.19e-2 9.05e-4 9.22e-4 8.52e-5 2.10e-5
+30 1.62e-12 4.09e-10 1.49e-3 1.25e-5 2.50e-2 9.98e-4 9.92e-4 3.97e-5 1.88e-5
+35 3.13e-13 4.59e-10 1.65e-3 2.58e-5 2.77e-2 1.17e-3 9.16e-4 5.46e-5 2.51e-5
+40 1.02e-13 4.27e-10 1.67e-3 3.76e-5 2.83e-2 1.27e-3 8.79e-4 9.62e-5 3.09e-5
diff --git a/PyChem/shared/tables/MetalSNII/yields_tsujimoto95.txt b/PyChem/shared/tables/MetalSNII/yields_tsujimoto95.txt
new file mode 100644
index 0000000..cd15967
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/yields_tsujimoto95.txt
@@ -0,0 +1,67 @@
+Species 13 15 18 20 25 40 70
+C12 2.68E-03 8.26E-02 1.65E-01 1.14E-01 1.48E-01 1.48E-01 4.67E-01
+C13 9.47E-09 4.97E-10 7.73E-10 1.17E-10 1.03E-08 3.02E-10 2.57E-10
+N14 3.75E-08 5.37E-03 3.39E-03 2.72E-03 9.53E-04 7.08E-05 7.68E-03
+N15 2.08E-08 1.36E-10 9.05E-08 6.48E-10 1.04E-08 1.19E-08 2.36E-10
+O16 1.51E-01 3.55E-01 7.92E-01 1.48E+00 2.99E+00 9.11E+00 2.14E+01
+O17 6.07E-08 4.41E-09 4.01E-07 9.86E-09 7.86E-08 3.13E-07 6.64E-10
+O18 9.44E-09 1.35E-02 8.67E-03 8.68E-03 6.69E-03 1.79E-06 3.80E-03
+F19 8.06E-10 2.12E-11 7.67E-09 7.84E-11 8.17E-10 7.38E-10 2.63E-15
+Ne20 2.25E-02 2.08E-02 1.61E-01 2.29E-01 5.94E-01 6.58E-01 2.00E+00
+Ne21 2.08E-04 3.93E-05 2.19E-03 3.03E-04 3.22E-03 2.36E-03 1.14E-02
+Ne22 1.01E-04 1.25E-02 2.74E-02 2.93E-02 3.39E-02 5.66E-02 5.23E-02
+Na23 7.27E-04 1.53E-04 7.25E-03 1.15E-03 1.81E-02 2.37E-02 6.98E-02
+Mg24 9.23E-03 3.16E-02 3.62E-02 1.47E-01 1.59E-01 3.54E-01 7.87E-01
+Mg25 1.38E-03 2.55E-03 7.54E-03 1.85E-02 3.92E-02 4.81E-02 1.01E-01
+Mg26 8.96E-04 2.03E-03 5.94E-03 1.74E-02 3.17E-02 1.07E-01 2.91E-01
+Al27 1.04E-03 4.01E-03 5.44E-03 1.55E-02 1.95E-02 8.05E-02 1.44E-01
+Si28 6.68E-02 7.16E-02 8.69E-02 8.50E-02 1.03E-01 4.29E-01 7.55E-01
+Si29 7.99E-04 3.25E-03 1.76E-03 9.80E-03 6.97E-03 5.43E-02 1.08E-01
+Si30 1.87E-03 4.04E-03 3.33E-03 7.19E-03 6.81E-03 4.32E-02 1.00E-01
+P31 2.95E-04 6.55E-04 4.11E-04 1.05E-03 9.02E-04 5.99E-03 2.57E-02
+S32 1.46E-02 3.01E-02 3.76E-02 2.29E-02 3.84E-02 1.77E-01 2.05E-01
+S33 1.19E-04 9.60E-05 1.48E-04 8.84E-05 2.20E-04 7.49E-04 1.02E-03
+S34 1.83E-03 1.49E-03 1.89E-03 1.26E-03 2.77E-03 1.14E-02 1.98E-02
+S36 3.04E-07 3.34E-07 8.08E-07 4.23E-07 7.51E-07 1.40E-05 2.17E-06
+Cl35 3.70E-05 3.45E-05 8.95E-05 6.05E-05 6.72E-05 4.75E-04 1.76E-03
+Cl37 6.73E-06 9.60E-06 1.04E-05 4.96E-06 1.32E-05 1.17E-04 1.01E-04
+Ar36 2.36E-03 5.63E-03 6.13E-03 3.78E-03 6.71E-03 3.11E-02 2.92E-02
+Ar38 4.85E-04 6.49E-04 6.29E-04 3.25E-04 7.24E-04 9.14E-03 6.16E-03
+Ar40 4.82E-09 3.24E-09 1.42E-08 4.65E-09 8.92E-09 1.74E-07 5.07E-08
+K39 1.95E-05 3.31E-05 3.66E-05 3.24E-05 3.47E-05 3.83E-04 3.84E-04
+K41 1.42E-06 2.37E-06 2.23E-06 1.28E-06 2.79E-06 3.43E-05 2.84E-05
+Ca40 2.53E-03 5.29E-03 5.11E-03 3.25E-03 6.15E-03 2.56E-02 2.14E-02
+Ca42 1.02E-05 1.63E-05 1.45E-05 9.45E-06 1.77E-05 3.13E-04 1.64E-04
+Ca43 1.91E-06 1.30E-06 3.99E-07 3.38E-06 2.78E-07 4.02E-07 4.09E-06
+Ca44 1.22E-04 7.49E-05 1.43E-05 9.15E-05 2.11E-05 2.00E-05 2.97E-04
+Ca46 2.06E-10 6.23E-11 3.23E-11 1.12E-11 2.60E-10 4.39E-10 2.23E-10
+Ca48 1.13E-13 3.99E-16 1.07E-15 2.41E-16 1.70E-14 2.48E-13 2.36E-14
+Sc45 4.26E-08 7.44E-08 1.18E-07 1.04E-07 8.96E-08 1.53E-06 2.78E-06
+Ti46 2.56E-06 6.26E-06 6.72E-06 6.81E-06 6.84E-06 3.56E-05 1.44E-05
+Ti47 5.13E-06 3.75E-06 3.11E-07 1.73E-06 9.11E-07 9.74E-07 6.26E-07
+Ti48 1.68E-04 1.58E-04 8.59E-05 1.85E-04 8.98E-05 1.58E-04 1.42E-04
+Ti49 3.45E-06 6.10E-06 7.54E-06 4.89E-06 6.01E-06 2.17E-05 6.97E-06
+Ti50 3.56E-10 1.21E-09 1.17E-10 1.12E-10 5.90E-10 2.00E-10 2.56E-10
+V50 8.65E-10 8.57E-10 4.64E-10 2.15E-10 7.99E-10 2.14E-09 1.52E-09
+V51 9.34E-06 1.25E-05 1.25E-05 6.40E-06 9.96E-06 2.73E-05 1.15E-05
+Cr50 2.30E-05 5.15E-05 7.49E-05 3.54E-05 5.01E-05 1.49E-04 1.01E-04
+Cr52 1.15E-03 1.36E-03 1.44E-03 8.64E-04 1.31E-03 2.77E-03 6.86E-04
+Cr53 9.34E-05 1.35E-04 1.50E-04 7.12E-05 1.39E-04 3.56E-04 1.00E-04
+Cr54 3.35E-08 4.09E-08 2.53E-08 6.26E-09 2.41E-08 2.81E-08 7.61E-08
+Mn55 3.65E-04 4.74E-04 5.48E-04 2.27E-04 5.02E-04 8.41E-04 3.64E-04
+Fe54 2.10E-03 4.49E-03 6.04E-03 2.52E-03 4.81E-03 9.17E-03 5.81E-03
+Fe56 1.50E-01 1.44E-01 7.57E-02 7.32E-02 5.24E-02 7.50E-02 7.50E-02
+Fe57 4.86E-03 4.90E-03 2.17E-03 3.07E-03 1.16E-03 2.29E-03 3.83E-03
+Fe58 3.93E-09 1.27E-08 1.37E-08 3.70E-09 8.34E-09 1.29E-08 4.17E-08
+Co59 1.39E-04 1.22E-04 4.82E-05 1.31E-04 2.19E-05 2.51E-05 1.59E-04
+Ni58 5.82E-03 7.50E-03 3.08E-03 3.71E-03 1.33E-03 3.31E-03 9.25E-03
+Ni60 3.72E-03 3.36E-03 8.71E-04 2.18E-03 6.67E-04 3.88E-04 1.77E-03
+Ni61 1.58E-04 1.43E-04 4.77E-05 1.59E-04 2.75E-05 2.57E-05 1.55E-04
+Ni62 1.05E-03 9.50E-04 2.52E-04 7.26E-04 1.70E-04 1.11E-04 1.28E-03
+Ni64 2.02E-15 4.28E-15 2.93E-16 2.06E-15 6.08E-15 6.49E-16 4.33E-12
+Cu63 1.18E-06 1.01E-06 4.32E-07 3.00E-06 1.50E-07 1.62E-07 9.09E-06
+Cu65 9.11E-07 7.17E-07 8.40E-08 7.02E-07 1.42E-07 1.89E-08 5.34E-07
+Zn64 2.14E-05 1.99E-05 3.89E-06 1.78E-05 3.10E-06 8.79E-07 1.02E-05
+Zn66 1.63E-05 1.30E-05 4.47E-06 2.08E-05 2.58E-06 9.99E-07 3.09E-05
+Zn67 2.13E-08 1.54E-08 3.39E-09 6.39E-08 2.95E-09 2.51E-10 1.95E-07
+Zn68 6.63E-09 7.35E-09 8.36E-10 5.33E-09 9.29E-10 1.20E-10 9.51E-08
diff --git a/PyChem/shared/tables/MetalSNII/yields_tsujimoto95bis.txt b/PyChem/shared/tables/MetalSNII/yields_tsujimoto95bis.txt
new file mode 100644
index 0000000..48f851d
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNII/yields_tsujimoto95bis.txt
@@ -0,0 +1,9 @@
+# M C12 C13 N14 N15 O16 O17 O18 F19 Ne20 Ne21 Ne22 Na23 Mg24 Mg25 Mg26 Al27 Si28 Si29 Si30 P31 S32 S33 S34 S36 Cl35 Cl37 Ar36 Ar38 Ar40 K39 K41 Ca40 Ca42 Ca43 Ca44 Ca46 Ca48 Sc45 Ti46 Ti47 Ti48 Ti49 Ti50 V50 V51 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Co59 Ni58 Ni60 Ni61 Ni62 Ni64 Cu63 Cu65 Zn64 Zn66 Zn67 Zn68
+10 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00 0.00E-00
+13 2.68E-03 9.47E-09 3.75E-08 2.08E-08 1.51E-01 6.07E-08 9.44E-09 8.06E-10 2.25E-02 2.08E-04 1.01E-04 7.27E-04 9.23E-03 1.38E-03 8.96E-04 1.04E-03 6.68E-02 7.99E-04 1.87E-03 2.95E-04 1.46E-02 1.19E-04 1.83E-03 3.04E-07 3.70E-05 6.73E-06 2.36E-03 4.85E-04 4.82E-09 1.95E-05 1.42E-06 2.53E-03 1.02E-05 1.91E-06 1.22E-04 2.06E-10 1.13E-13 4.26E-08 2.56E-06 5.13E-06 1.68E-04 3.45E-06 3.56E-10 8.65E-10 9.34E-06 2.30E-05 1.15E-03 9.34E-05 3.35E-08 3.65E-04 2.10E-03 1.50E-01 4.86E-03 3.93E-09 1.39E-04 5.82E-03 3.72E-03 1.58E-04 1.05E-03 2.02E-15 1.18E-06 9.11E-07 2.14E-05 1.63E-05 2.13E-08 6.63E-09
+15 8.26E-02 4.97E-10 5.37E-03 1.36E-10 3.55E-01 4.41E-09 1.35E-02 2.12E-11 2.08E-02 3.93E-05 1.25E-02 1.53E-04 3.16E-02 2.55E-03 2.03E-03 4.01E-03 7.16E-02 3.25E-03 4.04E-03 6.55E-04 3.01E-02 9.60E-05 1.49E-03 3.34E-07 3.45E-05 9.60E-06 5.63E-03 6.49E-04 3.24E-09 3.31E-05 2.37E-06 5.29E-03 1.63E-05 1.30E-06 7.49E-05 6.23E-11 3.99E-16 7.44E-08 6.26E-06 3.75E-06 1.58E-04 6.10E-06 1.21E-09 8.57E-10 1.25E-05 5.15E-05 1.36E-03 1.35E-04 4.09E-08 4.74E-04 4.49E-03 1.44E-01 4.90E-03 1.27E-08 1.22E-04 7.50E-03 3.36E-03 1.43E-04 9.50E-04 4.28E-15 1.01E-06 7.17E-07 1.99E-05 1.30E-05 1.54E-08 7.35E-09
+18 1.65E-01 7.73E-10 3.39E-03 9.05E-08 7.92E-01 4.01E-07 8.67E-03 7.67E-09 1.61E-01 2.19E-03 2.74E-02 7.25E-03 3.62E-02 7.54E-03 5.94E-03 5.44E-03 8.69E-02 1.76E-03 3.33E-03 4.11E-04 3.76E-02 1.48E-04 1.89E-03 8.08E-07 8.95E-05 1.04E-05 6.13E-03 6.29E-04 1.42E-08 3.66E-05 2.23E-06 5.11E-03 1.45E-05 3.99E-07 1.43E-05 3.23E-11 1.07E-15 1.18E-07 6.72E-06 3.11E-07 8.59E-05 7.54E-06 1.17E-10 4.64E-10 1.25E-05 7.49E-05 1.44E-03 1.50E-04 2.53E-08 5.48E-04 6.04E-03 7.57E-02 2.17E-03 1.37E-08 4.82E-05 3.08E-03 8.71E-04 4.77E-05 2.52E-04 2.93E-16 4.32E-07 8.40E-08 3.89E-06 4.47E-06 3.39E-09 8.36E-10
+20 1.14E-01 1.17E-10 2.72E-03 6.48E-10 1.48E+00 9.86E-09 8.68E-03 7.84E-11 2.29E-01 3.03E-04 2.93E-02 1.15E-03 1.47E-01 1.85E-02 1.74E-02 1.55E-02 8.50E-02 9.80E-03 7.19E-03 1.05E-03 2.29E-02 8.84E-05 1.26E-03 4.23E-07 6.05E-05 4.96E-06 3.78E-03 3.25E-04 4.65E-09 3.24E-05 1.28E-06 3.25E-03 9.45E-06 3.38E-06 9.15E-05 1.12E-11 2.41E-16 1.04E-07 6.81E-06 1.73E-06 1.85E-04 4.89E-06 1.12E-10 2.15E-10 6.40E-06 3.54E-05 8.64E-04 7.12E-05 6.26E-09 2.27E-04 2.52E-03 7.32E-02 3.07E-03 3.70E-09 1.31E-04 3.71E-03 2.18E-03 1.59E-04 7.26E-04 2.06E-15 3.00E-06 7.02E-07 1.78E-05 2.08E-05 6.39E-08 5.33E-09
+25 1.48E-01 1.03E-08 9.53E-04 1.04E-08 2.99E+00 7.86E-08 6.69E-03 8.17E-10 5.94E-01 3.22E-03 3.39E-02 1.81E-02 1.59E-01 3.92E-02 3.17E-02 1.95E-02 1.03E-01 6.97E-03 6.81E-03 9.02E-04 3.84E-02 2.20E-04 2.77E-03 7.51E-07 6.72E-05 1.32E-05 6.71E-03 7.24E-04 8.92E-09 3.47E-05 2.79E-06 6.15E-03 1.77E-05 2.78E-07 2.11E-05 2.60E-10 1.70E-14 8.96E-08 6.84E-06 9.11E-07 8.98E-05 6.01E-06 5.90E-10 7.99E-10 9.96E-06 5.01E-05 1.31E-03 1.39E-04 2.41E-08 5.02E-04 4.81E-03 5.24E-02 1.16E-03 8.34E-09 2.19E-05 1.33E-03 6.67E-04 2.75E-05 1.70E-04 6.08E-15 1.50E-07 1.42E-07 3.10E-06 2.58E-06 2.95E-09 9.29E-10
+40 1.48E-01 3.02E-10 7.08E-05 1.19E-08 9.11E+00 3.13E-07 1.79E-06 7.38E-10 6.58E-01 2.36E-03 5.66E-02 2.37E-02 3.54E-01 4.81E-02 1.07E-01 8.05E-02 4.29E-01 5.43E-02 4.32E-02 5.99E-03 1.77E-01 7.49E-04 1.14E-02 1.40E-05 4.75E-04 1.17E-04 3.11E-02 9.14E-03 1.74E-07 3.83E-04 3.43E-05 2.56E-02 3.13E-04 4.02E-07 2.00E-05 4.39E-10 2.48E-13 1.53E-06 3.56E-05 9.74E-07 1.58E-04 2.17E-05 2.00E-10 2.14E-09 2.73E-05 1.49E-04 2.77E-03 3.56E-04 2.81E-08 8.41E-04 9.17E-03 7.50E-02 2.29E-03 1.29E-08 2.51E-05 3.31E-03 3.88E-04 2.57E-05 1.11E-04 6.49E-16 1.62E-07 1.89E-08 8.79E-07 9.99E-07 2.51E-10 1.20E-10
+70 4.67E-01 2.57E-10 7.68E-03 2.36E-10 2.14E+01 6.64E-10 3.80E-03 2.63E-15 2.00E+00 1.14E-02 5.23E-02 6.98E-02 7.87E-01 1.01E-01 2.91E-01 1.44E-01 7.55E-01 1.08E-01 1.00E-01 2.57E-02 2.05E-01 1.02E-03 1.98E-02 2.17E-06 1.76E-03 1.01E-04 2.92E-02 6.16E-03 5.07E-08 3.84E-04 2.84E-05 2.14E-02 1.64E-04 4.09E-06 2.97E-04 2.23E-10 2.36E-14 2.78E-06 1.44E-05 6.26E-07 1.42E-04 6.97E-06 2.56E-10 1.52E-09 1.15E-05 1.01E-04 6.86E-04 1.00E-04 7.61E-08 3.64E-04 5.81E-03 7.50E-02 3.83E-03 4.17E-08 1.59E-04 9.25E-03 1.77E-03 1.55E-04 1.28E-03 4.33E-12 9.09E-06 5.34E-07 1.02E-05 3.09E-05 1.95E-07 9.51E-08
diff --git a/PyChem/shared/tables/MetalSNIa/.svn/all-wcprops b/PyChem/shared/tables/MetalSNIa/.svn/all-wcprops
new file mode 100644
index 0000000..7bd2e7e
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/.svn/all-wcprops
@@ -0,0 +1,35 @@
+K 25
+svn:wc:ra_dav:version-url
+V 35
+/svn/chemistry/!svn/ver/2/MetalSNIa
+END
+convert_yields.py
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/svn/chemistry/!svn/ver/2/MetalSNIa/convert_yields.py
+END
+yields_SNIa_tsujimoto95bis.txt
+K 25
+svn:wc:ra_dav:version-url
+V 66
+/svn/chemistry/!svn/ver/2/MetalSNIa/yields_SNIa_tsujimoto95bis.txt
+END
+yields_SNIa_tsujimoto95.txt
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/chemistry/!svn/ver/2/MetalSNIa/yields_SNIa_tsujimoto95.txt
+END
+Readme
+K 25
+svn:wc:ra_dav:version-url
+V 42
+/svn/chemistry/!svn/ver/2/MetalSNIa/Readme
+END
+libmetalsSNIa.py
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/chemistry/!svn/ver/2/MetalSNIa/libmetalsSNIa.py
+END
diff --git a/PyChem/shared/tables/MetalSNIa/.svn/entries b/PyChem/shared/tables/MetalSNIa/.svn/entries
new file mode 100644
index 0000000..220aa91
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/.svn/entries
@@ -0,0 +1,198 @@
+10
+
+dir
+2
+https://svn.epfl.ch/svn/chemistry/MetalSNIa
+https://svn.epfl.ch/svn/chemistry
+
+
+
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3206ecf2-eaf6-43ec-8d24-0b1ce831b07a
+
+convert_yields.py
+file
+
+
+
+
+2011-06-11T17:22:26.777215Z
+aff1f99c46999bbd90a089c28c643175
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+764
+
+yields_SNIa_tsujimoto95bis.txt
+file
+
+
+
+
+2011-06-11T17:22:26.949523Z
+335adb55f02ec07b2734a37ee5caa5d2
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1020
+
+yields_SNIa_tsujimoto95.txt
+file
+
+
+
+
+2011-06-11T17:22:27.103889Z
+0b4261a232720c196255e88f9f71a070
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1174
+
+Readme
+file
+
+
+
+
+2011-06-11T17:22:27.253649Z
+9495798e1cd9b733df39354d71c91e8a
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+114
+
+libmetalsSNIa.py
+file
+
+
+
+
+2011-06-11T17:22:27.403741Z
+632e82ba77d53160c38eb4a44dd51ce7
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3027
+
diff --git a/PyChem/shared/tables/MetalSNIa/.svn/prop-base/convert_yields.py.svn-base b/PyChem/shared/tables/MetalSNIa/.svn/prop-base/convert_yields.py.svn-base
new file mode 100644
index 0000000..a669705
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/.svn/prop-base/convert_yields.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
diff --git a/PyChem/shared/tables/MetalSNIa/.svn/text-base/Readme.svn-base b/PyChem/shared/tables/MetalSNIa/.svn/text-base/Readme.svn-base
new file mode 100644
index 0000000..90c2de9
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/.svn/text-base/Readme.svn-base
@@ -0,0 +1,5 @@
+# Ba et Eu ajouté à la main...
+
+./convert_yields.py yields_SNIa_tsujimoto95.txt yields_SNIa_tsujimoto95bis.txt
+
+
diff --git a/PyChem/shared/tables/MetalSNIa/.svn/text-base/convert_yields.py.svn-base b/PyChem/shared/tables/MetalSNIa/.svn/text-base/convert_yields.py.svn-base
new file mode 100644
index 0000000..2b9e359
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/.svn/text-base/convert_yields.py.svn-base
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+import sys,string
+from numpy import *
+
+file1 = sys.argv[1]
+file2 = sys.argv[2]
+
+
+f = open(file1,'r')
+lines = f.readlines()
+f.close()
+
+
+data = array([])
+
+for line in lines:
+ line = string.split(line)
+ data = concatenate((data,array(line)))
+
+data.shape = (len(lines),len(data)/len(lines))
+
+data[0,0] = '# %s'%data[0,0]
+
+f = open(file2,'w')
+
+# header
+f.write("%s\t\t"%data[0,0])
+
+for j in xrange(1,data.shape[0]):
+ f.write("%s\t\t"%data[j,0])
+f.write("%s\t\t"%'Metals') # metals
+f.write("\n")
+
+
+
+for i in xrange(1,data.shape[1]):
+ f.write("%s\t"%data[0,i])
+
+ for j in xrange(1,data.shape[0]):
+ f.write("%s\t"%data[j,i])
+ s = sum(data[:,i].astype(float))
+ f.write("%8.2E\t"%s) # metals
+ f.write("\n")
+
+
+f.close()
diff --git a/PyChem/shared/tables/MetalSNIa/.svn/text-base/libmetalsSNIa.py.svn-base b/PyChem/shared/tables/MetalSNIa/.svn/text-base/libmetalsSNIa.py.svn-base
new file mode 100644
index 0000000..b175eed
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/.svn/text-base/libmetalsSNIa.py.svn-base
@@ -0,0 +1,166 @@
+
+from numpy import *
+import sys,types,string
+
+
+#####################################################
+def read_MetalFile(file,columns=None,lines=None,dtype=float,skipheader=False,cchar='#'):
+#####################################################
+ """[X,Y,Z] = READ('FILE',[1,4,13],lines=[10,1000])
+ Read columns 1,4 and 13 from 'FILE' from line 10 to 1000
+ into array X,Y and Z
+
+ file is either fd or name file
+
+ """
+
+ def RemoveComments(l):
+ if l[0]==cchar:
+ return None
+ else:
+ return l
+
+ def toNumList(l):
+ return map(dtype,l)
+
+ if type(file) != types.FileType:
+ f = open(file,'r')
+ else:
+ f = file
+
+
+ # read header while there is one
+ while 1:
+ fpos = f.tell()
+ header = f.readline()
+ if header[0] != cchar:
+ f.seek(fpos)
+ header = None
+ break
+ else:
+ if skipheader:
+ header = None
+ else:
+ # create dict from header
+ header = string.strip(header[2:])
+ elts = string.split(header)
+ break
+
+
+ # now, read the file content
+ lines = f.readlines()
+
+ # remove trailing
+ lines = map(string.strip, lines)
+
+
+ # remove comments
+ #lines = map(RemoveComments, lines)
+
+ # split
+ lines = map(string.split, lines)
+
+ # convert into float
+ lines = map(toNumList, lines)
+
+ # convert into array
+ lines = array(map(array, lines))
+
+ # transpose
+ lines = transpose(lines)
+
+ if header != None:
+ iobs = {}
+ i = 0
+ for elt in elts:
+ iobs[elt]=i
+ i = i + 1
+
+ vals = {}
+ for key in iobs.keys():
+ vals[key] = lines[iobs[key]]
+
+ return elts,vals
+
+
+ # return
+ if columns == None:
+ return lines
+ else:
+ return lines.take(axis=0,indices=columns)
+
+
+
+
+
+
+def WriteParams(f,SNIaFile,MeanWDMass,elts,nelts):
+
+ # read ejecta
+ eltbs,datai = read_MetalFile(SNIaFile,[0,1,2,3],skipheader=False,cchar='#')
+
+
+ if elts==None:
+ elts=eltbs
+ data = datai
+ else:
+ nelts = len(elts)
+ # create a new data and elts
+ dataif = {}
+ for elt in elts:
+
+ # check if exists
+ if datai.has_key(elt):
+ dataif[elt] = datai[elt]
+ else:
+ # try to find isotopes
+ dataiso = zeros(1)
+ for key in datai.keys():
+ if key[:len(elt)] == elt:
+ dataiso = dataiso+datai[key]
+ print "add",key,"to",elt
+ dataif[elt] = dataiso
+
+ data = dataif
+
+
+ # check length of elts
+ if len(elts)!=nelts:
+ raise "nelts(=%d) != len(elts)(=%d) !!!"%(nelts,len(elts))
+
+
+
+ f.write("\n")
+ f.write("# Mean WD Mass\n")
+ f.write("\n")
+ f.write("%f\n"%MeanWDMass)
+ f.write("\n")
+ f.write("# SNIa Metal Ejection\n")
+ f.write("\n")
+ f.write("# Number of elements\n")
+ f.write("%d\n"%nelts)
+ f.write("\n")
+
+ f.write("# Ej\n")
+ f.write("0.0\n")
+ f.write("\n")
+
+ f.write("# Ejnp\n")
+ f.write("0.0\n")
+ f.write("\n")
+
+
+ for elt in elts:
+ f.write("# %s\n"%elt)
+ f.write("%e\n"%data[elt])
+ f.write("\n")
+
+
+ return elts
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNIa/.svn/text-base/yields_SNIa_tsujimoto95.txt.svn-base b/PyChem/shared/tables/MetalSNIa/.svn/text-base/yields_SNIa_tsujimoto95.txt.svn-base
new file mode 100644
index 0000000..e958c61
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/.svn/text-base/yields_SNIa_tsujimoto95.txt.svn-base
@@ -0,0 +1,68 @@
+C12 4.83E-02
+C13 1.40E-06
+N14 1.16E-06
+N15 1.32E-09
+O16 1.43E-01
+O17 3.54E-08
+O18 8.25E-10
+F19 5.67E-10
+Ne20 2.02E-03
+Ne21 8.46E-06
+Ne22 2.49E-03
+Na23 6.32E-05
+Mg24 8.50E-03
+Mg25 4.05E-05
+Mg26 3.18E-05
+Al27 9.86E-04
+Si28 1.50E-01
+Si29 8.61E-04
+Si30 1.74E-03
+P31 4.18E-04
+S32 8.41E-02
+S33 4.50E-04
+S34 1.90E-03
+S36 3.15E-07
+Cl35 1.34E-04
+Cl37 3.98E-05
+Ar36 1.49E-02
+Ar38 1.06E-03
+Ar40 1.26E-08
+K39 8.52E-05
+K41 7.44E-06
+Ca40 1.23E-02
+Ca42 3.52E-05
+Ca43 1.03E-07
+Ca44 8.86E-06
+Ca46 1.99E-09
+Ca48 7.10E-12
+Sc45 2.47E-07
+Ti46 1.71E-05
+Ti47 6.04E-07
+Ti48 2.03E-04
+Ti49 1.69E-05
+Ti50 1.26E-05
+V50 8.28E-09
+V51 5.15E-05
+Cr50 2.71E-04
+Cr52 5.15E-03
+Cr53 7.85E-04
+Cr54 1.90E-04
+Mn55 8.23E-03
+Fe54 1.04E-01
+Fe56 6.13E-01
+Fe57 2.55E-02
+Fe58 9.63E-04
+Co59 1.02E-03
+Ni58 1.28E-01
+Ni60 1.05E-02
+Ni61 2.51E-04
+Ni62 2.66E-03
+Ni64 1.31E-06
+Cu63 1.79E-06
+Cu65 6.83E-07
+Zn64 1.22E-05
+Zn66 2.12E-05
+Zn67 1.34E-08
+Zn68 1.02E-08
+Ba 0.00E-00
+Eu 0.00E-00
diff --git a/PyChem/shared/tables/MetalSNIa/.svn/text-base/yields_SNIa_tsujimoto95bis.txt.svn-base b/PyChem/shared/tables/MetalSNIa/.svn/text-base/yields_SNIa_tsujimoto95bis.txt.svn-base
new file mode 100644
index 0000000..cb8ca24
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/.svn/text-base/yields_SNIa_tsujimoto95bis.txt.svn-base
@@ -0,0 +1,2 @@
+# C12 C13 N14 N15 O16 O17 O18 F19 Ne20 Ne21 Ne22 Na23 Mg24 Mg25 Mg26 Al27 Si28 Si29 Si30 P31 S32 S33 S34 S36 Cl35 Cl37 Ar36 Ar38 Ar40 K39 K41 Ca40 Ca42 Ca43 Ca44 Ca46 Ca48 Sc45 Ti46 Ti47 Ti48 Ti49 Ti50 V50 V51 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Co59 Ni58 Ni60 Ni61 Ni62 Ni64 Cu63 Cu65 Zn64 Zn66 Zn67 Zn68 Ba Eu Metals
+4.83E-02 1.40E-06 1.16E-06 1.32E-09 1.43E-01 3.54E-08 8.25E-10 5.67E-10 2.02E-03 8.46E-06 2.49E-03 6.32E-05 8.50E-03 4.05E-05 3.18E-05 9.86E-04 1.50E-01 8.61E-04 1.74E-03 4.18E-04 8.41E-02 4.50E-04 1.90E-03 3.15E-07 1.34E-04 3.98E-05 1.49E-02 1.06E-03 1.26E-08 8.52E-05 7.44E-06 1.23E-02 3.52E-05 1.03E-07 8.86E-06 1.99E-09 7.10E-12 2.47E-07 1.71E-05 6.04E-07 2.03E-04 1.69E-05 1.26E-05 8.28E-09 5.15E-05 2.71E-04 5.15E-03 7.85E-04 1.90E-04 8.23E-03 1.04E-01 6.13E-01 2.55E-02 9.63E-04 1.02E-03 1.28E-01 1.05E-02 2.51E-04 2.66E-03 1.31E-06 1.79E-06 6.83E-07 1.22E-05 2.12E-05 1.34E-08 1.02E-08 0.00E-00 0.00E-00 1.37E+00
diff --git a/PyChem/shared/tables/MetalSNIa/Readme b/PyChem/shared/tables/MetalSNIa/Readme
new file mode 100644
index 0000000..90c2de9
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/Readme
@@ -0,0 +1,5 @@
+# Ba et Eu ajouté à la main...
+
+./convert_yields.py yields_SNIa_tsujimoto95.txt yields_SNIa_tsujimoto95bis.txt
+
+
diff --git a/PyChem/shared/tables/MetalSNIa/convert_yields.py b/PyChem/shared/tables/MetalSNIa/convert_yields.py
new file mode 100755
index 0000000..2b9e359
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/convert_yields.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+import sys,string
+from numpy import *
+
+file1 = sys.argv[1]
+file2 = sys.argv[2]
+
+
+f = open(file1,'r')
+lines = f.readlines()
+f.close()
+
+
+data = array([])
+
+for line in lines:
+ line = string.split(line)
+ data = concatenate((data,array(line)))
+
+data.shape = (len(lines),len(data)/len(lines))
+
+data[0,0] = '# %s'%data[0,0]
+
+f = open(file2,'w')
+
+# header
+f.write("%s\t\t"%data[0,0])
+
+for j in xrange(1,data.shape[0]):
+ f.write("%s\t\t"%data[j,0])
+f.write("%s\t\t"%'Metals') # metals
+f.write("\n")
+
+
+
+for i in xrange(1,data.shape[1]):
+ f.write("%s\t"%data[0,i])
+
+ for j in xrange(1,data.shape[0]):
+ f.write("%s\t"%data[j,i])
+ s = sum(data[:,i].astype(float))
+ f.write("%8.2E\t"%s) # metals
+ f.write("\n")
+
+
+f.close()
diff --git a/PyChem/shared/tables/MetalSNIa/libmetalsSNIa.py b/PyChem/shared/tables/MetalSNIa/libmetalsSNIa.py
new file mode 100644
index 0000000..b175eed
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/libmetalsSNIa.py
@@ -0,0 +1,166 @@
+
+from numpy import *
+import sys,types,string
+
+
+#####################################################
+def read_MetalFile(file,columns=None,lines=None,dtype=float,skipheader=False,cchar='#'):
+#####################################################
+ """[X,Y,Z] = READ('FILE',[1,4,13],lines=[10,1000])
+ Read columns 1,4 and 13 from 'FILE' from line 10 to 1000
+ into array X,Y and Z
+
+ file is either fd or name file
+
+ """
+
+ def RemoveComments(l):
+ if l[0]==cchar:
+ return None
+ else:
+ return l
+
+ def toNumList(l):
+ return map(dtype,l)
+
+ if type(file) != types.FileType:
+ f = open(file,'r')
+ else:
+ f = file
+
+
+ # read header while there is one
+ while 1:
+ fpos = f.tell()
+ header = f.readline()
+ if header[0] != cchar:
+ f.seek(fpos)
+ header = None
+ break
+ else:
+ if skipheader:
+ header = None
+ else:
+ # create dict from header
+ header = string.strip(header[2:])
+ elts = string.split(header)
+ break
+
+
+ # now, read the file content
+ lines = f.readlines()
+
+ # remove trailing
+ lines = map(string.strip, lines)
+
+
+ # remove comments
+ #lines = map(RemoveComments, lines)
+
+ # split
+ lines = map(string.split, lines)
+
+ # convert into float
+ lines = map(toNumList, lines)
+
+ # convert into array
+ lines = array(map(array, lines))
+
+ # transpose
+ lines = transpose(lines)
+
+ if header != None:
+ iobs = {}
+ i = 0
+ for elt in elts:
+ iobs[elt]=i
+ i = i + 1
+
+ vals = {}
+ for key in iobs.keys():
+ vals[key] = lines[iobs[key]]
+
+ return elts,vals
+
+
+ # return
+ if columns == None:
+ return lines
+ else:
+ return lines.take(axis=0,indices=columns)
+
+
+
+
+
+
+def WriteParams(f,SNIaFile,MeanWDMass,elts,nelts):
+
+ # read ejecta
+ eltbs,datai = read_MetalFile(SNIaFile,[0,1,2,3],skipheader=False,cchar='#')
+
+
+ if elts==None:
+ elts=eltbs
+ data = datai
+ else:
+ nelts = len(elts)
+ # create a new data and elts
+ dataif = {}
+ for elt in elts:
+
+ # check if exists
+ if datai.has_key(elt):
+ dataif[elt] = datai[elt]
+ else:
+ # try to find isotopes
+ dataiso = zeros(1)
+ for key in datai.keys():
+ if key[:len(elt)] == elt:
+ dataiso = dataiso+datai[key]
+ print "add",key,"to",elt
+ dataif[elt] = dataiso
+
+ data = dataif
+
+
+ # check length of elts
+ if len(elts)!=nelts:
+ raise "nelts(=%d) != len(elts)(=%d) !!!"%(nelts,len(elts))
+
+
+
+ f.write("\n")
+ f.write("# Mean WD Mass\n")
+ f.write("\n")
+ f.write("%f\n"%MeanWDMass)
+ f.write("\n")
+ f.write("# SNIa Metal Ejection\n")
+ f.write("\n")
+ f.write("# Number of elements\n")
+ f.write("%d\n"%nelts)
+ f.write("\n")
+
+ f.write("# Ej\n")
+ f.write("0.0\n")
+ f.write("\n")
+
+ f.write("# Ejnp\n")
+ f.write("0.0\n")
+ f.write("\n")
+
+
+ for elt in elts:
+ f.write("# %s\n"%elt)
+ f.write("%e\n"%data[elt])
+ f.write("\n")
+
+
+ return elts
+
+
+
+
+
+
+
diff --git a/PyChem/shared/tables/MetalSNIa/yields_SNIa_tsujimoto95.txt b/PyChem/shared/tables/MetalSNIa/yields_SNIa_tsujimoto95.txt
new file mode 100644
index 0000000..e958c61
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/yields_SNIa_tsujimoto95.txt
@@ -0,0 +1,68 @@
+C12 4.83E-02
+C13 1.40E-06
+N14 1.16E-06
+N15 1.32E-09
+O16 1.43E-01
+O17 3.54E-08
+O18 8.25E-10
+F19 5.67E-10
+Ne20 2.02E-03
+Ne21 8.46E-06
+Ne22 2.49E-03
+Na23 6.32E-05
+Mg24 8.50E-03
+Mg25 4.05E-05
+Mg26 3.18E-05
+Al27 9.86E-04
+Si28 1.50E-01
+Si29 8.61E-04
+Si30 1.74E-03
+P31 4.18E-04
+S32 8.41E-02
+S33 4.50E-04
+S34 1.90E-03
+S36 3.15E-07
+Cl35 1.34E-04
+Cl37 3.98E-05
+Ar36 1.49E-02
+Ar38 1.06E-03
+Ar40 1.26E-08
+K39 8.52E-05
+K41 7.44E-06
+Ca40 1.23E-02
+Ca42 3.52E-05
+Ca43 1.03E-07
+Ca44 8.86E-06
+Ca46 1.99E-09
+Ca48 7.10E-12
+Sc45 2.47E-07
+Ti46 1.71E-05
+Ti47 6.04E-07
+Ti48 2.03E-04
+Ti49 1.69E-05
+Ti50 1.26E-05
+V50 8.28E-09
+V51 5.15E-05
+Cr50 2.71E-04
+Cr52 5.15E-03
+Cr53 7.85E-04
+Cr54 1.90E-04
+Mn55 8.23E-03
+Fe54 1.04E-01
+Fe56 6.13E-01
+Fe57 2.55E-02
+Fe58 9.63E-04
+Co59 1.02E-03
+Ni58 1.28E-01
+Ni60 1.05E-02
+Ni61 2.51E-04
+Ni62 2.66E-03
+Ni64 1.31E-06
+Cu63 1.79E-06
+Cu65 6.83E-07
+Zn64 1.22E-05
+Zn66 2.12E-05
+Zn67 1.34E-08
+Zn68 1.02E-08
+Ba 0.00E-00
+Eu 0.00E-00
diff --git a/PyChem/shared/tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt b/PyChem/shared/tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt
new file mode 100644
index 0000000..cb8ca24
--- /dev/null
+++ b/PyChem/shared/tables/MetalSNIa/yields_SNIa_tsujimoto95bis.txt
@@ -0,0 +1,2 @@
+# C12 C13 N14 N15 O16 O17 O18 F19 Ne20 Ne21 Ne22 Na23 Mg24 Mg25 Mg26 Al27 Si28 Si29 Si30 P31 S32 S33 S34 S36 Cl35 Cl37 Ar36 Ar38 Ar40 K39 K41 Ca40 Ca42 Ca43 Ca44 Ca46 Ca48 Sc45 Ti46 Ti47 Ti48 Ti49 Ti50 V50 V51 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Co59 Ni58 Ni60 Ni61 Ni62 Ni64 Cu63 Cu65 Zn64 Zn66 Zn67 Zn68 Ba Eu Metals
+4.83E-02 1.40E-06 1.16E-06 1.32E-09 1.43E-01 3.54E-08 8.25E-10 5.67E-10 2.02E-03 8.46E-06 2.49E-03 6.32E-05 8.50E-03 4.05E-05 3.18E-05 9.86E-04 1.50E-01 8.61E-04 1.74E-03 4.18E-04 8.41E-02 4.50E-04 1.90E-03 3.15E-07 1.34E-04 3.98E-05 1.49E-02 1.06E-03 1.26E-08 8.52E-05 7.44E-06 1.23E-02 3.52E-05 1.03E-07 8.86E-06 1.99E-09 7.10E-12 2.47E-07 1.71E-05 6.04E-07 2.03E-04 1.69E-05 1.26E-05 8.28E-09 5.15E-05 2.71E-04 5.15E-03 7.85E-04 1.90E-04 8.23E-03 1.04E-01 6.13E-01 2.55E-02 9.63E-04 1.02E-03 1.28E-01 1.05E-02 2.51E-04 2.66E-03 1.31E-06 1.79E-06 6.83E-07 1.22E-05 2.12E-05 1.34E-08 1.02E-08 0.00E-00 0.00E-00 1.37E+00
diff --git a/PyChem/shared/tables/SNIa/SNIaEjection.dat b/PyChem/shared/tables/SNIa/SNIaEjection.dat
new file mode 100644
index 0000000..99b7820
--- /dev/null
+++ b/PyChem/shared/tables/SNIa/SNIaEjection.dat
@@ -0,0 +1,2 @@
+# Fe56 Mg24 O16 Metals
+6.13e-1 8.5e-3 1.43e-1 1.3743
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/all-wcprops b/PyChem/shared/tables/SolarAbundances/.svn/all-wcprops
new file mode 100644
index 0000000..3c7897e
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/all-wcprops
@@ -0,0 +1,47 @@
+K 25
+svn:wc:ra_dav:version-url
+V 41
+/svn/chemistry/!svn/ver/2/SolarAbundances
+END
+Grevesse98.txt
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svn/chemistry/!svn/ver/2/SolarAbundances/Grevesse98.txt
+END
+libSolarAbundances.py
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/chemistry/!svn/ver/2/SolarAbundances/libSolarAbundances.py
+END
+plot.py
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/svn/chemistry/!svn/ver/2/SolarAbundances/plot.py
+END
+test.py
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/svn/chemistry/!svn/ver/2/SolarAbundances/test.py
+END
+index.html
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/chemistry/!svn/ver/2/SolarAbundances/index.html
+END
+grevesse98.pdf
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svn/chemistry/!svn/ver/2/SolarAbundances/grevesse98.pdf
+END
+Readme
+K 25
+svn:wc:ra_dav:version-url
+V 48
+/svn/chemistry/!svn/ver/2/SolarAbundances/Readme
+END
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/entries b/PyChem/shared/tables/SolarAbundances/.svn/entries
new file mode 100644
index 0000000..576d757
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/entries
@@ -0,0 +1,266 @@
+10
+
+dir
+2
+https://svn.epfl.ch/svn/chemistry/SolarAbundances
+https://svn.epfl.ch/svn/chemistry
+
+
+
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3206ecf2-eaf6-43ec-8d24-0b1ce831b07a
+
+Grevesse98.txt
+file
+
+
+
+
+2011-06-11T17:21:40.274588Z
+5d4278194a9b93b611afd2af011af446
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2019
+
+libSolarAbundances.py
+file
+
+
+
+
+2011-06-11T17:21:40.408741Z
+5190ed97fb6da9afdef6e0c37bf21d44
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1519
+
+plot.py
+file
+
+
+
+
+2011-06-11T17:21:40.593375Z
+0d744466a21e75df8fe71e6df8894a3a
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+271
+
+test.py
+file
+
+
+
+
+2011-06-11T17:21:40.948467Z
+95397849a2268952842f179b7dc6cec9
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+553
+
+index.html
+file
+
+
+
+
+2011-06-11T17:21:41.345785Z
+c3c30d455d15e1e5cb40989d7b86da0c
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5711
+
+grevesse98.pdf
+file
+
+
+
+
+2011-06-11T17:21:41.616234Z
+4627922916a8a972349013c6fe321c26
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+665779
+
+Readme
+file
+
+
+
+
+2011-06-11T17:21:41.775923Z
+56efad5d2e410c8998b1d726cae92fa0
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+355
+
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/prop-base/plot.py.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/prop-base/plot.py.svn-base
new file mode 100644
index 0000000..a669705
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/prop-base/plot.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/prop-base/test.py.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/prop-base/test.py.svn-base
new file mode 100644
index 0000000..a669705
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/prop-base/test.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/text-base/Grevesse98.txt.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/text-base/Grevesse98.txt.svn-base
new file mode 100644
index 0000000..9acafe5
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/text-base/Grevesse98.txt.svn-base
@@ -0,0 +1,84 @@
+# Z Elt X A Flag
+01 H 12.00 1.00797 0
+02 He 10.93 4.0026 0
+03 Li 1.10 6.941 0
+04 Be 1.40 9.0122 0
+05 B 2.55 10.811 0
+06 C 8.52 12.01115 0
+07 N 7.92 14.0067 0
+08 O 8.83 15.9994 0
+09 F 4.56 18.9984 0
+10 Ne 8.08 20.183 0
+11 Na 6.33 22.9898 0
+12 Mg 7.58 24.312 0
+13 Al 6.47 26.9815 0
+14 Si 7.55 28.086 0
+15 P 5.45 30.9738 0
+16 S 7.33 32.064 0
+17 Cl 5.50 35.453 0
+18 Ar 6.40 39.948 0
+19 K 5.12 39.098 0
+20 Ca 6.36 40.08 0
+21 Sc 3.17 44.956 0
+22 Ti 5.02 47.90 0
+23 V 4.00 50.942 0
+24 Cr 5.67 51.996 0
+25 Mn 5.39 54.938 0
+26 Fe 7.50 55.847 0
+27 Co 4.92 58.9332 0
+28 Ni 6.25 58.71 0
+29 Cu 4.21 63.546 0
+30 Zn 4.60 65.38 0
+31 Ga 2.88 69.72 0
+32 Ge 3.41 72.59 0
+33 As 2.37 74.9216 1
+34 Se 3.41 78.96 1
+35 Br 2.63 79.904 1
+36 Kr 3.31 83.80 1
+37 Rb 2.60 85.47 0
+38 Sr 2.97 87.62 0
+39 Y 2.24 88.905 0
+40 Zr 2.60 91.22 0
+41 Nb 1.42 92.906 0
+42 Mo 1.92 95.94 0
+44 Ru 1.84 101.07 0
+45 Rh 1.12 102.905 0
+46 Pd 1.69 106.4 0
+47 Ag 0.94 107.868 0
+48 Cd 1.77 112.41 0
+49 In 1.66 114.82 0
+50 Sn 2.00 118.69 0
+51 Sb 1.00 121.75 0
+52 Te 2.24 127.60 1
+53 I 1.51 126.904 1
+54 Xe 2.17 131.30 1
+55 Cs 1.13 132.905 1
+56 Ba 2.13 137.34 0
+57 La 1.17 138.91 0
+58 Ce 1.58 140.12 0
+59 Pr 0.71 140.907 0
+60 Nd 1.50 144.24 0
+62 Sm 1.01 150.35 0
+63 Eu 0.51 151.96 0
+64 Gd 1.12 157.25 0
+65 Tb 0.35 158.924 1
+66 Dy 1.14 162.50 0
+67 Ho 0.26 164.930 0
+68 Er 0.93 167.28 0
+69 Tm 0.00 168.934 0
+70 Yb 1.08 173.04 0
+71 Lu 0.06 174.97 0
+72 Hf 0.88 178.49 0
+73 Ta -0.13 180.948 1
+74 W 1.11 183.85 0
+75 Re 0.28 186.2 1
+76 Os 1.45 190.2 0
+77 Ir 1.35 192.2 0
+78 Pt 1.80 195.09 0
+79 Au 1.01 196.967 0
+80 Hg 1.13 200.59 1
+81 Tl 0.90 204.37 0
+82 Pb 1.95 207.19 0
+83 Bi 0.71 208.98 1
+90 Th 0.09 232.038 1
+92 U -0.47 238.03 0
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/text-base/Readme.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/text-base/Readme.svn-base
new file mode 100644
index 0000000..90aa4f6
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/text-base/Readme.svn-base
@@ -0,0 +1,11 @@
+table from
+Grevesse, N., & Sauval, A. J. 1998, Space Sci. Rev., 85, 161
+
+where Flag=1, X = X of Meteorites
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!! Li has a strange value, no ? (should be ~3 instead of 1.1) !!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+-------------------------------------------
+
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/text-base/grevesse98.pdf.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/text-base/grevesse98.pdf.svn-base
new file mode 100644
index 0000000..098b305
Binary files /dev/null and b/PyChem/shared/tables/SolarAbundances/.svn/text-base/grevesse98.pdf.svn-base differ
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/text-base/index.html.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/text-base/index.html.svn-base
new file mode 100644
index 0000000..558cbbf
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/text-base/index.html.svn-base
@@ -0,0 +1,63 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>ASCII Periodic Table of the Elements</title>
+<meta http-equiv="content-type" content="text/html; charset=us-ascii">
+<meta name="description" content="ASCII periodic table of the elements is available in 6 languages (German, English, French, Croatian, Italian, and Spanish) in plain ASCII text.">
+<meta name="keywords" content="ascii, periodic, table, elements, enig">
+<meta name="url" content="http://www.periodni.com">
+<meta name="author" content="Eni Generalic, Faculty of Chemistry and Technology, Split, Croatia">
+<meta http-equiv="reply-to" content="eni.generalic@gmail.com">
+<meta name="copyright" content="Copyright &copy; 2010 Eni Generalic, All Rights Reserved">
+<link rel="shortcut icon" href="../../slike/pse.ico">
+
+</head>
+<body>
+
+<center>
+<font size="+3">PERIODIC TABLE OF THE ELEMENTS</font><br>
+
+<pre>
+ __________________________________________________________________________
+| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
+| |
+|1 <a href="h.html">H </a> <a href="he.html">He</a> |
+| |
+|2 <a href="li.html">Li</a> <a href="be.html">Be</a> <a href="b.html">B </a> <a href="c.html">C </a> <a href="n.html">N </a> <a href="o.html">O </a> <a href="f.html">F </a> <a href="ne.html">Ne</a> |
+| |
+|3 <a href="na.html">Na</a> <a href="mg.html">Mg</a> <a href="al.html">Al</a> <a href="si.html">Si</a> <a href="p.html">P </a> <a href="s.html">S </a> <a href="cl.html">Cl</a> <a href="ar.html">Ar</a> |
+| |
+|4 <a href="k.html">K </a> <a href="ca.html">Ca</a> <a href="sc.html">Sc</a> <a href="ti.html">Ti</a> <a href="v.html">V </a> <a href="cr.html">Cr</a> <a href="mn.html">Mn</a> <a href="fe.html">Fe</a> <a href="co.html">Co</a> <a href="ni.html">Ni</a> <a href="cu.html">Cu</a> <a href="zn.html">Zn</a> <a href="ga.html">Ga</a> <a href="ge.html">Ge</a> <a href="as.html">As</a> <a href="se.html">Se</a> <a href="br.html">Br</a> <a href="kr.html">Kr</a> |
+| |
+|5 <a href="rb.html">Rb</a> <a href="sr.html">Sr</a> <a href="y.html">Y </a> <a href="zr.html">Zr</a> <a href="nb.html">Nb</a> <a href="mo.html">Mo</a> <a href="tc.html">Tc</a> <a href="ru.html">Ru</a> <a href="rh.html">Rh</a> <a href="pd.html">Pd</a> <a href="ag.html">Ag</a> <a href="cd.html">Cd</a> <a href="in.html">In</a> <a href="sn.html">Sn</a> <a href="sb.html">Sb</a> <a href="te.html">Te</a> <a href="i.html">I </a> <a href="xe.html">Xe</a> |
+| |
+|6 <a href="cs.html">Cs</a> <a href="ba.html">Ba</a> * <a href="hf.html">Hf</a> <a href="ta.html">Ta</a> <a href="w.html">W </a> <a href="re.html">Re</a> <a href="os.html">Os</a> <a href="ir.html">Ir</a> <a href="pt.html">Pt</a> <a href="au.html">Au</a> <a href="hg.html">Hg</a> <a href="tl.html">Tl</a> <a href="pb.html">Pb</a> <a href="bi.html">Bi</a> <a href="po.html">Po</a> <a href="at.html">At</a> <a href="rn.html">Rn</a> |
+| |
+|7 <a href="fr.html">Fr</a> <a href="ra.html">Ra</a> ** <a href="rf.html">Rf</a> <a href="db.html">Db</a> <a href="sg.html">Sg</a> <a href="bh.html">Bh</a> <a href="hs.html">Hs</a> <a href="mt.html">Mt</a> |
+|__________________________________________________________________________|
+| |
+| |
+| Lantanoidi* <a href="la.html">La</a> <a href="ce.html">Ce</a> <a href="pr.html">Pr</a> <a href="nd.html">Nd</a> <a href="pm.html">Pm</a> <a href="sm.html">Sm</a> <a href="eu.html">Eu</a> <a href="gd.html">Gd</a> <a href="tb.html">Tb</a> <a href="dy.html">Dy</a> <a href="ho.html">Ho</a> <a href="er.html">Er</a> <a href="tm.html">Tm</a> <a href="yb.html">Yb</a> <a href="lu.html">Lu</a> |
+| |
+| Aktinoidi** <a href="ac.html">Ac</a> <a href="th.html">Th</a> <a href="pa.html">Pa</a> <a href="u.html">U </a> <a href="np.html">Np</a> <a href="pu.html">Pu</a> <a href="am.html">Am</a> <a href="cm.html">Cm</a> <a href="bk.html">Bk</a> <a href="cf.html">Cf</a> <a href="es.html">Es</a> <a href="fm.html">Fm</a> <a href="md.html">Md</a> <a href="no.html">No</a> <a href="lr.html">Lr</a> |
+|__________________________________________________________________________|
+
+ASCII periodic table of the elements is available in six languages:
+
+<a href="../../de/ascii/index.html">German</a> - <a href="../../en/ascii/index.html">English</a> - <a href="../../fr/ascii/index.html">French</a> - <a href="../../hr/ascii/index.html">Croatian</a> - <a href="../../it/ascii/index.html">Italian</a> - <a href="../../es/ascii/index.html">Spanish</a>
+</pre>
+
+<br>
+
+<tt><a href="../index.html">EniG. Periodic Table of the Elements</a></tt>
+
+<br><br>____________________________________________<br>
+15 Feb. 2010
+<br>
+Copyright &copy; 1998-2010 by Eni Generalic.
+</center>
+
+</body>
+</html>
+
+
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/text-base/libSolarAbundances.py.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/text-base/libSolarAbundances.py.svn-base
new file mode 100644
index 0000000..497f32f
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/text-base/libSolarAbundances.py.svn-base
@@ -0,0 +1,94 @@
+#!/usr/bin/env python
+
+import string,sys,os
+from numpy import *
+
+import Ptools as pt
+
+
+
+
+def WriteParams(f,Files,elts):
+ E = PE(Files)
+
+ f.write("\n")
+ f.write("# Element Solar Abundances\n")
+ f.write("\n")
+ f.write("# Number of elements\n")
+ f.write("%d\n"%len(elts))
+ f.write("\n")
+
+ for elt in elts:
+
+ if elt == "Metals":
+ abun = 0.02
+ else:
+ abun = E[elt]
+
+ f.write("# %s\n"%elt)
+ f.write("%g\n"%abun)
+ f.write("\n")
+
+
+
+
+
+
+def Read(file):
+ f = open(file,'r')
+ lines = f.readlines()
+ f.close()
+
+ lines = lines[1:]
+
+ Elt = []
+ Z = zeros(len(lines),int)
+ X = zeros(len(lines),float)
+ A = zeros(len(lines),float)
+
+ for i,line in enumerate(lines):
+ line = string.split(line)
+
+ Elt.append(line[1])
+
+ Z[i] = int(line[0])
+ X[i] = float(line[2])
+ A[i] = float(line[3])
+
+ return Z,X,A,Elt
+
+
+class PE(dict):
+ def __init__(self,file):
+
+ Zs,Xs,As,Elts = Read(file)
+
+ '''
+ here,
+ Xs = 12 + log(Nx/NH)
+ '''
+
+ self.Zs = Zs
+ self.Xs = Xs
+ self.As = As
+ self.Elts = Elts
+
+ self.Ys = Xs
+ self.Xs = As *10**(Xs-12)
+ for i,elt in enumerate(self.Elts):
+ self[elt] = self.Xs[i]
+
+ def AtomicMass(self,elt):
+ idx = self.Elts.index(elt)
+ return self.As[idx]
+
+ def AtomicNumber(self,elt):
+ idx = self.Elts.index(elt)
+ return self.Zs[idx]
+
+ def SolarAbundance(self,elt):
+ """
+ Ax * Nx/NH (Ax=atomic mass)
+ """
+ idx = self.Elts.index(elt)
+ return self.Xs[idx]
\ No newline at end of file
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/text-base/plot.py.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/text-base/plot.py.svn-base
new file mode 100644
index 0000000..0e11fd4
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/text-base/plot.py.svn-base
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+import string,sys,os
+from numpy import *
+
+import Ptools as pt
+
+import libSolarAbundances
+
+E = libSolarAbundances.PE("Grevesse98.txt")
+
+Z = E.Zs
+X = E.Ys
+
+pt.plot(Z,X)
+pt.plot(Z,X,'o')
+
+pt.xlabel('Atomic Number')
+pt.ylabel('Abundance')
+
+pt.show()
+
+
diff --git a/PyChem/shared/tables/SolarAbundances/.svn/text-base/test.py.svn-base b/PyChem/shared/tables/SolarAbundances/.svn/text-base/test.py.svn-base
new file mode 100644
index 0000000..b29672b
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/.svn/text-base/test.py.svn-base
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+import string,sys,os
+from numpy import *
+
+import Ptools as pt
+
+import libSolarAbundances
+
+E = libSolarAbundances.PE("Grevesse98.txt")
+
+#print S.As
+
+
+print E['O']
+print E['Mg']
+print E['Fe']
+print E['Ba']
+
+
+print E.SolarAbundance('O')
+print E.SolarAbundance('Mg')
+print E.SolarAbundance('Fe')
+print E.SolarAbundance('Ba')
+
+
+print E.AtomicMass('O')
+print E.AtomicMass('Mg')
+print E.AtomicMass('Fe')
+print E.AtomicMass('Ba')
+
+print E.AtomicNumber('O')
+print E.AtomicNumber('Mg')
+print E.AtomicNumber('Fe')
+print E.AtomicNumber('Ba')
\ No newline at end of file
diff --git a/PyChem/shared/tables/SolarAbundances/Grevesse98.txt b/PyChem/shared/tables/SolarAbundances/Grevesse98.txt
new file mode 100644
index 0000000..9acafe5
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/Grevesse98.txt
@@ -0,0 +1,84 @@
+# Z Elt X A Flag
+01 H 12.00 1.00797 0
+02 He 10.93 4.0026 0
+03 Li 1.10 6.941 0
+04 Be 1.40 9.0122 0
+05 B 2.55 10.811 0
+06 C 8.52 12.01115 0
+07 N 7.92 14.0067 0
+08 O 8.83 15.9994 0
+09 F 4.56 18.9984 0
+10 Ne 8.08 20.183 0
+11 Na 6.33 22.9898 0
+12 Mg 7.58 24.312 0
+13 Al 6.47 26.9815 0
+14 Si 7.55 28.086 0
+15 P 5.45 30.9738 0
+16 S 7.33 32.064 0
+17 Cl 5.50 35.453 0
+18 Ar 6.40 39.948 0
+19 K 5.12 39.098 0
+20 Ca 6.36 40.08 0
+21 Sc 3.17 44.956 0
+22 Ti 5.02 47.90 0
+23 V 4.00 50.942 0
+24 Cr 5.67 51.996 0
+25 Mn 5.39 54.938 0
+26 Fe 7.50 55.847 0
+27 Co 4.92 58.9332 0
+28 Ni 6.25 58.71 0
+29 Cu 4.21 63.546 0
+30 Zn 4.60 65.38 0
+31 Ga 2.88 69.72 0
+32 Ge 3.41 72.59 0
+33 As 2.37 74.9216 1
+34 Se 3.41 78.96 1
+35 Br 2.63 79.904 1
+36 Kr 3.31 83.80 1
+37 Rb 2.60 85.47 0
+38 Sr 2.97 87.62 0
+39 Y 2.24 88.905 0
+40 Zr 2.60 91.22 0
+41 Nb 1.42 92.906 0
+42 Mo 1.92 95.94 0
+44 Ru 1.84 101.07 0
+45 Rh 1.12 102.905 0
+46 Pd 1.69 106.4 0
+47 Ag 0.94 107.868 0
+48 Cd 1.77 112.41 0
+49 In 1.66 114.82 0
+50 Sn 2.00 118.69 0
+51 Sb 1.00 121.75 0
+52 Te 2.24 127.60 1
+53 I 1.51 126.904 1
+54 Xe 2.17 131.30 1
+55 Cs 1.13 132.905 1
+56 Ba 2.13 137.34 0
+57 La 1.17 138.91 0
+58 Ce 1.58 140.12 0
+59 Pr 0.71 140.907 0
+60 Nd 1.50 144.24 0
+62 Sm 1.01 150.35 0
+63 Eu 0.51 151.96 0
+64 Gd 1.12 157.25 0
+65 Tb 0.35 158.924 1
+66 Dy 1.14 162.50 0
+67 Ho 0.26 164.930 0
+68 Er 0.93 167.28 0
+69 Tm 0.00 168.934 0
+70 Yb 1.08 173.04 0
+71 Lu 0.06 174.97 0
+72 Hf 0.88 178.49 0
+73 Ta -0.13 180.948 1
+74 W 1.11 183.85 0
+75 Re 0.28 186.2 1
+76 Os 1.45 190.2 0
+77 Ir 1.35 192.2 0
+78 Pt 1.80 195.09 0
+79 Au 1.01 196.967 0
+80 Hg 1.13 200.59 1
+81 Tl 0.90 204.37 0
+82 Pb 1.95 207.19 0
+83 Bi 0.71 208.98 1
+90 Th 0.09 232.038 1
+92 U -0.47 238.03 0
diff --git a/PyChem/shared/tables/SolarAbundances/Readme b/PyChem/shared/tables/SolarAbundances/Readme
new file mode 100644
index 0000000..90aa4f6
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/Readme
@@ -0,0 +1,11 @@
+table from
+Grevesse, N., & Sauval, A. J. 1998, Space Sci. Rev., 85, 161
+
+where Flag=1, X = X of Meteorites
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!! Li has a strange value, no ? (should be ~3 instead of 1.1) !!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+-------------------------------------------
+
diff --git a/PyChem/shared/tables/SolarAbundances/grevesse98.pdf b/PyChem/shared/tables/SolarAbundances/grevesse98.pdf
new file mode 100644
index 0000000..098b305
Binary files /dev/null and b/PyChem/shared/tables/SolarAbundances/grevesse98.pdf differ
diff --git a/PyChem/shared/tables/SolarAbundances/index.html b/PyChem/shared/tables/SolarAbundances/index.html
new file mode 100644
index 0000000..558cbbf
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/index.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>ASCII Periodic Table of the Elements</title>
+<meta http-equiv="content-type" content="text/html; charset=us-ascii">
+<meta name="description" content="ASCII periodic table of the elements is available in 6 languages (German, English, French, Croatian, Italian, and Spanish) in plain ASCII text.">
+<meta name="keywords" content="ascii, periodic, table, elements, enig">
+<meta name="url" content="http://www.periodni.com">
+<meta name="author" content="Eni Generalic, Faculty of Chemistry and Technology, Split, Croatia">
+<meta http-equiv="reply-to" content="eni.generalic@gmail.com">
+<meta name="copyright" content="Copyright &copy; 2010 Eni Generalic, All Rights Reserved">
+<link rel="shortcut icon" href="../../slike/pse.ico">
+
+</head>
+<body>
+
+<center>
+<font size="+3">PERIODIC TABLE OF THE ELEMENTS</font><br>
+
+<pre>
+ __________________________________________________________________________
+| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
+| |
+|1 <a href="h.html">H </a> <a href="he.html">He</a> |
+| |
+|2 <a href="li.html">Li</a> <a href="be.html">Be</a> <a href="b.html">B </a> <a href="c.html">C </a> <a href="n.html">N </a> <a href="o.html">O </a> <a href="f.html">F </a> <a href="ne.html">Ne</a> |
+| |
+|3 <a href="na.html">Na</a> <a href="mg.html">Mg</a> <a href="al.html">Al</a> <a href="si.html">Si</a> <a href="p.html">P </a> <a href="s.html">S </a> <a href="cl.html">Cl</a> <a href="ar.html">Ar</a> |
+| |
+|4 <a href="k.html">K </a> <a href="ca.html">Ca</a> <a href="sc.html">Sc</a> <a href="ti.html">Ti</a> <a href="v.html">V </a> <a href="cr.html">Cr</a> <a href="mn.html">Mn</a> <a href="fe.html">Fe</a> <a href="co.html">Co</a> <a href="ni.html">Ni</a> <a href="cu.html">Cu</a> <a href="zn.html">Zn</a> <a href="ga.html">Ga</a> <a href="ge.html">Ge</a> <a href="as.html">As</a> <a href="se.html">Se</a> <a href="br.html">Br</a> <a href="kr.html">Kr</a> |
+| |
+|5 <a href="rb.html">Rb</a> <a href="sr.html">Sr</a> <a href="y.html">Y </a> <a href="zr.html">Zr</a> <a href="nb.html">Nb</a> <a href="mo.html">Mo</a> <a href="tc.html">Tc</a> <a href="ru.html">Ru</a> <a href="rh.html">Rh</a> <a href="pd.html">Pd</a> <a href="ag.html">Ag</a> <a href="cd.html">Cd</a> <a href="in.html">In</a> <a href="sn.html">Sn</a> <a href="sb.html">Sb</a> <a href="te.html">Te</a> <a href="i.html">I </a> <a href="xe.html">Xe</a> |
+| |
+|6 <a href="cs.html">Cs</a> <a href="ba.html">Ba</a> * <a href="hf.html">Hf</a> <a href="ta.html">Ta</a> <a href="w.html">W </a> <a href="re.html">Re</a> <a href="os.html">Os</a> <a href="ir.html">Ir</a> <a href="pt.html">Pt</a> <a href="au.html">Au</a> <a href="hg.html">Hg</a> <a href="tl.html">Tl</a> <a href="pb.html">Pb</a> <a href="bi.html">Bi</a> <a href="po.html">Po</a> <a href="at.html">At</a> <a href="rn.html">Rn</a> |
+| |
+|7 <a href="fr.html">Fr</a> <a href="ra.html">Ra</a> ** <a href="rf.html">Rf</a> <a href="db.html">Db</a> <a href="sg.html">Sg</a> <a href="bh.html">Bh</a> <a href="hs.html">Hs</a> <a href="mt.html">Mt</a> |
+|__________________________________________________________________________|
+| |
+| |
+| Lantanoidi* <a href="la.html">La</a> <a href="ce.html">Ce</a> <a href="pr.html">Pr</a> <a href="nd.html">Nd</a> <a href="pm.html">Pm</a> <a href="sm.html">Sm</a> <a href="eu.html">Eu</a> <a href="gd.html">Gd</a> <a href="tb.html">Tb</a> <a href="dy.html">Dy</a> <a href="ho.html">Ho</a> <a href="er.html">Er</a> <a href="tm.html">Tm</a> <a href="yb.html">Yb</a> <a href="lu.html">Lu</a> |
+| |
+| Aktinoidi** <a href="ac.html">Ac</a> <a href="th.html">Th</a> <a href="pa.html">Pa</a> <a href="u.html">U </a> <a href="np.html">Np</a> <a href="pu.html">Pu</a> <a href="am.html">Am</a> <a href="cm.html">Cm</a> <a href="bk.html">Bk</a> <a href="cf.html">Cf</a> <a href="es.html">Es</a> <a href="fm.html">Fm</a> <a href="md.html">Md</a> <a href="no.html">No</a> <a href="lr.html">Lr</a> |
+|__________________________________________________________________________|
+
+ASCII periodic table of the elements is available in six languages:
+
+<a href="../../de/ascii/index.html">German</a> - <a href="../../en/ascii/index.html">English</a> - <a href="../../fr/ascii/index.html">French</a> - <a href="../../hr/ascii/index.html">Croatian</a> - <a href="../../it/ascii/index.html">Italian</a> - <a href="../../es/ascii/index.html">Spanish</a>
+</pre>
+
+<br>
+
+<tt><a href="../index.html">EniG. Periodic Table of the Elements</a></tt>
+
+<br><br>____________________________________________<br>
+15 Feb. 2010
+<br>
+Copyright &copy; 1998-2010 by Eni Generalic.
+</center>
+
+</body>
+</html>
+
+
diff --git a/PyChem/shared/tables/SolarAbundances/libSolarAbundances.py b/PyChem/shared/tables/SolarAbundances/libSolarAbundances.py
new file mode 100644
index 0000000..497f32f
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/libSolarAbundances.py
@@ -0,0 +1,94 @@
+#!/usr/bin/env python
+
+import string,sys,os
+from numpy import *
+
+import Ptools as pt
+
+
+
+
+def WriteParams(f,Files,elts):
+ E = PE(Files)
+
+ f.write("\n")
+ f.write("# Element Solar Abundances\n")
+ f.write("\n")
+ f.write("# Number of elements\n")
+ f.write("%d\n"%len(elts))
+ f.write("\n")
+
+ for elt in elts:
+
+ if elt == "Metals":
+ abun = 0.02
+ else:
+ abun = E[elt]
+
+ f.write("# %s\n"%elt)
+ f.write("%g\n"%abun)
+ f.write("\n")
+
+
+
+
+
+
+def Read(file):
+ f = open(file,'r')
+ lines = f.readlines()
+ f.close()
+
+ lines = lines[1:]
+
+ Elt = []
+ Z = zeros(len(lines),int)
+ X = zeros(len(lines),float)
+ A = zeros(len(lines),float)
+
+ for i,line in enumerate(lines):
+ line = string.split(line)
+
+ Elt.append(line[1])
+
+ Z[i] = int(line[0])
+ X[i] = float(line[2])
+ A[i] = float(line[3])
+
+ return Z,X,A,Elt
+
+
+class PE(dict):
+ def __init__(self,file):
+
+ Zs,Xs,As,Elts = Read(file)
+
+ '''
+ here,
+ Xs = 12 + log(Nx/NH)
+ '''
+
+ self.Zs = Zs
+ self.Xs = Xs
+ self.As = As
+ self.Elts = Elts
+
+ self.Ys = Xs
+ self.Xs = As *10**(Xs-12)
+ for i,elt in enumerate(self.Elts):
+ self[elt] = self.Xs[i]
+
+ def AtomicMass(self,elt):
+ idx = self.Elts.index(elt)
+ return self.As[idx]
+
+ def AtomicNumber(self,elt):
+ idx = self.Elts.index(elt)
+ return self.Zs[idx]
+
+ def SolarAbundance(self,elt):
+ """
+ Ax * Nx/NH (Ax=atomic mass)
+ """
+ idx = self.Elts.index(elt)
+ return self.Xs[idx]
\ No newline at end of file
diff --git a/PyChem/shared/tables/SolarAbundances/plot.py b/PyChem/shared/tables/SolarAbundances/plot.py
new file mode 100755
index 0000000..0e11fd4
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/plot.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+import string,sys,os
+from numpy import *
+
+import Ptools as pt
+
+import libSolarAbundances
+
+E = libSolarAbundances.PE("Grevesse98.txt")
+
+Z = E.Zs
+X = E.Ys
+
+pt.plot(Z,X)
+pt.plot(Z,X,'o')
+
+pt.xlabel('Atomic Number')
+pt.ylabel('Abundance')
+
+pt.show()
+
+
diff --git a/PyChem/shared/tables/SolarAbundances/test.py b/PyChem/shared/tables/SolarAbundances/test.py
new file mode 100755
index 0000000..b29672b
--- /dev/null
+++ b/PyChem/shared/tables/SolarAbundances/test.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+import string,sys,os
+from numpy import *
+
+import Ptools as pt
+
+import libSolarAbundances
+
+E = libSolarAbundances.PE("Grevesse98.txt")
+
+#print S.As
+
+
+print E['O']
+print E['Mg']
+print E['Fe']
+print E['Ba']
+
+
+print E.SolarAbundance('O')
+print E.SolarAbundance('Mg')
+print E.SolarAbundance('Fe')
+print E.SolarAbundance('Ba')
+
+
+print E.AtomicMass('O')
+print E.AtomicMass('Mg')
+print E.AtomicMass('Fe')
+print E.AtomicMass('Ba')
+
+print E.AtomicNumber('O')
+print E.AtomicNumber('Mg')
+print E.AtomicNumber('Fe')
+print E.AtomicNumber('Ba')
\ No newline at end of file
diff --git a/PyChem/shared/tables/Woosley/.svn/all-wcprops b/PyChem/shared/tables/Woosley/.svn/all-wcprops
new file mode 100644
index 0000000..3d0332f
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/all-wcprops
@@ -0,0 +1,47 @@
+K 25
+svn:wc:ra_dav:version-url
+V 33
+/svn/chemistry/!svn/ver/2/Woosley
+END
+old.HeliumCore.dat
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/chemistry/!svn/ver/2/Woosley/old.HeliumCore.dat
+END
+WoosleyYields.dat
+K 25
+svn:wc:ra_dav:version-url
+V 51
+/svn/chemistry/!svn/ver/2/Woosley/WoosleyYields.dat
+END
+HeliumCore.dat
+K 25
+svn:wc:ra_dav:version-url
+V 48
+/svn/chemistry/!svn/ver/2/Woosley/HeliumCore.dat
+END
+old.yieldsSNII.txt
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/chemistry/!svn/ver/2/Woosley/old.yieldsSNII.txt
+END
+yieldsSNII.txt
+K 25
+svn:wc:ra_dav:version-url
+V 48
+/svn/chemistry/!svn/ver/2/Woosley/yieldsSNII.txt
+END
+Readme
+K 25
+svn:wc:ra_dav:version-url
+V 40
+/svn/chemistry/!svn/ver/2/Woosley/Readme
+END
+WW95.yields.original.dat
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svn/chemistry/!svn/ver/2/Woosley/WW95.yields.original.dat
+END
diff --git a/PyChem/shared/tables/Woosley/.svn/entries b/PyChem/shared/tables/Woosley/.svn/entries
new file mode 100644
index 0000000..1d5289c
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/entries
@@ -0,0 +1,266 @@
+10
+
+dir
+2
+https://svn.epfl.ch/svn/chemistry/Woosley
+https://svn.epfl.ch/svn/chemistry
+
+
+
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3206ecf2-eaf6-43ec-8d24-0b1ce831b07a
+
+old.HeliumCore.dat
+file
+
+
+
+
+2011-06-11T17:22:02.907740Z
+1e975965fe25a99eb479ee26236fb749
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1108
+
+WoosleyYields.dat
+file
+
+
+
+
+2011-06-11T17:22:03.049337Z
+dda50bd433d785ad22ac44144b5aae0f
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2233
+
+HeliumCore.dat
+file
+
+
+
+
+2011-06-11T17:22:03.190864Z
+e76ea2bff4148f3810385be65e62c6fe
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1108
+
+old.yieldsSNII.txt
+file
+
+
+
+
+2011-06-11T17:22:03.331612Z
+2b71723554559e7892f6b949e0a3347d
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1289
+
+yieldsSNII.txt
+file
+
+
+
+
+2011-06-11T17:22:03.470992Z
+a0df8d8e06b10c99e3ed18fd5232c718
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1515
+
+Readme
+file
+
+
+
+
+2011-06-11T17:22:03.604218Z
+4333274b62580ae10aa69ea980a9a289
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+176
+
+WW95.yields.original.dat
+file
+
+
+
+
+2011-06-11T17:22:03.751866Z
+9f20c324c8e83eef5610146e13523bc0
+2011-06-11T17:19:50.398463Z
+2
+yrevaz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1988
+
diff --git a/PyChem/shared/tables/Woosley/.svn/text-base/HeliumCore.dat.svn-base b/PyChem/shared/tables/Woosley/.svn/text-base/HeliumCore.dat.svn-base
new file mode 100644
index 0000000..48f6ab8
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/text-base/HeliumCore.dat.svn-base
@@ -0,0 +1,35 @@
+# Mass Residu Helium Core
+0.80 0.459 0.459
+1.00 0.473 0.473
+1.50 0.480 0.480
+1.75 0.487 0.487
+2.00 0.404 0.404
+2.50 0.501 0.501
+3.00 0.508 0.508
+3.50 0.515 0.515
+4.00 0.550 0.550
+4.30 0.620 0.620
+4.60 0.675 0.675
+4.80 0.730 0.730
+5.00 0.870 0.870
+6.00 1.010 1.010
+8.00 1.120 1.120
+10.0 1.150 1.150
+ 0.11000E+02 0.13200E+01 0.26458E+01
+ 0.12000E+02 0.13200E+01 0.29510E+01
+ 0.13000E+02 0.14600E+01 0.33763E+01
+ 0.15000E+02 0.14300E+01 0.40611E+01
+ 0.18000E+02 0.17600E+01 0.54186E+01
+ 0.19000E+02 0.19800E+01 0.59923E+01
+ 0.20000E+02 0.20600E+01 0.65491E+01
+ 0.22000E+02 0.20200E+01 0.73852E+01
+ 0.25000E+02 0.20700E+01 0.89315E+01
+ 0.30000E+02 0.19400E+01 0.10502E+02
+ 0.35000E+02 0.38600E+01 0.14489E+02
+ 0.40000E+02 0.54500E+01 0.16703E+02
+ 0.50000E+02 0.24500E+01 0.14237E+02
+ 0.60000E+02 0.24500E+01 0.14603E+02
+ 0.70000E+02 0.24500E+01 0.14871E+02
+ 0.80000E+02 0.24500E+01 0.15082E+02
+ 0.90000E+02 0.24500E+01 0.15240E+02
+ 0.10000E+03 0.24500E+01 0.15377E+02
diff --git a/PyChem/shared/tables/Woosley/.svn/text-base/Readme.svn-base b/PyChem/shared/tables/Woosley/.svn/text-base/Readme.svn-base
new file mode 100644
index 0000000..d6fa137
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/text-base/Readme.svn-base
@@ -0,0 +1,13 @@
+
+The table
+WW95.yields.original.dat
+
+send from Gabriele.
+
+
+The files
+old.yieldsSNII.txt
+old.HeliumCore.dat
+WoosleyYields.dat
+
+corresponds to Francois, but with Mg from Woosley
diff --git a/PyChem/shared/tables/Woosley/.svn/text-base/WW95.yields.original.dat.svn-base b/PyChem/shared/tables/Woosley/.svn/text-base/WW95.yields.original.dat.svn-base
new file mode 100644
index 0000000..176ae71
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/text-base/WW95.yields.original.dat.svn-base
@@ -0,0 +1,19 @@
+ massa Hecore Ztot Remn O16 Mg Si Fe
+ 0.11000E+02 0.26458E+01 0.25775E+00 0.13200E+01 0.43000E-01 0.57350E-02 0.16080E-01 0.80000E-01
+ 0.12000E+02 0.29510E+01 0.45804E+00 0.13200E+01 0.11000E+00 0.40170E-02 0.84720E-01 0.55000E-01
+ 0.13000E+02 0.33763E+01 0.58025E+00 0.14600E+01 0.16100E+00 0.15270E-01 0.53640E-01 0.14600E+00
+ 0.15000E+02 0.40611E+01 0.11231E+01 0.14300E+01 0.55000E+00 0.30860E-01 0.10600E+00 0.12970E+00
+ 0.18000E+02 0.54186E+01 0.18446E+01 0.17600E+01 0.97400E+00 0.66290E-01 0.13430E+00 0.83000E-01
+ 0.19000E+02 0.59923E+01 0.22333E+01 0.19800E+01 0.12700E+01 0.34760E-01 0.27210E+00 0.11700E+00
+ 0.20000E+02 0.65491E+01 0.27026E+01 0.20600E+01 0.17700E+01 0.37500E-01 0.28660E+00 0.10600E+00
+ 0.22000E+02 0.73852E+01 0.33497E+01 0.20200E+01 0.21900E+01 0.49220E-01 0.36830E+00 0.22247E+00
+ 0.25000E+02 0.89315E+01 0.45275E+01 0.20700E+01 0.30300E+01 0.14720E+00 0.32280E+00 0.15000E+00
+ 0.30000E+02 0.10502E+02 0.58782E+01 0.19400E+01 0.46100E+01 0.25280E+00 0.12280E+00 0.25000E-01
+ 0.35000E+02 0.14489E+02 0.72920E+01 0.38600E+01 0.55200E+01 0.37080E+00 0.14340E+00 0.27700E-01
+ 0.40000E+02 0.16703E+02 0.77541E+01 0.54500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.50000E+02 0.14237E+02 0.82870E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.60000E+02 0.14603E+02 0.86530E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.70000E+02 0.14871E+02 0.89210E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.80000E+02 0.15082E+02 0.91320E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.90000E+02 0.15240E+02 0.92900E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.10000E+03 0.15377E+02 0.94270E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
diff --git a/PyChem/shared/tables/Woosley/.svn/text-base/WoosleyYields.dat.svn-base b/PyChem/shared/tables/Woosley/.svn/text-base/WoosleyYields.dat.svn-base
new file mode 100644
index 0000000..1a59658
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/text-base/WoosleyYields.dat.svn-base
@@ -0,0 +1,19 @@
+ massa Hecore Ztot Remn O16 Mg_orig Mg_Fran Si Fe
+ 0.11000E+02 0.27100E+01 0.32204E+00 0.13200E+01 0.43000E-01 5.73500E-03 0.64400E-01 0.21700E-01 0.80000E-01
+ 0.12000E+02 0.30106E+01 0.51760E+00 0.13200E+01 0.11000E+00 4.01700E-03 0.57400E-01 0.90900E-01 0.55000E-01
+ 0.13000E+02 0.34806E+01 0.68464E+00 0.14600E+01 0.16100E+00 1.52700E-02 0.11480E+00 0.58500E-01 0.14600E+00
+ 0.15000E+02 0.42212E+01 0.12832E+01 0.14300E+01 0.55000E+00 3.08600E-02 0.18690E+00 0.11000E+00 0.12970E+00
+ 0.18000E+02 0.57414E+01 0.21674E+01 0.17600E+01 0.97400E+00 6.62900E-02 0.38640E+00 0.13700E+00 0.83000E-01
+ 0.19000E+02 0.61381E+01 0.23791E+01 0.19800E+01 0.12700E+01 3.47600E-02 0.17570E+00 0.27700E+00 0.11700E+00
+ 0.20000E+02 0.67321E+01 0.28856E+01 0.20600E+01 0.17700E+01 3.75000E-02 0.21910E+00 0.28800E+00 0.10600E+00
+ 0.22000E+02 0.76149E+01 0.35794E+01 0.20200E+01 0.21900E+01 4.92200E-02 0.29120E+00 0.35600E+00 0.22247E+00
+ 0.25000E+02 0.88465E+01 0.44425E+01 0.20700E+01 0.30300E+01 1.47200E-01 0.70000E-01 0.31500E+00 0.15000E+00
+ 0.30000E+02 0.10512E+02 0.58886E+01 0.19400E+01 0.46100E+01 2.52800E-01 0.70000E-01 0.31600E+00 0.25000E-01
+ 0.35000E+02 0.14156E+02 0.69598E+01 0.38600E+01 0.55200E+01 3.70800E-01 0.70000E-01 0.11200E+00 0.27700E-01
+ 0.40000E+02 0.16429E+02 0.74799E+01 0.54500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.50000E+02 0.13963E+02 0.80129E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.60000E+02 0.14329E+02 0.83788E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.70000E+02 0.14597E+02 0.86468E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.80000E+02 0.14808E+02 0.88578E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.90000E+02 0.14966E+02 0.90158E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.10000E+03 0.15103E+02 0.91528E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
diff --git a/PyChem/shared/tables/Woosley/.svn/text-base/old.HeliumCore.dat.svn-base b/PyChem/shared/tables/Woosley/.svn/text-base/old.HeliumCore.dat.svn-base
new file mode 100644
index 0000000..2436e65
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/text-base/old.HeliumCore.dat.svn-base
@@ -0,0 +1,35 @@
+# Mass Residu Helium Core
+0.80 0.459 0.459
+1.00 0.473 0.473
+1.50 0.480 0.480
+1.75 0.487 0.487
+2.00 0.404 0.404
+2.50 0.501 0.501
+3.00 0.508 0.508
+3.50 0.515 0.515
+4.00 0.550 0.550
+4.30 0.620 0.620
+4.60 0.675 0.675
+4.80 0.730 0.730
+5.00 0.870 0.870
+6.00 1.010 1.010
+8.00 1.120 1.120
+10.0 1.150 1.150
+ 0.11000E+02 0.13200E+01 0.27100E+01
+ 0.12000E+02 0.13200E+01 0.30106E+01
+ 0.13000E+02 0.14600E+01 0.34806E+01
+ 0.15000E+02 0.14300E+01 0.42212E+01
+ 0.18000E+02 0.17600E+01 0.57414E+01
+ 0.19000E+02 0.19800E+01 0.61381E+01
+ 0.20000E+02 0.20600E+01 0.67321E+01
+ 0.22000E+02 0.20200E+01 0.76149E+01
+ 0.25000E+02 0.20700E+01 0.88465E+01
+ 0.30000E+02 0.19400E+01 0.10512E+02
+ 0.35000E+02 0.38600E+01 0.14156E+02
+ 0.40000E+02 0.54500E+01 0.16429E+02
+ 0.50000E+02 0.24500E+01 0.13963E+02
+ 0.60000E+02 0.24500E+01 0.14329E+02
+ 0.70000E+02 0.24500E+01 0.14597E+02
+ 0.80000E+02 0.24500E+01 0.14808E+02
+ 0.90000E+02 0.24500E+01 0.14966E+02
+ 0.10000E+03 0.24500E+01 0.15103E+02
diff --git a/PyChem/shared/tables/Woosley/.svn/text-base/old.yieldsSNII.txt.svn-base b/PyChem/shared/tables/Woosley/.svn/text-base/old.yieldsSNII.txt.svn-base
new file mode 100644
index 0000000..db08993
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/text-base/old.yieldsSNII.txt.svn-base
@@ -0,0 +1,20 @@
+# M O16 Mg Si Fe
+ 10 0 0 0 0
+ 0.11000E+02 0.43000E-01 5.73500E-03 0.21700E-01 0.80000E-01
+ 0.12000E+02 0.11000E+00 4.01700E-03 0.90900E-01 0.55000E-01
+ 0.13000E+02 0.16100E+00 1.52700E-02 0.58500E-01 0.14600E+00
+ 0.15000E+02 0.55000E+00 3.08600E-02 0.11000E+00 0.12970E+00
+ 0.18000E+02 0.97400E+00 6.62900E-02 0.13700E+00 0.83000E-01
+ 0.19000E+02 0.12700E+01 3.47600E-02 0.27700E+00 0.11700E+00
+ 0.20000E+02 0.17700E+01 3.75000E-02 0.28800E+00 0.10600E+00
+ 0.22000E+02 0.21900E+01 4.92200E-02 0.35600E+00 0.22247E+00
+ 0.25000E+02 0.30300E+01 1.47200E-01 0.31500E+00 0.15000E+00
+ 0.30000E+02 0.46100E+01 2.52800E-01 0.31600E+00 0.25000E-01
+ 0.35000E+02 0.55200E+01 3.70800E-01 0.11200E+00 0.27700E-01
+ 0.40000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.50000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.60000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.70000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.80000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.90000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.10000E+03 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
diff --git a/PyChem/shared/tables/Woosley/.svn/text-base/yieldsSNII.txt.svn-base b/PyChem/shared/tables/Woosley/.svn/text-base/yieldsSNII.txt.svn-base
new file mode 100644
index 0000000..c7732bb
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/.svn/text-base/yieldsSNII.txt.svn-base
@@ -0,0 +1,20 @@
+# M O16 Mg Si Fe Metals
+ 10 0 0 0 0 0
+ 0.11000E+02 0.43000E-01 0.57350E-02 0.16080E-01 0.80000E-01 0.25775E+00
+ 0.12000E+02 0.11000E+00 0.40170E-02 0.84720E-01 0.55000E-01 0.45804E+00
+ 0.13000E+02 0.16100E+00 0.15270E-01 0.53640E-01 0.14600E+00 0.58025E+00
+ 0.15000E+02 0.55000E+00 0.30860E-01 0.10600E+00 0.12970E+00 0.11231E+01
+ 0.18000E+02 0.97400E+00 0.66290E-01 0.13430E+00 0.83000E-01 0.18446E+01
+ 0.19000E+02 0.12700E+01 0.34760E-01 0.27210E+00 0.11700E+00 0.22333E+01
+ 0.20000E+02 0.17700E+01 0.37500E-01 0.28660E+00 0.10600E+00 0.27026E+01
+ 0.22000E+02 0.21900E+01 0.49220E-01 0.36830E+00 0.22247E+00 0.33497E+01
+ 0.25000E+02 0.30300E+01 0.14720E+00 0.32280E+00 0.15000E+00 0.45275E+01
+ 0.30000E+02 0.46100E+01 0.25280E+00 0.12280E+00 0.25000E-01 0.58782E+01
+ 0.35000E+02 0.55200E+01 0.37080E+00 0.14340E+00 0.27700E-01 0.72920E+01
+ 0.40000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.77541E+01
+ 0.50000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.82870E+01
+ 0.60000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.86530E+01
+ 0.70000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.89210E+01
+ 0.80000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.91320E+01
+ 0.90000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.92900E+01
+ 0.10000E+03 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.94270E+01
diff --git a/PyChem/shared/tables/Woosley/HeliumCore.dat b/PyChem/shared/tables/Woosley/HeliumCore.dat
new file mode 100644
index 0000000..48f6ab8
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/HeliumCore.dat
@@ -0,0 +1,35 @@
+# Mass Residu Helium Core
+0.80 0.459 0.459
+1.00 0.473 0.473
+1.50 0.480 0.480
+1.75 0.487 0.487
+2.00 0.404 0.404
+2.50 0.501 0.501
+3.00 0.508 0.508
+3.50 0.515 0.515
+4.00 0.550 0.550
+4.30 0.620 0.620
+4.60 0.675 0.675
+4.80 0.730 0.730
+5.00 0.870 0.870
+6.00 1.010 1.010
+8.00 1.120 1.120
+10.0 1.150 1.150
+ 0.11000E+02 0.13200E+01 0.26458E+01
+ 0.12000E+02 0.13200E+01 0.29510E+01
+ 0.13000E+02 0.14600E+01 0.33763E+01
+ 0.15000E+02 0.14300E+01 0.40611E+01
+ 0.18000E+02 0.17600E+01 0.54186E+01
+ 0.19000E+02 0.19800E+01 0.59923E+01
+ 0.20000E+02 0.20600E+01 0.65491E+01
+ 0.22000E+02 0.20200E+01 0.73852E+01
+ 0.25000E+02 0.20700E+01 0.89315E+01
+ 0.30000E+02 0.19400E+01 0.10502E+02
+ 0.35000E+02 0.38600E+01 0.14489E+02
+ 0.40000E+02 0.54500E+01 0.16703E+02
+ 0.50000E+02 0.24500E+01 0.14237E+02
+ 0.60000E+02 0.24500E+01 0.14603E+02
+ 0.70000E+02 0.24500E+01 0.14871E+02
+ 0.80000E+02 0.24500E+01 0.15082E+02
+ 0.90000E+02 0.24500E+01 0.15240E+02
+ 0.10000E+03 0.24500E+01 0.15377E+02
diff --git a/PyChem/shared/tables/Woosley/Readme b/PyChem/shared/tables/Woosley/Readme
new file mode 100644
index 0000000..d6fa137
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/Readme
@@ -0,0 +1,13 @@
+
+The table
+WW95.yields.original.dat
+
+send from Gabriele.
+
+
+The files
+old.yieldsSNII.txt
+old.HeliumCore.dat
+WoosleyYields.dat
+
+corresponds to Francois, but with Mg from Woosley
diff --git a/PyChem/shared/tables/Woosley/WW95.yields.original.dat b/PyChem/shared/tables/Woosley/WW95.yields.original.dat
new file mode 100644
index 0000000..176ae71
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/WW95.yields.original.dat
@@ -0,0 +1,19 @@
+ massa Hecore Ztot Remn O16 Mg Si Fe
+ 0.11000E+02 0.26458E+01 0.25775E+00 0.13200E+01 0.43000E-01 0.57350E-02 0.16080E-01 0.80000E-01
+ 0.12000E+02 0.29510E+01 0.45804E+00 0.13200E+01 0.11000E+00 0.40170E-02 0.84720E-01 0.55000E-01
+ 0.13000E+02 0.33763E+01 0.58025E+00 0.14600E+01 0.16100E+00 0.15270E-01 0.53640E-01 0.14600E+00
+ 0.15000E+02 0.40611E+01 0.11231E+01 0.14300E+01 0.55000E+00 0.30860E-01 0.10600E+00 0.12970E+00
+ 0.18000E+02 0.54186E+01 0.18446E+01 0.17600E+01 0.97400E+00 0.66290E-01 0.13430E+00 0.83000E-01
+ 0.19000E+02 0.59923E+01 0.22333E+01 0.19800E+01 0.12700E+01 0.34760E-01 0.27210E+00 0.11700E+00
+ 0.20000E+02 0.65491E+01 0.27026E+01 0.20600E+01 0.17700E+01 0.37500E-01 0.28660E+00 0.10600E+00
+ 0.22000E+02 0.73852E+01 0.33497E+01 0.20200E+01 0.21900E+01 0.49220E-01 0.36830E+00 0.22247E+00
+ 0.25000E+02 0.89315E+01 0.45275E+01 0.20700E+01 0.30300E+01 0.14720E+00 0.32280E+00 0.15000E+00
+ 0.30000E+02 0.10502E+02 0.58782E+01 0.19400E+01 0.46100E+01 0.25280E+00 0.12280E+00 0.25000E-01
+ 0.35000E+02 0.14489E+02 0.72920E+01 0.38600E+01 0.55200E+01 0.37080E+00 0.14340E+00 0.27700E-01
+ 0.40000E+02 0.16703E+02 0.77541E+01 0.54500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.50000E+02 0.14237E+02 0.82870E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.60000E+02 0.14603E+02 0.86530E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.70000E+02 0.14871E+02 0.89210E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.80000E+02 0.15082E+02 0.91320E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.90000E+02 0.15240E+02 0.92900E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
+ 0.10000E+03 0.15377E+02 0.94270E+01 0.24500E+01 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01
diff --git a/PyChem/shared/tables/Woosley/WoosleyYields.dat b/PyChem/shared/tables/Woosley/WoosleyYields.dat
new file mode 100644
index 0000000..1a59658
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/WoosleyYields.dat
@@ -0,0 +1,19 @@
+ massa Hecore Ztot Remn O16 Mg_orig Mg_Fran Si Fe
+ 0.11000E+02 0.27100E+01 0.32204E+00 0.13200E+01 0.43000E-01 5.73500E-03 0.64400E-01 0.21700E-01 0.80000E-01
+ 0.12000E+02 0.30106E+01 0.51760E+00 0.13200E+01 0.11000E+00 4.01700E-03 0.57400E-01 0.90900E-01 0.55000E-01
+ 0.13000E+02 0.34806E+01 0.68464E+00 0.14600E+01 0.16100E+00 1.52700E-02 0.11480E+00 0.58500E-01 0.14600E+00
+ 0.15000E+02 0.42212E+01 0.12832E+01 0.14300E+01 0.55000E+00 3.08600E-02 0.18690E+00 0.11000E+00 0.12970E+00
+ 0.18000E+02 0.57414E+01 0.21674E+01 0.17600E+01 0.97400E+00 6.62900E-02 0.38640E+00 0.13700E+00 0.83000E-01
+ 0.19000E+02 0.61381E+01 0.23791E+01 0.19800E+01 0.12700E+01 3.47600E-02 0.17570E+00 0.27700E+00 0.11700E+00
+ 0.20000E+02 0.67321E+01 0.28856E+01 0.20600E+01 0.17700E+01 3.75000E-02 0.21910E+00 0.28800E+00 0.10600E+00
+ 0.22000E+02 0.76149E+01 0.35794E+01 0.20200E+01 0.21900E+01 4.92200E-02 0.29120E+00 0.35600E+00 0.22247E+00
+ 0.25000E+02 0.88465E+01 0.44425E+01 0.20700E+01 0.30300E+01 1.47200E-01 0.70000E-01 0.31500E+00 0.15000E+00
+ 0.30000E+02 0.10512E+02 0.58886E+01 0.19400E+01 0.46100E+01 2.52800E-01 0.70000E-01 0.31600E+00 0.25000E-01
+ 0.35000E+02 0.14156E+02 0.69598E+01 0.38600E+01 0.55200E+01 3.70800E-01 0.70000E-01 0.11200E+00 0.27700E-01
+ 0.40000E+02 0.16429E+02 0.74799E+01 0.54500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.50000E+02 0.13963E+02 0.80129E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.60000E+02 0.14329E+02 0.83788E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.70000E+02 0.14597E+02 0.86468E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.80000E+02 0.14808E+02 0.88578E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.90000E+02 0.14966E+02 0.90158E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
+ 0.10000E+03 0.15103E+02 0.91528E+01 0.24500E+01 0.57000E+01 3.41900E-01 0.70000E-01 0.54600E-01 0.28300E-01
diff --git a/PyChem/shared/tables/Woosley/old.HeliumCore.dat b/PyChem/shared/tables/Woosley/old.HeliumCore.dat
new file mode 100644
index 0000000..2436e65
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/old.HeliumCore.dat
@@ -0,0 +1,35 @@
+# Mass Residu Helium Core
+0.80 0.459 0.459
+1.00 0.473 0.473
+1.50 0.480 0.480
+1.75 0.487 0.487
+2.00 0.404 0.404
+2.50 0.501 0.501
+3.00 0.508 0.508
+3.50 0.515 0.515
+4.00 0.550 0.550
+4.30 0.620 0.620
+4.60 0.675 0.675
+4.80 0.730 0.730
+5.00 0.870 0.870
+6.00 1.010 1.010
+8.00 1.120 1.120
+10.0 1.150 1.150
+ 0.11000E+02 0.13200E+01 0.27100E+01
+ 0.12000E+02 0.13200E+01 0.30106E+01
+ 0.13000E+02 0.14600E+01 0.34806E+01
+ 0.15000E+02 0.14300E+01 0.42212E+01
+ 0.18000E+02 0.17600E+01 0.57414E+01
+ 0.19000E+02 0.19800E+01 0.61381E+01
+ 0.20000E+02 0.20600E+01 0.67321E+01
+ 0.22000E+02 0.20200E+01 0.76149E+01
+ 0.25000E+02 0.20700E+01 0.88465E+01
+ 0.30000E+02 0.19400E+01 0.10512E+02
+ 0.35000E+02 0.38600E+01 0.14156E+02
+ 0.40000E+02 0.54500E+01 0.16429E+02
+ 0.50000E+02 0.24500E+01 0.13963E+02
+ 0.60000E+02 0.24500E+01 0.14329E+02
+ 0.70000E+02 0.24500E+01 0.14597E+02
+ 0.80000E+02 0.24500E+01 0.14808E+02
+ 0.90000E+02 0.24500E+01 0.14966E+02
+ 0.10000E+03 0.24500E+01 0.15103E+02
diff --git a/PyChem/shared/tables/Woosley/old.yieldsSNII.txt b/PyChem/shared/tables/Woosley/old.yieldsSNII.txt
new file mode 100644
index 0000000..db08993
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/old.yieldsSNII.txt
@@ -0,0 +1,20 @@
+# M O16 Mg Si Fe
+ 10 0 0 0 0
+ 0.11000E+02 0.43000E-01 5.73500E-03 0.21700E-01 0.80000E-01
+ 0.12000E+02 0.11000E+00 4.01700E-03 0.90900E-01 0.55000E-01
+ 0.13000E+02 0.16100E+00 1.52700E-02 0.58500E-01 0.14600E+00
+ 0.15000E+02 0.55000E+00 3.08600E-02 0.11000E+00 0.12970E+00
+ 0.18000E+02 0.97400E+00 6.62900E-02 0.13700E+00 0.83000E-01
+ 0.19000E+02 0.12700E+01 3.47600E-02 0.27700E+00 0.11700E+00
+ 0.20000E+02 0.17700E+01 3.75000E-02 0.28800E+00 0.10600E+00
+ 0.22000E+02 0.21900E+01 4.92200E-02 0.35600E+00 0.22247E+00
+ 0.25000E+02 0.30300E+01 1.47200E-01 0.31500E+00 0.15000E+00
+ 0.30000E+02 0.46100E+01 2.52800E-01 0.31600E+00 0.25000E-01
+ 0.35000E+02 0.55200E+01 3.70800E-01 0.11200E+00 0.27700E-01
+ 0.40000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.50000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.60000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.70000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.80000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.90000E+02 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
+ 0.10000E+03 0.57000E+01 3.41900E-01 0.54600E-01 0.28300E-01
diff --git a/PyChem/shared/tables/Woosley/yieldsSNII.txt b/PyChem/shared/tables/Woosley/yieldsSNII.txt
new file mode 100644
index 0000000..c7732bb
--- /dev/null
+++ b/PyChem/shared/tables/Woosley/yieldsSNII.txt
@@ -0,0 +1,20 @@
+# M O16 Mg Si Fe Metals
+ 10 0 0 0 0 0
+ 0.11000E+02 0.43000E-01 0.57350E-02 0.16080E-01 0.80000E-01 0.25775E+00
+ 0.12000E+02 0.11000E+00 0.40170E-02 0.84720E-01 0.55000E-01 0.45804E+00
+ 0.13000E+02 0.16100E+00 0.15270E-01 0.53640E-01 0.14600E+00 0.58025E+00
+ 0.15000E+02 0.55000E+00 0.30860E-01 0.10600E+00 0.12970E+00 0.11231E+01
+ 0.18000E+02 0.97400E+00 0.66290E-01 0.13430E+00 0.83000E-01 0.18446E+01
+ 0.19000E+02 0.12700E+01 0.34760E-01 0.27210E+00 0.11700E+00 0.22333E+01
+ 0.20000E+02 0.17700E+01 0.37500E-01 0.28660E+00 0.10600E+00 0.27026E+01
+ 0.22000E+02 0.21900E+01 0.49220E-01 0.36830E+00 0.22247E+00 0.33497E+01
+ 0.25000E+02 0.30300E+01 0.14720E+00 0.32280E+00 0.15000E+00 0.45275E+01
+ 0.30000E+02 0.46100E+01 0.25280E+00 0.12280E+00 0.25000E-01 0.58782E+01
+ 0.35000E+02 0.55200E+01 0.37080E+00 0.14340E+00 0.27700E-01 0.72920E+01
+ 0.40000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.77541E+01
+ 0.50000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.82870E+01
+ 0.60000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.86530E+01
+ 0.70000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.89210E+01
+ 0.80000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.91320E+01
+ 0.90000E+02 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.92900E+01
+ 0.10000E+03 0.57000E+01 0.34190E+00 0.56880E-01 0.28300E-01 0.94270E+01
diff --git a/PyChem/src b/PyChem/src
new file mode 120000
index 0000000..5cd551c
--- /dev/null
+++ b/PyChem/src
@@ -0,0 +1 @@
+../src
\ No newline at end of file
diff --git a/src/Makefile b/src/Makefile
index c11b3fc..4852c42 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,893 +1,894 @@
#----------------------------------------------------------------------
# From the list below, please activate/deactivate the options that
# apply to your run. If you modify any of these options, make sure
# that you recompile the whole code by typing "make clean; make".
#
# Look at end of file for a brief guide to the compile-time options.
#----------------------------------------------------------------------
#--------------------------------------- Basic operation mode of code
OPT += -DPERIODIC
#OPT += -DUNEQUALSOFTENINGS
#--------------------------------------- Things that are always recommended
OPT += -DPEANOHILBERT
OPT += -DWALLCLOCK
#--------------------------------------- TreePM Options
#OPT += -DPMGRID=128
#OPT += -DPLACEHIGHRESREGION=3
#OPT += -DENLARGEREGION=1.2
#OPT += -DASMTH=1.25
#OPT += -DRCUT=4.5
#--------------------------------------- Single/Double Precision
#OPT += -DDOUBLEPRECISION
#OPT += -DDOUBLEPRECISION_FFTW
#--------------------------------------- Time integration options
OPT += -DSYNCHRONIZATION
#OPT += -DFLEXSTEPS
#OPT += -DPSEUDOSYMMETRIC
OPT += -DNOSTOP_WHEN_BELOW_MINTIMESTEP
#OPT += -DNOPMSTEPADJUSTMENT
#--------------------------------------- Output
OPT += -DADVANCEDSTATISTICS
OPT += -DADVANCEDCPUSTATISTICS
OPT += -DSYSTEMSTATISTICS
OPT += -DBLOCK_SKIPPING
#OPT += -DHAVE_HDF5
#OPT += -DOUTPUTPOTENTIAL
#OPT += -DOUTPUTACCELERATION
#OPT += -DOUTPUTCHANGEOFENTROPY
#OPT += -DOUTPUTTIMESTEP
#OPT += -DOUTPUTERADSTICKY
#OPT += -DOUTPUTERADFEEDBACK
#OPT += -DOUTPUTENERGYFLUX
#OPT += -DOUTPUTOPTVAR1
#OPT += -DOUTPUTOPTVAR2
#OPT += -DOUTPUTSTELLAR_PROP
#--------------------------------------- Things for special behaviour
OPT += -DNOGRAVITY
#OPT += -DNOTREERND
#OPT += -DNOTYPEPREFIX_FFTW
#OPT += -DLONG_X=60
#OPT += -DLONG_Y=5
#OPT += -DLONG_Z=0.2
#OPT += -DTWODIMS
#OPT += -DSPH_BND_PARTICLES
#OPT += -DNOVISCOSITYLIMITER
#OPT += -DCOMPUTE_POTENTIAL_ENERGY
#OPT += -DLONGIDS
OPT += -DISOTHERM_EQS
#OPT += -DADAPTIVE_GRAVSOFT_FORGAS
#OPT += -DSELECTIVE_NO_GRAVITY=2+4+8+16
#OPT += -DAVOIDNUMNGBPROBLEM
#OPT += -DLIMIT_DVEL=1.0
#OPT += -DOTHERINFO
#OPT += -DDOMAIN_AT_ORIGIN
OPT += -DNO_NEGATIVE_PRESSURE
#OPT += -DCOMPUTE_VELOCITY_DISPERSION
#OPT += -DCYLINDRICAL_SYMMETRY
OPT += -DWRITE_ALL_MASSES
#OPT += -DENTROPYPRED
#OPT += -DCOUNT_ACTIVE_PARTICLES
OPT += -DRANDOMSEED_AS_PARAMETER
#OPT += -DDETAILED_CPU
#OPT += -DDETAILED_CPU_GRAVITY
#OPT += -DDETAILED_CPU_DOMAIN
#OPT += -DDETAILED_CPU_OUTPUT_IN_GRAVTREE
#OPT += -DDETAILED_CPU_OUTPUT_IN_HYDRA
#OPT += -DDETAILED_CPU_OUTPUT_IN_DENSITY
#OPT += -DDETAILED_CPU_OUTPUT_IN_STARS_DENSITY
#OPT += -DDETAILED_CPU_OUTPUT_IN_CHIMIE
#OPT += -DSPLIT_DOMAIN_USING_TIME
#OPT += -DCOSMICTIME
OPT += -DONLY_MASTER_READ_EWALD
#OPT += -DPNBODY
#OPT += -DPNBODY_OUTPUT_POS
#OPT += -DPNBODY_OUTPUT_VEL
#OPT += -DPNBODY_OUTPUT_NUM
#OPT += -DPNBODY_OUTPUT_MASS
#OPT += -DPNBODY_OUTPUT_TYPE
#OPT += -DPNBODY_OUTPUT_ENERGY
#OPT += -DPNBODY_OUTPUT_DENSITY
#OPT += -DPNBODY_OUTPUT_HSML
#OPT += -DPNBODY_OUTPUT_METALS
#--------------------------------------- Physical processes
#OPT += -DCOOLING
#OPT += -DIMPLICIT_COOLING_INTEGRATION
#OPT += -DDO_NO_USE_HYDROGEN_MASSFRAC_IN_COOLING
#OPT += -DHEATING
#OPT += -DHEATING_PE # photo-electric heating
#OPT += -DSFR
#OPT += -DCOMPUTE_SFR_ENERGY
#OPT += -DSFR_NEG_DIV_ONLY
#OPT += -DSTELLAR_PROP
#OPT += -DCHIMIE # need stellar prop
#OPT += -DCHIMIE_THERMAL_FEEDBACK
#OPT += -DCHIMIE_COMPUTE_THERMAL_FEEDBACK_ENERGY
#OPT += -DCHIMIE_KINETIC_FEEDBACK
#OPT += -DCHIMIE_COMPUTE_KINETIC_FEEDBACK_ENERGY
#OPT += -DCHIMIE_EXTRAHEADER
#OPT += -DCHIMIE_INPUT_ALL
#OPT += -DCHIMIE_MC_SUPERNOVAE
#OPT += -DFEEDBACK
#OPT += -DFEEDBACK_WIND
#--------------------------------------- multiphase
#OPT += -DMULTIPHASE
#OPT += -DNO_HYDRO_FOR_GAS # do not use hydro routine (at all)
#OPT += -DNO_DENSITY_FOR_STICKY # do not compute density in sticky (need to be done in sfr)
#OPT += -DPHASE_MIXING # need MULTIPHASE : enable phase mixing
#OPT += -DCOLDGAS_CYCLE # need MULTIPHASE and PHASE_MIXING
#OPT += -DEXTERNAL_FLUX
#OPT += -DSTELLAR_FLUX
#OPT += -DCOUNT_COLLISIONS # count sticky collisions
#--------------------------------------- Outer potential
#OPT += -DOUTERPOTENTIAL
#OPT += -DNFW
#OPT += -DPISOTHERM
#OPT += -DPLUMMER
#OPT += -DMIYAMOTONAGAI
#OPT += -DCORIOLIS
#--------------------------------------- Testing and Debugging options
#OPT += -DFORCETEST=0.1
#OPT += -DWITH_ID_IN_HYDRA
#OPT += -DPARTICLE_FLAG
#OPT += -DOUTPUT_EVERY_TIMESTEP
#OPT += -DOUTPUT_COOLING_FUNCTION
#OPT += -DCHECK_BLOCK_ORDER
#OPT += -DCHECK_ENTROPY_SIGN
#OPT += -DCHECK_TYPE_DURING_IO
#OPT += -DCHECK_ID_CORRESPONDENCE
#--------------------------------------- Glass making
#OPT += -DMAKEGLASS=262144
#--------------------------------------- Artificial Conductivity
#OPT += -DART_CONDUCTIVITY
#OPT += -DOUTPUT_CONDUCTIVITY
#OPT += -DOUTPUTOPTVAR1
#OPT += -DOUTPUTOPTVAR2
#--------------------------------------- Agn
#OPT += -DBUBBLES
#OPT += -DAGN_ACCRETION
#OPT += -DAGN_FEEDBACK
#OPT += -DAGN_USE_ANGULAR_MOMENTUM
#OPT += -DAGN_HEATING
#OPT += -DBONDI_ACCRETION
#OPT += -DUSE_BONDI_POWER
#--------------------------------------- Driven Turbulence
OPT += -DAB_TURB
#--------------------------------------- Artificial Viscosity
OPT += -DART_VISCO_CD
#OPT += -DART_VISCO_MM
#OPT += -DART_VISCO_RO
#--------------------------------------- SPH flavour
OPT += -DPRESSURE_ENTROPY_FORMULATION
OPT += -DENTROPYPRED
#----------------------------------------------------------------------
# Here, select compile environment for the target machine. This may need
# adjustment, depending on your local system. Follow the examples to add
# additional target platforms, and to get things properly compiled.
#----------------------------------------------------------------------
#--------------------------------------- Select some defaults
CC = mpicc # sets the C-compiler
OPTIMIZE = -O2 -Wall -g # sets optimization and warning flags
MPICHLIB = -lmpich
#--------------------------------------- Select target computer
SYSTYPE="obscalc"
#SYSTYPE="callisto-intel"
#SYSTYPE="bg1"
#SYSTYPE="obsds"
#SYSTYPE="leo_openmpi"
#SYSTYPE="leo_mpich2shm"
#SYSTYPE="graphor0"
#SYSTYPE="obsrevaz"
#SYSTYPE="regor_openmpigcc"
#SYSTYPE="regor_mvapich2gcc"
#SYSTYPE="meso_mpich2"
#SYSTYPE="meso"
#SYSTYPE="revaz/local"
#SYSTYPE="revaz/local_mpich2"
#SYSTYPE="horizon3_mpich1"
#SYSTYPE="horizon3_mpich2"
#SYSTYPE="horizon3"
#SYSTYPE="LUXOR"
#SYSTYPE="MPA"
#SYSTYPE="Mako"
#SYSTYPE="Regatta"
#SYSTYPE="RZG_LinuxCluster"
#SYSTYPE="RZG_LinuxCluster-gcc"
#SYSTYPE="OpteronMPA"
#SYSTYPE="OPA-Cluster32"
#SYSTYPE="OPA-Cluster64"
#--------------------------------------- Adjust settings for target computer
# module add openmpi-x86_64
ifeq ($(SYSTYPE),"obscalc")
CC = mpicc
OPTIMIZE =
GSL_INCL =
GSL_LIBS =
FFTW_INCL=
FFTW_LIBS=
MPICHLIB =
HDF5INCL =
HDF5LIB =
NO_FFTW_LIB = "yes"
PY_INCL = -I/usr/include/python2.6/
PY_LIB = -lpython2.6
endif
ifeq ($(SYSTYPE),"callisto-intel")
CC = mpicc
OPTIMIZE =
GSL_INCL = -I/u1/yrevaz/local/gsl-intel/include
GSL_LIBS = -L/u1/yrevaz/local/gsl-intel/lib
FFTW_INCL= -I/u1/yrevaz/local/fftw-2.1.5-intel/include
FFTW_LIBS= -L/u1/yrevaz/local/fftw-2.1.5-intel/lib
MPICHLIB =
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"bg1")
CC = mpicc
OPTIMIZE = -O3 -Wall -g
GSL_INCL = -I/home/yrevaz/local/include
GSL_LIBS = -L/home/yrevaz/local/lib
FFTW_INCL=
FFTW_LIBS=
MPICHLIB =
HDF5INCL =
HDF5LIB =
NO_FFTW_LIB = "yes"
endif
ifeq ($(SYSTYPE),"obsds")
CC = mpicc
OPTIMIZE = -O3 -Wall -g
GSL_INCL =
GSL_LIBS =
FFTW_INCL=
FFTW_LIBS=
MPICHLIB =
HDF5INCL =
HDF5LIB =
NO_FFTW_LIB = "yes"
endif
ifeq ($(SYSTYPE),"graphor0")
CC = mpicc
OPTIMIZE = -O3 -Wall -g
GSL_INCL = -I/home/epfl/revaz/local/include
GSL_LIBS = -L/home/epfl/revaz/local/lib
FFTW_INCL= -I/home/epfl/revaz/local/include
FFTW_LIBS= -L/home/epfl/revaz/local/lib
MPICHLIB = -L/home/epfl/revaz/local/openmpi/lib -lmpi
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"obsrevaz")
CC = mpicc
OPTIMIZE = -O3 -Wall -fpack-struct
GSL_INCL =
GSL_LIBS =
FFTW_INCL= -I/home/revaz/local/include/
FFTW_LIBS= -L/home/revaz/local/lib/
MPICHLIB = -lmpi
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"regor_openmpigcc")
CC = mpicc
OPTIMIZE = -O3 -Wall -fpack-struct
GSL_INCL = -I/usr/include
GSL_LIBS = -L/usr/lib64/
FFTW_INCL= -I/home/revaz/local_mvapich2gcc/include/
FFTW_LIBS= -L/home/revaz/local_mvapich2gcc/lib/
MPICHLIB = -lmpi
HDF5INCL =
HDF5LIB =
OPT += -DMESOMACHINE
endif
ifeq ($(SYSTYPE),"regor_mpich2")
CC = mpicc
OPTIMIZE = -O3 -Wall -fpack-struct
GSL_INCL = -I/usr/include
GSL_LIBS = -L/usr/lib64/
FFTW_INCL= -I/home/revaz/local_mvapich2gcc/include/
FFTW_LIBS= -L/home/revaz/local_mvapich2gcc/lib/
MPICHLIB = -L/home/revaz/local/mpich2-1.0.6nemesis/lib/ -lmpich
HDF5INCL =
HDF5LIB =
OPT += -DMESOMACHINE
endif
ifeq ($(SYSTYPE),"regor_mvapich2gcc")
CC = mpicc
OPTIMIZE = -O3 -Wall -fpack-struct
GSL_INCL = -I/usr/include
GSL_LIBS = -L/usr/lib64/
FFTW_INCL= -I/home/revaz/local_mvapich2gcc/include/
FFTW_LIBS= -L/home/revaz/local_mvapich2gcc/lib/
MPICHLIB = -L/cvos/shared/apps/ofed/1.2.5.3/mpi/gcc/mvapich2-0.9.8-15/lib/ -lmpich
HDF5INCL =
HDF5LIB =
OPT += -DMESOMACHINE
endif
ifeq ($(SYSTYPE),"leo_openmpi")
CC = mpicc
OPTIMIZE = -O3 -Wall -fpack-struct
GSL_INCL = -I/export/revaz/local/include
GSL_LIBS = -L/export/revaz/local/lib
FFTW_INCL= -I/export/revaz/local/include
FFTW_LIBS= -L/export/revaz/local/lib
MPICHLIB = -L/usr/local/mpich2-pgi/lib -lmpi
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"leo_mpich2shm")
CC = mpicc
OPTIMIZE = -O3 -Wall -g -fpack-struct
GSL_INCL = -I/export/revaz/local/include
GSL_LIBS = -L/export/revaz/local/lib
FFTW_INCL= -I/export/revaz/local/include
FFTW_LIBS= -L/export/revaz/local/lib
MPICHLIB = -L/usr/local/mpich2-pgi/lib -lmpich
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"meso_mpich2")
CC = mpicc
OPTIMIZE = -O3 -Wall -g -fpack-struct
GSL_INCL = -I/home/revaz/local/include
GSL_LIBS = -L/home/revaz/local/lib
FFTW_INCL= -I/horizon1/x86_64_sl4/fftw/2.1.5/include/
FFTW_LIBS= -L/horizon1/x86_64_sl4/fftw/2.1.5/lib/
MPICHLIB = -L/home/revaz/local/mpich2-1.0.3/lib -lmpich
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"meso")
CC = mpicc
OPTIMIZE = -O3 -g
GSL_INCL =
GSL_LIBS =
FFTW_INCL= -I/horizon1/x86_64_sl4/fftw/2.1.5/include/
FFTW_LIBS= -L/horizon1/x86_64_sl4/fftw/2.1.5/lib/
MPICHLIB =
HDF5INCL =
HDF5LIB =
OPT += -DMESOMACHINE
endif
ifeq ($(SYSTYPE),"revaz/local")
CC = mpicc
OPTIMIZE = -O3 -Wall -g
GSL_INCL = -I/home/revaz/local/include
GSL_LIBS = -L/home/revaz/local/lib
FFTW_INCL= -I/home/revaz/local/include
FFTW_LIBS= -L/home/revaz/local/lib
MPICHLIB = -L/home/revaz/local/mpich-1.2.5/ch_p4/lib -lmpich
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"revaz/local_mpich2")
CC = mpicc
OPTIMIZE = -O3 -Wall -g
GSL_INCL = -I/home/revaz/local/include
GSL_LIBS = -L/home/revaz/local/lib
FFTW_INCL= -I/home/revaz/local/include
FFTW_LIBS= -L/home/revaz/local/lib
MPICHLIB = -L/home/revaz/local/mpich2-1.0.3/lib/ -lmpich
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"LUXOR")
CC = mpicc
OPTIMIZE = -O3 -Wall -g
#GSL_INCL = -I/home/revaz/local/include
#GSL_LIBS = -L/home/revaz/local/lib
#FFTW_INCL= -I/home/revaz/local/include
#FFTW_LIBS= -L/home/revaz/local/lib
MPICHLIB = -L/home/revaz/local/mpich-1.2.7/ch_p4/lib -lmpich
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"horizon3")
CC = mpicc
OPTIMIZE = -O3 -Wall -g -fpack-struct
GSL_INCL = -I/home/revaz/local/include
GSL_LIBS = -L/home/revaz/local/lib
FFTW_INCL= -I/home/revaz/local/include
FFTW_LIBS= -L/home/revaz/local/lib
MPICHLIB = -llam
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"horizon3_mpich1")
CC = mpicc
OPTIMIZE = -O3 -Wall -g -fpack-struct
GSL_INCL = -I/home/revaz/local/include
GSL_LIBS = -L/home/revaz/local/lib
FFTW_INCL= -I/home/revaz/local/include
FFTW_LIBS= -L/home/revaz/local/lib
MPICHLIB = -L/home/revaz/local/mpich-1.2.7/lib -lmpich
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"horizon3_mpich2")
CC = mpicc
OPTIMIZE = -O3 -Wall -g -fpack-struct
GSL_INCL = -I/home/revaz/local/include
GSL_LIBS = -L/home/revaz/local/lib
FFTW_INCL= -I/home/revaz/local/include
FFTW_LIBS= -L/home/revaz/local/lib
MPICHLIB = -L/usr/local/mpich2-pgi/lib -lmpich
HDF5INCL =
HDF5LIB =
endif
ifeq ($(SYSTYPE),"MPA")
CC = mpicc
OPTIMIZE = -O3 -Wall
GSL_INCL = -I/usr/common/pdsoft/include
GSL_LIBS = -L/usr/common/pdsoft/lib -Wl,"-R /usr/common/pdsoft/lib"
FFTW_INCL=
FFTW_LIBS=
MPICHLIB =
HDF5INCL =
HDF5LIB = -lhdf5 -lz
endif
ifeq ($(SYSTYPE),"OpteronMPA")
CC = mpicc
OPTIMIZE = -O3 -Wall -m64
GSL_INCL = -L/usr/local/include
GSL_LIBS = -L/usr/local/lib
FFTW_INCL=
FFTW_LIBS=
MPICHLIB =
HDF5INCL = -I/opt/hdf5/include
HDF5LIB = -L/opt/hdf5/lib -lhdf5 -lz -Wl,"-R /opt/hdf5/lib"
endif
ifeq ($(SYSTYPE),"OPA-Cluster32")
CC = mpicc
OPTIMIZE = -O3 -Wall
GSL_INCL = -I/afs/rzg/bc-b/vrs/opteron32/include
GSL_LIBS = -L/afs/rzg/bc-b/vrs/opteron32/lib -Wl,"-R /afs/rzg/bc-b/vrs/opteron32/lib"
FFTW_INCL= -I/afs/rzg/bc-b/vrs/opteron32/include
FFTW_LIBS= -L/afs/rzg/bc-b/vrs/opteron32/lib
MPICHLIB =
HDF5INCL =
HDF5LIB = -lhdf5 -lz
endif
ifeq ($(SYSTYPE),"OPA-Cluster64")
CC = mpicc
OPTIMIZE = -O3 -Wall -m64
GSL_INCL = -I/afs/rzg/bc-b/vrs/opteron64/include
GSL_LIBS = -L/afs/rzg/bc-b/vrs/opteron64/lib -Wl,"-R /afs/rzg/bc-b/vrs/opteron64/lib"
FFTW_INCL= -I/afs/rzg/bc-b/vrs/opteron64/include
FFTW_LIBS= -L/afs/rzg/bc-b/vrs/opteron64/lib
MPICHLIB =
HDF5INCL =
HDF5LIB = -lhdf5 -lz
endif
ifeq ($(SYSTYPE),"Mako")
CC = mpicc # sets the C-compiler
OPTIMIZE = -O3 -march=athlon-mp -mfpmath=sse
GSL_INCL =
GSL_LIBS =
FFTW_INCL=
FFTW_LIBS=
MPICHLIB =
HDF5INCL =
HDF5LIB = -lhdf5 -lz
endif
ifeq ($(SYSTYPE),"Regatta")
CC = mpcc_r
OPTIMIZE = -O5 -qstrict -qipa -q64
GSL_INCL = -I/afs/rzg/u/vrs/gsl_psi64/include
GSL_LIBS = -L/afs/rzg/u/vrs/gsl_psi64/lib
FFTW_INCL= -I/afs/rzg/u/vrs/fftw_psi64/include
FFTW_LIBS= -L/afs/rzg/u/vrs/fftw_psi64/lib -q64 -qipa
MPICHLIB =
HDF5INCL = -I/afs/rzg/u/vrs/hdf5_psi64/include
HDF5LIB = -L/afs/rzg/u/vrs/hdf5_psi64/lib -lhdf5 -lz
endif
ifeq ($(SYSTYPE),"RZG_LinuxCluster")
CC = mpicci
OPTIMIZE = -O3 -ip # Note: Don't use the "-rcd" optimization of Intel's compiler! (causes code crashes)
GSL_INCL = -I/afs/rzg/u/vrs/gsl_linux/include
GSL_LIBS = -L/afs/rzg/u/vrs/gsl_linux/lib -Wl,"-R /afs/rzg/u/vrs/gsl_linux/lib"
FFTW_INCL= -I/afs/rzg/u/vrs/fftw_linux/include
FFTW_LIBS= -L/afs/rzg/u/vrs/fftw_linux/lib
HDF5INCL = -I/afs/rzg/u/vrs/hdf5_linux/include
HDF5LIB = -L/afs/rzg/u/vrs/hdf5_linux/lib -lhdf5 -lz -Wl,"-R /afs/rzg/u/vrs/hdf5_linux/lib"
endif
ifeq ($(SYSTYPE),"RZG_LinuxCluster-gcc")
CC = mpiccg
OPTIMIZE = -Wall -g -O3 -march=pentium4
GSL_INCL = -I/afs/rzg/u/vrs/gsl_linux_gcc3.2/include
GSL_LIBS = -L/afs/rzg/u/vrs/gsl_linux_gcc3.2/lib -Wl,"-R /afs/rzg/u/vrs/gsl_linux_gcc3.2/lib"
FFTW_INCL= -I/afs/rzg/u/vrs/fftw_linux_gcc3.2/include
FFTW_LIBS= -L/afs/rzg/u/vrs/fftw_linux_gcc3.2/lib
HDF5INCL = -I/afs/rzg/u/vrs/hdf5_linux/include
HDF5LIB = -L/afs/rzg/u/vrs/hdf5_linux/lib -lhdf5 -lz -Wl,"-R /afs/rzg/u/vrs/hdf5_linux/lib"
endif
ifneq (HAVE_HDF5,$(findstring HAVE_HDF5,$(OPT)))
HDF5INCL =
HDF5LIB =
endif
OPTIONS = $(OPTIMIZE) $(OPT)
EXEC = Gadget2
OBJS = main.o run.o predict.o begrun.o endrun.o global.o \
timestep.o init.o restart.o io.o \
accel.o read_ic.o ngb.o \
system.o allocate.o density.o \
gravtree.o hydra.o driftfac.o \
domain.o allvars.o potential.o \
forcetree.o peano.o gravtree_forcetest.o \
pm_periodic.o pm_nonperiodic.o longrange.o \
cooling.o agn_heating.o phase.o sticky.o outerpotential.o starformation.o \
- agn_feedback.o bubbles.o bondi_accretion.o chimie.o stars_density.o cosmictime.o pnbody.o ab_turb.o art_visc.o
+ agn_feedback.o bubbles.o bondi_accretion.o chimie.o stars_density.o cosmictime.o \
+ pnbody.o ab_turb.o art_visc.o chemistry.o
INCL = allvars.h proto.h tags.h Makefile
CFLAGS = $(OPTIONS) $(GSL_INCL) $(FFTW_INCL) $(HDF5INCL) $(PY_INCL)
ifeq (NOTYPEPREFIX_FFTW,$(findstring NOTYPEPREFIX_FFTW,$(OPT))) # fftw installed with type prefix?
FFTW_LIB = $(FFTW_LIBS) -lrfftw_mpi -lfftw_mpi -lrfftw -lfftw
else
ifeq (DOUBLEPRECISION_FFTW,$(findstring DOUBLEPRECISION_FFTW,$(OPT)))
FFTW_LIB = $(FFTW_LIBS) -ldrfftw_mpi -ldfftw_mpi -ldrfftw -ldfftw
else
FFTW_LIB = $(FFTW_LIBS) -lsrfftw_mpi -lsfftw_mpi -lsrfftw -lsfftw
endif
endif
ifeq ($(NO_FFTW_LIB),"yes")
FFTW_LIB =
endif
LIBS = $(HDF5LIB) -g $(MPICHLIB) $(GSL_LIBS) -lgsl -lgslcblas -lm $(FFTW_LIB) $(PY_LIB)
$(EXEC): $(OBJS)
$(CC) $(OBJS) $(LIBS) -o $(EXEC)
$(OBJS): $(INCL)
clean:
rm -f $(OBJS) $(EXEC)
#-----------------------------------------------------------------------
#
# Brief guide to compile-time options of the code. More information
# can be found in the code documentation.
#
# - PERIODIC:
# Set this if you want to have periodic boundary conditions.
#
# - UNEQUALSOFTENINGS:
# Set this if you use particles with different gravitational
# softening lengths.
#
# - PEANOHILBERT:
# This is a tuning option. When set, the code will bring the
# particles after each domain decomposition into Peano-Hilbert
# order. This improves cache utilization and performance.
#
# - WALLCLOCK:
# If set, a wallclock timer is used by the code to measure internal
# time consumption (see cpu-log file). Otherwise, a timer that
# measures consumed processor ticks is used.
#
# - PMGRID:
# This enables the TreePM method, i.e. the long-range force is
# computed with a PM-algorithm, and the short range force with the
# tree. The parameter has to be set to the size of the mesh that
# should be used, (e.g. 64, 96, 128, etc). The mesh dimensions need
# not necessarily be a power of two. Note: If the simulation is
# not in a periodic box, then a FFT method for vacuum boundaries is
# employed, using an actual mesh with dimension twice(!) that
# specified by PMGRID.
#
# - PLACEHIGHRESREGION:
# If this option is set (will only work together with PMGRID), then
# the long range force is computed in two stages: One Fourier-grid
# is used to cover the whole simulation volume, allowing the
# computation of the longe-range force. A second Fourier mesh is
# placed on the region occupied by "high-resolution" particles,
# allowing the computation of an intermediate scale force. Finally,
# the force on short scales is computed with the tree. This
# procedure can be useful for "zoom-simulations", provided the
# majority of particles (the high-res particles) are occupying only
# a small fraction of the volume. To activate this option, the
# parameter needs to be set to an integer bit mask that encodes the
# particle types that make up the high-res particles.
# For example, if types 0, 1, and 4 form the high-res
# particles, set the parameter to PLACEHIGHRESREGION=19, because
# 2^0 + 2^1 + 2^4 = 19. The spatial region covered by the high-res
# grid is determined automatically from the initial conditions.
# Note: If a periodic box is used, the high-res zone may not intersect
# the box boundaries.
#
# - ENLARGEREGION:
# The spatial region covered by the high-res zone has a fixed size
# during the simulation, which initially is set to the smallest
# region that encompasses all high-res particles. Normally, the
# simulation will be interrupted if high-res particles leave this
# region in the course of the run. However, by setting this
# parameter to a value larger than one, the size of the high-res
# region can be expanded, providing a buffer region. For example,
# setting it to 1.4 will enlarge its side-length by 40% (it remains
# centered on the high-res particles). Hence, with this setting, the
# high-res region may expand or move by a limited amount.
# Note: If SYNCHRONIZATION is activated, the code will be able to
# continue even if high-res particles leave the initial high-res
# grid. In this case, the code will update the size and position of
# the grid that is placed onto the high-resolution region
# automatically. To prevent that this potentially happens every
# single PM step, one should nevertheless assign a value slightly
# larger than 1 to ENLARGEREGION.
#
# - ASMTH:
# This can be used to override the value assumed for the scale that
# defines the long-range/short-range force-split in the TreePM
# algorithm. The default value is 1.25, in mesh-cells.
#
# - RCUT:
# This can be used to override the maximum radius in which the
# short-range tree-force is evaluated (in case the TreePM algorithm
# is used). The default value is 4.5, given in mesh-cells.
#
# - DOUBLEPRECISION:
# This makes the code store and compute internal particle data in
# double precision. Note that output files are nevertheless written
# by converting the particle data to single precision.
#
# - DDOUBLEPRECISION_FFTW:
# If this is set, the code will use the double-precision version of
# FTTW, provided the latter has been explicitly installed with a
# "d" prefix, and NOTYPEPREFIX_FFTW is not set. Otherwise the
# single precision version ("s" prefix) is used.
#
# - SYNCHRONIZATION:
# When this is set, particles are kept in a binary hierarchy of
# timesteps and may only increase their timestep if the new
# timestep will put them into synchronization with the higher time
# level.
#
# - FLEXSTEPS:
# This is an alternative to SYNCHRONIZATION. Particle timesteps are
# here allowed to be integer multiples of the minimum timestep that
# occurs among the particles, which in turn is rounded down to the
# nearest power-of-two devision of the total simulated
# timespan. This option distributes particles more evenly over
# individual system timesteps, particularly once a simulation has
# run for a while, and may then result in a reduction of work-load
# imbalance losses.
#
# - PSEUDOSYMMETRIC:
# When this option is set, the code will try to "anticipate"
# timestep changes by extrapolating the change of the acceleration
# into the future. This can in certain idealized cases improve the
# long-term integration behaviour of periodic orbits, but should
# make little or no difference in most real-world applications. May
# only be used together with SYNCHRONIZATION.
#
# - NOSTOP_WHEN_BELOW_MINTIMESTEP:
# If this is activated, the code will not terminate when the
# timestep falls below the value of MinSizeTimestep specified in
# the parameterfile. This is useful for runs where one wants to
# enforce a constant timestep for all particles. This can be done
# by activating this option, and by setting MinSizeTimestep and
# MaxSizeTimestep to an equal value.
#
# - NOPMSTEPADJUSTMENT:
# When this is set, the long-range timestep for the PM-force
# computation (when the TreePM algorithm is used) is always
# determined by MaxSizeTimeStep. Otherwise, it is determined by
# the MaxRMSDisplacement parameter, or MaxSizeTimeStep, whichever
# gives the smaller step.
#
# - HAVE_HDF5:
# If this is set, the code will be compiled with support for input
# and output in the HDF5 format. You need to have the HDF5
# libraries and headers installed on your computer for this option
# to work. The HDF5 format can then be selected as format "3" in
# Gadget's parameterfile.
#
# - OUTPUTPOTENTIAL:
# This will make the code compute gravitational potentials for
# all particles each time a snapshot file is generated. The values
# are then included in the snapshot file. Note that the computation
# of the values of the gravitational potential costs additional CPU.
#
# - OUTPUTACCELERATION:
# This will include the physical acceleration of each particle in
# snapshot files.
#
# - OUTPUTCHANGEOFENTROPY:
# This will include the rate of change of entropy of gas particles
# in snapshot files.
#
# - OUTPUTTIMESTEP:
# This will include the current timesteps of all particles in the
# snapshot files.
#
# - NOGRAVITY
# This switches off gravity. Useful only for pure SPH simulations
# in non-expanding space.
#
# - NOTREERND:
# If this is not set, the tree construction will succeed even when
# there are a few particles at identical locations. This is done by
# `rerouting' particles once the node-size has fallen below 1.0e-3
# of the softening length. When this option is activated, this will
# be surpressed and the tree construction will always fail if there
# are particles at extremely close coordinates.
#
# - NOTYPEPREFIX_FFTW:
# This is an option that signals that FFTW has been compiled
# without the type-prefix option, i.e. no leading "d" or "s"
# characters are used to access the library.
#
# - LONG_X/Y/Z:
# These options can be used together with PERIODIC and NOGRAVITY only.
# When set, the options define numerical factors that can be used to
# distorts the periodic simulation cube into a parallelepiped of
# arbitrary aspect ratio. This can be useful for idealized SPH tests.
#
# - TWODIMS:
# This effectively switches of one dimension in SPH, i.e. the code
# follows only 2d hydrodynamics in the xy-, yz-, or xz-plane. This
# only works with NOGRAVITY, and if all coordinates of the third
# axis are exactly equal. Can be useful for idealized SPH tests.
#
# - SPH_BND_PARTICLES:
# If this is set, particles with a particle-ID equal to zero do not
# receive any SPH acceleration. This can be useful for idealized
# SPH tests, where these particles represent fixed "walls".
#
# - NOVISCOSITYLIMITER:
# If this is set, the code will not try to put an upper limit on
# the viscous force in case an implausibly high pair-wise viscous
# force (which may lead to a particle 'reflection' in case of poor
# timestepping) should arise. Note: For proper settings of the
# timestep parameters, this situation should not arise.
#
# - COMPUTE_POTENTIAL_ENERGY:
# When this option is set, the code will compute the gravitational
# potential energy each time a global statistics is computed. This
# can be useful for testing global energy conservation.
#
# - LONGIDS:
# If this is set, the code assumes that particle-IDs are stored as
# 64-bit long integers. This is only really needed if you want to
# go beyond ~2 billion particles.
#
# - ISOTHERM_EQS:
# This special option makes the gas behave like an isothermal gas
# with equation of state P = cs^2 * rho. The sound-speed cs is set by
# the thermal energy per unit mass in the intial conditions,
# i.e. cs^2=u. If the value for u is zero, then the initial gas
# temperature in the parameter file is used to define the sound speed
# according to cs^2 = 3/2 kT/mp, where mp is the proton mass.
#
# - ADAPTIVE_GRAVSOFT_FORGAS:
# When this option is set, the gravitational softening lengths used for
# gas particles is tied to their SPH smoothing length. This can be useful
# for dissipative collapse simulations. The option requires the setting
# of UNEQUALSOFTENINGS.
#
# - SELECTIVE_NO_GRAVITY:
# This can be used for special computations where one wants to
# exclude certain particle types from receiving gravitational
# forces. The particle types that are excluded in this fashion are
# specified by a bit mask, in the same as for the PLACEHIGHRESREGION
# option.
#
# - FORCETEST:
# This can be set to check the force accuracy of the code. The
# option needs to be set to a number between 0 and 1 (e.g. 0.01),
# which is taken to specify a random fraction of particles for
# which at each timestep forces by direct summation are
# computed. The normal tree-forces and the correct direct
# summation forces are collected in a file. Note that the
# simulation itself is unaffected by this option, but it will of
# course run much(!) slower, especially if
# FORCETEST*NumPart*NumPart >> NumPart. Note: Particle IDs must
# be set to numbers >=1 for this to work.
#
# - MAKEGLASS
# This option can be used to generate a glass-like particle
# configuration. The value assigned gives the particle load,
# which is initially generated as a Poisson sample and then
# evolved towards a glass with the sign of gravity reversed.
#
#-----------------------------------------------------------------------
diff --git a/src/allvars.h b/src/allvars.h
index 26bb6b2..2ed2b97 100644
--- a/src/allvars.h
+++ b/src/allvars.h
@@ -1,1949 +1,1953 @@
/*! \file allvars.h
* \brief declares global variables.
*
* This file declares all global variables. Further variables should be added here, and declared as
* 'extern'. The actual existence of these variables is provided by the file 'allvars.c'. To produce
* 'allvars.c' from 'allvars.h', do the following:
*
* - Erase all #define's, typedef's, and enum's
* - add #include "allvars.h", delete the #ifndef ALLVARS_H conditional
* - delete all keywords 'extern'
* - delete all struct definitions enclosed in {...}, e.g.
* "extern struct global_data_all_processes {....} All;"
* becomes "struct global_data_all_processes All;"
*/
#ifndef ALLVARS_H
#define ALLVARS_H
#include <stdio.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_spline.h>
#include <gsl/gsl_integration.h>
#include "tags.h"
#define GADGETVERSION "2.0" /*!< code version string */
#define TIMEBASE (1<<28) /*!< The simulated timespan is mapped onto the integer interval [0,TIMESPAN],
* where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29
*/
#define MAXTOPNODES 200000 /*!< Maximum number of nodes in the top-level tree used for domain decomposition */
typedef long long peanokey; /*!< defines the variable type used for Peano-Hilbert keys */
#define BITS_PER_DIMENSION 18 /*!< Bits per dimension available for Peano-Hilbert order.
Note: If peanokey is defined as type int, the allowed maximum is 10.
If 64-bit integers are used, the maximum is 21 */
#define PEANOCELLS (((peanokey)1)<<(3*BITS_PER_DIMENSION)) /*!< The number of different Peano-Hilbert cells */
#define RNDTABLE 3000 /*!< gives the length of a table with random numbers, refreshed at every timestep.
This is used to allow application of random numbers to a specific particle
in a way that is independent of the number of processors used. */
#define MAX_REAL_NUMBER 1e37
#define MIN_REAL_NUMBER 1e-37
#define MAXLEN_FILENAME 100 /*!< Maximum number of characters for filenames (including the full path) */
#ifdef ISOTHERM_EQS
#define GAMMA (1.0) /*!< index for isothermal gas */
#else
#define GAMMA (5.0/3) /*!< adiabatic index of simulated gas */
#endif
#define GAMMA_MINUS1 (GAMMA-1)
#define HYDROGEN_MASSFRAC 0.76 /*!< mass fraction of hydrogen, relevant only for radiative cooling */
/* Some physical constants in cgs units */
#define GRAVITY 6.672e-8 /*!< Gravitational constant (in cgs units) */
#define SOLAR_MASS 1.989e33
#define SOLAR_LUM 3.826e33
#define RAD_CONST 7.565e-15
#define AVOGADRO 6.0222e23
#define BOLTZMANN 1.3806e-16
#define GAS_CONST 8.31425e7
#define C 2.9979e10
#define PLANCK 6.6262e-27
#define CM_PER_MPC 3.085678e24
#define PROTONMASS 1.6726e-24
#define ELECTRONMASS 9.10953e-28
#define THOMPSON 6.65245e-25
#define ELECTRONCHARGE 4.8032e-10
#define HUBBLE 3.2407789e-18 /* in h/sec */
#define YEAR_IN_SECOND 31536000.0 /* year in sec */
#define FEH_SOLAR 0.00181 /* used only if cooling with metal is on and chimie is off */
#define PI 3.1415926535897931
#define TWOPI 6.2831853071795862
/* Some conversion factors */
#define SEC_PER_MEGAYEAR 3.155e13
#define SEC_PER_YEAR 3.155e7
#ifndef ASMTH
#define ASMTH 1.25 /*!< ASMTH gives the scale of the short-range/long-range force split in units of FFT-mesh cells */
#endif
#ifndef RCUT
#define RCUT 4.5 /*!< RCUT gives the maximum distance (in units of the scale used for the force split) out to
which short-range forces are evaluated in the short-range tree walk. */
#endif
#define MAX_NGB 20000 /*!< defines maximum length of neighbour list */
#define MAXLEN_OUTPUTLIST 500 /*!< maxmimum number of entries in list of snapshot output times */
#define DRIFT_TABLE_LENGTH 1000 /*!< length of the lookup table used to hold the drift and kick factors */
#ifdef COSMICTIME
#define COSMICTIME_TABLE_LENGTH 1000 /*!< length of the lookup table used for the cosmic time computation */
#endif
#define MAXITER 1000 /*!< maxmimum number of steps for SPH neighbour iteration */
#ifdef DOUBLEPRECISION /*!< If defined, the variable type FLOAT is set to "double", otherwise to FLOAT */
#define FLOAT double
#else
#define FLOAT float
#endif
#ifndef TWODIMS
#define NUMDIMS 3 /*!< For 3D-normalized kernel */
#define KERNEL_COEFF_1 2.546479089470 /*!< Coefficients for SPH spline kernel and its derivative */
#define KERNEL_COEFF_2 15.278874536822
#define KERNEL_COEFF_3 45.836623610466
#define KERNEL_COEFF_4 30.557749073644
#define KERNEL_COEFF_5 5.092958178941
#define KERNEL_COEFF_6 (-15.278874536822)
#define NORM_COEFF 4.188790204786 /*!< Coefficient for kernel normalization. Note: 4.0/3 * PI = 4.188790204786 */
#else
#define NUMDIMS 2 /*!< For 2D-normalized kernel */
#define KERNEL_COEFF_1 (5.0/7*2.546479089470) /*!< Coefficients for SPH spline kernel and its derivative */
#define KERNEL_COEFF_2 (5.0/7*15.278874536822)
#define KERNEL_COEFF_3 (5.0/7*45.836623610466)
#define KERNEL_COEFF_4 (5.0/7*30.557749073644)
#define KERNEL_COEFF_5 (5.0/7*5.092958178941)
#define KERNEL_COEFF_6 (5.0/7*(-15.278874536822))
#define NORM_COEFF M_PI /*!< Coefficient for kernel normalization. */
#endif
#ifdef MULTIPHASE
#define GAS_SPH 0
#define GAS_STICKY 1
#define GAS_DARK 2
#endif
#if defined(SFR) || defined(STELLAR_PROP)
#define ST 1
#endif
#ifdef CHIMIE
#define NELEMENTS 5
#define MAXNELEMENTS 64
#define FIRST_ELEMENT "Fe"
#define FE 0
#endif
#ifdef COOLING
#define COOLING_NMETALICITIES 9
#define COOLING_NTEMPERATURES 171
#endif
#ifdef COMPUTE_VELOCITY_DISPERSION
#define VELOCITY_DISPERSION_SIZE 3
#endif
extern int SetMinTimeStepForActives;
extern int ThisTask; /*!< the rank of the local processor */
extern int NTask; /*!< number of processors */
extern int PTask; /*!< smallest integer such that NTask <= 2^PTask */
extern int NumPart; /*!< number of particles on the LOCAL processor */
extern int N_gas; /*!< number of gas particles on the LOCAL processor */
#if defined(SFR) || defined(STELLAR_PROP)
extern int N_stars; /*!< number of stars particle on the LOCAL processor */
#endif
#ifdef MULTIPHASE
extern int N_sph;
extern int N_sticky;
extern int N_stickyflaged;
extern int N_dark;
extern int NumColPotLocal; /*!< local number of potentially collisional particles */
extern int NumColPot; /*!< total number of potentially collisional particles */
extern int NumColLocal; /*!< local number of collisions */
extern int NumCol; /*!< total number of collisions */
extern int NumNoColLocal;
extern int NumNoCol;
#endif
extern long long Ntype[6]; /*!< total number of particles of each type */
extern int NtypeLocal[6]; /*!< local number of particles of each type */
extern int NumForceUpdate; /*!< number of active particles on local processor in current timestep */
extern int NumSphUpdate; /*!< number of active SPH particles on local processor in current timestep */
#ifdef CHIMIE
extern int NumStUpdate;
#endif
#ifdef TESSEL
extern int NumPTUpdate;
#endif
extern double CPUThisRun; /*!< Sums the CPU time for the process (current submission only) */
#ifdef SPLIT_DOMAIN_USING_TIME
extern double CPU_Gravity;
#endif
extern int RestartFlag; /*!< taken from command line used to start code. 0 is normal start-up from
initial conditions, 1 is resuming a run from a set of restart files, while 2
marks a restart from a snapshot file. */
extern char *Exportflag; /*!< Buffer used for flagging whether a particle needs to be exported to another process */
extern int *Ngblist; /*!< Buffer to hold indices of neighbours retrieved by the neighbour search routines */
extern int TreeReconstructFlag; /*!< Signals that a new tree needs to be constructed */
#ifdef SFR
extern int RearrangeParticlesFlag;/*!< Signals that particles must be rearanged */
#endif
extern int Flag_FullStep; /*!< This flag signals that the current step involves all particles */
extern gsl_rng *random_generator; /*!< the employed random number generator of the GSL library */
extern double RndTable[RNDTABLE]; /*!< Hold a table with random numbers, refreshed every timestep */
#ifdef SFR
extern double StarFormationRndTable[RNDTABLE]; /*!< Hold a table with random numbers, refreshed every timestep */
#endif
#ifdef FEEDBACK_WIND
extern double FeedbackWindRndTable[RNDTABLE]; /*!< Hold a table with random numbers, refreshed every timestep */
#endif
#ifdef CHIMIE
extern double ChimieRndTable[RNDTABLE]; /*!< Hold a table with random numbers, refreshed every timestep */
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
extern double ChimieKineticFeedbackRndTable[RNDTABLE]; /*!< Hold a table with random numbers, refreshed every timestep */
#endif
#ifdef AB_TURB
//Ornstein-Uhlenbeck variables
extern double StOUVar;
extern double* StOUPhases;
extern gsl_rng* StRng;
//forcing field in fourie space
extern double* StAmpl;
extern double* StAka; //phases (real part)
extern double* StAkb; //phases (imag part)
extern double* StMode;
extern int StNModes;
//integertime StTPrev; (yr : ask ?)
extern int StTPrev;
extern double StSolWeightNorm;
#endif
#ifdef PY_INTERFACE
extern int NumPartQ;
extern int N_gasQ;
extern long long NtypeQ[6]; /*!< total number of particles of each type */
extern int NtypeLocalQ[6]; /*!< local number of particles of each type */
extern double DomainCornerQ[3]; /*!< gives the lower left corner of simulation volume */
extern double DomainCenterQ[3]; /*!< gives the center of simulation volume */
extern double DomainLenQ; /*!< gives the (maximum) side-length of simulation volume */
extern double DomainFacQ; /*!< factor used for converting particle coordinates to a Peano-Hilbert mesh covering the simulation volume */
extern int DomainMyStartQ; /*!< first domain mesh cell that resides on the local processor */
extern int DomainMyLastQ; /*!< last domain mesh cell that resides on the local processor */
extern int *DomainStartListQ; /*!< a table that lists the first domain mesh cell for all processors */
extern int *DomainEndListQ; /*!< a table that lists the last domain mesh cell for all processors */
extern double *DomainWorkQ; /*!< a table that gives the total "work" due to the particles stored by each processor */
extern int *DomainCountQ; /*!< a table that gives the total number of particles held by each processor */
extern int *DomainCountSphQ; /*!< a table that gives the total number of SPH particles held by each processor */
extern int *DomainTaskQ; /*!< this table gives for each leaf of the top-level tree the processor it was assigned to */
extern peanokey *DomainKeyBufQ; /*!< this points to a buffer used during the exchange of particle data */
extern int NTopnodesQ; /*!< total number of nodes in top-level tree */
extern int NTopleavesQ; /*!< number of leaves in top-level tree. Each leaf can be assigned to a different processor */
extern void *CommBufferQ; /*!< points to communication buffer, which is used in the domain decomposition, the
parallel tree-force computation, the SPH routines, etc. */
#endif
extern double DomainCorner[3]; /*!< gives the lower left corner of simulation volume */
extern double DomainCenter[3]; /*!< gives the center of simulation volume */
extern double DomainLen; /*!< gives the (maximum) side-length of simulation volume */
extern double DomainFac; /*!< factor used for converting particle coordinates to a Peano-Hilbert mesh covering the simulation volume */
extern int DomainMyStart; /*!< first domain mesh cell that resides on the local processor */
extern int DomainMyLast; /*!< last domain mesh cell that resides on the local processor */
extern int *DomainStartList; /*!< a table that lists the first domain mesh cell for all processors */
extern int *DomainEndList; /*!< a table that lists the last domain mesh cell for all processors */
extern double *DomainWork; /*!< a table that gives the total "work" due to the particles stored by each processor */
extern int *DomainCount; /*!< a table that gives the total number of particles held by each processor */
extern int *DomainCountSph; /*!< a table that gives the total number of SPH particles held by each processor */
extern int *DomainTask; /*!< this table gives for each leaf of the top-level tree the processor it was assigned to */
extern int *DomainNodeIndex; /*!< this table gives for each leaf of the top-level tree the corresponding node of the gravitational tree */
extern FLOAT *DomainTreeNodeLen; /*!< this table gives for each leaf of the top-level tree the side-length of the corresponding node of the gravitational tree */
extern FLOAT *DomainHmax; /*!< this table gives for each leaf of the top-level tree the maximum SPH smoothing length among the particles of the corresponding node of the gravitational tree */
extern struct DomainNODE
{
FLOAT s[3]; /*!< center-of-mass coordinates */
FLOAT vs[3]; /*!< center-of-mass velocities */
FLOAT mass; /*!< mass of node */
#ifdef STELLAR_FLUX
FLOAT starlum; /*!< star luminosity of node */
#endif
#ifdef UNEQUALSOFTENINGS
#ifndef ADAPTIVE_GRAVSOFT_FORGAS
int bitflags; /*!< this bit-field encodes the particle type with the largest softening among the particles of the nodes, and whether there are particles with different softening in the node */
#else
FLOAT maxsoft; /*!< hold the maximum gravitational softening of particles in the
node if the ADAPTIVE_GRAVSOFT_FORGAS option is selected */
#endif
#endif
}
*DomainMoment; /*!< this table stores for each node of the top-level tree corresponding node data from the gravitational tree */
extern peanokey *DomainKeyBuf; /*!< this points to a buffer used during the exchange of particle data */
extern peanokey *Key; /*!< a table used for storing Peano-Hilbert keys for particles */
extern peanokey *KeySorted; /*!< holds a sorted table of Peano-Hilbert keys for all particles, used to construct top-level tree */
extern int NTopnodes; /*!< total number of nodes in top-level tree */
extern int NTopleaves; /*!< number of leaves in top-level tree. Each leaf can be assigned to a different processor */
extern struct topnode_data
{
int Daughter; /*!< index of first daughter cell (out of 8) of top-level node */
int Pstart; /*!< for the present top-level node, this gives the index of the first node in the concatenated list of topnodes collected from all processors */
int Blocks; /*!< for the present top-level node, this gives the number of corresponding nodes in the concatenated list of topnodes collected from all processors */
int Leaf; /*!< if the node is a leaf, this gives its number when all leaves are traversed in Peano-Hilbert order */
peanokey Size; /*!< number of Peano-Hilbert mesh-cells represented by top-level node */
peanokey StartKey; /*!< first Peano-Hilbert key in top-level node */
long long Count; /*!< counts the number of particles in this top-level node */
}
#ifdef PY_INTERFACE
*TopNodesQ,
#endif
*TopNodes; /*!< points to the root node of the top-level tree */
extern double TimeOfLastTreeConstruction; /*!< holds what it says, only used in connection with FORCETEST */
/* variables for input/output, usually only used on process 0 */
extern char ParameterFile[MAXLEN_FILENAME]; /*!< file name of parameterfile used for starting the simulation */
extern FILE *FdInfo; /*!< file handle for info.txt log-file. */
extern FILE *FdLog; /*!< file handle for log.txt log-file. */
extern FILE *FdEnergy; /*!< file handle for energy.txt log-file. */
#ifdef SYSTEMSTATISTICS
extern FILE *FdSystem;
#endif
extern FILE *FdTimings; /*!< file handle for timings.txt log-file. */
extern FILE *FdCPU; /*!< file handle for cpu.txt log-file. */
#ifdef FORCETEST
extern FILE *FdForceTest; /*!< file handle for forcetest.txt log-file. */
#endif
#ifdef SFR
extern FILE *FdSfr; /*!< file handle for sfr.txt log-file. */
#endif
#ifdef CHIMIE
extern FILE *FdChimie; /*!< file handle for chimie log-file. */
#endif
#ifdef MULTIPHASE
extern FILE *FdPhase; /*!< file handle for pase.txt log-file. */
extern FILE *FdSticky; /*!< file handle for sticky.txt log-file. */
#endif
#ifdef AGN_ACCRETION
extern FILE *FdAccretion; /*!< file handle for accretion.txt log-file. */
#endif
#ifdef BONDI_ACCRETION
extern FILE *FdBondi; /*!< file handle for bondi.txt log-file. */
#endif
#ifdef BUBBLES
extern FILE *FdBubble; /*!< file handle for bubble.txt log-file. */
#endif
extern double DriftTable[DRIFT_TABLE_LENGTH]; /*!< table for the cosmological drift factors */
extern double GravKickTable[DRIFT_TABLE_LENGTH]; /*!< table for the cosmological kick factor for gravitational forces */
extern double HydroKickTable[DRIFT_TABLE_LENGTH]; /*!< table for the cosmological kick factor for hydrodynmical forces */
#ifdef COSMICTIME
extern double CosmicTimeTable[COSMICTIME_TABLE_LENGTH]; /*!< table for the computation of cosmic time */
#endif
extern void *CommBuffer; /*!< points to communication buffer, which is used in the domain decomposition, the
parallel tree-force computation, the SPH routines, etc. */
/*! This structure contains data which is the SAME for all tasks (mostly code parameters read from the
* parameter file). Holding this data in a structure is convenient for writing/reading the restart file, and
* it allows the introduction of new global variables in a simple way. The only thing to do is to introduce
* them into this structure.
*/
extern struct global_data_all_processes
{
long long TotNumPart; /*!< total particle numbers (global value) */
long long TotN_gas; /*!< total gas particle number (global value) */
#ifdef PY_INTERFACE
long long TotNumPartQ; /*!< total particle numbers (global value) */
long long TotN_gasQ; /*!< total gas particle number (global value) */
int MaxPartQ; /*!< This gives the maxmimum number of particles that can be stored on one processor. */
int MaxPartSphQ; /*!< This gives the maxmimum number of SPH particles that can be stored on one processor. */
int BunchSizeSph;
int BunchSizeDensitySph;
double ForceSofteningQ;
#endif
#if defined(SFR) || defined(STELLAR_PROP)
long long TotN_stars; /*!< total stars particle number (global value) */
#endif
#ifdef MULTIPHASE
long long TotN_sph; /*!< total sph particle number (global value) */
long long TotN_sticky; /*!< total sticky particle number (global value) */
long long TotN_stickyflaged; /*!< total sticky flaged particle number (global value) */
long long TotN_stickyactive; /*!< total sticky active particle number (global value) */
long long TotN_dark; /*!< total dark particle number (global value) */
#endif
int MaxPart; /*!< This gives the maxmimum number of particles that can be stored on one processor. */
int MaxPartSph; /*!< This gives the maxmimum number of SPH particles that can be stored on one processor. */
#ifdef TESSEL
int MaxgPart;
#endif
#ifdef STELLAR_PROP
int MaxPartStars; /*!< This gives the maxmimum number of Star particles that can be stored on one processor. */
#endif
double BoxSize; /*!< Boxsize in case periodic boundary conditions are used */
int ICFormat; /*!< selects different versions of IC file-format */
int SnapFormat; /*!< selects different versions of snapshot file-formats */
int NumFilesPerSnapshot; /*!< number of files in multi-file snapshot dumps */
int NumFilesWrittenInParallel;/*!< maximum number of files that may be written simultaneously when
writing/reading restart-files, or when writing snapshot files */
int BufferSize; /*!< size of communication buffer in MB */
int BunchSizeForce; /*!< number of particles fitting into the buffer in the parallel tree-force algorithm */
int BunchSizeDensity; /*!< number of particles fitting into the communication buffer in the density computation */
int BunchSizeHydro; /*!< number of particles fitting into the communication buffer in the SPH hydrodynamical force computation */
int BunchSizeDomain; /*!< number of particles fitting into the communication buffer in the domain decomposition */
#ifdef MULTIPHASE
int BunchSizeSticky; /*!< number of particles fitting into the communication buffer in the Chimie computation */
#endif
#ifdef CHIMIE
int BunchSizeChimie; /*!< number of particles fitting into the communication buffer in the Chimie computation */
int BunchSizeStarsDensity; /*!< number of particles fitting into the communication buffer in the star density computation */
#endif
#ifdef TESSEL
int BunchSizeGhost;
#endif
double PartAllocFactor; /*!< in order to maintain work-load balance, the particle load will usually
NOT be balanced. Each processor allocates memory for PartAllocFactor times
the average number of particles to allow for that */
double TreeAllocFactor; /*!< Each processor allocates a number of nodes which is TreeAllocFactor times
the maximum(!) number of particles. Note: A typical local tree for N
particles needs usually about ~0.65*N nodes. */
#ifdef SFR
double StarsAllocFactor; /*!< Estimated fraction of gas particles that will form stars during the simulation
This allow to reduce the memory stored for stellar particles */
#endif
/* some SPH parameters */
double DesNumNgb; /*!< Desired number of SPH neighbours */
double MaxNumNgbDeviation; /*!< Maximum allowed deviation neighbour number */
double ArtBulkViscConst; /*!< Sets the parameter \f$\alpha\f$ of the artificial viscosity */
#ifdef ART_CONDUCTIVITY
double ArtCondConst; /*!< Sets the parameter \f$\alpha\f$ of the artificial conductivity */
double ArtCondThreshold;
#endif
double InitGasTemp; /*!< may be used to set the temperature in the IC's */
double MinGasTemp; /*!< may be used to set a floor for the gas temperature */
double MinEgySpec; /*!< the minimum allowed temperature expressed as energy per unit mass */
/* Usefull constants */
double Boltzmann;
double ProtonMass;
double mumh;
#ifdef COOLING
/* Cooling parameters */
double *logT;
double *logL;
gsl_interp_accel *acc_cooling_spline;
gsl_spline *cooling_spline;
double CoolingType;
char CoolingFile[MAXLEN_FILENAME]; /*!< cooling file */
double CutofCoolingTemperature;
/*
new metal dependent cooling
*/
double CoolingParameters_zmin;
double CoolingParameters_zmax;
double CoolingParameters_slz;
double CoolingParameters_tmin;
double CoolingParameters_tmax;
double CoolingParameters_slt;
double CoolingParameters_FeHSolar;
double CoolingParameters_cooling_data_max;
double CoolingParameters_cooling_data[COOLING_NMETALICITIES][COOLING_NTEMPERATURES];
int CoolingParameters_p;
int CoolingParameters_q;
#endif
#ifdef CHIMIE
int ChimieNumberOfParameterFiles;
+#ifdef PYCHEM
+ char * ChimieParameterFile;
+#else
char ChimieParameterFile[MAXLEN_FILENAME]; /*!< chimie parameter file */
+#endif
double ChimieSupernovaEnergy;
double ChimieKineticFeedbackFraction;
double ChimieWindSpeed;
double ChimieWindTime;
double ChimieSNIaThermalTime;
double ChimieSNIIThermalTime;
double ChimieMaxSizeTimestep;
#endif
#if defined (CHIMIE) || defined (COOLING)
double InitGasMetallicity;
#endif
#if !defined (HEATING_PE)
double HeatingPeElectronFraction;
#endif
#if !defined (HEATING_PE) || defined (STELLAR_FLUX) || defined (EXTERNAL_FLUX)
double HeatingPeSolarEnergyDensity;
#endif
#if !defined (HEATING_PE) || defined (STELLAR_FLUX)
double HeatingPeLMRatioGas;
double HeatingPeLMRatioHalo;
double HeatingPeLMRatioDisk;
double HeatingPeLMRatioBulge;
double HeatingPeLMRatioStars;
double HeatingPeLMRatioBndry;
double HeatingPeLMRatio[6];
#endif
#ifdef EXTERNAL_FLUX
double HeatingExternalFLuxEnergyDensity;
#endif
#ifdef MULTIPHASE
double CriticalTemperature;
double CriticalEgySpec;
double CriticalNonCollisionalTemperature;
double CriticalNonCollisionalEgySpec;
#ifdef COLDGAS_CYCLE
double ColdGasCycleTransitionTime;
double ColdGasCycleTransitionParameter;
#endif
#endif
#ifdef MULTIPHASE
/* some STICKY parameters */
int StickyUseGridForCollisions;
double StickyTime; /*!< Cooling time of sticky particle collision */
double StickyCollisionTime;
double StickyLastCollisionTime;
double StickyIdleTime;
double StickyMinVelocity;
double StickyMaxVelocity;
int StickyGridNx;
int StickyGridNy;
int StickyGridNz;
double StickyGridXmin;
double StickyGridXmax;
double StickyGridYmin;
double StickyGridYmax;
double StickyGridZmin;
double StickyGridZmax;
double StickyLambda;
double StickyDensity;
double StickyDensityPower;
double StickyBetaR;
double StickyBetaT;
double StickyRsphFact; /*!< Fraction of the sph radius used in sticky particle */
#endif
#ifdef OUTERPOTENTIAL
#ifdef NFW
double HaloConcentration;
double HaloMass;
double GasMassFraction;
double NFWPotentialCte;
double Rs;
#endif
#ifdef PLUMMER
double PlummerMass;
double PlummerSoftenning;
double PlummerPotentialCte;
#endif
#ifdef MIYAMOTONAGAI
double MiyamotoNagaiMass;
double MiyamotoNagaiHr;
double MiyamotoNagaiHz;
double MiyamotoNagaiPotentialCte;
#endif
#ifdef PISOTHERM
double Rho0;
double Rc;
double PisothermPotentialCte;
double GasMassFraction;
double PotentialInf;
gsl_function PotentialF;
gsl_integration_workspace *Potentialw;
#endif
#ifdef CORIOLIS
double CoriolisOmegaX;
double CoriolisOmegaY;
double CoriolisOmegaZ;
double CoriolisOmegaX0;
double CoriolisOmegaY0;
double CoriolisOmegaZ0;
#endif
#endif
#ifdef SFR
int StarFormationNStarsFromGas;
double StarFormationStarMass;
double StarFormationMgMsFraction;
int StarFormationType;
double StarFormationCstar;
double StarFormationTime;
double StarFormationDensity;
double StarFormationTemperature;
double ThresholdDensity;
#endif
#ifdef FEEDBACK
double SupernovaTime;
#endif
#ifdef FEEDBACK_WIND
double SupernovaWindEgySpecPerMassUnit;
double SupernovaWindFractionInEgyKin;
double SupernovaWindParameter;
double SupernovaWindSpeed;
double SupernovaWindIntAccuracy;
#endif
#ifdef AGN_ACCRETION
double TimeBetAccretion;
double AccretionRadius;
double AGNFactor;
double MinMTotInRa;
double TimeLastAccretion;
double LastMTotInRa;
double MTotInRa;
double dMTotInRa;
#endif
#ifdef BUBBLES
char BubblesInitFile[MAXLEN_FILENAME]; /*!< bubble file */
double *BubblesTime;
double *BubblesD;
double *BubblesR;
double *BubblesE;
double *BubblesA;
double *BubblesB;
int BubblesIndex;
double BubblesAlpha;
double BubblesBeta;
double BubblesDelta;
double BubblesRadiusFactor;
double EnergyBubbles;
#endif
#ifdef AGN_HEATING
double AGNHeatingPower;
double AGNHeatingRmax;
#endif
#ifdef BONDI_ACCRETION
double BondiEfficiency;
double BondiBlackHoleMass;
double BondiHsmlFactor;
double BondiPower;
double BondiTimeBet;
double BondiTimeLast;
#endif
#if defined (AGN_ACCRETION) || defined (BONDI_ACCRETION)
double LightSpeed;
#endif
#if defined(ART_VISCO_MM)|| defined(ART_VISCO_RO) || defined(ART_VISCO_CD)
double ArtBulkViscConstMin;
double ArtBulkViscConstMax;
double ArtBulkViscConstL;
#endif
#ifdef AB_TURB
double StDecay;
double StEnergy;
double StDtFreq;
double StKmin;
double StKmax;
double StSolWeight;
double StAmplFac;
int StSpectForm;
int StSeed;
#endif
/* some force counters */
long long TotNumOfForces; /*!< counts total number of force computations */
long long NumForcesSinceLastDomainDecomp; /*!< count particle updates since last domain decomposition */
/* system of units */
double G; /*!< Gravity-constant in internal units */
double UnitTime_in_s; /*!< factor to convert internal time unit to seconds/h */
double UnitMass_in_g; /*!< factor to convert internal mass unit to grams/h */
double UnitVelocity_in_cm_per_s; /*!< factor to convert intqernal velocity unit to cm/sec */
double UnitLength_in_cm; /*!< factor to convert internal length unit to cm/h */
double UnitPressure_in_cgs; /*!< factor to convert internal pressure unit to cgs units (little 'h' still around!) */
double UnitDensity_in_cgs; /*!< factor to convert internal length unit to g/cm^3*h^2 */
double UnitCoolingRate_in_cgs; /*!< factor to convert internal cooling rate to cgs units */
double UnitEnergy_in_cgs; /*!< factor to convert internal energy to cgs units */
double UnitTime_in_Megayears; /*!< factor to convert internal time to megayears/h */
double GravityConstantInternal; /*!< If set to zero in the parameterfile, the internal value of the
gravitational constant is set to the Newtonian value based on the system of
units specified. Otherwise the value provided is taken as internal gravity constant G. */
/* Cosmological parameters */
double Hubble; /*!< Hubble-constant in internal units */
double Omega0; /*!< matter density in units of the critical density (at z=0)*/
double OmegaLambda; /*!< vaccum energy density relative to crictical density (at z=0) */
double OmegaBaryon; /*!< baryon density in units of the critical density (at z=0)*/
double HubbleParam; /*!< little `h', i.e. Hubble constant in units of 100 km/s/Mpc. Only needed to get absolute physical values for cooling physics */
/* Code options */
int ComovingIntegrationOn; /*!< flags that comoving integration is enabled */
int PeriodicBoundariesOn; /*!< flags that periodic boundaries are enabled */
int ResubmitOn; /*!< flags that automatic resubmission of job to queue system is enabled */
int TypeOfOpeningCriterion; /*!< determines tree cell-opening criterion: 0 for Barnes-Hut, 1 for relative criterion */
int TypeOfTimestepCriterion; /*!< gives type of timestep criterion (only 0 supported right now - unlike gadget-1.1) */
int OutputListOn; /*!< flags that output times are listed in a specified file */
/* Parameters determining output frequency */
int SnapshotFileCount; /*!< number of snapshot that is written next */
double TimeBetSnapshot; /*!< simulation time interval between snapshot files */
double TimeOfFirstSnapshot; /*!< simulation time of first snapshot files */
double CpuTimeBetRestartFile; /*!< cpu-time between regularly generated restart files */
double TimeLastRestartFile; /*!< cpu-time when last restart-file was written */
double TimeBetStatistics; /*!< simulation time interval between computations of energy statistics */
double TimeLastStatistics; /*!< simulation time when the energy statistics was computed the last time */
int NumCurrentTiStep; /*!< counts the number of system steps taken up to this point */
/* Current time of the simulation, global step, and end of simulation */
double Time; /*!< current time of the simulation */
double TimeBegin; /*!< time of initial conditions of the simulation */
double TimeStep; /*!< difference between current times of previous and current timestep */
double TimeMax; /*!< marks the point of time until the simulation is to be evolved */
/* variables for organizing discrete timeline */
double Timebase_interval; /*!< factor to convert from floating point time interval to integer timeline */
int Ti_Current; /*!< current time on integer timeline */
int Ti_nextoutput; /*!< next output time on integer timeline */
#ifdef FLEXSTEPS
int PresentMinStep; /*!< If FLEXSTEPS is used, particle timesteps are chosen as multiples of the present minimum timestep. */
int PresentMaxStep; /*!< If FLEXSTEPS is used, this is the maximum timestep in timeline units, rounded down to the next power 2 division */
#endif
#ifdef PMGRID
int PM_Ti_endstep; /*!< begin of present long-range timestep */
int PM_Ti_begstep; /*!< end of present long-range timestep */
#endif
/* Placement of PM grids */
#ifdef PMGRID
double Asmth[2]; /*!< Gives the scale of the long-range/short-range split (in mesh-cells), both for the coarse and the high-res mesh */
double Rcut[2]; /*!< Gives the maximum radius for which the short-range force is evaluated with the tree (in mesh-cells), both for the coarse and the high-res mesh */
double Corner[2][3]; /*!< lower left corner of coarse and high-res PM-mesh */
double UpperCorner[2][3]; /*!< upper right corner of coarse and high-res PM-mesh */
double Xmintot[2][3]; /*!< minimum particle coordinates both for coarse and high-res PM-mesh */
double Xmaxtot[2][3]; /*!< maximum particle coordinates both for coarse and high-res PM-mesh */
double TotalMeshSize[2]; /*!< total extension of coarse and high-res PM-mesh */
#endif
/* Variables that keep track of cumulative CPU consumption */
double TimeLimitCPU; /*!< CPU time limit as defined in parameterfile */
double CPU_TreeConstruction; /*!< time spent for constructing the gravitational tree */
double CPU_TreeWalk; /*!< actual time spent for pure tree-walks */
double CPU_Gravity; /*!< cumulative time used for gravity computation (tree-algorithm only) */
double CPU_Potential; /*!< time used for computing gravitational potentials */
double CPU_Domain; /*!< cumulative time spent for domain decomposition */
double CPU_Snapshot; /*!< time used for writing snapshot files */
double CPU_Total; /*!< cumulative time spent for domain decomposition */
double CPU_CommSum; /*!< accumulated time used for communication, and for collecting partial results, in tree-gravity */
double CPU_Imbalance; /*!< cumulative time lost accross all processors as work-load imbalance in gravitational tree */
double CPU_HydCompWalk; /*!< time used for actual SPH computations, including neighbour search */
double CPU_HydCommSumm; /*!< cumulative time used for communication in SPH, and for collecting partial results */
double CPU_HydImbalance; /*!< cumulative time lost due to work-load imbalance in SPH */
double CPU_Hydro; /*!< cumulative time spent for SPH related computations */
#ifdef SFR
double CPU_StarFormation; /*!< cumulative time spent for star formation computations */
#endif
#ifdef CHIMIE
double CPU_Chimie; /*!< cumulative time spent for chimie computations */
double CPU_ChimieDensCompWalk;
double CPU_ChimieDensCommSumm;
double CPU_ChimieDensImbalance;
double CPU_ChimieDensEnsureNgb;
double CPU_ChimieCompWalk;
double CPU_ChimieCommSumm;
double CPU_ChimieImbalance;
#endif
#ifdef MULTIPHASE
double CPU_Sticky; /*!< cumulative time spent for sticky computations */
#endif
double CPU_EnsureNgb; /*!< time needed to iterate on correct neighbour numbers */
double CPU_Predict; /*!< cumulative time to drift the system forward in time, including dynamic tree updates */
double CPU_TimeLine; /*!< time used for determining new timesteps, and for organizing the timestepping, including kicks of active particles */
double CPU_PM; /*!< time used for long-range gravitational force */
double CPU_Peano; /*!< time required to establish Peano-Hilbert order */
#ifdef DETAILED_CPU_DOMAIN
double CPU_Domain_findExtend;
double CPU_Domain_determineTopTree;
double CPU_Domain_sumCost;
double CPU_Domain_findSplit;
double CPU_Domain_shiftSplit;
double CPU_Domain_countToGo;
double CPU_Domain_exchange;
#endif
#ifdef DETAILED_CPU_GRAVITY
double CPU_Gravity_TreeWalk1;
double CPU_Gravity_TreeWalk2;
double CPU_Gravity_CommSum1;
double CPU_Gravity_CommSum2;
double CPU_Gravity_Imbalance1;
double CPU_Gravity_Imbalance2;
#endif
#ifdef COOLING
double CPU_Cooling;
#endif
#ifdef DETAILED_CPU
double CPU_Leapfrog;
double CPU_Physics;
double CPU_Residual;
double CPU_Accel;
double CPU_Begrun;
#endif
/* tree code opening criterion */
double ErrTolTheta; /*!< BH tree opening angle */
double ErrTolForceAcc; /*!< parameter for relative opening criterion in tree walk */
/* adjusts accuracy of time-integration */
double ErrTolIntAccuracy; /*!< accuracy tolerance parameter \f$ \eta \f$ for timestep criterion. The
timestep is \f$ \Delta t = \sqrt{\frac{2 \eta eps}{a}} \f$ */
double MinSizeTimestep; /*!< minimum allowed timestep. Normally, the simulation terminates if the
timestep determined by the timestep criteria falls below this limit. */
double MaxSizeTimestep; /*!< maximum allowed timestep */
double MaxRMSDisplacementFac; /*!< this determines a global timestep criterion for cosmological simulations
in comoving coordinates. To this end, the code computes the rms velocity
of all particles, and limits the timestep such that the rms displacement
is a fraction of the mean particle separation (determined from the
particle mass and the cosmological parameters). This parameter specifies
this fraction. */
double CourantFac; /*!< SPH-Courant factor */
/* frequency of tree reconstruction/domain decomposition */
double TreeDomainUpdateFrequency; /*!< controls frequency of domain decompositions */
/* Gravitational and hydrodynamical softening lengths (given in terms of an `equivalent' Plummer softening length).
* Five groups of particles are supported 0="gas", 1="halo", 2="disk", 3="bulge", 4="stars", 5="bndry"
*/
double MinGasHsmlFractional; /*!< minimum allowed SPH smoothing length in units of SPH gravitational softening length */
double MinGasHsml; /*!< minimum allowed SPH smoothing length */
double SofteningGas; /*!< comoving gravitational softening lengths for type 0 */
double SofteningHalo; /*!< comoving gravitational softening lengths for type 1 */
double SofteningDisk; /*!< comoving gravitational softening lengths for type 2 */
double SofteningBulge; /*!< comoving gravitational softening lengths for type 3 */
double SofteningStars; /*!< comoving gravitational softening lengths for type 4 */
double SofteningBndry; /*!< comoving gravitational softening lengths for type 5 */
double SofteningGasMaxPhys; /*!< maximum physical softening length for type 0 */
double SofteningHaloMaxPhys; /*!< maximum physical softening length for type 1 */
double SofteningDiskMaxPhys; /*!< maximum physical softening length for type 2 */
double SofteningBulgeMaxPhys; /*!< maximum physical softening length for type 3 */
double SofteningStarsMaxPhys; /*!< maximum physical softening length for type 4 */
double SofteningBndryMaxPhys; /*!< maximum physical softening length for type 5 */
double SofteningTable[6]; /*!< current (comoving) gravitational softening lengths for each particle type */
double ForceSoftening[6]; /*!< the same, but multiplied by a factor 2.8 - at that scale the force is Newtonian */
double MassTable[6]; /*!< Table with particle masses for particle types with equal mass.
If particle masses are all equal for one type, the corresponding entry in MassTable
is set to this value, allowing the size of the snapshot files to be reduced. */
/* some filenames */
char InitCondFile[MAXLEN_FILENAME]; /*!< filename of initial conditions */
char OutputDir[MAXLEN_FILENAME]; /*!< output directory of the code */
char SnapshotFileBase[MAXLEN_FILENAME]; /*!< basename to construct the names of snapshotf files */
char EnergyFile[MAXLEN_FILENAME]; /*!< name of file with energy statistics */
#ifdef SYSTEMSTATISTICS
char SystemFile[MAXLEN_FILENAME];
#endif
char CpuFile[MAXLEN_FILENAME]; /*!< name of file with cpu-time statistics */
char InfoFile[MAXLEN_FILENAME]; /*!< name of log-file with a list of the timesteps taken */
char LogFile[MAXLEN_FILENAME]; /*!< name of log-file with varied info */
#ifdef SFR
char SfrFile[MAXLEN_FILENAME]; /*!< name of file with sfr records */
#endif
#ifdef CHIMIE
char ChimieFile[MAXLEN_FILENAME]; /*!< name of file with chimie records */
#endif
#ifdef MULTIPHASE
char PhaseFile[MAXLEN_FILENAME]; /*!< name of file with phase records */
char StickyFile[MAXLEN_FILENAME]; /*!< name of file with sticky records */
#endif
#ifdef AGN_ACCRETION
char AccretionFile[MAXLEN_FILENAME]; /*!< name of file with accretion records */
#endif
#ifdef BONDI_ACCRETION
char BondiFile[MAXLEN_FILENAME]; /*!< name of file with bondi records */
#endif
#ifdef BUBBLES
char BubbleFile[MAXLEN_FILENAME]; /*!< name of file with bubble records */
#endif
char TimingsFile[MAXLEN_FILENAME]; /*!< name of file with performance metrics of gravitational tree algorithm */
char RestartFile[MAXLEN_FILENAME]; /*!< basename of restart-files */
char ResubmitCommand[MAXLEN_FILENAME]; /*!< name of script-file that will be executed for automatic restart */
char OutputListFilename[MAXLEN_FILENAME]; /*!< name of file with list of desired output times */
double OutputListTimes[MAXLEN_OUTPUTLIST]; /*!< table with desired output times */
int OutputListLength; /*!< number of output times stored in the table of desired output times */
#ifdef RANDOMSEED_AS_PARAMETER
int RandomSeed; /*!< initial random seed >*/
#endif
}
All; /*!< a container variable for global variables that are equal on all processors */
/*! This structure holds all the information that is
* stored for each particle of the simulation.
*/
extern struct particle_data
{
FLOAT Pos[3]; /*!< particle position at its current time */
FLOAT Mass; /*!< particle mass */
FLOAT Vel[3]; /*!< particle velocity at its current time */
FLOAT GravAccel[3]; /*!< particle acceleration due to gravity */
#ifdef PMGRID
FLOAT GravPM[3]; /*!< particle acceleration due to long-range PM gravity force*/
#endif
#ifdef FORCETEST
FLOAT GravAccelDirect[3]; /*!< particle acceleration when computed with direct summation */
#endif
FLOAT Potential; /*!< gravitational potential */
FLOAT OldAcc; /*!< magnitude of old gravitational force. Used in relative opening criterion */
#ifndef LONGIDS
unsigned int ID; /*!< particle identifier */
#else
unsigned long long ID; /*!< particle identifier */
#endif
int Type; /*!< flags particle type. 0=gas, 1=halo, 2=disk, 3=bulge, 4=stars, 5=bndry */
int Ti_endstep; /*!< marks start of current timestep of particle on integer timeline */
int Ti_begstep; /*!< marks end of current timestep of particle on integer timeline */
#ifdef FLEXSTEPS
int FlexStepGrp; /*!< a random 'offset' on the timeline to create a smooth groouping of particles */
#endif
float GravCost; /*!< weight factor used for balancing the work-load */
#ifdef PSEUDOSYMMETRIC
float AphysOld; /*!< magnitude of acceleration in last timestep. Used to make a first order
prediction of the change of acceleration expected in the future, thereby
allowing to guess whether a decrease/increase of the timestep should occur
in the timestep that is started. */
#endif
#ifdef PARTICLE_FLAG
float Flag;
#endif
#ifdef STELLAR_PROP
unsigned int StPIdx; /*!< index to the corresponding StP particle */
#endif
#ifdef TESSEL
int iT; /*!< index of a triangle to which the point belong to */
int IsDone;
int IsAdded; /*!< if the point has already be added in the tesselation */
int ivPoint; /*!< index of first voronoi point */
int nvPoints; /*!< number of voronoi points */
int iMedian;
int nMedians;
double Volume;
double Density;
double Pressure;
double Entropy;
double rSearch; /*!< radius in which particles must search for ngbs */
int iPref; /*!< for a ghost point, index of the reference point */
FLOAT tesselAccel[3];
#endif
}
*P, /*!< holds particle data on local processor */
#ifdef PY_INTERFACE
*Q,
*DomainPartBufQ, /*!< buffer for particle data used in domain decomposition */
#endif
*DomainPartBuf; /*!< buffer for particle data used in domain decomposition */
/* the following struture holds data that is stored for each SPH particle in addition to the collisionless
* variables.
*/
extern struct sph_particle_data
{
FLOAT Entropy; /*!< current value of entropy (actually entropic function) of particle */
FLOAT Density; /*!< current baryonic mass density of particle */
FLOAT Hsml; /*!< current smoothing length */
FLOAT Left; /*!< lower bound in iterative smoothing length search */
FLOAT Right; /*!< upper bound in iterative smoothing length search */
FLOAT NumNgb; /*!< weighted number of neighbours found */
#ifdef AVOIDNUMNGBPROBLEM
FLOAT OldNumNgb;
#endif
FLOAT Pressure; /*!< current pressure */
FLOAT DtEntropy; /*!< rate of change of entropy */
#ifdef STELLAR_FLUX
FLOAT EnergyFlux; /*!< current value of local energy flux - Sph particles */
#endif
#ifdef AGN_HEATING
FLOAT EgySpecAGNHeat; /*!< current value of specific energy radiated of particle - Sph particles */
FLOAT DtEgySpecAGNHeat; /*!< rate of change of specific radiated energy - Sph particles */
FLOAT DtEntropyAGNHeat;
#endif
#ifdef MULTIPHASE
FLOAT StickyTime;
int StickyFlag;
#ifdef COUNT_COLLISIONS
float StickyCollisionNumber;
#endif
#endif
#ifdef FEEDBACK
FLOAT EgySpecFeedback;
FLOAT DtEgySpecFeedback;
FLOAT EnergySN;
FLOAT EnergySNrem;
FLOAT TimeSN;
FLOAT FeedbackVel[3]; /*!< kick due to feedback force */
#endif
#ifdef FEEDBACK_WIND
FLOAT FeedbackWindVel[3]; /*!< kick due to feedback force */
#endif
FLOAT HydroAccel[3]; /*!< acceleration due to hydrodynamical force */
FLOAT VelPred[3]; /*!< predicted SPH particle velocity at the current time */
FLOAT DivVel; /*!< local velocity divergence */
FLOAT CurlVel; /*!< local velocity curl */
FLOAT Rot[3]; /*!< local velocity curl */
FLOAT DhsmlDensityFactor; /*!< correction factor needed in the equation of motion of the conservative entropy formulation of SPH */
FLOAT MaxSignalVel; /*!< maximum "signal velocity" occuring for this particle */
#ifdef MULTIPHASE
int Phase;
int StickyIndex;
int StickyNgb;
int StickyMaxID;
float StickyMaxFs;
FLOAT StickyNewVel[3];
#endif
#ifdef OUTPUTOPTVAR1
FLOAT OptVar1; /*!< optional variable 1 */
#endif
#ifdef OUTPUTOPTVAR2
FLOAT OptVar2; /*!< optional variable 2 */
#endif
#ifdef COMPUTE_VELOCITY_DISPERSION
FLOAT VelocityDispersion[VELOCITY_DISPERSION_SIZE]; /*!< velocity dispersion */
#endif
#ifdef CHIMIE
FLOAT Metal[NELEMENTS];
FLOAT dMass; /*!< mass variation due to mass transfere */
#ifdef CHIMIE_THERMAL_FEEDBACK
FLOAT DeltaEgySpec;
FLOAT SNIaThermalTime; /*!< flag particles that got energy from SNIa */
FLOAT SNIIThermalTime; /*!< flag particles that got energy from SNII */
double NumberOfSNIa;
double NumberOfSNII;
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
FLOAT WindTime; /*!< flag particles that belongs to the wind */
unsigned int WindFlag; /*!< flag particles that will be part of the wind */
#endif
#endif /*CHIMIE*/
#ifdef ENTROPYPRED
FLOAT EntropyPred; /*!< predicted entropy at the current time */
#endif
#ifdef ART_CONDUCTIVITY
FLOAT EnergyIntPred;
FLOAT GradEnergyInt[3];
#endif
#ifdef AB_TURB
FLOAT TurbAccel[3];
#endif
#if defined(ART_VISCO_MM)|| defined(ART_VISCO_RO) || defined(ART_VISCO_CD)
double ArtBulkViscConst;
#ifdef ART_VISCO_CD
double DmatCD[3][3];
double TmatCD[3][3];
double DiVelAccurate;
double DiVelTemp;
double ArtBulkViscConstOld;
double R_CD;
FLOAT MaxSignalVelCD;
#endif
#endif
#ifdef PRESSURE_ENTROPY_FORMULATION
FLOAT nDensity;
FLOAT mPressure;
FLOAT DhsmlnDensityFactor;
FLOAT DhsmlPressureFactor;
#endif
#if PY_INTERFACE
FLOAT Observable;
FLOAT ObsMoment0;
FLOAT ObsMoment1;
FLOAT GradObservable[3];
#endif
}
*SphP, /*!< holds SPH particle data on local processor */
#ifdef PY_INTERFACE
*SphQ,
*DomainSphBufQ, /*!< buffer for SPH particle data in domain decomposition */
#endif
*DomainSphBuf; /*!< buffer for SPH particle data in domain decomposition */
#ifdef STELLAR_PROP
/* the following struture holds data that is stored for each SPH particle in addition to the collisionless
* variables.
*/
extern struct st_particle_data
{
#ifdef CHECK_ID_CORRESPONDENCE
unsigned int ID; /*!< particle identifier (must be the same as P[].ID) only used to check ID correspondance */
#endif
FLOAT FormationTime; /*!< star formation time of particle */
FLOAT InitialMass; /*!< initial stellar mass */
#ifndef LONGIDS
unsigned int IDProj; /*!< id of projenitor particle */
#else
unsigned long long IDProj; /*!< id of projenitor particle */
#endif
FLOAT Metal[NELEMENTS];
FLOAT Density; /*!< current baryonic mass density of particle */
FLOAT Volume; /*!< current volume of particle */
FLOAT Hsml; /*!< current smoothing length */
FLOAT Left; /*!< lower bound in iterative smoothing length search */
FLOAT Right; /*!< upper bound in iterative smoothing length search */
FLOAT NumNgb; /*!< weighted number of neighbours found */
unsigned int PIdx; /*!< index to the corresponding particle */
#ifdef AVOIDNUMNGBPROBLEM
FLOAT OldNumNgb;
#endif
FLOAT DhsmlDensityFactor; /*!< correction factor needed in the equation of motion of the conservative entropy formulation of SPH */
double TotalEjectedGasMass;
double TotalEjectedEltMass[NELEMENTS];
double TotalEjectedEgySpec;
double NumberOfSNIa;
double NumberOfSNII;
#ifdef CHIMIE_KINETIC_FEEDBACK
double NgbMass; /*!< mass of neighbours */
#endif
#ifdef CHIMIE
unsigned int Flag;
#endif
}
*StP, /*!< holds ST particle data on local processor */
*DomainStBuf; /*!< buffer for ST particle data in domain decomposition */
#endif
/* Variables for Tree
*/
extern int MaxNodes; /*!< maximum allowed number of internal nodes */
extern int Numnodestree; /*!< number of (internal) nodes in each tree */
extern struct NODE
{
FLOAT len; /*!< sidelength of treenode */
FLOAT center[3]; /*!< geometrical center of node */
#ifdef ADAPTIVE_GRAVSOFT_FORGAS
FLOAT maxsoft; /*!< hold the maximum gravitational softening of particles in the
node if the ADAPTIVE_GRAVSOFT_FORGAS option is selected */
#endif
#ifdef STELLAR_FLUX
FLOAT starlum ; /*!< star luminosity of node */
#endif
union
{
int suns[8]; /*!< temporary pointers to daughter nodes */
struct
{
FLOAT s[3]; /*!< center of mass of node */
FLOAT mass; /*!< mass of node */
int bitflags; /*!< a bit-field with various information on the node */
int sibling; /*!< this gives the next node in the walk in case the current node can be used */
int nextnode; /*!< this gives the next node in case the current node needs to be opened */
int father; /*!< this gives the parent node of each node (or -1 if we have the root node) */
}
d;
}
u;
}
*Nodes_base, /*!< points to the actual memory allocted for the nodes */
*Nodes; /*!< this is a pointer used to access the nodes which is shifted such that Nodes[All.MaxPart]
gives the first allocated node */
extern int *Nextnode; /*!< gives next node in tree walk */
extern int *Father; /*!< gives parent node in tree */
extern struct extNODE /*!< this structure holds additional tree-node information which is not needed in the actual gravity computation */
{
FLOAT hmax; /*!< maximum SPH smoothing length in node. Only used for gas particles */
FLOAT vs[3]; /*!< center-of-mass velocity */
}
*Extnodes_base, /*!< points to the actual memory allocted for the extended node information */
*Extnodes; /*!< provides shifted access to extended node information, parallel to Nodes/Nodes_base */
/*! Header for the standard file format.
*/
extern struct io_header
{
int npart[6]; /*!< number of particles of each type in this file */
double mass[6]; /*!< mass of particles of each type. If 0, then the masses are explicitly
stored in the mass-block of the snapshot file, otherwise they are omitted */
double time; /*!< time of snapshot file */
double redshift; /*!< redshift of snapshot file */
int flag_sfr; /*!< flags whether the simulation was including star formation */
int flag_feedback; /*!< flags whether feedback was included (obsolete) */
unsigned int npartTotal[6]; /*!< total number of particles of each type in this snapshot. This can be
different from npart if one is dealing with a multi-file snapshot. */
int flag_cooling; /*!< flags whether cooling was included */
int num_files; /*!< number of files in multi-file snapshot */
double BoxSize; /*!< box-size of simulation in case periodic boundaries were used */
double Omega0; /*!< matter density in units of critical density */
double OmegaLambda; /*!< cosmological constant parameter */
double HubbleParam; /*!< Hubble parameter in units of 100 km/sec/Mpc */
int flag_stellarage; /*!< flags whether the file contains formation times of star particles */
int flag_metals; /*!< flags whether the file contains metallicity values for gas and star particles */
unsigned int npartTotalHighWord[6]; /*!< High word of the total number of particles of each type */
int flag_entropy_instead_u; /*!< flags that IC-file contains entropy instead of u */
int flag_chimie_extraheader; /*!< flags that IC-file contains extra-header for chimie */
#ifdef MULTIPHASE
double critical_energy_spec;
#ifdef MESOMACHINE
char fill[38];
#else
char fill[48]; /* use 42 with regor... */
#endif
#else
char fill[56]; /*!< fills to 256 Bytes */
#endif
}
header; /*!< holds header for snapshot files */
#ifdef CHIMIE_EXTRAHEADER
/*! Header for the chimie part.
*/
extern struct io_chimie_extraheader
{
int nelts; /*!< number of chemical element followed */
float SolarAbundances[NELEMENTS];
char labels[256-4-4*(NELEMENTS)];
}
chimie_extraheader;
#endif
#define IO_NBLOCKS 24 /*!< total number of defined information blocks for snapshot files.
Must be equal to the number of entries in "enum iofields" */
enum iofields /*!< this enumeration lists the defined output blocks in snapshot files. Not all of them need to be present. */
{
IO_POS,
IO_VEL,
IO_ID,
IO_MASS,
IO_U,
IO_RHO,
IO_HSML,
IO_POT,
IO_ACCEL,
IO_DTENTR,
IO_TSTP,
IO_ERADSPH,
IO_ERADSTICKY,
IO_ERADFEEDBACK,
IO_ENERGYFLUX,
IO_METALS,
IO_STAR_FORMATIONTIME,
IO_INITIAL_MASS,
IO_STAR_IDPROJ,
IO_STAR_RHO,
IO_STAR_HSML,
IO_STAR_METALS,
IO_OPTVAR1,
IO_OPTVAR2
};
extern char Tab_IO_Labels[IO_NBLOCKS][4]; /*<! This table holds four-byte character tags used for fileformat 2 */
/* global state of system, used for global statistics
*/
extern struct state_of_system
{
double Mass;
double EnergyKin;
double EnergyPot;
double EnergyInt;
#ifdef COOLING
double EnergyRadSph;
#endif
#ifdef AGN_HEATING
double EnergyAGNHeat;
#endif
#ifdef MULTIPHASE
double EnergyRadSticky;
#endif
#ifdef FEEDBACK_WIND
double EnergyFeedbackWind;
#endif
#ifdef BUBBLES
double EnergyBubbles;
#endif
#ifdef CHIMIE_THERMAL_FEEDBACK
double EnergyThermalFeedback;
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
double EnergyKineticFeedback;
#endif
double EnergyTot;
double Momentum[4];
double AngMomentum[4];
double CenterOfMass[4];
double MassComp[6];
double EnergyKinComp[6];
double EnergyPotComp[6];
double EnergyIntComp[6];
#ifdef COOLING
double EnergyRadSphComp[6];
#endif
#ifdef AGN_HEATING
double EnergyAGNHeatComp[6];
#endif
#ifdef MULTIPHASE
double EnergyRadStickyComp[6];
#endif
#ifdef FEEDBACK_WIND
double EnergyFeedbackWindComp[6];
#endif
#ifdef BUBBLES
double EnergyBubblesComp[6];
#endif
#ifdef CHIMIE_THERMAL_FEEDBACK
double EnergyThermalFeedbackComp[6];
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
double EnergyKineticFeedbackComp[6];
#endif
double EnergyTotComp[6];
double MomentumComp[6][4];
double AngMomentumComp[6][4];
double CenterOfMassComp[6][4];
}
SysState; /*<! Structure for storing some global statistics about the simulation. */
/*! This structure contains data related to the energy budget.
These values are different for each task. It need to be stored
in the restart flag.
*/
extern struct local_state_of_system
{
double EnergyTest;
double EnergyInt1;
double EnergyInt2;
double EnergyKin1;
double EnergyKin2;
#ifdef COOLING
double RadiatedEnergy;
#endif
#ifdef SFR
double StarEnergyInt;
#ifdef FEEDBACK
double StarEnergyFeedback;
#endif
#endif
#ifdef CHIMIE_THERMAL_FEEDBACK
double EnergyThermalFeedback;
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
double EnergyKineticFeedback;
#endif
#ifdef MULTIPHASE
double EnergyRadSticky;
#endif
#ifdef FEEDBACK_WIND
double EnergyFeedbackWind;
#endif
}
LocalSysState; /*<! Structure for storing some local statistics about the simulation. */
/* Various structures for communication
*/
extern struct gravdata_in
{
union
{
FLOAT Pos[3];
FLOAT Acc[3];
FLOAT Potential;
}
u;
#if defined(UNEQUALSOFTENINGS) || defined(STELLAR_FLUX)
int Type;
#ifdef ADAPTIVE_GRAVSOFT_FORGAS
FLOAT Soft;
#endif
#endif
#ifdef STELLAR_FLUX
FLOAT EnergyFlux;
#endif
union
{
FLOAT OldAcc;
int Ninteractions;
}
w;
}
*GravDataIn, /*!< holds particle data to be exported to other processors */
*GravDataGet, /*!< holds particle data imported from other processors */
*GravDataResult, /*!< holds the partial results computed for imported particles. Note: We use GravDataResult = GravDataGet, such that the result replaces the imported data */
*GravDataOut; /*!< holds partial results received from other processors. This will overwrite the GravDataIn array */
extern struct gravdata_index
{
int Task;
int Index;
int SortIndex;
}
*GravDataIndexTable; /*!< the particles to be exported are grouped by task-number. This table allows the results to be disentangled again and to be assigned to the correct particle */
extern struct densdata_in
{
FLOAT Pos[3];
FLOAT Vel[3];
FLOAT Hsml;
#ifdef MULTIPHASE
int Phase;
#endif
int Index;
int Task;
#ifdef ART_CONDUCTIVITY
FLOAT EnergyIntPred;
#endif
}
*DensDataIn, /*!< holds particle data for SPH density computation to be exported to other processors */
*DensDataGet; /*!< holds imported particle data for SPH density computation */
extern struct densdata_out
{
FLOAT Rho;
FLOAT Div, Rot[3];
FLOAT DhsmlDensity;
FLOAT Ngb;
#ifdef ART_CONDUCTIVITY
FLOAT GradEnergyInt[3];
#endif
#ifdef PRESSURE_ENTROPY_FORMULATION
FLOAT nDensity;
FLOAT mPressure;
FLOAT DhsmlnDensity;
FLOAT DhsmlPressure;
#endif
}
*DensDataResult, /*!< stores the locally computed SPH density results for imported particles */
*DensDataPartialResult; /*!< imported partial SPH density results from other processors */
extern struct hydrodata_in
{
FLOAT Pos[3];
FLOAT Vel[3];
FLOAT Hsml;
#ifdef FEEDBACK
FLOAT EnergySN;
#endif
#ifdef MULTIPHASE
int Phase;
FLOAT Entropy;
int StickyFlag;
#endif
FLOAT Mass;
FLOAT Density;
FLOAT Pressure;
FLOAT F1;
FLOAT DhsmlDensityFactor;
int Timestep;
int Task;
int Index;
#ifdef WITH_ID_IN_HYDRA
int ID;
#endif
#ifdef ART_CONDUCTIVITY
FLOAT NormGradEnergyInt;
#endif
#if defined(ART_VISCO_MM)|| defined(ART_VISCO_RO) || defined(ART_VISCO_CD)
double ArtBulkViscConst;
#endif
#ifdef PRESSURE_ENTROPY_FORMULATION
FLOAT mPressure;
FLOAT EntropyPred;
FLOAT DhsmlnDensityFactor;
#endif
}
*HydroDataIn, /*!< holds particle data for SPH hydro-force computation to be exported to other processors */
*HydroDataGet; /*!< holds imported particle data for SPH hydro-force computation */
extern struct hydrodata_out
{
FLOAT Acc[3];
FLOAT DtEntropy;
#ifdef FEEDBACK
FLOAT DtEgySpecFeedback;
FLOAT FeedbackAccel[3]; /*!< acceleration due to feedback force */
#endif
FLOAT MaxSignalVel;
#ifdef COMPUTE_VELOCITY_DISPERSION
FLOAT VelocityDispersion[VELOCITY_DISPERSION_SIZE];
#endif
#ifdef MULTIPHASE
FLOAT StickyDVel[3]; /*!< differences in velocities induced by sticky collisions */
#endif
#ifdef OUTPUT_CONDUCTIVITY
FLOAT OptVar2;
#endif
#ifdef ART_VISCO_CD
double DmatCD[3][3];
double TmatCD[3][3];
double R_CD;
FLOAT MaxSignalVelCD;
#endif
}
*HydroDataResult, /*!< stores the locally computed SPH hydro results for imported particles */
*HydroDataPartialResult; /*!< imported partial SPH hydro-force results from other processors */
#ifdef MULTIPHASE
extern struct stickydata_in
{
FLOAT Pos[3];
FLOAT Vel[3];
FLOAT Mass;
FLOAT Hsml;
int ID;
int StickyMaxID;
int StickyNgb;
float StickyMaxFs;
int Task;
int Index;
}
*StickyDataIn, /*!< holds particle data for sticky computation to be exported to other processors */
*StickyDataGet; /*!< holds imported particle data for sticky computation */
extern struct stickydata_out
{
int StickyMaxID;
int StickyNgb;
float StickyMaxFs;
FLOAT StickyNewVel[3];
}
*StickyDataResult, /*!< stores the locally computed sticky results for imported particles */
*StickyDataPartialResult; /*!< imported partial sticky results from other processors */
extern struct Sticky_index
{
int Index;
int CellIndex;
int Flag;
}
*StickyIndex;
#endif
#ifdef CHIMIE
extern struct chimiedata_in
{
FLOAT Pos[3];
FLOAT Vel[3];
#ifndef LONGIDS
unsigned int ID; /*!< particle identifier */
#else
unsigned long long ID; /*!< particle identifier */
#endif
FLOAT Hsml;
#ifdef FEEDBACK
FLOAT EnergySN;
#endif
#ifdef MULTIPHASE
int Phase;
FLOAT Entropy;
int StickyFlag;
#endif
FLOAT Density;
FLOAT Volume;
FLOAT Pressure;
FLOAT F1;
FLOAT DhsmlDensityFactor;
int Timestep;
int Task;
int Index;
#ifdef WITH_ID_IN_HYDRA
int ID;
#endif
double TotalEjectedGasMass;
double TotalEjectedEltMass[NELEMENTS];
double TotalEjectedEgySpec;
double NumberOfSNIa;
double NumberOfSNII;
#ifdef CHIMIE_KINETIC_FEEDBACK
FLOAT NgbMass;
#endif
}
*ChimieDataIn, /*!< holds particle data for Chimie computation to be exported to other processors */
*ChimieDataGet; /*!< holds imported particle data for Chimie computation */
extern struct chimiedata_out
{
FLOAT Acc[3];
FLOAT DtEntropy;
#ifdef FEEDBACK
FLOAT DtEgySpecFeedback;
FLOAT FeedbackAccel[3]; /*!< acceleration due to feedback force */
#endif
FLOAT MaxSignalVel;
#ifdef COMPUTE_VELOCITY_DISPERSION
FLOAT VelocityDispersion[VELOCITY_DISPERSION_SIZE];
#endif
#ifdef MULTIPHASE
FLOAT StickyDVel[3]; /*!< differences in velocities induced by sticky collisions */
#endif
}
*ChimieDataResult, /*!< stores the locally computed Chimie results for imported particles */
*ChimieDataPartialResult; /*!< imported partial Chimie results from other processors */
extern struct starsdensdata_in
{
FLOAT Pos[3];
FLOAT Hsml;
int Index;
int Task;
}
*StarsDensDataIn, /*!< holds particle data for SPH density computation to be exported to other processors */
*StarsDensDataGet; /*!< holds imported particle data for SPH density computation */
extern struct starsdensdata_out
{
FLOAT Rho;
FLOAT Volume;
FLOAT DhsmlDensity;
FLOAT Ngb;
#ifdef CHIMIE_KINETIC_FEEDBACK
FLOAT NgbMass;
#endif
}
*StarsDensDataResult, /*!< stores the locally computed SPH density results for imported particles */
*StarsDensDataPartialResult; /*!< imported partial SPH density results from other processors */
#endif /*CHIMIE*/
#ifdef TESSEL
extern struct ghostdata_in
{
FLOAT Pos[3];
FLOAT rSearch;
int Index;
int Task;
}
*GhostDataIn, /*!< holds particle data for SPH density computation to be exported to other processors */
*GhostDataGet; /*!< holds imported particle data for SPH density computation */
extern struct ghostdata_out
{
FLOAT Value;
}
*GhostDataResult, /*!< stores the locally computed SPH density results for imported particles */
*GhostDataPartialResult; /*!< imported partial SPH density results from other processors */
/* ghost particles */
//extern struct ghost_particle_data
//{
// FLOAT Pos[3]; /*!< particle position at its current time */
// FLOAT Mass; /*!< particle mass */
//}
// *gP;
extern int NumgPart;
#endif /* TESSEL */
#ifdef PY_INTERFACE
extern struct denssphdata_in
{
FLOAT Pos[3];
FLOAT Vel[3];
FLOAT Hsml;
FLOAT Density;
FLOAT DhsmlDensityFactor;
int Index;
int Task;
FLOAT Observable;
}
*DensSphDataIn, /*!< holds particle data for SPH density computation to be exported to other processors */
*DensSphDataGet; /*!< holds imported particle data for SPH density computation */
extern struct denssphdata_out
{
FLOAT Rho;
FLOAT Div, Rot[3];
FLOAT DhsmlDensity;
FLOAT Ngb;
FLOAT GradObservable[3];
}
*DensSphDataResult, /*!< stores the locally computed SPH density results for imported particles */
*DensSphDataPartialResult; /*!< imported partial SPH density results from other processors */
extern struct sphdata_in
{
FLOAT Pos[3];
FLOAT Vel[3];
FLOAT Hsml;
FLOAT Density;
FLOAT DhsmlDensityFactor;
FLOAT ObsMoment0;
FLOAT ObsMoment1;
FLOAT Observable;
int Task;
int Index;
}
*SphDataIn, /*!< holds particle data for SPH hydro-force computation to be exported to other processors */
*SphDataGet; /*!< holds imported particle data for SPH hydro-force computation */
extern struct sphdata_out
{
FLOAT ObsMoment0;
FLOAT ObsMoment1;
FLOAT GradObservable[3];
}
*SphDataResult, /*!< stores the locally computed SPH hydro results for imported particles */
*SphDataPartialResult; /*!< imported partial SPH hydro-force results from other processors */
#endif /*PY_INTERFACE*/
#endif
diff --git a/src/chimie.c b/src/chimie.c
index 143adcd..a0fc671 100644
--- a/src/chimie.c
+++ b/src/chimie.c
@@ -1,2833 +1,5073 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <mpi.h>
#include <gsl/gsl_math.h>
#include "allvars.h"
#include "proto.h"
#ifdef CHIMIE
+#ifdef PYCHEM
-/*! \file hydra.c
- * \brief Computation of SPH forces and rate of entropy generation
- *
- * This file contains the "second SPH loop", where the SPH forces are
- * computed, and where the rate of change of entropy due to the shock heating
- * (via artificial viscosity) is computed.
- */
+#include <Python.h>
+#include <math.h>
+#include <string.h>
+#include <stdio.h>
+#include <numpy/arrayobject.h>
-static double hubble_a, atime, hubble_a2, fac_mu, fac_vsic_fix, a3inv, fac_egy;
-#ifdef FEEDBACK
-static double fac_pow;
-#endif
-#ifdef PERIODIC
-static double boxSize, boxHalf;
+/*
+ ****************************************************
+ these variables are already defined in Gadget (or not needed)
+ ****************************************************
+*/
-#ifdef LONG_X
-static double boxSize_X, boxHalf_X;
-#else
-#define boxSize_X boxSize
-#define boxHalf_X boxHalf
-#endif
-#ifdef LONG_Y
-static double boxSize_Y, boxHalf_Y;
-#else
-#define boxSize_Y boxSize
-#define boxHalf_Y boxHalf
-#endif
-#ifdef LONG_Z
-static double boxSize_Z, boxHalf_Z;
-#else
-#define boxSize_Z boxSize
-#define boxHalf_Z boxHalf
-#endif
-#endif
+#define TO_DOUBLE(a) ( (PyArrayObject*) PyArray_CastToType(a, PyArray_DescrFromType(NPY_DOUBLE) ,0) )
+
+
+#endif /* PYCHEM */
+
/****************************************************************************************/
/*
/*
/*
-/* GADGET CHIMIE PART
+/* COMMON CHIMIE PART
/*
/*
/*
/****************************************************************************************/
#define MAXPTS 10
#define MAXDATASIZE 200
#define KPC_IN_CM 3.085e+21
static int verbose=0;
static double *MassFracSNII;
+static double *MassFracSNIa;
+static double *MassFracDYIN;
static double *SingleMassFracSNII;
+static double *SingleMassFracSNIa;
+static double *SingleMassFracDYIN;
static double *EjectedMass;
static double *SingleEjectedMass;
static double **MassFracSNIIs;
+static double **MassFracSNIas;
+static double **MassFracDYINs;
static double **SingleMassFracSNIIs;
+static double **SingleMassFracSNIas;
+static double **SingleMassFracDYINs;
static double **EjectedMasss;
static double **SingleEjectedMasss;
/* intern global variables */
static struct local_params_chimie
{
float coeff_z[3][3];
float Mmin,Mmax;
int n;
float ms[MAXPTS];
float as[MAXPTS+1];
float bs[MAXPTS+1];
float fs[MAXPTS];
double imf_Ntot;
float SNII_Mmin;
float SNII_Mmax;
float SNII_cte;
float SNII_a;
float SNIa_Mpl;
float SNIa_Mpu;
float SNIa_a;
float SNIa_cte;
float SNIa_Mdl1;
float SNIa_Mdu1;
float SNIa_a1;
float SNIa_b1;
float SNIa_cte1;
float SNIa_bb1;
float SNIa_Mdl2;
float SNIa_Mdu2;
float SNIa_a2;
float SNIa_b2;
float SNIa_cte2;
float SNIa_bb2;
float Mco;
int npts;
int nelts;
}
*Cps,*Cp;
static struct local_elts_chimie
{
float Mmin; /* minimal mass */
float Step; /* log of mass step */
float Array[MAXDATASIZE]; /* data */
float Metal[MAXDATASIZE]; /* data */
float MSNIa;
float SolarAbundance;
char label[72];
}
**Elts,*Elt;
+/*! This function allocate all varaiables related to the chemistry
+ */
+
+
void allocate_chimie()
{
int j;
/* allocate Cp */
Cps = malloc((All.ChimieNumberOfParameterFiles) * sizeof(struct local_params_chimie));
/* allocate elts */
Elts = malloc((All.ChimieNumberOfParameterFiles) * sizeof(struct local_elts_chimie));
//for (j=0;j<All.ChimieNumberOfParameterFiles;j++)
// Elt[j] = malloc((nelts) * sizeof(struct local_elts_chimie));
- MassFracSNIIs = malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
+ MassFracSNIIs = malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
+ MassFracSNIas = malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
+ MassFracDYINs = malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
EjectedMasss = malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
SingleMassFracSNIIs= malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
+ SingleMassFracSNIas= malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
+ SingleMassFracDYINs= malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
SingleEjectedMasss = malloc((All.ChimieNumberOfParameterFiles) * sizeof(double));
}
-void allocate_Elts(int it)
- {
-
- /* allocate memory for elts */
- if (Cps[it].npts<=MAXDATASIZE)
- {
- Elts[it] = malloc((Cps[it].nelts+2) * sizeof(struct local_elts_chimie));
- }
- else
- {
- printf("\n Cps[it].npts = %d > MAXDATASIZE = %d !!!\n\n",Cps[it].npts,MAXDATASIZE);
- endrun(88800);
- }
-
-
- }
-
-
-
-
-
+/*! Set the chemistry table to use
+ */
-
void set_table(int i)
{
if (i>=All.ChimieNumberOfParameterFiles)
{
printf("\n set_table : i>= %d !!!\n\n",All.ChimieNumberOfParameterFiles);
endrun(88809);
}
else
{
Cp = &Cps[i];
Elt = Elts[i];
- MassFracSNII = MassFracSNIIs[i];
- SingleMassFracSNII = SingleMassFracSNIIs[i];
+ MassFracSNII = MassFracSNIIs[i]; /* all this is useless, no ?*/
+ MassFracSNIa = MassFracSNIas[i];
+ MassFracDYIN = MassFracDYINs[i];
+
+ SingleMassFracSNII = SingleMassFracSNIIs[i];
+ SingleMassFracSNIa = SingleMassFracSNIas[i];
+ SingleMassFracDYIN = SingleMassFracDYINs[i];
+
EjectedMass = EjectedMasss[i];
SingleEjectedMass = SingleEjectedMasss[i];
}
}
+
+
+/*! Read the chemistry table
+ */
+
void read_chimie(char * filename,int it)
{
char line[72],buffer[72];
FILE *fd;
int i,j;
+
+ printf("reading %s ...\n",filename);
+ fd = fopen(filename,"r");
+
+ /* read Lifetime */
+ /* #### Livetime #### */
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fscanf(fd, "%g %g %g\n", &Cps[it].coeff_z[0][0],&Cps[it].coeff_z[0][1],&Cps[it].coeff_z[0][2]);
+ fscanf(fd, "%g %g %g\n", &Cps[it].coeff_z[1][0],&Cps[it].coeff_z[1][1],&Cps[it].coeff_z[1][2]);
+ fscanf(fd, "%g %g %g\n", &Cps[it].coeff_z[2][0],&Cps[it].coeff_z[2][1],&Cps[it].coeff_z[2][2]);
+ fgets(line, sizeof(line), fd);
+ /* IMF Parameters */
+ /* #### IMF Parameters #### */
+ fgets(line, sizeof(line), fd);
+ fscanf(fd, "%g %g\n",&Cps[it].Mmin,&Cps[it].Mmax);
+ fscanf(fd, "%d\n",&Cps[it].n);
-
- if (ThisTask==0)
- {
+ if (Cps[it].n>0)
+ for (i=0;i<Cps[it].n;i++)
+ fscanf(fd,"%g",&Cps[it].ms[i]);
+ else
+ fgets(line, sizeof(line), fd);
- printf("reading %s ...\n",filename);
- fd = fopen(filename,"r");
-
- /* read Lifetime */
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
- fscanf(fd, "%g %g %g\n", &Cps[it].coeff_z[0][0],&Cps[it].coeff_z[0][1],&Cps[it].coeff_z[0][2]);
- fscanf(fd, "%g %g %g\n", &Cps[it].coeff_z[1][0],&Cps[it].coeff_z[1][1],&Cps[it].coeff_z[1][2]);
- fscanf(fd, "%g %g %g\n", &Cps[it].coeff_z[2][0],&Cps[it].coeff_z[2][1],&Cps[it].coeff_z[2][2]);
- fgets(line, sizeof(line), fd);
+ for (i=0;i<Cps[it].n+1;i++)
+ fscanf(fd,"%g",&Cps[it].as[i]);
+
+ fgets(line, sizeof(line), fd);
- /* IMF Parameters */
- fgets(line, sizeof(line), fd);
- fscanf(fd, "%g %g\n",&Cps[it].Mmin,&Cps[it].Mmax);
- fscanf(fd, "%d\n",&Cps[it].n);
+ /* Parameters for SNII Rates */
+ /* #### SNII Parameters #### */
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fscanf(fd, "%g \n",&Cps[it].SNII_Mmin);
+ fgets(line, sizeof(line), fd);
+
+ /* Parameters for SNIa Rates */
+ /* #### SNIa Parameters #### */
+ fgets(line, sizeof(line), fd);
+ fscanf(fd, "%g %g\n",&Cps[it].SNIa_Mpl,&Cps[it].SNIa_Mpu);
+ fscanf(fd, "%g \n",&Cps[it].SNIa_a);
+ fscanf(fd, "%g %g %g\n",&Cps[it].SNIa_Mdl1,&Cps[it].SNIa_Mdu1,&Cps[it].SNIa_bb1);
+ fscanf(fd, "%g %g %g\n",&Cps[it].SNIa_Mdl2,&Cps[it].SNIa_Mdu2,&Cps[it].SNIa_bb2);
+ fgets(line, sizeof(line), fd);
+
+
+
+
+ /* Metal injection SNII */
+ /* #### Metal Parameters ####*/
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fscanf(fd, "%d %d\n",&Cps[it].npts,&Cps[it].nelts);
- if (Cps[it].n>0)
- for (i=0;i<Cps[it].n;i++)
- fscanf(fd,"%g",&Cps[it].ms[i]);
- else
- fgets(line, sizeof(line), fd);
+ /* allocate memory for elts */
+ if (Cps[it].npts<=MAXDATASIZE)
+ {
+ Elts[it] = malloc((Cps[it].nelts+2) * sizeof(struct local_elts_chimie));
+ }
+ else
+ {
+ printf("\n Cps[it].npts = %d > MAXDATASIZE = %d !!!\n\n",Cps[it].npts,MAXDATASIZE);
+ endrun(88800);
+ }
- for (i=0;i<Cps[it].n+1;i++)
- fscanf(fd,"%g",&Cps[it].as[i]);
- fgets(line, sizeof(line), fd);
-
- /* Parameters for SNII Rates */
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
- fscanf(fd, "%g \n",&Cps[it].SNII_Mmin);
- fgets(line, sizeof(line), fd);
-
- /* Parameters for SNIa Rates */
- fgets(line, sizeof(line), fd);
- fscanf(fd, "%g %g\n",&Cps[it].SNIa_Mpl,&Cps[it].SNIa_Mpu);
- fscanf(fd, "%g \n",&Cps[it].SNIa_a);
- fscanf(fd, "%g %g %g\n",&Cps[it].SNIa_Mdl1,&Cps[it].SNIa_Mdu1,&Cps[it].SNIa_bb1);
- fscanf(fd, "%g %g %g\n",&Cps[it].SNIa_Mdl2,&Cps[it].SNIa_Mdu2,&Cps[it].SNIa_bb2);
- fgets(line, sizeof(line), fd);
-
-
-
-
- /* Metal injection SNII */
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
- fscanf(fd, "%d %d\n",&Cps[it].npts,&Cps[it].nelts);
+ /* allocate memory */
+ MassFracSNIIs[it] = malloc((Cps[it].nelts+2) * sizeof(double)); /* really needed ? */
+ MassFracSNIas[it] = malloc((Cps[it].nelts+2) * sizeof(double));
+ MassFracDYINs[it] = malloc((Cps[it].nelts+2) * sizeof(double));
- /* allocate memory for elts */
- allocate_Elts(it);
+ EjectedMasss[it] = malloc((Cps[it].nelts+2) * sizeof(double));
+
+ SingleMassFracSNIIs[it] = malloc((Cps[it].nelts+2) * sizeof(double));
+ SingleMassFracSNIas[it] = malloc((Cps[it].nelts+2) * sizeof(double));
+ SingleMassFracDYINs[it] = malloc((Cps[it].nelts+2) * sizeof(double));
+
+ SingleEjectedMasss[it] = malloc((Cps[it].nelts+2) * sizeof(double));
- /* injected metals */
-
- for (i=0;i<Cps[it].nelts+2;i++)
- {
- fgets(line, sizeof(line), fd);
-
- /* strip trailing line */
- for (j = 0; j < strlen(line); j++)
- if ( line[j] == '\n' || line[j] == '\r' )
- line[j] = '\0';
- /* copy labels */
- strcpy(Elts[it][i].label,line);
- strcpy(buffer,&Elts[it][i].label[2]);
- strcpy(Elts[it][i].label,buffer);
-
- fgets(line, sizeof(line), fd);
-
- fscanf(fd, "%g %g\n",&Elts[it][i].Mmin,&Elts[it][i].Step);
-
- for (j=0;j<Cps[it].npts;j++)
- {
- fscanf(fd, "%g\n",&Elts[it][i].Metal[j]);
- }
- }
+
+ /* injected metals */
+ for (i=0;i<Cps[it].nelts+2;i++)
+ {
+ fgets(line, sizeof(line), fd);
+
+ /* strip trailing line */
+ for (j = 0; j < strlen(line); j++)
+ if ( line[j] == '\n' || line[j] == '\r' )
+ line[j] = '\0';
+ /* copy labels */
+ strcpy(Elts[it][i].label,line);
+
+ /* probleme */
+ strcpy(buffer,&Elts[it][i].label[2]);
+ strcpy(Elts[it][i].label,buffer);
-
+ fgets(line, sizeof(line), fd);
+
+ fscanf(fd, "%g %g\n",&Elts[it][i].Mmin,&Elts[it][i].Step);
+
+ for (j=0;j<Cps[it].npts;j++)
+ {
+ fscanf(fd, "%g\n",&Elts[it][i].Metal[j]);
+ }
+ }
+
- /* integrals of injected metals */
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
- fscanf(fd, "%d %d\n",&Cps[it].npts,&Cps[it].nelts);
+ /* integrals of injected metals */
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fscanf(fd, "%d %d\n",&Cps[it].npts,&Cps[it].nelts);
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
- /* integrals of injected metals */
+ /* integrals of injected metals */
- for (i=0;i<Cps[it].nelts+2;i++)
+ for (i=0;i<Cps[it].nelts+2;i++)
+ {
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+
+ fscanf(fd, "%g %g\n",&Elts[it][i].Mmin,&Elts[it][i].Step);
+
+ for (j=0;j<Cps[it].npts;j++)
{
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
-
- fscanf(fd, "%g %g\n",&Elts[it][i].Mmin,&Elts[it][i].Step);
-
- for (j=0;j<Cps[it].npts;j++)
- {
- fscanf(fd, "%g\n",&Elts[it][i].Array[j]);
- }
-
- }
+ fscanf(fd, "%g\n",&Elts[it][i].Array[j]);
+ }
+
+ }
-
- /* Metal injection SNIa */
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
- fscanf(fd, "%g\n",&Cps[it].Mco);
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
+
+ /* Metal injection SNIa */
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fscanf(fd, "%g\n",&Cps[it].Mco);
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
- int nelts;
- char label[72];
- fscanf(fd, "%d\n",&nelts);
- /* check */
- if (nelts != Cps[it].nelts)
- {
- printf("\nThe number of elements in SNII (=%d) is not identical to the on of SNIa (=%d) !!!\n\n",Cps[it].nelts,nelts);
- printf("This is not supported by the current implementation !!!\n");
- endrun(88805);
- }
-
-
- for (i=0;i<Cps[it].nelts+2;i++)
- {
-
- fgets(line, sizeof(line), fd); /* label */
-
- /* check label */
- /* strip trailing line */
- for (j = 0; j < strlen(line); j++)
- if ( line[j] == '\n' || line[j] == '\r' )
- line[j] = '\0';
-
- strcpy(label,line);
- strcpy(buffer,&label[2]);
- strcpy(label,buffer);
- if (strcmp(label,Elts[it][i].label)!=0)
- {
- printf("\nLabel of SNII element %d (=%s) is different from the SNIa one (=%s) !!!\n\n",i,Elts[it][i].label,label);
- endrun(88806);
- }
-
- //fgets(line, sizeof(line), fd);
- fscanf(fd, "%g\n",&Elts[it][i].MSNIa);
+ int nelts;
+ char label[72];
+ fscanf(fd, "%d\n",&nelts);
+ /* check */
+ if (nelts != Cps[it].nelts)
+ {
+ printf("\nThe number of elements in SNII (=%d) is not identical to the on of SNIa (=%d) !!!\n\n",Cps[it].nelts,nelts);
+ printf("This is not supported by the current implementation !!!\n");
+ endrun(88805);
+ }
- }
+ for (i=0;i<Cps[it].nelts+2;i++)
+ {
+ fgets(line, sizeof(line), fd); /* label */
+
+ /* check label */
+ /* strip trailing line */
+ for (j = 0; j < strlen(line); j++)
+ if ( line[j] == '\n' || line[j] == '\r' )
+ line[j] = '\0';
+
+ strcpy(label,line);
+ strcpy(buffer,&label[2]);
+ strcpy(label,buffer);
+
+ if (strcmp(label,Elts[it][i].label)!=0)
+ {
+ printf("\nLabel of SNII element %d (=%s) is different from the SNIa one (=%s) !!!\n\n",i,Elts[it][i].label,label);
+ endrun(88806);
+ }
+
+ //fgets(line, sizeof(line), fd);
+ fscanf(fd, "%g\n",&Elts[it][i].MSNIa);
-
- /* Solar Abundances */
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
- fgets(line, sizeof(line), fd);
+ }
- fscanf(fd, "%d\n",&nelts);
- /* check */
- if (nelts != Cps[it].nelts)
- {
- printf("\nThe number of elements in SolarAbundances (=%d) is not identical to the on of SNIa (=%d) !!!\n\n",Cps[it].nelts,nelts);
- printf("This is not supported by the current implementation !!!\n");
- endrun(88805);
- }
- for (i=0;i<Cps[it].nelts;i++)
- {
+
+ /* Solar Abundances */
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+ fgets(line, sizeof(line), fd);
+
+ fscanf(fd, "%d\n",&nelts);
+ /* check */
+ if (nelts != Cps[it].nelts)
+ {
+ printf("\nThe number of elements in SolarAbundances (=%d) is not identical to the on of SNIa (=%d) !!!\n\n",Cps[it].nelts,nelts);
+ printf("This is not supported by the current implementation !!!\n");
+ endrun(88805);
+ }
- fgets(line, sizeof(line), fd); /* label */
-
- /* check label */
- /* strip trailing line */
- for (j = 0; j < strlen(line); j++)
- if ( line[j] == '\n' || line[j] == '\r' )
- line[j] = '\0';
-
- strcpy(label,line);
- strcpy(buffer,&label[2]);
- strcpy(label,buffer);
- if (strcmp(label,Elts[it][i+2].label)!=0)
- {
- printf("\nLabel of SNII element %d (=%s) is different from the SNIa one (=%s) !!!\n\n",i,Elts[it][i+2].label,label);
- endrun(88806);
- }
-
- //fgets(line, sizeof(line), fd);
- fscanf(fd, "%g\n",&Elts[it][i+2].SolarAbundance);
- }
+ for (i=0;i<Cps[it].nelts;i++)
+ {
-
- fclose(fd);
+ fgets(line, sizeof(line), fd); /* label */
+
+ /* check label */
+ /* strip trailing line */
+ for (j = 0; j < strlen(line); j++)
+ if ( line[j] == '\n' || line[j] == '\r' )
+ line[j] = '\0';
+ strcpy(label,line);
+ strcpy(buffer,&label[2]);
+ strcpy(label,buffer);
+ if (strcmp(label,Elts[it][i+2].label)!=0)
+ {
+ printf("\nLabel of SNII element %d (=%s) is different from the SNIa one (=%s) !!!\n\n",i,Elts[it][i+2].label,label);
+ endrun(88806);
+ }
+
+ //fgets(line, sizeof(line), fd);
+ fscanf(fd, "%g\n",&Elts[it][i+2].SolarAbundance);
}
-
-
-
- /* send Cps */
- MPI_Bcast(Cps, (All.ChimieNumberOfParameterFiles) * sizeof(struct local_params_chimie), MPI_BYTE, 0, MPI_COMM_WORLD);
-
-
- /* slaves allocate Elts */
- if (ThisTask!=0)
- allocate_Elts(it);
-
- MPI_Bcast(Elts[it], (Cps[it].nelts+2) * sizeof(struct local_elts_chimie), MPI_BYTE, 0, MPI_COMM_WORLD);
-
-
-
- /* allocate memory */
- MassFracSNIIs[it] = malloc((Cps[it].nelts+2) * sizeof(double));
- EjectedMasss[it] = malloc((Cps[it].nelts+2) * sizeof(double));
- SingleMassFracSNIIs[it] = malloc((Cps[it].nelts+2) * sizeof(double));
- SingleEjectedMasss[it] = malloc((Cps[it].nelts+2) * sizeof(double));
-
-
+
+
+ fclose(fd);
if (verbose && ThisTask==0)
{
printf("%g %g %g\n", Cps[it].coeff_z[0][0],Cps[it].coeff_z[0][1],Cps[it].coeff_z[0][2]);
printf("%g %g %g\n", Cps[it].coeff_z[1][0],Cps[it].coeff_z[1][1],Cps[it].coeff_z[1][2]);
printf("%g %g %g\n", Cps[it].coeff_z[2][0],Cps[it].coeff_z[2][1],Cps[it].coeff_z[2][2]);
printf("\n");
printf("\nIMF\n");
printf("%g %g\n",Cps[it].Mmin,Cps[it].Mmax);
printf("%d\n",Cps[it].n);
for (i=0;i<Cps[it].n;i++)
printf( "ms : %g ",Cps[it].ms[i]);
printf("\n");
for (i=0;i<Cps[it].n+1;i++)
printf( "as : %g ",Cps[it].as[i]);
printf("\n");
printf("\nRate SNII\n");
printf("%g ",Cps[it].SNII_Mmin);
printf("\n");
printf("\nRate SNIa\n");
printf("%g %g\n",Cps[it].SNIa_Mpl,Cps[it].SNIa_Mpu);
printf("%g \n",Cps[it].SNIa_a);
printf("%g %g %g\n",Cps[it].SNIa_Mdl1,Cps[it].SNIa_Mdu1,Cps[it].SNIa_b1);
printf("%g %g %g\n",Cps[it].SNIa_Mdl2,Cps[it].SNIa_Mdu2,Cps[it].SNIa_b2);
printf("\n");
for (i=0;i<Cps[it].nelts+2;i++)
{
printf("> %g %g\n",Elts[it][i].Mmin,Elts[it][i].Step);
for (j=0;j<Cps[it].npts;j++)
{
printf(" %g\n",Elts[it][i].Array[j]);
}
}
printf("\n");
printf("%g\n",Cps[it].Mco);
for (i=0;i<Cps[it].nelts+2;i++)
printf("%g\n",Elts[it][i].MSNIa);
printf("\n");
}
}
+/*! This function returns the mass fraction of a star of mass m
+ * using the current IMF
+ */
-/*
-
- This function returns the mass fraction of a star of mass m
- using the current IMF
-
-*/
static double get_imf(double m)
{
int i;
int n;
n = Cp->n;
/* convert m in msol */
m = m*All.UnitMass_in_g / SOLAR_MASS;
if (n==0)
return Cp->bs[0]* pow(m,Cp->as[0]);
else
{
for (i=0;i<n;i++)
if (m < Cp->ms[i])
return Cp->bs[i]* pow(m,Cp->as[i]);
return Cp->bs[n]* pow(m,Cp->as[n]);
}
}
-/*
-
- This function returns the mass fraction between m1 and m2
- per mass unit, using the current IMF
-*/
+/*! This function returns the mass fraction between m1 and m2
+ * per mass unit, using the current IMF
+ */
static double get_imf_M(double m1, double m2)
{
int i;
int n;
double p;
double integral=0;
double mmin,mmax;
n = Cp->n;
/* convert m in msol */
m1 = m1*All.UnitMass_in_g / SOLAR_MASS;
m2 = m2*All.UnitMass_in_g / SOLAR_MASS;
if (n==0)
{
p = Cp->as[0]+1;
integral = (Cp->bs[0]/p) * ( pow(m2,p) - pow(m1,p) );
//printf("--> %g %g %g %g int=%g\n",m1,m2,pow(m2,p), pow(m1,p),integral);
}
else
{
integral = 0;
/* first */
if (m1<Cp->ms[0])
{
mmin = m1;
mmax = dmin(Cp->ms[0],m2);
p = Cp->as[0] + 1;
integral += (Cp->bs[0]/p) * ( pow(mmax,p) - pow(mmin,p) );
}
/* last */
if (m2>Cp->ms[n-1])
{
mmin = dmax(Cp->ms[n-1],m1);
mmax = m2;
p = Cp->as[n] + 1;
integral += (Cp->bs[n]/p) * ( pow(mmax,p) - pow(mmin,p) );
}
/* loop over other segments */
for (i=0;i<n-1;i++)
{
mmin = dmax(Cp->ms[i ],m1);
mmax = dmin(Cp->ms[i+1],m2);
if (mmin<mmax)
{
p = Cp->as[i+1] + 1;
integral += (Cp->bs[i+1]/p) * ( pow(mmax,p) - pow(mmin,p) );
}
}
}
/* convert into mass unit mass unit */
/* integral = integral * SOLAR_MASS/All.UnitMass_in_g;*/
return integral;
}
-/*
-
- This function returns the number fraction between m1 and m2
- per mass unit, using the current IMF
-
+/*! This function returns the number fraction between m1 and m2
+ * per mass unit, using the current IMF
*/
static double get_imf_N(double m1, double m2)
{
int i;
int n;
double p;
double integral=0;
double mmin,mmax;
n = Cp->n;
/* convert m in msol */
m1 = m1*All.UnitMass_in_g / SOLAR_MASS;
m2 = m2*All.UnitMass_in_g / SOLAR_MASS;
if (n==0)
{
p = Cp->as[0];
integral = (Cp->bs[0]/p) * ( pow(m2,p) - pow(m1,p) );
}
else
{
integral = 0;
/* first */
if (m1<Cp->ms[0])
{
mmin = m1;
mmax = dmin(Cp->ms[0],m2);
p = Cp->as[0];
integral += (Cp->bs[0]/p) * ( pow(mmax,p) - pow(mmin,p) );
}
/* last */
if (m2>Cp->ms[n-1])
{
mmin = dmax(Cp->ms[n-1],m1);
mmax = m2;
p = Cp->as[n];
integral += (Cp->bs[n]/p) * ( pow(mmax,p) - pow(mmin,p) );
}
/* loop over other segments */
for (i=0;i<n-1;i++)
{
mmin = dmax(Cp->ms[i ],m1);
mmax = dmin(Cp->ms[i+1],m2);
if (mmin<mmax)
{
p = Cp->as[i+1];
integral += (Cp->bs[i+1]/p) * ( pow(mmax,p) - pow(mmin,p) );
}
}
}
/* convert into mass unit mass unit */
integral = integral / SOLAR_MASS*All.UnitMass_in_g;
return integral;
}
-/*
-
- This function returns the number fraction between m1 and m2
- per mass unit, using the current IMF
-
+/*! Sample the imf using monte carlo approach
*/
static double imf_sampling()
{
int i;
int n;
double m;
double f;
double pmin,pmax;
n = Cp->n;
/* init random */
- //srandom(irand);
+ //srandom(irand);
f = (double)random()/(double)RAND_MAX;
-
-
+
if (n==0)
{
pmin = pow(Cp->Mmin,Cp->as[0]);
- pmax = pow(Cp->Mmax,Cp->as[0]);
- m = pow(f*(pmax - pmin) + pmin ,1./Cp->as[0]);
- return m* SOLAR_MASS/All.UnitMass_in_g;
+ pmax = pow(Cp->Mmax,Cp->as[0]);
+ m = pow(f*(pmax - pmin) + pmin ,1./Cp->as[0]);
+ return m* SOLAR_MASS/All.UnitMass_in_g;
}
else
{
if (f<Cp->fs[0])
{
pmin = pow(Cp->Mmin ,Cp->as[0]);
m = pow(Cp->imf_Ntot*Cp->as[0]/Cp->bs[0]* (f-0) + pmin ,1./Cp->as[0]);
return m* SOLAR_MASS/All.UnitMass_in_g;
}
for (i=0;i<n-1;i++)
{
if (f<Cp->fs[i+1])
{
pmin = pow(Cp->ms[i] ,Cp->as[i+1]);
m = pow(Cp->imf_Ntot*Cp->as[i+1]/Cp->bs[i+1]* (f-Cp->fs[i]) + pmin ,1./Cp->as[i+1]);
return m* SOLAR_MASS/All.UnitMass_in_g;
}
}
/* last portion */
pmin = pow(Cp->ms[n-1] ,Cp->as[n]);
m = pow(Cp->imf_Ntot*Cp->as[n]/Cp->bs[n]* (f-Cp->fs[n-1]) + pmin ,1./Cp->as[n]);
return m* SOLAR_MASS/All.UnitMass_in_g;
}
}
-/*
-
- This function initialized the imf parameters
- defined in the chimie file
-
+/*! This function initializes the imf parameters
+ defined in the chemistry file
*/
void init_imf(void)
{
float integral = 0;
float p;
float cte;
int i,n;
double mmin,mmax;
n = Cp->n;
if (n==0)
{
p = Cp->as[0]+1;
integral = integral + ( pow(Cp->Mmax,p)-pow(Cp->Mmin,p))/(p) ;
Cp->bs[0] = 1./integral ;
}
else
{
cte = 1.0;
if (Cp->Mmin < Cp->ms[0])
{
p = Cp->as[0]+1;
integral = integral + (pow(Cp->ms[0],p) - pow(Cp->Mmin,p))/p;
}
for (i=0;i<n-1;i++)
{
cte = cte* pow( Cp->ms[i],( Cp->as[i] - Cp->as[i+1] ));
p = Cp->as[i+1]+1;
integral = integral + cte*(pow(Cp->ms[i+1],p) - pow(Cp->ms[i],p))/p;
}
if (Cp->Mmax > Cp->ms[-1])
{
cte = cte* pow( Cp->ms[n-1] , ( Cp->as[n-1] - Cp->as[n] ) );
p = Cp->as[n]+1;
integral = integral + cte*(pow(Cp->Mmax,p) - pow(Cp->ms[n-1],p))/p;
}
/* compute all b */
Cp->bs[0] = 1./integral;
for (i=0;i<n;i++)
{
Cp->bs[i+1] = Cp->bs[i] * pow( Cp->ms[i],( Cp->as[i] - Cp->as[i+1] ));
}
}
if (verbose && ThisTask==0)
{
printf("-- bs -- \n");
for (i=0;i<n+1;i++)
printf("%g ",Cp->bs[i]);
printf("\n");
}
mmin = Cp->Mmin / All.UnitMass_in_g * SOLAR_MASS; /* in mass unit */
mmax = Cp->Mmax / All.UnitMass_in_g * SOLAR_MASS; /* in mass unit */
Cp->imf_Ntot = get_imf_N(mmin,mmax) *SOLAR_MASS/All.UnitMass_in_g;
/* init fs : mass fraction at ms */
if (n>0)
{
for (i=0;i<n+1;i++)
{
mmax = Cp->ms[i] / All.UnitMass_in_g * SOLAR_MASS; /* in mass unit */
Cp->fs[i] = SOLAR_MASS/All.UnitMass_in_g*get_imf_N(mmin,mmax)/Cp->imf_Ntot;
}
}
}
-/*
-
- This function init the chime parameters
-
+/*! This function initializes the chemistry parameters
*/
void init_chimie(void)
{
int i,nf;
double u_lt;
double UnitLength_in_kpc;
double UnitMass_in_Msol;
char filename[500];
char ext[100];
-
-
/* check some flags */
#ifndef COSMICTIME
if (All.ComovingIntegrationOn)
{
if(ThisTask == 0)
printf("Code wasn't compiled with COSMICTIME support enabled!\n");
endrun(-88800);
}
#endif
UnitLength_in_kpc = All.UnitLength_in_cm / KPC_IN_CM;
UnitMass_in_Msol = All.UnitMass_in_g / SOLAR_MASS;
//u_lt = -log10( 4.7287e11*sqrt(pow(UnitLength_in_kpc,3)/UnitMass_in_Msol));
/*Sat Dec 25 23:27:10 CET 2010 */
u_lt = -log10(All.UnitTime_in_Megayears*1e6);
allocate_chimie();
for (nf=0;nf<All.ChimieNumberOfParameterFiles;nf++)
{
if (All.ChimieNumberOfParameterFiles==1)
sprintf(filename,"%s",All.ChimieParameterFile);
else
sprintf(filename,"%s.%d",All.ChimieParameterFile,nf);
-
read_chimie(filename,nf);
-
/* set the table */
set_table(nf);
/* Conversion into program time unit */
Cp->coeff_z[2][2] = Cp->coeff_z[2][2] + u_lt;
for (i=0;i<3;i++)
Cp->coeff_z[1][i] = Cp->coeff_z[1][i]/2.0;
/* init imf parameters */
init_imf();
/* init SNII parameters */
if (Cp->n==0)
{
//Cp->SNII_cte[0] = Cp->bs[0]/Cp->as[0];
Cp->SNII_cte = Cp->bs[0]/Cp->as[0];
Cp->SNII_a = Cp->as[0];
}
else
{
//for (i=0;i<Cp->n+1;i++) /* if multiple power law in the SNII mass range */
// Cp->SNII_cte[i] = Cp->bs[i]/Cp->as[i];
Cp->SNII_cte = Cp->bs[Cp->n]/Cp->as[Cp->n];
Cp->SNII_a = Cp->as[Cp->n];
}
/* init SNIa parameters */
Cp->SNIa_a1 = Cp->SNIa_a;
Cp->SNIa_b1 = (Cp->SNIa_a1+1)/(pow(Cp->SNIa_Mdu1,Cp->SNIa_a1+1)-pow(Cp->SNIa_Mdl1,Cp->SNIa_a1+1));
Cp->SNIa_cte1 = Cp->SNIa_b1/Cp->SNIa_a1;
Cp->SNIa_a2 = Cp->SNIa_a;
Cp->SNIa_b2 = (Cp->SNIa_a2+1)/(pow(Cp->SNIa_Mdu2,Cp->SNIa_a2+1)-pow(Cp->SNIa_Mdl2,Cp->SNIa_a2+1));
Cp->SNIa_cte2 = Cp->SNIa_b2/Cp->SNIa_a2;
/* init SNII parameters */
if (Cp->n==0)
{
Cp->SNIa_cte = Cp->bs[0]/Cp->as[0];
Cp->SNIa_a = Cp->as[0];
}
else
{
Cp->SNIa_cte = Cp->bs[Cp->n]/Cp->as[Cp->n];
Cp->SNIa_a = Cp->as[Cp->n];
}
Cp->SNII_Mmax = Cp->Mmax;
for (i=0;i<Cp->nelts+2;i++)
Elt[i].Mmin = log10(Elt[i].Mmin);
/* output info */
if (verbose && ThisTask==0)
{
printf("-- SNII_cte -- \n");
//for (i=0;i<Cp->n+1;i++)
// printf("%g ",Cp->SNII_cte[i]);
printf("%g ",Cp->SNII_cte);
printf("\n");
}
/* check that the masses are higher than the last IMF elbow */
if (Cp->n>0)
{
if (Cp->SNIa_Mpl < Cp->ms[Cp->n-1])
{
printf("\nSNIa_Mpl = %g < ms[n-1] = %g !!!\n\n",Cp->SNIa_Mpl,Cp->ms[Cp->n-1]);
printf("This is not supported by the current implementation !!!\n");
endrun(88801);
}
if (Cp->SNIa_Mpu < Cp->ms[Cp->n-1])
{
printf("\nSNIa_Mpu = %g < ms[n-1] = %g !!!\n\n",Cp->SNIa_Mpu,Cp->ms[Cp->n-1]);
printf("This is not supported by the current implementation !!!\n");
endrun(88802);
}
if (Cp->SNII_Mmin < Cp->ms[Cp->n-1])
{
printf("\nSNII_Mmin = %g < ms[n-1] = %g !!!\n\n",Cp->SNII_Mmin,Cp->ms[Cp->n-1]);
printf("This is not supported by the current implementation !!!\n");
endrun(88803);
}
if (Cp->SNII_Mmax < Cp->ms[Cp->n-1])
{
printf("\nSNII_Mmax = %g < ms[n-1] = %g !!!\n\n",Cp->SNII_Mmax,Cp->ms[Cp->n-1]);
printf("This is not supported by the current implementation !!!\n");
endrun(88804);
}
}
}
}
-
+/*! This function performe simple checks
+ * to validate the chemistry initialization
+*/
void check_chimie(void)
{
int i;
-
- if (ThisTask==0)
- {
- printf("Number of elements : %d\n",Cp->nelts);
- for(i=2;i<Cp->nelts+2;i++)
- printf("%s ",&Elt[i].label);
- printf("\n");
- }
+
+ printf("(Taks=%d) Number of elts : %d\n",ThisTask,Cp->nelts);
+ for(i=2;i<Cp->nelts+2;i++)
+ printf("%s ",&Elt[i].label);
+ printf("\n");
/* check number of elements */
if (NELEMENTS != Cp->nelts)
{
- printf("\n(Taks=%d) NELEMENTS (=%d) != Cp->nelts (=%d)!!!\n\n",ThisTask,NELEMENTS,Cp->nelts);
- printf("This means that the number of chemical elements defined in the chimie parameter file is\n");
- printf("different from the one defined by the variable NELEMENTS.\n");
- printf("You can either change NELEMENTS and recompile the code or change the chimie parameter file.\n");
+ printf("(Taks=%d) NELEMENTS (=%d) != Cp->nelts (=%d) : please check !!!\n\n",ThisTask,NELEMENTS,Cp->nelts);
endrun(88807);
}
/* check that iron is the first element */
if ((strcmp("Fe",Elt[2].label))!=0)
{
printf("(Taks=%d) first element (=%s) is not %s !!!\n\n",ThisTask,Elt[2].label,FIRST_ELEMENT);
endrun(88808);
}
}
+/*! Return the number of elements considered
+*/
int get_nelts()
{
return Cp->nelts;
}
+/*! Return the solar abundance of elt i
+*/
float get_SolarAbundance(i)
{
return Elt[i+2].SolarAbundance;
}
+/*! Return the label of element i
+*/
char* get_Element(i)
{
return Elt[i+2].label;
}
-
+/*! Return the lifetime of a star of mass m and metallicity z
+*/
double star_lifetime(double z,double m)
{
/* z is the mass fraction of metals, ie, the metallicity */
/* m is the stellar mass in code unit */
/* Return t in code time unit */
int i;
double a,b,c;
double coeff[3];
double logm,twologm,logm2,time;
/* convert m in msol */
m = m*All.UnitMass_in_g / SOLAR_MASS;
for (i=0;i<3;i++)
coeff[i] = ( Cp->coeff_z[i][0]*z+Cp->coeff_z[i][1] )*z+Cp->coeff_z[i][2];
a = coeff[0];
b = coeff[1];
c = coeff[2];
logm = log10(m);
twologm = 2.0 * logm;
logm2 = logm*logm;
time = pow(10.,(a*logm2+b*twologm+c));
return time;
}
-
+/*! Return the mass of a star having a livetime t and a metallicity z
+*/
double star_mass_from_age(double z,double t)
{
/* z is the mass fraction of metals, ie, the metallicity */
/* t is the star life time */
/* return the stellar mass (in code unit) that has a lifetime equal to t */
/* this is the inverse of star_lifetime */
int i;
double a,b,c;
double coeff[3];
double m;
for (i=0;i<3;i++)
coeff[i] = ( Cp->coeff_z[i][0]*z+Cp->coeff_z[i][1] )*z+Cp->coeff_z[i][2];
a = coeff[0];
b = coeff[1];
c = coeff[2];
m = -(b+sqrt(b*b-a*(c-log10(t))))/a;
m = pow(10,m); /* here, m is in solar mass */
m = m*SOLAR_MASS/All.UnitMass_in_g; /* Msol to mass unit */
return m;
}
/****************************************************************************************/
/*
/* Supernova rate : number of supernova per mass unit
/*
/****************************************************************************************/
+double DYIN_rate(double m1,double m2)
+{
+
+ /*
+ compute the number of stars between m1 and m2
+ masses in code unit
+ */
+
+ double RDYIN;
+ double md,mu;
+
+ /* find md, mu */
+ md = dmin(m1,Cp->SNII_Mmin/All.UnitMass_in_g * SOLAR_MASS);
+ mu = dmin(m2,Cp->SNII_Mmin/All.UnitMass_in_g * SOLAR_MASS);
+
+ if (mu<=md) /* no dying stars in that mass range */
+ return 0.0;
+
+ RDYIN = get_imf_N(md,mu);
+
+ return RDYIN;
+}
double SNII_rate(double m1,double m2)
{
/*
+ compute the number of SNII between m1 and m2
masses in code unit
*/
double RSNII;
double md,mu;
RSNII = 0.0;
/* convert m in msol */
m1 = m1*All.UnitMass_in_g / SOLAR_MASS;
m2 = m2*All.UnitMass_in_g / SOLAR_MASS;
/* (1) find md, mu */
md = dmax(m1,Cp->SNII_Mmin);
mu = dmin(m2,Cp->SNII_Mmax);
if (mu<=md) /* no SNII in that mass range */
return 0.0;
-
+
+ /* !!!!! here we should use get_imf_N !!!! */
+ /* to ensure the full imf */
+
RSNII = Cp->SNII_cte * (pow(mu,Cp->SNII_a)-pow(md,Cp->SNII_a)); /* number per solar mass */
/* convert in number per solar mass to number per mass unit */
RSNII = RSNII *All.UnitMass_in_g / SOLAR_MASS;
return RSNII;
}
double SNIa_rate(double m1,double m2)
{
/*
+ compute the number of SNIa between m1 and m2
masses in code unit
*/
double RSNIa;
double md,mu;
RSNIa = 0.0;
/* convert m in msol */
m1 = m1*All.UnitMass_in_g / SOLAR_MASS;
m2 = m2*All.UnitMass_in_g / SOLAR_MASS;
/* RG contribution */
md = dmax(m1,Cp->SNIa_Mdl1);
mu = dmin(m2,Cp->SNIa_Mdu1);
-
+
if (md<mu)
RSNIa = RSNIa + Cp->SNIa_bb1 * Cp->SNIa_cte1 * (pow(mu,Cp->SNIa_a1)-pow(md,Cp->SNIa_a1));
/* MS contribution */
md = dmax(m1,Cp->SNIa_Mdl2);
mu = dmin(m2,Cp->SNIa_Mdu2);
-
+
+
if (md<mu)
RSNIa = RSNIa + Cp->SNIa_bb2 * Cp->SNIa_cte2 * (pow(mu,Cp->SNIa_a2)-pow(md,Cp->SNIa_a2));
-
/* WD contribution */
md = dmax(m1,Cp->SNIa_Mpl); /* select stars that have finished their life -> WD */
mu = Cp->SNIa_Mpu; /* no upper bond */
if (mu<=md) /* no SNIa in that mass range */
return 0.0;
RSNIa = RSNIa * Cp->SNIa_cte * (pow(mu,Cp->SNIa_a)-pow(md,Cp->SNIa_a)); /* number per solar mass */
/* convert in number per solar mass to number per mass unit */
RSNIa = RSNIa *All.UnitMass_in_g / SOLAR_MASS;
-
return RSNIa;
}
-
-void SNII_mass_ejection(double m1,double m2)
+void DYIN_mass_ejection(double m1,double m2)
{
+ /*
+ Compute the mass fraction and yields of dying stars with masses between m1 and m2.
+ Store the result in the global variable`` MassFracDYIN``::
+
+ MassFracDYIN[0] = total gas
+ MassFracDYIN[1] = helium core (i.e. alpha(m))
+ MassFracDYIN[i] = frac mass elt i.
+
+ */
+
double l1,l2;
int i1,i2,i1p,i2p,j;
double f1,f2;
double v1,v2;
/* convert m in msol */
m1 = m1*All.UnitMass_in_g / SOLAR_MASS;
m2 = m2*All.UnitMass_in_g / SOLAR_MASS;
-
+
+ /* this was not in Poirier... */
+ m1 = dmin(m1,Cp->SNII_Mmin);
+ m2 = dmin(m2,Cp->SNII_Mmin);
+
+
+ if (m1>=m2)
+ {
+ for (j=0;j<Cp->nelts+2;j++)
+ MassFracDYIN[j] = 0;
+ return;
+ }
+
+
j = 0;
l1 = ( log10(m1) - Elt[j].Mmin) / Elt[j].Step ;
l2 = ( log10(m2) - Elt[j].Mmin) / Elt[j].Step ;
if (l1 < 0.0) l1 = 0.0;
if (l2 < 0.0) l2 = 0.0;
i1 = (int)l1;
i2 = (int)l2;
i1p = i1 + 1;
i2p = i2 + 1;
f1 = l1 - i1;
f2 = l2 - i2;
/* check (yr) */
if (i1<0) i1=0;
if (i2<0) i2=0;
/* --------- TOTAL GAS ---------- */
j = 0;
v1 = f1 * ( Elt[j].Array[i1p] - Elt[j].Array[i1] ) + Elt[j].Array[i1];
v2 = f2 * ( Elt[j].Array[i2p] - Elt[j].Array[i2] ) + Elt[j].Array[i2];
- MassFracSNII[j] = v2-v1;
+ MassFracDYIN[j] = v2-v1;
/* --------- He core therm ---------- */
j = 1;
v1 = f1 * ( Elt[j].Array[i1p] - Elt[j].Array[i1] ) + Elt[j].Array[i1];
v2 = f2 * ( Elt[j].Array[i2p] - Elt[j].Array[i2] ) + Elt[j].Array[i2];
- MassFracSNII[j] = v2-v1;
+ MassFracDYIN[j] = v2-v1;
/* ---------------------------- */
/* --------- Metals ---------- */
/* ---------------------------- */
j = 2;
l1 = ( log10(m1) - Elt[j].Mmin) / Elt[j].Step ;
l2 = ( log10(m2) - Elt[j].Mmin) / Elt[j].Step ;
if (l1 < 0.0) l1 = 0.0;
if (l2 < 0.0) l2 = 0.0;
i1 = (int)l1;
i2 = (int)l2;
i1p = i1 + 1;
i2p = i2 + 1;
f1 = l1 - i1;
f2 = l2 - i2;
/* check (yr) */
if (i1<0) i1=0;
if (i2<0) i2=0;
for (j=2;j<Cp->nelts+2;j++)
{
v1 = f1 * ( Elt[j].Array[i1p] - Elt[j].Array[i1] ) + Elt[j].Array[i1];
v2 = f2 * ( Elt[j].Array[i2p] - Elt[j].Array[i2] ) + Elt[j].Array[i2];
- MassFracSNII[j] = v2-v1;
+ MassFracDYIN[j] = v2-v1;
}
}
-void SNII_single_mass_ejection(double m1)
+void DYIN_single_mass_ejection(double m1)
{
+
+ /*
+ Compute the mass fraction and yields of a dying stars of masse m1.
+ Store the result in the global variable ``SingleMassFracDYIN``::
+
+ SingleMassFracDYIN[0] = total gas
+ SingleMassFracDYIN[1] = helium core (i.e. alpha(m))
+ SingleMassFracDYIN[i] = frac mass elt i.
+ */
+
double l1;
int i1,i1p,j;
double f1;
double v1;
/* convert m in msol */
m1 = m1*All.UnitMass_in_g / SOLAR_MASS;
-
+
+
+ /* this was not in Poirier... */
+ if ( (m1>=Cp->SNII_Mmin) )
+ {
+ for (j=0;j<Cp->nelts+2;j++)
+ SingleMassFracDYIN[j] = 0;
+ return;
+ }
+
j = 0;
l1 = ( log10(m1) - Elt[j].Mmin) / Elt[j].Step ;
if (l1 < 0.0) l1 = 0.0;
i1 = (int)l1;
i1p = i1 + 1;
f1 = l1 - i1;
/* check (yr) */
if (i1<0) i1=0;
/* --------- TOTAL GAS ---------- */
j = 0;
v1 = f1 * ( Elt[j].Metal[i1p] - Elt[j].Metal[i1] ) + Elt[j].Metal[i1];
- SingleMassFracSNII[j] = v1;
+ SingleMassFracDYIN[j] = v1;
/* --------- He core therm ---------- */
j = 1;
v1 = f1 * ( Elt[j].Metal[i1p] - Elt[j].Metal[i1] ) + Elt[j].Metal[i1];
- SingleMassFracSNII[j] = v1;
+ SingleMassFracDYIN[j] = v1;
/* ---------------------------- */
/* --------- Metals ---------- */
/* ---------------------------- */
j = 2;
l1 = ( log10(m1) - Elt[j].Mmin) / Elt[j].Step ;
if (l1 < 0.0) l1 = 0.0;
i1 = (int)l1;
i1p = i1 + 1;
f1 = l1 - i1;
/* check (yr) */
if (i1<0) i1=0;
for (j=2;j<Cp->nelts+2;j++)
{
v1 = f1 * ( Elt[j].Metal[i1p] - Elt[j].Metal[i1] ) + Elt[j].Metal[i1];
- SingleMassFracSNII[j] = v1;
+ SingleMassFracDYIN[j] = v1;
}
}
-
-void Total_mass_ejection(double m1,double m2,double M0,double *z)
+void SNII_mass_ejection(double m1,double m2)
{
+
+ /*
+ .. warning:: here, we we do not limit the computation to SNII !!!
- int j;
- double NSNIa;
+ Compute the mass fraction and yields of SNII stars with masses between m1 and m2.
+ Store the result in the global variable ``MassFracSNII``::
+
+ MassFracSNII[0] = total gas
+ MassFracSNII[1] = 1-helium core (i.e. non processed elts)
+ MassFracSNII[i] = frac mass elt i.
+ */
+
+ double l1,l2;
+ int i1,i2,i1p,i2p,j;
+ double f1,f2;
+ double v1,v2;
+
+ /* convert m in msol */
+ m1 = m1*All.UnitMass_in_g / SOLAR_MASS;
+ m2 = m2*All.UnitMass_in_g / SOLAR_MASS;
+
+
+ /* this was not in Poirier... */
+ m1 = dmax(m1,Cp->SNII_Mmin);
+ m2 = dmin(m2,Cp->SNII_Mmax);
- /* compute SNII mass ejection -> MassFracSNII */
- SNII_mass_ejection(m1,m2);
+ if ( m2<=m1 )
+ {
+ for (j=0;j<Cp->nelts+2;j++)
+ MassFracSNII[j] = 0;
+ return;
+ }
- /* number of SNIa per mass unit between time and time+dt */
- NSNIa = SNIa_rate(m1,m2)*M0;
+ j = 0;
+
+ l1 = ( log10(m1) - Elt[j].Mmin) / Elt[j].Step ;
+ l2 = ( log10(m2) - Elt[j].Mmin) / Elt[j].Step ;
+
+ if (l1 < 0.0) l1 = 0.0;
+ if (l2 < 0.0) l2 = 0.0;
+
+ i1 = (int)l1;
+ i2 = (int)l2;
- /* number of SNII per mass unit between time and time+dt */
- //NSNII = SNII_rate(m1,m2)*M0; /* useless (only for energy) */
+ i1p = i1 + 1;
+ i2p = i2 + 1;
+
+ f1 = l1 - i1;
+ f2 = l2 - i2;
- /* total ejected gas mass */
- EjectedMass[0] = M0 * MassFracSNII[0] + Cp->Mco/All.UnitMass_in_g*SOLAR_MASS * NSNIa;
+ /* check (yr) */
+ if (i1<0) i1=0;
+ if (i2<0) i2=0;
+
+
+ /* --------- TOTAL GAS ---------- */
+ j = 0;
+ v1 = f1 * ( Elt[j].Array[i1p] - Elt[j].Array[i1] ) + Elt[j].Array[i1];
+ v2 = f2 * ( Elt[j].Array[i2p] - Elt[j].Array[i2] ) + Elt[j].Array[i2];
+ MassFracSNII[j] = v2-v1;
+
+ /* --------- He core therm ---------- */
+ j = 1;
+ v1 = f1 * ( Elt[j].Array[i1p] - Elt[j].Array[i1] ) + Elt[j].Array[i1];
+ v2 = f2 * ( Elt[j].Array[i2p] - Elt[j].Array[i2] ) + Elt[j].Array[i2];
+ MassFracSNII[j] = v2-v1;
+
+
+
+
+ /* ---------------------------- */
+ /* --------- Metals ---------- */
+ /* ---------------------------- */
+
+ j = 2;
+ l1 = ( log10(m1) - Elt[j].Mmin) / Elt[j].Step ;
+ l2 = ( log10(m2) - Elt[j].Mmin) / Elt[j].Step ;
+
+ if (l1 < 0.0) l1 = 0.0;
+ if (l2 < 0.0) l2 = 0.0;
- /* ejected mass per element */
- for (j=2;j<Cp->nelts+2;j++)
- EjectedMass[j] = M0*(MassFracSNII[j] +z[j-2]*MassFracSNII[1]) + NSNIa* Elt[j].MSNIa/All.UnitMass_in_g*SOLAR_MASS;
+ i1 = (int)l1;
+ i2 = (int)l2;
+ i1p = i1 + 1;
+ i2p = i2 + 1;
+
+ f1 = l1 - i1;
+ f2 = l2 - i2;
- /* not used */
- EjectedMass[1] = -1;
+ /* check (yr) */
+ if (i1<0) i1=0;
+ if (i2<0) i2=0;
+ for (j=2;j<Cp->nelts+2;j++)
+ {
+ v1 = f1 * ( Elt[j].Array[i1p] - Elt[j].Array[i1] ) + Elt[j].Array[i1];
+ v2 = f2 * ( Elt[j].Array[i2p] - Elt[j].Array[i2] ) + Elt[j].Array[i2];
+ MassFracSNII[j] = v2-v1;
+ }
+
}
-void Total_single_mass_ejection(double m1,double *z)
+
+
+void SNII_single_mass_ejection(double m1)
{
-
+
/*
-
- !!! we do not take into account SNIa
- */
+ .. warning:: here, we we do not limit the computation to SNII !!!
+
+ Compute the mass fraction and yields of a SNII stars of masse m1.
+ Store the result in the global variable ``SingleMassFracSNII``::
+
+ SingleMassFracSNII[0] = total gas
+ SingleMassFracSNII[1] = 1-helium core (i.e. non processed elts)
+ SingleMassFracSNII[i] = frac mass elt i.
+ */
+
+ double l1;
+ int i1,i1p,j;
+ double f1;
+ double v1;
+
+ /* convert m in msol */
+ m1 = m1*All.UnitMass_in_g / SOLAR_MASS;
+
+ /* this was not in Poirier... */
+ if ( m1<= Cp->SNII_Mmin)
+ {
+ for (j=0;j<Cp->nelts+2;j++)
+ SingleMassFracSNII[j] = 0;
+ return;
+ }
+
- int j;
- float M0;
+ j = 0;
- M0 = m1;
+ l1 = ( log10(m1) - Elt[j].Mmin) / Elt[j].Step ;
- /* compute SNII mass ejection -> SingleMassFracSNII */
- SNII_single_mass_ejection(m1);
+ if (l1 < 0.0) l1 = 0.0;
+
+ i1 = (int)l1;
+
+ i1p = i1 + 1;
+
+ f1 = l1 - i1;
+
+ /* check (yr) */
+ if (i1<0) i1=0;
+
+
+ /* --------- TOTAL GAS ---------- */
+ j = 0;
+ v1 = f1 * ( Elt[j].Metal[i1p] - Elt[j].Metal[i1] ) + Elt[j].Metal[i1];
+ SingleMassFracSNII[j] = v1;
+
+ /* --------- He core therm ---------- */
+ j = 1;
+ v1 = f1 * ( Elt[j].Metal[i1p] - Elt[j].Metal[i1] ) + Elt[j].Metal[i1];
+ SingleMassFracSNII[j] = v1;
-
- /* total ejected gas mass */
- SingleEjectedMass[0] = M0 * SingleMassFracSNII[0]; /* + Cp->Mco/All.UnitMass_in_g*SOLAR_MASS * NSNIa; */
+
+
+ /* ---------------------------- */
+ /* --------- Metals ---------- */
+ /* ---------------------------- */
- /* ejected mass per element */
- for (j=2;j<Cp->nelts+2;j++)
- SingleEjectedMass[j] = M0*(SingleMassFracSNII[j] +z[j-2]*SingleMassFracSNII[1]); /* + NSNIa* Elt[j].MSNIa/All.UnitMass_in_g*SOLAR_MASS; */
+ j = 2;
- /* not used */
- SingleEjectedMass[1] = -1;
+ l1 = ( log10(m1) - Elt[j].Mmin) / Elt[j].Step ;
+
+ if (l1 < 0.0) l1 = 0.0;
+
+ i1 = (int)l1;
+
+ i1p = i1 + 1;
+
+ f1 = l1 - i1;
+
+ /* check (yr) */
+ if (i1<0) i1=0;
+
+
+ for (j=2;j<Cp->nelts+2;j++)
+ {
+ v1 = f1 * ( Elt[j].Metal[i1p] - Elt[j].Metal[i1] ) + Elt[j].Metal[i1];
+ SingleMassFracSNII[j] = v1;
+ }
}
+void SNIa_mass_ejection(double m1,double m2)
+{
+
+ /*
+ Compute the total mass and element mass per mass unit of SNIa stars with masses between m1 and m2.
+ Store the result in the global variable ``MassFracSNIa``::
+
+ MassFracSNIa[0] = total gas
+ MassFracSNIa[1] = unused
+ MassFracSNIa[i] = frac mass elt i.
+ */
+
+ int j;
+ double NSNIa;
+
+
+ /* number of SNIa per mass unit between time and time+dt */
+ NSNIa = SNIa_rate(m1,m2);
+
+ /* ejected mass in gas per mass unit */
+ MassFracSNIa[0] = Cp->Mco/All.UnitMass_in_g*SOLAR_MASS * NSNIa;
+ /* ejected elements in gas per mass unit */
+ for (j=2;j<Cp->nelts+2;j++)
+ MassFracSNIa[j] = NSNIa* Elt[j].MSNIa/All.UnitMass_in_g*SOLAR_MASS;
+ /* unused */
+ MassFracSNIa[1]=-1;
+}
-/**********************************************************************************************
- END OF CHIMIE FUNCTIONS
-**********************************************************************************************/
+void SNIa_single_mass_ejection(double m1)
+{
+ /*
+ Compute the total mass mass of element of a SNIa stars of masse m1.
+ Store the result in the global variable ``SingleMassFracSNIa``::
+
+ SingleMassFracSNIa[0] = total gas
+ SingleMassFracSNIa[1] = unused
+ SingleMassFracSNIa[i] = frac mass elt i.
+
+ */
+
+ int j;
+
+ /* total ejected gas mass */
+ SingleMassFracSNIa[0] = Cp->Mco/All.UnitMass_in_g*SOLAR_MASS;
+ /* ejected mass per element */
+ for (j=2;j<Cp->nelts+2;j++)
+ SingleMassFracSNIa[j] = Elt[j].MSNIa/All.UnitMass_in_g*SOLAR_MASS;
+
+ /* unused */
+ SingleMassFracSNIa[1] = -1;
+
+
+
+}
-#if defined(CHIMIE_THERMAL_FEEDBACK) && defined(CHIMIE_COMPUTE_THERMAL_FEEDBACK_ENERGY)
-void chimie_compute_energy_int(int mode)
+void Total_mass_ejection(double m1,double m2,double M0,double *z)
{
- int i;
- double DeltaEgyInt;
- double Tot_DeltaEgyInt;
- DeltaEgyInt = 0;
- Tot_DeltaEgyInt = 0;
+
+ /*
- if (mode==1)
- {
- LocalSysState.EnergyInt1 = 0;
- LocalSysState.EnergyInt2 = 0;
- }
+ Sum the contribution in mass and yields of all stars in the mass range m1,m2.
+ Store the result in the global variable EjectedMass::
+ EjectedMass[0] = total gas
+ EjectedMass[1] = UNUSED
+ EjectedMass[i+2] = frac mass elt i.
- for(i = 0; i < N_gas; i++)
- {
- if (P[i].Type==0)
- {
- if (mode==1)
- LocalSysState.EnergyInt1 += P[i].Mass * SphP[i].EntropyPred / (GAMMA_MINUS1) * pow(SphP[i].Density*a3inv, GAMMA_MINUS1);
- else
- LocalSysState.EnergyInt2 += P[i].Mass * SphP[i].EntropyPred / (GAMMA_MINUS1) * pow(SphP[i].Density*a3inv, GAMMA_MINUS1);
- }
+ FOR THE MOMENT::
+
+ - contrib of SNII (= all stars)
+ - contrib of SNIa
+
+ EjectedMass[0] = ejected Mass from SNII + Mco * number of SNIa
+ EjectedMass[i] = (SNII elts created ) + (SNII elts existing) + (SNIa elts)
+
+ */
+
+
+
+ int j;
+
+ /* compute SNII mass ejection -> MassFracSNII */
+ SNII_mass_ejection(m1,m2);
+
+ /* compute SNIa mass ejection -> MassFracSNIa */ /* not really a mass fraction */
+ SNIa_mass_ejection(m1,m2);
+
+ /* compute DYIN mass ejection -> MassFracDYIN */ /* not really a mass fraction */
+ DYIN_mass_ejection(m1,m2);
+
+
+
+ /* total ejected gas mass */
+ EjectedMass[0] = M0 * ( MassFracDYIN[0] + MassFracSNII[0] + MassFracSNIa[0] );
+
+ /* ejected mass per element */
+ for (j=2;j<Cp->nelts+2;j++)
+ EjectedMass[j] = M0*( MassFracDYIN[j] +z[j-2]*MassFracDYIN[1] + MassFracSNII[j] +z[j-2]*MassFracSNII[1] + MassFracSNIa[j] );
+
+
+ /* not used */
+ EjectedMass[1] = -1;
+
+
+}
+
+void DYIN_Total_single_mass_ejection(double m1,double *z)
+{
+
+ /*
+
+ Mass and element ejected by a single dying stars of mass m1.
+ This takes into account processed and non processed gas
+ The results are stored in::
+
+ SingleEjectedMass[0] = gas mass
+ SingleEjectedMass[1] = unsued
+ SingleEjectedMass[i+2] = frac mass elt i
+
+ */
+
+
+ int j;
+ float M0;
+
+ M0 = m1;
+
+ /* compute dying stars mass ejection -> SingleMassFracDYIN */
+ DYIN_single_mass_ejection(m1);
+
+
+ /* total ejected gas mass */
+ SingleEjectedMass[0] = M0 * SingleMassFracDYIN[0];
+
+ /* ejected mass per element */
+ for (j=2;j<Cp->nelts+2;j++)
+ SingleEjectedMass[j] = M0*(SingleMassFracDYIN[j] +z[j-2]*SingleMassFracDYIN[1]);
+
+ /* not used */
+ SingleEjectedMass[1] = -1;
+
+}
+
+
+void SNII_Total_single_mass_ejection(double m1,double *z)
+{
+
+ /*
+
+ Mass and element ejected by a single SNII of mass m1.
+ This takes into account processed and non processed gas
+ The results are stored in::
+
+ SingleEjectedMass[0] = gas mass
+ SingleEjectedMass[1] = unsued
+ SingleEjectedMass[i+2] = frac mass elt i
+
+ */
+
+
+ int j;
+ float M0;
+
+ M0 = m1;
+
+ /* compute SNII mass ejection -> SingleMassFracSNII */
+ SNII_single_mass_ejection(m1);
+
+
+ /* total ejected gas mass */
+ SingleEjectedMass[0] = M0 * SingleMassFracSNII[0];
+ /* ejected mass per element */
+ for (j=2;j<Cp->nelts+2;j++)
+ SingleEjectedMass[j] = M0*(SingleMassFracSNII[j] +z[j-2]*SingleMassFracSNII[1]);
+
+ /* not used */
+ SingleEjectedMass[1] = -1;
+
+}
+
+
+
+void SNIa_Total_single_mass_ejection(double m1, double *z)
+{
+
+ int j;
+
+ /*
+
+ Mass and element ejected by a single SNIa of mass m1.
+ The results are stored in::
+
+ SingleEjectedMass[0] = gas mass
+ SingleEjectedMass[1] = unsued
+ SingleEjectedMass[i+2] = frac mass elt i
+
+ */
+
+ /* compute SNIa mass ejection -> SingleMassFracSNIa */
+ SNIa_single_mass_ejection(m1);
+
+ /* total ejected gas mass */
+ SingleEjectedMass[0] = SingleMassFracSNIa[0];
+
+ /* ejected mass per element */
+ for (j=2;j<Cp->nelts+2;j++)
+ SingleEjectedMass[j] = SingleMassFracSNIa[j];
+
+}
+
+
+void Total_single_mass_ejection(double m1,double *z,double NSNII,double NSNIa,double NDYIN)
+{
+
+
+ /*
+
+ Sum the contribution in mass and yields of one star for mass m1.
+ Store the result in the global variable EjectedMass::
+
+ SingleEjectedMass[0] = total gas
+ SingleEjectedMass[1] = UNUSED
+ SingleEjectedMass[i+2] = frac mass elt i.
+
+
+ FOR THE MOMENT::
+
+ - contrib of SNII (= all stars)
+ - contrib of SNIa
+
+ SingleEjectedMass[0] = ejected Mass from SNII + Mco * number of SNIa
+ SingleEjectedMass[i] = (SNII elts created ) + (SNII elts existing) + (SNIa elts)
+
+
+ */
+
+
+
+
+ int j;
+ float M0;
+
+ M0 = m1;
+
+ /* compute SNII mass ejection -> SingleMassFracSNII */
+ SNII_single_mass_ejection(m1);
+
+ /* compute SNII mass ejection -> SingleMassFracSNIa */
+ SNIa_single_mass_ejection(m1);
+
+ /* compute DYIN mass ejection -> SingleMassFracDYIN */
+ DYIN_single_mass_ejection(m1);
+
+
+ /* total ejected gas mass */
+ SingleEjectedMass[0] = M0 * ( SingleMassFracDYIN[0]*NDYIN + SingleMassFracSNII[0]*NSNII ) + SingleMassFracSNIa[0]*NSNIa;
+
+
+ /* ejected mass per element */
+ for (j=2;j<Cp->nelts+2;j++)
+ SingleEjectedMass[j] = M0*( SingleMassFracDYIN[j]*NDYIN +z[j-2]*SingleMassFracDYIN[1]*NDYIN + SingleMassFracSNII[j]*NSNII +z[j-2]*SingleMassFracSNII[1]*NSNII ) + SingleMassFracSNIa[j]*NSNIa;
+
+
+ /* not used */
+ SingleEjectedMass[1] = -1;
+
+
+
+
+}
+
+
+
+
+
+/****************************************************************************************/
+/*
+/*
+/*
+/* GADGET ONLY PART
+/*
+/*
+/*
+/****************************************************************************************/
+
+
+
+
+
+
+
+
+static double hubble_a, atime, hubble_a2, fac_mu, fac_vsic_fix, a3inv, fac_egy;
+#ifdef FEEDBACK
+static double fac_pow;
+#endif
+
+#ifdef PERIODIC
+static double boxSize, boxHalf;
+
+#ifdef LONG_X
+static double boxSize_X, boxHalf_X;
+#else
+#define boxSize_X boxSize
+#define boxHalf_X boxHalf
+#endif
+#ifdef LONG_Y
+static double boxSize_Y, boxHalf_Y;
+#else
+#define boxSize_Y boxSize
+#define boxHalf_Y boxHalf
+#endif
+#ifdef LONG_Z
+static double boxSize_Z, boxHalf_Z;
+#else
+#define boxSize_Z boxSize
+#define boxHalf_Z boxHalf
+#endif
+#endif
+
+
+
+
+
+
+#if defined(CHIMIE_THERMAL_FEEDBACK) && defined(CHIMIE_COMPUTE_THERMAL_FEEDBACK_ENERGY)
+
+void chimie_compute_energy_int(int mode)
+{
+ int i;
+ double DeltaEgyInt;
+ double Tot_DeltaEgyInt;
+
+ DeltaEgyInt = 0;
+ Tot_DeltaEgyInt = 0;
+
+ if (mode==1)
+ {
+ LocalSysState.EnergyInt1 = 0;
+ LocalSysState.EnergyInt2 = 0;
+ }
+
+
+ for(i = 0; i < N_gas; i++)
+ {
+ if (P[i].Type==0)
+ {
+
+ if (mode==1)
+ LocalSysState.EnergyInt1 += P[i].Mass * SphP[i].EntropyPred / (GAMMA_MINUS1) * pow(SphP[i].Density*a3inv, GAMMA_MINUS1);
+ else
+ LocalSysState.EnergyInt2 += P[i].Mass * SphP[i].EntropyPred / (GAMMA_MINUS1) * pow(SphP[i].Density*a3inv, GAMMA_MINUS1);
+ }
}
if (mode==2)
{
DeltaEgyInt = LocalSysState.EnergyInt2 - LocalSysState.EnergyInt1;
MPI_Reduce(&DeltaEgyInt, &Tot_DeltaEgyInt, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
LocalSysState.EnergyThermalFeedback -= DeltaEgyInt;
}
}
#endif
#if defined(CHIMIE_KINETIC_FEEDBACK) && defined(CHIMIE_COMPUTE_KINETIC_FEEDBACK_ENERGY)
void chimie_compute_energy_kin(int mode)
{
int i;
double DeltaEgyKin;
double Tot_DeltaEgyKin;
DeltaEgyKin = 0;
Tot_DeltaEgyKin = 0;
if (mode==1)
{
LocalSysState.EnergyKin1 = 0;
LocalSysState.EnergyKin2 = 0;
}
for(i = 0; i < N_gas; i++)
{
if (P[i].Type==0)
{
if (mode==1)
LocalSysState.EnergyKin1 += 0.5 * P[i].Mass * (P[i].Vel[0]*P[i].Vel[0]+P[i].Vel[1]*P[i].Vel[1]+P[i].Vel[2]*P[i].Vel[2]);
else
LocalSysState.EnergyKin2 += 0.5 * P[i].Mass * (P[i].Vel[0]*P[i].Vel[0]+P[i].Vel[1]*P[i].Vel[1]+P[i].Vel[2]*P[i].Vel[2]);
}
}
if (mode==2)
{
DeltaEgyKin = LocalSysState.EnergyKin2 - LocalSysState.EnergyKin1;
MPI_Reduce(&DeltaEgyKin, &Tot_DeltaEgyKin, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
LocalSysState.EnergyKineticFeedback -= DeltaEgyKin;
}
}
#endif
#ifdef CHIMIE_THERMAL_FEEDBACK
void chimie_apply_thermal_feedback(void)
{
int i;
double EgySpec,NewEgySpec,DeltaEntropy;
for(i = 0; i < N_gas; i++)
{
if (P[i].Type==0)
{
if (SphP[i].DeltaEgySpec > 0)
{
/* spec energy at current step */
EgySpec = SphP[i].EntropyPred / GAMMA_MINUS1 * pow(SphP[i].Density*a3inv, GAMMA_MINUS1);
/* new egyspec */
NewEgySpec = EgySpec + SphP[i].DeltaEgySpec;
LocalSysState.EnergyThermalFeedback -= SphP[i].DeltaEgySpec*P[i].Mass;
/* new entropy */
DeltaEntropy = GAMMA_MINUS1*NewEgySpec/pow(SphP[i].Density*a3inv, GAMMA_MINUS1) - SphP[i].EntropyPred;
SphP[i].EntropyPred += DeltaEntropy;
SphP[i].Entropy += DeltaEntropy;
/* set the adiabatic period for SNIa */
if (SphP[i].NumberOfSNIa>0)
SphP[i].SNIaThermalTime = All.Time;
/* set the adiabatic period for SNII */
if (SphP[i].NumberOfSNII>0)
SphP[i].SNIIThermalTime = All.Time;
/* reset variables */
SphP[i].DeltaEgySpec = 0;
SphP[i].NumberOfSNIa = 0;
SphP[i].NumberOfSNII = 0;
}
}
}
}
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
void chimie_apply_wind(void)
{
/* apply wind */
int i;
double e1,e2;
double phi,costh,sinth,vx,vy,vz;
for(i = 0; i < N_gas; i++)
{
if (P[i].Type==0)
{
if (SphP[i].WindFlag)
{
phi = get_ChimieKineticFeedback_random_number(P[i].ID)*PI*2.;
costh = 1.-2.*get_ChimieKineticFeedback_random_number(P[i].ID+1);
sinth = sqrt(1.-pow(costh,2));
vx = All.ChimieWindSpeed*sinth*cos(phi);
vy = All.ChimieWindSpeed*sinth*sin(phi);
vz = All.ChimieWindSpeed*costh;
e1 = 0.5*P[i].Mass * ( SphP[i].VelPred[0]*SphP[i].VelPred[0] + SphP[i].VelPred[1]*SphP[i].VelPred[1] + SphP[i].VelPred[2]*SphP[i].VelPred[2]);
P[i].Vel[0] += vx;
P[i].Vel[1] += vy;
P[i].Vel[2] += vz;
SphP[i].VelPred[0] += vx;
SphP[i].VelPred[1] += vy;
SphP[i].VelPred[2] += vz;
e2 = 0.5*P[i].Mass * ( SphP[i].VelPred[0]*SphP[i].VelPred[0] + SphP[i].VelPred[1]*SphP[i].VelPred[1] + SphP[i].VelPred[2]*SphP[i].VelPred[2]);
LocalSysState.EnergyKineticFeedback -= e2-e1;
SphP[i].WindFlag = 0;
}
}
}
}
#endif
/*! This function is the driver routine for the calculation of chemical evolution
*/
void chimie(void)
{
double t0, t1;
t0 = second(); /* measure the time for the full chimie computation */
if (ThisTask==0)
printf("Start Chimie computation.\n");
if(All.ComovingIntegrationOn)
{
/* Factors for comoving integration of hydro */
hubble_a = All.Omega0 / (All.Time * All.Time * All.Time)
+ (1 - All.Omega0 - All.OmegaLambda) / (All.Time * All.Time) + All.OmegaLambda;
hubble_a = All.Hubble * sqrt(hubble_a);
hubble_a2 = All.Time * All.Time * hubble_a;
fac_mu = pow(All.Time, 3 * (GAMMA - 1) / 2) / All.Time;
fac_egy = pow(All.Time, 3 * (GAMMA - 1));
fac_vsic_fix = hubble_a * pow(All.Time, 3 * GAMMA_MINUS1);
a3inv = 1 / (All.Time * All.Time * All.Time);
atime = All.Time;
#ifdef FEEDBACK
fac_pow = fac_egy*atime*atime;
#endif
}
else
{
hubble_a = hubble_a2 = atime = fac_mu = fac_vsic_fix = a3inv = fac_egy = 1.0;
#ifdef FEEDBACK
fac_pow = 1.0;
#endif
}
/* apply thermal feedback on selected particles */
#ifdef CHIMIE_THERMAL_FEEDBACK
chimie_apply_thermal_feedback();
#endif
/* apply wind on selected particles */
#ifdef CHIMIE_KINETIC_FEEDBACK
chimie_apply_wind();
#endif
stars_density(); /* compute density */
do_chimie(); /* chimie */
if (ThisTask==0)
printf("Chimie computation done.\n");
t1 = second();
All.CPU_Chimie += timediff(t0, t1);
}
/*! This function is the driver routine for the calculation of chemical evolution
*/
void do_chimie(void)
{
long long ntot, ntotleft;
int i, j, k, n, m, ngrp, maxfill, source, ndone;
int *nbuffer, *noffset, *nsend_local, *nsend, *numlist, *ndonelist;
int level, sendTask, recvTask, nexport, place;
double tstart, tend, sumt, sumcomm;
double timecomp = 0, timecommsumm = 0, timeimbalance = 0, sumimbalance;
int flag_chimie;
MPI_Status status;
int do_it;
int Ti0,Ti1,Ti2;
double t1,t2,t01,t02;
double tmin,tmax;
double minlivetime,maxlivetime;
double m1,m2,M0;
double NSNIa,NSNII;
double NSNIa_tot,NSNII_tot,NSNIa_totlocal,NSNII_totlocal;
double EgySN,EgySNlocal;
double EgySNThermal,EgySNKinetic;
int Nchim,Nchimlocal;
int Nwind,Nwindlocal;
int Nflag,Nflaglocal;
int Noldwind,Noldwindlocal;
double metals[NELEMENTS];
double FeH;
float MinRelMass=1e-3;
#ifdef DETAILED_CPU_OUTPUT_IN_CHIMIE
double *timecomplist;
double *timecommsummlist;
double *timeimbalancelist;
#endif
#ifdef PERIODIC
boxSize = All.BoxSize;
boxHalf = 0.5 * All.BoxSize;
#ifdef LONG_X
boxHalf_X = boxHalf * LONG_X;
boxSize_X = boxSize * LONG_X;
#endif
#ifdef LONG_Y
boxHalf_Y = boxHalf * LONG_Y;
boxSize_Y = boxSize * LONG_Y;
#endif
#ifdef LONG_Z
boxHalf_Z = boxHalf * LONG_Z;
boxSize_Z = boxSize * LONG_Z;
#endif
#endif
#ifdef COMPUTE_VELOCITY_DISPERSION
double v1m,v2m;
#endif
/* `NumStUpdate' gives the number of particles on this processor that want a chimie computation */
for(n = 0, NumStUpdate = 0; n < N_gas+N_stars; n++)
{
if(P[n].Ti_endstep == All.Ti_Current)
if(P[n].Type == ST)
{
m = P[n].StPIdx;
if ( (P[n].Mass/StP[m].InitialMass) > MinRelMass)
NumStUpdate++;
}
if(P[n].Type == 0)
SphP[n].dMass = 0.;
}
numlist = malloc(NTask * sizeof(int) * NTask);
MPI_Allgather(&NumStUpdate, 1, MPI_INT, numlist, 1, MPI_INT, MPI_COMM_WORLD);
for(i = 0, ntot = 0; i < NTask; i++)
ntot += numlist[i];
free(numlist);
noffset = malloc(sizeof(int) * NTask); /* offsets of bunches in common list */
nbuffer = malloc(sizeof(int) * NTask);
nsend_local = malloc(sizeof(int) * NTask);
nsend = malloc(sizeof(int) * NTask * NTask);
ndonelist = malloc(sizeof(int) * NTask);
i = 0; /* first gas particle, because stars may be hidden among gas particles */
ntotleft = ntot; /* particles left for all tasks together */
NSNIa_tot = 0;
NSNII_tot = 0;
NSNIa_totlocal = 0;
NSNII_totlocal = 0;
EgySN = 0;
EgySNlocal =0;
Nchimlocal = 0;
Nchim = 0;
Nwindlocal = 0;
Nwind = 0;
Noldwindlocal = 0;
Noldwind = 0;
Nflaglocal = 0;
Nflag = 0;
while(ntotleft > 0)
{
for(j = 0; j < NTask; j++)
nsend_local[j] = 0;
/* do local particles and prepare export list */
tstart = second();
for(nexport = 0, ndone = 0; i < N_gas+N_stars && nexport < All.BunchSizeChimie - NTask; i++)
{
/* only active particles and stars */
if((P[i].Ti_endstep == All.Ti_Current)&&(P[i].Type == ST))
{
if(P[i].Type != ST)
{
printf("P[i].Type != ST, we better stop.\n");
printf("N_gas=%d (type=%d) i=%d (type=%d)\n",N_gas,P[N_gas].Type,i,P[i].Type);
printf("Please, check that you do not use PEANOHILBERT\n");
endrun(777001);
}
m = P[i].StPIdx;
if ( (P[i].Mass/StP[m].InitialMass) > MinRelMass)
{
flag_chimie = 0;
/******************************************/
/* do chimie */
/******************************************/
/*****************************************************/
/* look if a SN may have explode during the last step
/*****************************************************/
/***********************************************/
/***********************************************/
/* set the right table base of the metallicity */
set_table(0);
//FeH = log10( (StP[m].Metal[FE]/get_SolarAbundance(FE)) + 1.e-20 );
//if (FeH<-3)
// set_table(1);
//else
// set_table(0);
//if (P[i].ID==65546)
// {
// printf("(%d) %g the particle 65546 FeH=%g metalFe=%g Mmin=%g Mmax=%g n=%d\n",ThisTask,All.Time,FeH,StP[m].Metal[FE],Cp->Mmin,Cp->Mmax,Cp->n);
// }
/*
Cp->Mmin
Cp->Mmax
Cp->n
Cp->ms[]
Cp->as[]
Cp->SNIa_cte
Cp->SNIa_a
Cp->SNIa_Mdl1
Cp->SNIa_Mdu1
Cp->SNIa_bb1
Cp->SNIa_cte1
Cp->SNIa_a1
Cp->SNIa_Mdl2
Cp->SNIa_Mdu2
Cp->SNIa_bb2
Cp->SNIa_cte2
Cp->SNIa_a2
*/
/***********************************************/
/***********************************************/
/* minimum live time for a given metallicity */
minlivetime = star_lifetime(StP[m].Metal[NELEMENTS-1],Cp->Mmax*SOLAR_MASS/All.UnitMass_in_g)*All.HubbleParam;
/* maximum live time for a given metallicity */
maxlivetime = star_lifetime(StP[m].Metal[NELEMENTS-1],Cp->Mmin*SOLAR_MASS/All.UnitMass_in_g)*All.HubbleParam;
//if (P[i].ID==65546)
// printf("(%d) %g the particle 65546 has a max livetime of %g (metal=%g Mmin=%g)\n",ThisTask,All.Time,maxlivetime,StP[m].Metal[NELEMENTS-1],Cp->Mmin);
if (All.ComovingIntegrationOn)
{
/* FormationTime on the time line */
Ti0 = log(StP[m].FormationTime/All.TimeBegin) / All.Timebase_interval;
/* Beginning of time step on the time line */
Ti1 = P[i].Ti_begstep;
/* End of time step on the time line */
Ti2 = All.Ti_Current;
#ifdef COSMICTIME
t01 = get_cosmictime_difference(Ti0,Ti1);
t02 = get_cosmictime_difference(Ti0,Ti2);
#endif
}
else
{
t1 = All.TimeBegin + (P[i].Ti_begstep * All.Timebase_interval);
t2 = All.TimeBegin + (All.Ti_Current * All.Timebase_interval);
t01 = t1-StP[m].FormationTime;
t02 = t2-StP[m].FormationTime;
}
/* now treat all cases */
do_it=1;
/* beginning of interval */
if (t01>=minlivetime)
if (t01>=maxlivetime)
do_it=0; /* nothing to do */
else
m2 = star_mass_from_age(StP[m].Metal[NELEMENTS-1],t01/All.HubbleParam)*All.HubbleParam;
else
m2 = Cp->Mmax*SOLAR_MASS/All.UnitMass_in_g*All.HubbleParam;
/* end of interval */
if (t02<=maxlivetime)
if (t02<=minlivetime)
do_it=0; /* nothing to do */
else
m1 = star_mass_from_age(StP[m].Metal[NELEMENTS-1],t02/All.HubbleParam)*All.HubbleParam;
else
m1 = Cp->Mmin*SOLAR_MASS/All.UnitMass_in_g*All.HubbleParam;
//printf("Time=%g t01=%g t02=%g id=%d minlivetime=%g maxlivetime=%g \n",All.Time,t01,t02,P[i].ID,minlivetime,maxlivetime);
/* if some of the stars in the SSP explode between t1 and t2 */
if (do_it)
{
Nchimlocal++;
StP[m].Flag = 1; /* mark it as active */
if (m1>m2)
{
printf("m1=%g (%g Msol) > m2=%g (%g Msol) !!!\n\n",m1,m1*All.UnitMass_in_g/SOLAR_MASS,m2,m2*All.UnitMass_in_g/SOLAR_MASS);
endrun(777002);
}
M0 = StP[m].InitialMass;
for (k=0;k<NELEMENTS;k++)
metals[k] = StP[m].Metal[k];
/* number of SNIa */
NSNIa = SNIa_rate(m1/All.HubbleParam,m2/All.HubbleParam)*M0/All.HubbleParam;
/* number of SNII */
NSNII = SNII_rate(m1/All.HubbleParam,m2/All.HubbleParam)*M0/All.HubbleParam;
/* discretize SN */
#ifdef CHIMIE_MC_SUPERNOVAE
double fNSNIa,fNSNII;
fNSNIa = NSNIa-floor(NSNIa);
NSNIa = floor(NSNIa);
if (get_Chimie_random_number(P[i].ID) < fNSNIa)
NSNIa = NSNIa+1;
fNSNII = NSNII-floor(NSNII);
NSNII = floor(NSNII);
if (get_Chimie_random_number(P[i].ID) < fNSNII)
NSNII = NSNII+1;
+
+
+ /* compute ejectas */
+ Total_single_mass_ejection(0.5*(m1+m2)/All.HubbleParam,metals,NSNII,NSNIa,0);
+
+ StP[m].TotalEjectedGasMass = SingleEjectedMass[0]*All.HubbleParam; /* gas mass */
+
+ for (k=0;k<NELEMENTS;k++)
+ StP[m].TotalEjectedEltMass[k] = SingleEjectedMass[k+2]*All.HubbleParam; /* metal mass */
+
+
+
+#else
+
+ /* compute ejectas */
+ Total_mass_ejection(m1/All.HubbleParam,m2/All.HubbleParam,M0/All.HubbleParam,metals);
+
+ StP[m].TotalEjectedGasMass = EjectedMass[0]*All.HubbleParam; /* gas mass */
+
+ for (k=0;k<NELEMENTS;k++)
+ StP[m].TotalEjectedEltMass[k] = EjectedMass[k+2]*All.HubbleParam; /* metal mass */
+
#endif CHIMIE_MC_SUPERNOVAE
/* discretize SN */
-
-
-
- NSNIa_totlocal += NSNIa;
- NSNII_totlocal += NSNII;
-
- /* compute ejectas */
- Total_mass_ejection(m1/All.HubbleParam,m2/All.HubbleParam,M0/All.HubbleParam,metals);
-
-
- StP[m].TotalEjectedGasMass = EjectedMass[0]*All.HubbleParam; /* gas mass */
-
- for (k=0;k<NELEMENTS;k++)
- StP[m].TotalEjectedEltMass[k] = EjectedMass[k+2]*All.HubbleParam; /* metal mass */
+
+
+
+
if (StP[m].TotalEjectedGasMass>0)
flag_chimie=1;
/* compute injected energy */
StP[m].TotalEjectedEgySpec = All.ChimieSupernovaEnergy* (NSNIa + NSNII) /StP[m].TotalEjectedGasMass;
StP[m].NumberOfSNIa = NSNIa;
StP[m].NumberOfSNII = NSNII;
EgySNlocal += All.ChimieSupernovaEnergy* (NSNIa + NSNII);
-
-
+
+
+ NSNIa_totlocal += NSNIa;
+ NSNII_totlocal += NSNII;
+
+
/* correct mass particle */
if (P[i].Mass-StP[m].TotalEjectedGasMass<0)
{
printf("mass wants to be less than zero...\n");
printf("P[i].Mass=%g StP[m].TotalEjectedGasMass=%g\n",P[i].Mass,StP[m].TotalEjectedGasMass);
endrun(777100);
}
//if (P[i].ID==65546)
// printf("(%d) %g the particle 65546 is here, mass=%g TotalEjectedEltMass=%g m1=%g m2=%g\n",ThisTask,All.Time,P[i].Mass,StP[m].TotalEjectedGasMass,m1,m2);
P[i].Mass = P[i].Mass-StP[m].TotalEjectedGasMass;
//float Fe,Mg;
//Fe = StP[m].TotalEjectedEltMass[0];
//Mg = StP[m].TotalEjectedEltMass[1];
}
/******************************************/
/* end do chimie */
/******************************************/
ndone++;
if (flag_chimie)
{
for(j = 0; j < NTask; j++)
Exportflag[j] = 0;
chimie_evaluate(i, 0);
for(j = 0; j < NTask; j++)
{
if(Exportflag[j])
{
for(k = 0; k < 3; k++)
{
ChimieDataIn[nexport].Pos[k] = P[i].Pos[k];
ChimieDataIn[nexport].Vel[k] = P[i].Vel[k];
}
ChimieDataIn[nexport].ID = P[i].ID;
ChimieDataIn[nexport].Timestep = P[i].Ti_endstep - P[i].Ti_begstep;
ChimieDataIn[nexport].Hsml = StP[m].Hsml;
ChimieDataIn[nexport].Density = StP[m].Density;
ChimieDataIn[nexport].Volume = StP[m].Volume;
#ifdef CHIMIE_KINETIC_FEEDBACK
ChimieDataIn[nexport].NgbMass = StP[m].NgbMass;
#endif
ChimieDataIn[nexport].TotalEjectedGasMass = StP[m].TotalEjectedGasMass;
for(k = 0; k < NELEMENTS; k++)
ChimieDataIn[nexport].TotalEjectedEltMass[k] = StP[m].TotalEjectedEltMass[k];
ChimieDataIn[nexport].TotalEjectedEgySpec = StP[m].TotalEjectedEgySpec;
ChimieDataIn[nexport].NumberOfSNIa = StP[m].NumberOfSNIa;
ChimieDataIn[nexport].NumberOfSNII = StP[m].NumberOfSNII;
#ifdef WITH_ID_IN_HYDRA
ChimieDataIn[nexport].ID = P[i].ID;
#endif
ChimieDataIn[nexport].Index = i;
ChimieDataIn[nexport].Task = j;
nexport++;
nsend_local[j]++;
}
}
}
}
}
}
tend = second();
timecomp += timediff(tstart, tend);
qsort(ChimieDataIn, nexport, sizeof(struct chimiedata_in), chimie_compare_key);
for(j = 1, noffset[0] = 0; j < NTask; j++)
noffset[j] = noffset[j - 1] + nsend_local[j - 1];
tstart = second();
MPI_Allgather(nsend_local, NTask, MPI_INT, nsend, NTask, MPI_INT, MPI_COMM_WORLD);
tend = second();
timeimbalance += timediff(tstart, tend);
/* now do the particles that need to be exported */
for(level = 1; level < (1 << PTask); level++)
{
tstart = second();
for(j = 0; j < NTask; j++)
nbuffer[j] = 0;
for(ngrp = level; ngrp < (1 << PTask); ngrp++)
{
maxfill = 0;
for(j = 0; j < NTask; j++)
{
if((j ^ ngrp) < NTask)
if(maxfill < nbuffer[j] + nsend[(j ^ ngrp) * NTask + j])
maxfill = nbuffer[j] + nsend[(j ^ ngrp) * NTask + j];
}
if(maxfill >= All.BunchSizeChimie)
break;
sendTask = ThisTask;
recvTask = ThisTask ^ ngrp;
if(recvTask < NTask)
{
if(nsend[ThisTask * NTask + recvTask] > 0 || nsend[recvTask * NTask + ThisTask] > 0)
{
/* get the particles */
MPI_Sendrecv(&ChimieDataIn[noffset[recvTask]],
nsend_local[recvTask] * sizeof(struct chimiedata_in), MPI_BYTE,
recvTask, TAG_CHIMIE_A,
&ChimieDataGet[nbuffer[ThisTask]],
nsend[recvTask * NTask + ThisTask] * sizeof(struct chimiedata_in), MPI_BYTE,
recvTask, TAG_CHIMIE_A, MPI_COMM_WORLD, &status);
}
}
for(j = 0; j < NTask; j++)
if((j ^ ngrp) < NTask)
nbuffer[j] += nsend[(j ^ ngrp) * NTask + j];
}
tend = second();
timecommsumm += timediff(tstart, tend);
/* now do the imported particles */
tstart = second();
for(j = 0; j < nbuffer[ThisTask]; j++)
chimie_evaluate(j, 1);
tend = second();
timecomp += timediff(tstart, tend);
/* do a block to measure imbalance */
tstart = second();
MPI_Barrier(MPI_COMM_WORLD);
tend = second();
timeimbalance += timediff(tstart, tend);
/* get the result */
tstart = second();
for(j = 0; j < NTask; j++)
nbuffer[j] = 0;
for(ngrp = level; ngrp < (1 << PTask); ngrp++)
{
maxfill = 0;
for(j = 0; j < NTask; j++)
{
if((j ^ ngrp) < NTask)
if(maxfill < nbuffer[j] + nsend[(j ^ ngrp) * NTask + j])
maxfill = nbuffer[j] + nsend[(j ^ ngrp) * NTask + j];
}
if(maxfill >= All.BunchSizeChimie)
break;
sendTask = ThisTask;
recvTask = ThisTask ^ ngrp;
if(recvTask < NTask)
{
if(nsend[ThisTask * NTask + recvTask] > 0 || nsend[recvTask * NTask + ThisTask] > 0)
{
/* send the results */
MPI_Sendrecv(&ChimieDataResult[nbuffer[ThisTask]],
nsend[recvTask * NTask + ThisTask] * sizeof(struct chimiedata_out),
MPI_BYTE, recvTask, TAG_CHIMIE_B,
&ChimieDataPartialResult[noffset[recvTask]],
nsend_local[recvTask] * sizeof(struct chimiedata_out),
MPI_BYTE, recvTask, TAG_CHIMIE_B, MPI_COMM_WORLD, &status);
/* add the result to the particles */
for(j = 0; j < nsend_local[recvTask]; j++)
{
source = j + noffset[recvTask];
place = ChimieDataIn[source].Index;
// for(k = 0; k < 3; k++)
// SphP[place].HydroAccel[k] += HydroDataPartialResult[source].Acc[k];
//
// SphP[place].DtEntropy += HydroDataPartialResult[source].DtEntropy;
//#ifdef FEEDBACK
// SphP[place].DtEgySpecFeedback += HydroDataPartialResult[source].DtEgySpecFeedback;
//#endif
// if(SphP[place].MaxSignalVel < HydroDataPartialResult[source].MaxSignalVel)
// SphP[place].MaxSignalVel = HydroDataPartialResult[source].MaxSignalVel;
//#ifdef COMPUTE_VELOCITY_DISPERSION
// for(k = 0; k < VELOCITY_DISPERSION_SIZE; k++)
// SphP[place].VelocityDispersion[k] += HydroDataPartialResult[source].VelocityDispersion[k];
//#endif
}
}
}
for(j = 0; j < NTask; j++)
if((j ^ ngrp) < NTask)
nbuffer[j] += nsend[(j ^ ngrp) * NTask + j];
}
tend = second();
timecommsumm += timediff(tstart, tend);
level = ngrp - 1;
}
MPI_Allgather(&ndone, 1, MPI_INT, ndonelist, 1, MPI_INT, MPI_COMM_WORLD);
for(j = 0; j < NTask; j++)
ntotleft -= ndonelist[j];
}
free(ndonelist);
free(nsend);
free(nsend_local);
free(nbuffer);
free(noffset);
/* do final operations on results */
tstart = second();
for(i = 0; i < N_gas; i++)
{
if (P[i].Type==0)
{
P[i].Mass += SphP[i].dMass;
SphP[i].dMass = 0.;
}
}
tend = second();
timecomp += timediff(tstart, tend);
/* collect some timing information */
MPI_Reduce(&timecomp, &sumt, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(&timecommsumm, &sumcomm, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(&timeimbalance, &sumimbalance, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
if(ThisTask == 0)
{
All.CPU_ChimieCompWalk += sumt / NTask;
All.CPU_ChimieCommSumm += sumcomm / NTask;
All.CPU_ChimieImbalance += sumimbalance / NTask;
}
#ifdef DETAILED_CPU_OUTPUT_IN_CHIMIE
numlist = malloc(sizeof(int) * NTask);
timecomplist = malloc(sizeof(double) * NTask);
timecommsummlist = malloc(sizeof(double) * NTask);
timeimbalancelist = malloc(sizeof(double) * NTask);
MPI_Gather(&NumStUpdate, 1, MPI_INT, numlist, 1, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Gather(&timecomp, 1, MPI_DOUBLE, timecomplist, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Gather(&timecommsumm, 1, MPI_DOUBLE, timecommsummlist, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Gather(&timeimbalance, 1, MPI_DOUBLE, timeimbalancelist, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
if(ThisTask == 0)
{
fprintf(FdTimings, "\n chimie\n\n");
fprintf(FdTimings, "Nupdate ");
for (i=0;i<NTask;i++)
fprintf(FdTimings, "%12d ",numlist[i]); /* nombre de part par proc */
fprintf(FdTimings, "\n");
fprintf(FdTimings, "timecomp ");
for (i=0;i<NTask;i++)
fprintf(FdTimings, "%12g ",timecomplist[i]);
fprintf(FdTimings, "\n");
fprintf(FdTimings, "timecommsumm ");
for (i=0;i<NTask;i++)
fprintf(FdTimings, "%12g ",timecommsummlist[i]);
fprintf(FdTimings, "\n");
fprintf(FdTimings, "timeimbalance ");
for (i=0;i<NTask;i++)
fprintf(FdTimings, "%12g ",timeimbalancelist[i]);
fprintf(FdTimings, "\n");
fprintf(FdTimings, "\n");
}
free(timeimbalancelist);
free(timecommsummlist);
free(timecomplist);
free(numlist);
#endif
/* collect some chimie informations */
MPI_Reduce(&NSNIa_totlocal, &NSNIa_tot, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(&NSNII_totlocal, &NSNII_tot, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(&EgySNlocal, &EgySN, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(&Nchimlocal, &Nchim, 1, MPI_INT , MPI_SUM, 0, MPI_COMM_WORLD);
#ifdef CHIMIE_THERMAL_FEEDBACK
EgySNThermal = EgySN*(1-All.ChimieKineticFeedbackFraction);
#else
EgySNThermal = 0;
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
EgySNKinetic = EgySN*All.ChimieKineticFeedbackFraction;
/* count number of wind particles */
for(i = 0; i < N_gas; i++)
{
if (P[i].Type==0)
{
if (SphP[i].WindTime >= (All.Time-All.ChimieWindTime))
Nwindlocal++;
//else
// if (SphP[i].WindTime > All.TimeBegin-2*All.ChimieWindTime)
// Noldwindlocal++;
if (SphP[i].WindFlag)
Nflaglocal++;
}
}
MPI_Reduce(&Nwindlocal, &Nwind, 1, MPI_INT , MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(&Noldwindlocal, &Noldwind, 1, MPI_INT , MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Allreduce(&Nflaglocal, &Nflag, 1, MPI_INT , MPI_SUM, MPI_COMM_WORLD);
#else
EgySNKinetic = 0;
#endif
/* write some info */
if (ThisTask==0)
{
fprintf(FdChimie, "%15g %10d %15g %15g %15g %15g %15g %10d %10d %10d\n",All.Time,Nchim,NSNIa_tot,NSNII_tot,EgySN,EgySNThermal,EgySNKinetic,Nwind,Noldwind,Nflag);
fflush(FdChimie);
}
if (Nflag>0)
{
SetMinTimeStepForActives=1;
if (ThisTask==0)
fprintf(FdLog,"%g : !!! set min timestep for active particles !!!\n",All.Time);
}
}
/*! This function is the 'core' of the Chemie computation. A target
* particle is specified which may either be local, or reside in the
* communication buffer.
*/
void chimie_evaluate(int target, int mode)
{
int j, n, startnode, numngb,numngb_inbox,k;
FLOAT *pos,*vel;
//FLOAT *vel;
//FLOAT mass;
double h, h2;
double acc[3];
double dx, dy, dz;
double wk, r, r2, u=0;
double hinv=1, hinv3;
int target_stp;
double density;
double volume;
#ifdef CHIMIE_KINETIC_FEEDBACK
double ngbmass;
double p;
#endif
double aij;
double ejectedGasMass;
double ejectedEltMass[NELEMENTS];
double ejectedEgySpec;
double NumberOfSNIa;
double NumberOfSNII;
double mass_k;
double NewMass;
double fv,vi2,vj2;
double EgySpec,NewEgySpec;
double DeltaEntropy;
double DeltaVel[3];
#ifndef LONGIDS
unsigned int id; /*!< particle identifier */
#else
unsigned long long id; /*!< particle identifier */
#endif
if(mode == 0)
{
pos = P[target].Pos;
vel = P[target].Vel;
id = P[target].ID;
target_stp = P[target].StPIdx;
h = StP[target_stp].Hsml;
density = StP[target_stp].Density;
volume = StP[target_stp].Volume;
#ifdef CHIMIE_KINETIC_FEEDBACK
ngbmass = StP[target_stp].NgbMass;
#endif
ejectedGasMass = StP[target_stp].TotalEjectedGasMass;
for(k=0;k<NELEMENTS;k++)
ejectedEltMass[k] = StP[target_stp].TotalEjectedEltMass[k];
ejectedEgySpec = StP[target_stp].TotalEjectedEgySpec;
NumberOfSNIa = StP[target_stp].NumberOfSNIa;
NumberOfSNII = StP[target_stp].NumberOfSNII;
}
else
{
pos = ChimieDataGet[target].Pos;
vel = ChimieDataGet[target].Vel;
id = ChimieDataGet[target].ID;
h = ChimieDataGet[target].Hsml;
density = ChimieDataGet[target].Density;
volume = ChimieDataGet[target].Volume;
#ifdef CHIMIE_KINETIC_FEEDBACK
ngbmass = ChimieDataGet[target].NgbMass;
#endif
ejectedGasMass = ChimieDataGet[target].TotalEjectedGasMass;
for(k=0;k<NELEMENTS;k++)
ejectedEltMass[k] = ChimieDataGet[target].TotalEjectedEltMass[k];
ejectedEgySpec = ChimieDataGet[target].TotalEjectedEgySpec;
NumberOfSNIa = ChimieDataGet[target].NumberOfSNIa;
NumberOfSNII = ChimieDataGet[target].NumberOfSNII;
}
/* initialize variables before SPH loop is started */
acc[0] = acc[1] = acc[2] = 0;
vi2 = 0;
for(k=0;k<3;k++)
vi2 += vel[k]*vel[k];
h2 = h * h;
hinv = 1.0 / h;
#ifndef TWODIMS
hinv3 = hinv * hinv * hinv;
#else
hinv3 = hinv * hinv / boxSize_Z;
#endif
/* Now start the actual SPH computation for this particle */
startnode = All.MaxPart;
numngb = 0;
do
{
numngb_inbox = ngb_treefind_variable_for_chimie(&pos[0], h, &startnode);
for(n = 0; n < numngb_inbox; n++)
{
j = Ngblist[n];
dx = pos[0] - P[j].Pos[0];
dy = pos[1] - P[j].Pos[1];
dz = pos[2] - P[j].Pos[2];
#ifdef PERIODIC /* now find the closest image in the given box size */
if(dx > boxHalf_X)
dx -= boxSize_X;
if(dx < -boxHalf_X)
dx += boxSize_X;
if(dy > boxHalf_Y)
dy -= boxSize_Y;
if(dy < -boxHalf_Y)
dy += boxSize_Y;
if(dz > boxHalf_Z)
dz -= boxSize_Z;
if(dz < -boxHalf_Z)
dz += boxSize_Z;
#endif
r2 = dx * dx + dy * dy + dz * dz;
if(r2 < h2)
{
numngb++;
r = sqrt(r2);
u = r * hinv;
if(u < 0.5)
{
wk = hinv3 * (KERNEL_COEFF_1 + KERNEL_COEFF_2 * (u - 1) * u * u);
}
else
{
wk = hinv3 * KERNEL_COEFF_5 * (1.0 - u) * (1.0 - u) * (1.0 - u);
}
/* normalisation using mass */
aij = P[j].Mass*wk/density;
/* normalisation using volume */
/* !!! si on utilise, il faut stoquer une nouvelle variable : OldDensity, car density est modifié plus bas... */
//aij = P[j].Mass/SphP[j].Density*wk/volume;
/* metal injection */
for(k=0;k<NELEMENTS;k++)
{
mass_k = SphP[j].Metal[k]*P[j].Mass; /* mass of elt k */
SphP[j].Metal[k] = ( mass_k + aij*ejectedEltMass[k] )/( P[j].Mass + aij*ejectedGasMass );
}
/* new mass */
NewMass = P[j].Mass + aij*ejectedGasMass;
/* new velocity */
vj2 = 0;
for(k=0;k<3;k++)
vj2 += SphP[j].VelPred[k]*SphP[j].VelPred[k];
fv = sqrt( (P[j].Mass/NewMass) + aij*(ejectedGasMass/NewMass) * (vi2/vj2) );
for(k=0;k<3;k++)
{
DeltaVel[k] = fv*SphP[j].VelPred[k] - SphP[j].VelPred[k];
SphP[j].VelPred[k] += DeltaVel[k];
P[j].Vel [k] += DeltaVel[k];
}
/* spec energy at current step */
EgySpec = SphP[j].EntropyPred / GAMMA_MINUS1 * pow(SphP[j].Density*a3inv, GAMMA_MINUS1);
/* new egyspec */
NewEgySpec = (EgySpec )*(P[j].Mass/NewMass);
/* new density */
SphP[j].Density = SphP[j].Density*NewMass/P[j].Mass;
/* new entropy */
DeltaEntropy = GAMMA_MINUS1*NewEgySpec/pow(SphP[j].Density*a3inv, GAMMA_MINUS1) - SphP[j].EntropyPred;
SphP[j].EntropyPred += DeltaEntropy;
SphP[j].Entropy += DeltaEntropy;
#ifdef CHIMIE_THERMAL_FEEDBACK
SphP[j].DeltaEgySpec += (1.-All.ChimieKineticFeedbackFraction)*(ejectedGasMass*ejectedEgySpec)* aij/NewMass;
SphP[j].NumberOfSNII += NumberOfSNII*aij;
SphP[j].NumberOfSNIa += NumberOfSNIa*aij;
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
p = (All.ChimieKineticFeedbackFraction*ejectedEgySpec*ejectedGasMass)/(0.5*ngbmass*All.ChimieWindSpeed*All.ChimieWindSpeed);
double r;
r = get_Chimie_random_number(P[j].ID+id);
if ( r < p) /* we should maybe have a 2d table here... */
{
if (SphP[j].WindTime < (All.Time-All.ChimieWindTime)) /* not a wind particle */
{
SphP[j].WindFlag = 1;
SphP[j].WindTime = All.Time;
}
}
#endif
#ifdef CHECK_ENTROPY_SIGN
if ((SphP[j].EntropyPred < 0)||(SphP[j].Entropy < 0))
{
printf("\ntask=%d: entropy less than zero in chimie_evaluate !\n", ThisTask);
printf("ID=%d Entropy=%g EntropyPred=%g DeltaEntropy=%g\n",P[j].ID,SphP[j].Entropy,SphP[j].EntropyPred,DeltaEntropy);
fflush(stdout);
endrun(777003);
}
#endif
/* store mass diff. */
SphP[j].dMass += NewMass-P[j].Mass;
}
}
}
while(startnode >= 0);
/* Now collect the result at the right place */
if(mode == 0)
{
// for(k = 0; k < 3; k++)
// SphP[target].HydroAccel[k] = acc[k];
// SphP[target].DtEntropy = dtEntropy;
//#ifdef FEEDBACK
// SphP[target].DtEgySpecFeedback = dtEgySpecFeedback;
//#endif
// SphP[target].MaxSignalVel = maxSignalVel;
//#ifdef COMPUTE_VELOCITY_DISPERSION
// for(k = 0; k < VELOCITY_DISPERSION_SIZE; k++)
// SphP[target].VelocityDispersion[k] = VelocityDispersion[k];
//#endif
}
else
{
// for(k = 0; k < 3; k++)
// HydroDataResult[target].Acc[k] = acc[k];
// HydroDataResult[target].DtEntropy = dtEntropy;
//#ifdef FEEDBACK
// HydroDataResult[target].DtEgySpecFeedback = dtEgySpecFeedback;
//#endif
// HydroDataResult[target].MaxSignalVel = maxSignalVel;
//#ifdef COMPUTE_VELOCITY_DISPERSION
// for(k = 0; k < VELOCITY_DISPERSION_SIZE; k++)
// HydroDataResult[target].VelocityDispersion[k] = VelocityDispersion[k];
//#endif
}
}
/*! This is a comparison kernel for a sort routine, which is used to group
* particles that are going to be exported to the same CPU.
*/
int chimie_compare_key(const void *a, const void *b)
{
if(((struct chimiedata_in *) a)->Task < (((struct chimiedata_in *) b)->Task))
return -1;
if(((struct chimiedata_in *) a)->Task > (((struct chimiedata_in *) b)->Task))
return +1;
return 0;
}
-#endif
+
+
+
+
+
+
+
+
+
+
+
+
+/****************************************************************************************/
+/*
+/*
+/*
+/* PYTHON INTERFACE
+/*
+/*
+/*
+/****************************************************************************************/
+
+
+#ifdef PYCHEM
+
+
+static PyObject *
+ chemistry_CodeUnits_to_SolarMass_Factor(PyObject *self, PyObject *args)
+ {
+ return Py_BuildValue("d",All.UnitMass_in_g/SOLAR_MASS);
+ }
+
+static PyObject *
+ chemistry_SolarMass_to_CodeUnits_Factor(PyObject *self, PyObject *args)
+ {
+ return Py_BuildValue("d",SOLAR_MASS/All.UnitMass_in_g);
+ }
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_init_chimie(PyObject *self, PyObject *args, PyObject *kwds)
+ {
+ int NumberOfTables=1;
+ int DefaultTable=0;
+
+
+ //PyObject *filename;
+ //if (! PyArg_ParseTuple(args, "Oii",&filename,&NumberOfTables,&DefaultTable))
+ // {
+ // PyErr_SetString(PyExc_ValueError,"init_chimie, error in parsing.");
+ // return NULL;
+ // }
+
+
+ static char *kwlist[] = {"filename","NumberOfTables","DefaultTable", NULL};
+ PyObject *filename=PyString_FromString("chimie.yr.dat");
+
+ /* this fails with python2.6, I do not know why ??? */
+ if (! PyArg_ParseTupleAndKeywords(args, kwds, "|Oii",kwlist,&filename,&NumberOfTables,&DefaultTable))
+ {
+ PyErr_SetString(PyExc_ValueError,"init_chimie, error in parsing arguments.");
+ return NULL;
+ }
+
+
+ if (!PyString_Check(filename))
+ {
+ PyErr_SetString(PyExc_ValueError,"Argument must be a string.");
+ return NULL;
+ }
+
+ /* copy filename */
+ All.ChimieParameterFile = PyString_AsString(filename);
+
+ /* set number of tables */
+ All.ChimieNumberOfParameterFiles = NumberOfTables;
+
+ /* check if the file exists */
+ if(!(fopen(All.ChimieParameterFile, "r")))
+ {
+ PyErr_SetString(PyExc_ValueError,"The parameter file does not exists.");
+ return NULL;
+ }
+
+
+ /* some init only for python */
+ All.UnitLength_in_cm=3.085e+21;
+ All.UnitMass_in_g=1.989e+43;
+ All.UnitTime_in_Megayears=4.7287;
+
+ init_chimie();
+
+ /* by default, set the first one */
+ set_table(DefaultTable);
+
+
+ return Py_BuildValue("d",0);
+
+ }
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_set_table(PyObject *self, PyObject *args, PyObject *kwds)
+ {
+
+ int i;
+
+ if (! PyArg_ParseTuple(args, "i",&i))
+ return PyString_FromString("error");
+
+ /* set the table */
+ set_table(i);
+
+ return Py_BuildValue("d",0);
+
+ }
+
+
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_get_imf(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ PyArrayObject *m,*imf;
+ int i;
+
+
+ if (! PyArg_ParseTuple(args, "O",&m))
+ return PyString_FromString("error");
+
+ m = TO_DOUBLE(m);
+ /* create an output */
+
+ imf = (PyArrayObject *) PyArray_SimpleNew(m->nd,m->dimensions,PyArray_DOUBLE);
+
+ //printf("--> %g\n",Cp->bs[0]);
+ //for (i=0;i<Cp->n;i++)
+ // printf("%g %g\n",Cp->ms[i],Cp->as[i]);
+
+
+ for(i = 0; i < m->dimensions[0]; i++)
+ {
+ *(double *)(imf->data + i*(imf->strides[0])) = get_imf(*(double *)(m->data + i*(m->strides[0])));
+
+ }
+
+
+ return PyArray_Return(imf);
+
+ }
+
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_get_imf_M(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ PyArrayObject *m1,*m2,*imf;
+ int i;
+
+
+ if (! PyArg_ParseTuple(args, "OO",&m1,&m2))
+ return PyString_FromString("error");
+
+ m1 = TO_DOUBLE(m1);
+ m2 = TO_DOUBLE(m2);
+
+
+ /* create an output */
+
+ imf = (PyArrayObject *) PyArray_SimpleNew(m1->nd,m1->dimensions,PyArray_DOUBLE);
+
+ for(i = 0; i < imf->dimensions[0]; i++)
+ {
+ *(double *)(imf->data + i*(imf->strides[0])) = get_imf_M( *(double *)(m1->data + i*(m1->strides[0])), *(double *)(m2->data + i*(m2->strides[0])) );
+ }
+
+ return PyArray_Return(imf);
+ }
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_get_imf_N(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ PyArrayObject *m1,*m2,*imf;
+ int i;
+
+
+ if (! PyArg_ParseTuple(args, "OO",&m1,&m2))
+ return PyString_FromString("error");
+
+ m1 = TO_DOUBLE(m1);
+ m2 = TO_DOUBLE(m2);
+
+ /* create an output */
+
+ imf = (PyArrayObject *) PyArray_SimpleNew(m1->nd,m1->dimensions,PyArray_DOUBLE);
+
+ for(i = 0; i < imf->dimensions[0]; i++)
+ {
+
+ *(double *)(imf->data + i*(imf->strides[0])) = get_imf_N( *(double *)(m1->data + i*(m1->strides[0])), *(double *)(m2->data + i*(m2->strides[0])) );
+
+ }
+
+ return PyArray_Return(imf);
+ }
+
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_star_lifetime(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ /* z is the mass fraction of metals, ie, the metallicity */
+ /* m is the star mass in code unit */
+ /* Return t in time unit */
+
+
+ double time,z,m;
+
+ if (!PyArg_ParseTuple(args, "dd", &z, &m))
+ return NULL;
+
+
+ time = star_lifetime(z,m);
+
+ return Py_BuildValue("d",time);
+
+ }
+
+
+
+static PyObject *
+ chemistry_star_mass_from_age(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ /* t : life time (in code unit) */
+ /* return the stellar mass (in code unit) that has a lifetime equal to t */
+
+
+ double time,z,m;
+
+ if (!PyArg_ParseTuple(args, "dd", &z, &time))
+ return NULL;
+
+
+ m = star_mass_from_age(z,time);
+
+ return Py_BuildValue("d",m);
+
+ }
+
+
+static PyObject *
+ chemistry_DYIN_rate(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1,m2;
+ double RDYIN;
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dd", &m1,&m2))
+ return NULL;
+
+ RDYIN = DYIN_rate(m1,m2);
+
+ return Py_BuildValue("d",RDYIN);
+ }
+
+static PyObject *
+ chemistry_SNII_rate(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1,m2;
+ double RSNII;
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dd", &m1,&m2))
+ return NULL;
+
+ RSNII = SNII_rate(m1,m2);
+
+ return Py_BuildValue("d",RSNII);
+ }
+
+
+
+static PyObject *
+ chemistry_SNIa_rate(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1,m2;
+ double RSNIa;
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dd", &m1,&m2))
+ return NULL;
+
+ RSNIa = SNIa_rate(m1,m2);
+
+ return Py_BuildValue("d",RSNIa);
+ }
+
+
+
+
+static PyObject *
+ chemistry_DYIN_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1,m2;
+ PyArrayObject *ArrMassDYIN;
+ npy_intp ld[1];
+ int i;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dd", &m1,&m2))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ ArrMassDYIN = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* compute dying stars ejection */
+ DYIN_mass_ejection(m1,m2);
+
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(ArrMassDYIN->data + (i)*(ArrMassDYIN->strides[0])) = MassFracDYIN[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",ArrMassDYIN);
+
+ }
+
+
+
+
+static PyObject *
+ chemistry_DYIN_single_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1;
+ PyArrayObject *ArrMassDYIN;
+ npy_intp ld[1];
+ int i;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "d", &m1))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ ArrMassDYIN = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* compute SN ejection */
+ DYIN_single_mass_ejection(m1);
+
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(ArrMassDYIN->data + (i)*(ArrMassDYIN->strides[0])) = SingleMassFracDYIN[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",ArrMassDYIN);
+
+ }
+
+
+
+
+
+
+static PyObject *
+ chemistry_SNII_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1,m2;
+ PyArrayObject *ArrMassSNII;
+ npy_intp ld[1];
+ int i;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dd", &m1,&m2))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ ArrMassSNII = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* compute SN ejection */
+ SNII_mass_ejection(m1,m2);
+
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(ArrMassSNII->data + (i)*(ArrMassSNII->strides[0])) = MassFracSNII[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",ArrMassSNII);
+
+ }
+
+
+
+
+static PyObject *
+ chemistry_SNII_single_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1;
+ PyArrayObject *ArrMassSNII;
+ npy_intp ld[1];
+ int i;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "d", &m1))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ ArrMassSNII = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* compute SN ejection */
+ SNII_single_mass_ejection(m1);
+
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(ArrMassSNII->data + (i)*(ArrMassSNII->strides[0])) = SingleMassFracSNII[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",ArrMassSNII);
+
+ }
+
+
+
+
+static PyObject *
+ chemistry_SNIa_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1,m2;
+ PyArrayObject *ArrMassSNIa;
+ npy_intp ld[1];
+ int i;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dd", &m1,&m2))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ ArrMassSNIa = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* compute SN ejection */
+ SNIa_mass_ejection(m1,m2);
+
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(ArrMassSNIa->data + (i)*(ArrMassSNIa->strides[0])) = MassFracSNIa[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",ArrMassSNIa);
+
+ }
+
+
+
+
+static PyObject *
+ chemistry_SNIa_single_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1;
+ PyArrayObject *ArrMassSNIa;
+ npy_intp ld[1];
+ int i;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "d", &m1))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ ArrMassSNIa = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* compute SN ejection */
+ SNIa_single_mass_ejection(m1);
+
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(ArrMassSNIa->data + (i)*(ArrMassSNIa->strides[0])) = SingleMassFracSNIa[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",ArrMassSNIa);
+
+ }
+
+
+
+
+
+static PyObject *
+ chemistry_Total_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1,m2,M;
+ PyArrayObject *zs;
+ PyArrayObject *EMass;
+ npy_intp ld[1];
+ int i;
+ double *z;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dddO", &m1,&m2,&M,&zs))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ EMass = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+
+ /* allocate memory for the metallicity array */
+ z = malloc((Cp->nelts) * sizeof(double));
+ /* export values */
+ for (i=0;i<Cp->nelts;i++)
+ z[i]= *(double *)(zs->data + (i)*(zs->strides[0]));
+
+
+ /* compute SN ejection */
+ Total_mass_ejection(m1,m2,M,z);
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(EMass->data + (i)*(EMass->strides[0])) = EjectedMass[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",EMass);
+
+ }
+
+static PyObject *
+ chemistry_DYIN_Total_single_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1;
+ PyArrayObject *zs;
+ PyArrayObject *EMass;
+ npy_intp ld[1];
+ int i;
+ double *z;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dO", &m1,&zs))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ EMass = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+
+ /* allocate memory for the metallicity array */
+ z = malloc((Cp->nelts) * sizeof(double));
+ /* export values */
+ for (i=0;i<Cp->nelts;i++)
+ z[i]= *(double *)(zs->data + (i)*(zs->strides[0]));
+
+
+ /* compute dying stars ejection */
+ DYIN_Total_single_mass_ejection(m1,z);
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(EMass->data + (i)*(EMass->strides[0])) = SingleEjectedMass[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",EMass);
+
+ }
+
+static PyObject *
+ chemistry_SNII_Total_single_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1;
+ PyArrayObject *zs;
+ PyArrayObject *EMass;
+ npy_intp ld[1];
+ int i;
+ double *z;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dO", &m1,&zs))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ EMass = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+
+ /* allocate memory for the metallicity array */
+ z = malloc((Cp->nelts) * sizeof(double));
+ /* export values */
+ for (i=0;i<Cp->nelts;i++)
+ z[i]= *(double *)(zs->data + (i)*(zs->strides[0]));
+
+
+ /* compute SN ejection */
+ SNII_Total_single_mass_ejection(m1,z);
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(EMass->data + (i)*(EMass->strides[0])) = SingleEjectedMass[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",EMass);
+
+ }
+
+static PyObject *
+ chemistry_SNIa_Total_single_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1;
+ PyArrayObject *zs;
+ PyArrayObject *EMass;
+ npy_intp ld[1];
+ int i;
+ double *z;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dO", &m1,&zs))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ EMass = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+
+ /* allocate memory for the metallicity array */
+ z = malloc((Cp->nelts) * sizeof(double));
+ /* export values */
+ for (i=0;i<Cp->nelts;i++)
+ z[i]= *(double *)(zs->data + (i)*(zs->strides[0]));
+
+
+ /* compute SN ejection */
+ SNIa_Total_single_mass_ejection(m1,z);
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(EMass->data + (i)*(EMass->strides[0])) = SingleEjectedMass[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",EMass);
+
+ }
+
+
+static PyObject *
+ chemistry_Total_single_mass_ejection(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+ double m1;
+ double NSNII,NSNIa,NDYIN;
+ PyArrayObject *zs;
+ PyArrayObject *EMass;
+ npy_intp ld[1];
+ int i;
+ double *z;
+
+
+ /* parse arguments */
+ if (!PyArg_ParseTuple(args, "dOddd", &m1,&zs,&NSNII,&NSNIa,&NDYIN))
+ return NULL;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ EMass = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+
+ /* allocate memory for the metallicity array */
+ z = malloc((Cp->nelts) * sizeof(double));
+ /* export values */
+ for (i=0;i<Cp->nelts;i++)
+ z[i]= *(double *)(zs->data + (i)*(zs->strides[0]));
+
+
+ /* compute SN ejection */
+ Total_single_mass_ejection(m1,z,NSNII,NSNIa,NDYIN);
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(EMass->data + (i)*(EMass->strides[0])) = SingleEjectedMass[i];
+
+
+ /* convert in array */
+ return Py_BuildValue("O",EMass);
+
+ }
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_cooling_function(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+
+
+
+ /*
+ on gives :
+ u_energy
+ metal = metal(i,2)
+
+
+ parameters
+
+
+
+ t_const,zmin,zmax,slz,tmin,tmax,slt,FeHSolar,cooling_data_max
+
+ */
+
+
+
+ PyArrayObject *cooling_data;
+ double u_energy,metal;
+
+ double t_const,zmin,zmax,slz,tmin,tmax,slt,FeHSolar,cooling_data_max;
+
+
+ double cooling,u_cutoff,T,Z;
+ double rt, rz, ft, fz, v1, v2, v;
+ int it,iz,itp,izp;
+
+
+
+ /* parse arguments */
+
+ if (!PyArg_ParseTuple(args, "ddOddddddddd", &u_energy, &metal, &cooling_data,&t_const,&zmin,&zmax,&slz,&tmin,&tmax,&slt,&FeHSolar,&cooling_data_max))
+ return NULL;
+
+
+ u_cutoff=(100)/t_const;
+ cooling = 0.0;
+
+ if (u_energy > u_cutoff)
+ {
+
+ T = log10( t_const*u_energy );
+
+ Z = log10( metal/FeHSolar + 1.e-10 );
+
+ if (Z>zmax)
+ {
+ /*print *,'Warning: Z>Zmax for',i*/
+ Z=zmax;
+ }
+
+ if (Z < zmin)
+ {
+
+
+ rt = (T-tmin)/slt;
+
+ it = (int)rt;
+
+ if (it < cooling_data_max )
+ it = (int)rt;
+ else
+ it = cooling_data_max;
+
+ itp = it+1;
+
+ ft = rt - it;
+
+ fz = ( 10. + Z )/( 10. + zmin);
+
+
+
+ //v1 = ft*(cooling_data( 1, itp)-cooling_data( 1,it) ) + cooling_data( 1,it );
+ v1 = ft * (*(double *) (cooling_data->data + 1*(cooling_data->strides[0]) + itp*cooling_data->strides[1])
+ - *(double *) (cooling_data->data + 1*(cooling_data->strides[0]) + it *cooling_data->strides[1]))
+ + *(double *) (cooling_data->data + 1*(cooling_data->strides[0]) + it *cooling_data->strides[1]);
+
+ //v2 = ft*(cooling_data( 0,itp )-cooling_data( 0, it ) ) + cooling_data( 0, it );
+ v2 = ft * (*(double *) (cooling_data->data + 0*(cooling_data->strides[0]) + itp*cooling_data->strides[1])
+ - *(double *) (cooling_data->data + 0*(cooling_data->strides[0]) + it *cooling_data->strides[1]))
+ + *(double *) (cooling_data->data + 0*(cooling_data->strides[0]) + it *cooling_data->strides[1]);
+
+ v = v2 + fz*(v1-v2);
+
+ }
+ else
+ {
+
+ rt = (T-tmin)/slt;
+ rz = (Z-zmin)/slz+1.0;
+
+ if (it < cooling_data_max )
+ it = (int)rt;
+ else
+ it = cooling_data_max;
+
+ iz = (int)rz;
+
+ itp = it+1;
+ izp = iz+1;
+
+ ft = rt - it;
+ fz = rz - iz;
+
+ //v1 = ft*(cooling_data( izp, itp)-cooling_data(izp,it)) + cooling_data( izp, it );
+ v1 = ft * (*(double *) (cooling_data->data + izp*(cooling_data->strides[0]) + itp*cooling_data->strides[1])
+ - *(double *) (cooling_data->data + izp*(cooling_data->strides[0]) + it *cooling_data->strides[1]))
+ + *(double *) (cooling_data->data + izp*(cooling_data->strides[0]) + it *cooling_data->strides[1]);
+
+ //v2 = ft*(cooling_data( iz, itp )-cooling_data(iz,it )) + cooling_data( iz, it );
+ v2 = ft * (*(double *) (cooling_data->data + iz *(cooling_data->strides[0]) + itp*cooling_data->strides[1])
+ - *(double *) (cooling_data->data + iz *(cooling_data->strides[0]) + it *cooling_data->strides[1]))
+ + *(double *) (cooling_data->data + iz *(cooling_data->strides[0]) + it *cooling_data->strides[1]);
+
+ v = v2 + fz*(v1-v2);
+
+
+ }
+
+ cooling = pow(10,v);
+
+ }
+
+
+ return Py_BuildValue("d",cooling);
+ }
+
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_get_Mmax(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("d",(double)Cp->Mmax * SOLAR_MASS/All.UnitMass_in_g);
+ }
+
+static PyObject *
+ chemistry_get_Mmin(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("d",(double)Cp->Mmin * SOLAR_MASS/All.UnitMass_in_g);
+ }
+
+static PyObject *
+ chemistry_get_Mco(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("d",(double)Cp->Mco * SOLAR_MASS/All.UnitMass_in_g);
+ }
+
+static PyObject *
+ chemistry_get_SNIa_Mpl(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("d",(double)Cp->SNIa_Mpl * SOLAR_MASS/All.UnitMass_in_g);
+ }
+
+
+static PyObject *
+ chemistry_get_SNIa_Mpu(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("d",(double)Cp->SNIa_Mpu * SOLAR_MASS/All.UnitMass_in_g);
+ }
+
+
+static PyObject *
+ chemistry_get_SNII_Mmin(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("d",(double)Cp->SNII_Mmin * SOLAR_MASS/All.UnitMass_in_g);
+ }
+
+static PyObject *
+ chemistry_get_SNII_Mmax(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("d",(double)Cp->SNII_Mmax * SOLAR_MASS/All.UnitMass_in_g);
+ }
+
+
+static PyObject *
+ chemistry_get_imf_Ntot(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("d",(double)Cp->imf_Ntot/SOLAR_MASS*All.UnitMass_in_g); /* in code mass unit */
+ }
+
+
+static PyObject *
+ chemistry_get_as(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ PyArrayObject *as;
+ npy_intp ld[1];
+ int i;
+
+ /* create output array */
+ ld[0]= Cp->n+1;
+ as = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* import values */
+ for (i=0;i<Cp->n+1;i++)
+ *(double *)(as->data + (i)*(as->strides[0])) = Cp->as[i];
+
+ return Py_BuildValue("O",as);
+ }
+
+static PyObject *
+ chemistry_get_bs(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ PyArrayObject *bs;
+ npy_intp ld[1];
+ int i;
+
+ /* create output array */
+ ld[0]= Cp->n+1;
+ bs = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* import values */
+ for (i=0;i<Cp->n+1;i++)
+ *(double *)(bs->data + (i)*(bs->strides[0])) = Cp->bs[i];
+
+ return Py_BuildValue("O",bs);
+ }
+
+static PyObject *
+ chemistry_get_fs(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ PyArrayObject *fs;
+ npy_intp ld[1];
+ int i;
+
+ /* create output array */
+ ld[0]= Cp->n;
+ fs = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* import values */
+ for (i=0;i<Cp->n;i++)
+ *(double *)(fs->data + (i)*(fs->strides[0])) = Cp->fs[i];
+
+ return Py_BuildValue("O",fs);
+ }
+
+
+static PyObject *
+ chemistry_get_allnelts(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("i",(int)Cp->nelts+2);
+ }
+
+
+static PyObject *
+ chemistry_get_nelts(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ return Py_BuildValue("i",(int)Cp->nelts);
+ }
+
+
+
+static PyObject *
+ chemistry_get_allelts_labels(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ int i;
+
+ PyObject *LabelList,*LabelString;
+ LabelList = PyList_New((Py_ssize_t)Cp->nelts+2);
+
+ for(i=0;i<Cp->nelts+2;i++)
+ {
+ LabelString = PyString_FromString(Elt[i].label);
+ PyList_SetItem(LabelList, (Py_ssize_t)i,LabelString);
+ }
+ return Py_BuildValue("O",LabelList);
+ }
+
+ static PyObject *
+ chemistry_get_elts_labels(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ int i;
+
+ PyObject *LabelList,*LabelString;
+ LabelList = PyList_New((Py_ssize_t)Cp->nelts);
+
+ for(i=2;i<Cp->nelts+2;i++)
+ {
+ LabelString = PyString_FromString(Elt[i].label);
+ PyList_SetItem(LabelList, (Py_ssize_t)i-2,LabelString);
+ }
+ return Py_BuildValue("O",LabelList);
+ }
+
+
+/* static PyObject *
+ chemistry_get_elts_SolarAbundances(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ int i;
+ npy_intp ld[1];
+
+ PyArrayObject *AbList;
+
+ ld[0] = Cp->nelts;
+ AbList = (PyArrayObject *) PyArray_SimpleNew(1,ld,NPY_FLOAT);
+
+ for(i=2;i<Cp->nelts+2;i++)
+ *(float*)(AbList->data + (i-2)*(AbList->strides[0])) = (float) Elt[i].SolarAbundance;
+
+ return PyArray_Return(AbList);
+ } */
+
+
+ static PyObject *
+ chemistry_get_elts_SolarAbundances(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ int i;
+
+ PyObject *AbDict,*LabelString,*AbVal;
+ AbDict = PyDict_New();
+
+ for(i=2;i<Cp->nelts+2;i++)
+ {
+ AbVal = PyFloat_FromDouble(Elt[i].SolarAbundance);
+ LabelString = PyString_FromString(Elt[i].label);
+ PyDict_SetItem(AbDict,LabelString, AbVal);
+ }
+ return Py_BuildValue("O",AbDict);
+ }
+
+
+
+static PyObject *
+ chemistry_get_MSNIa(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ PyArrayObject *MSNIa;
+ npy_intp ld[1];
+ int i;
+
+ /* create output array */
+ ld[0]= Cp->nelts;
+ MSNIa = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* import values */
+ for (i=0;i<Cp->nelts;i++)
+ *(double *)(MSNIa->data + (i)*(MSNIa->strides[0])) = Elt[i+2].MSNIa/All.UnitMass_in_g*SOLAR_MASS;
+
+ return Py_BuildValue("O",MSNIa);
+ }
+
+static PyObject *
+ chemistry_get_MassFracSNII(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ PyArrayObject *MassFrac;
+ npy_intp ld[1];
+ int i;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ MassFrac = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(MassFrac->data + (i)*(MassFrac->strides[0])) = MassFracSNII[i];
+
+ return Py_BuildValue("O",MassFrac);
+ }
+
+
+static PyObject *
+ chemistry_get_SingleMassFracSNII(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ PyArrayObject *MassFrac;
+ npy_intp ld[1];
+ int i;
+
+ /* create output array */
+ ld[0]= Cp->nelts+2;
+ MassFrac = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ /* import values */
+ for (i=0;i<Cp->nelts+2;i++)
+ *(double *)(MassFrac->data + (i)*(MassFrac->strides[0])) = SingleMassFracSNII[i];
+
+ return Py_BuildValue("O",MassFrac);
+ }
+
+
+
+
+
+
+static PyObject *
+ chemistry_imf_sampling(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+ PyArrayObject *ms;
+ npy_intp ld[1];
+ int i;
+ int n,seed;
+
+ /* parse arguments */
+
+ if (!PyArg_ParseTuple(args, "ii", &n,&seed))
+ return NULL;
+
+ /* create output array */
+ ld[0]= n;
+ ms = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ srandom(seed);
+
+ /* import values */
+ for (i=0;i<n;i++)
+ *(double *)(ms->data + (i)*(ms->strides[0])) = imf_sampling();
+
+ return Py_BuildValue("O",ms);
+ }
+
+
+
+
+
+
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_SNII_rate_P(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+
+
+ PyArrayObject *ConstSN,*Msn;
+ double m1,m2,md;
+ double powSN1,powSN2;
+
+
+ double RSNII;
+
+
+ RSNII = 0.0;
+
+ /* parse arguments */
+
+ if (!PyArg_ParseTuple(args, "ddddOO", &m1,&m2,&powSN1,&powSN2,&ConstSN,&Msn))
+ return NULL;
+
+ if ( m1 < *(double *) (Msn->data + 2*(Msn->strides[0]) + 1*(Msn->strides[1])) )
+ md = *(double *) (Msn->data + 2*(Msn->strides[0]) + 1*(Msn->strides[1]));
+ else
+ md = m1;
+
+
+ if (md >= m2)
+ RSNII = 0;
+ else
+ RSNII = *(double *) (ConstSN->data + 2*ConstSN->strides[0]) *(pow(m2,powSN1)-pow(md,powSN1));
+
+
+
+ return Py_BuildValue("d",RSNII);
+ }
+
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_SNIa_rate_P(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+
+
+ PyArrayObject *ConstSN,*Msn;
+ double m1,m2,md,mu;
+ double powSN1,powSN2;
+
+
+ double RSNIa;
+ double rate;
+ int i;
+
+
+
+
+ /* parse arguments */
+
+ if (!PyArg_ParseTuple(args, "ddddOO", &m1,&m2,&powSN1,&powSN2,&ConstSN,&Msn))
+ return NULL;
+
+
+
+ RSNIa = 0.0;
+
+
+ for (i=0;i<2;i++)
+ {
+
+ if ( m1 < *(double *) (Msn->data + i*(Msn->strides[0]) + 0*(Msn->strides[1])) )
+ md = *(double *) (Msn->data + i*(Msn->strides[0]) + 0*(Msn->strides[1]));
+ else
+ md = m1;
+
+ if ( m2 > *(double *) (Msn->data + i*(Msn->strides[0]) + 1*(Msn->strides[1])) )
+ mu = *(double *) (Msn->data + i*(Msn->strides[0]) + 1*(Msn->strides[1]));
+ else
+ mu = m2;
+
+ if (md<mu)
+ RSNIa = RSNIa+ *(double *) (ConstSN->data + i*ConstSN->strides[0])*(pow(mu,powSN2)-pow(md,powSN2));
+
+
+ }
+
+
+
+ if ( m1 < *(double *) (Msn->data + 2*(Msn->strides[0]) + 0*(Msn->strides[1])) )
+ md = *(double *) (Msn->data + 2*(Msn->strides[0]) + 0*(Msn->strides[1]));
+ else
+ md = m1;
+
+
+ mu = *(double *) (Msn->data + 2*(Msn->strides[0]) + 1*(Msn->strides[1]));
+
+
+ if (md >= mu)
+ RSNIa = 0.0;
+ else
+ RSNIa = RSNIa*(pow(mu,powSN1)-pow(md,powSN1));
+
+ if (RSNIa<0)
+ RSNIa = 0;
+
+
+ return Py_BuildValue("d",RSNIa);
+ }
+
+
+
+
+
+
+
+/*********************************/
+/* */
+/*********************************/
+
+static PyObject *
+ chemistry_SNII_mass_ejection_P(self, args)
+ PyObject *self;
+ PyObject *args;
+ {
+
+
+
+ PyArrayObject *ArrayOrigin,*ArrayStep,*ChemArray;
+ double m1,m2;
+ int NbElement;
+
+
+ double l1,l2;
+ int i1,i2,i1p,i2p,j;
+ double f1,f2;
+ double v1,v2;
+
+ PyArrayObject *ArrMassSNII;
+ npy_intp ld[1];
+
+ /* parse arguments */
+
+ if (!PyArg_ParseTuple(args, "ddOOOi", &m1,&m2,&ArrayOrigin,&ArrayStep,&ChemArray,&NbElement))
+ return NULL;
+
+ /* create output array */
+ ld[0]= NbElement+2;
+ ArrMassSNII = (PyArrayObject *) PyArray_SimpleNew(1,ld,PyArray_DOUBLE);
+
+ l1 = ( log10(m1) - *(double *)(ArrayOrigin->data + 0*(ArrayOrigin->strides[0])) ) / *(double *)(ArrayStep->data + 0*(ArrayStep->strides[0])) ;
+ l2 = ( log10(m2) - *(double *)(ArrayOrigin->data + 0*(ArrayOrigin->strides[0])) ) / *(double *)(ArrayStep->data + 0*(ArrayStep->strides[0])) ;
+
+ if (l1 < 0.0) l1 = 0.0;
+ if (l2 < 0.0) l2 = 0.0;
+
+ i1 = (int)l1;
+ i2 = (int)l2;
+
+ i1p = i1 + 1;
+ i2p = i2 + 1;
+
+ f1 = l1 - i1;
+ f2 = l2 - i2;
+
+ /* check (yr) */
+ if (i1<1) i1=1;
+ if (i2<1) i2=1;
+
+ /* --------- TOTAL GAS ---------- */
+
+ j = NbElement;
+
+ v1=f1* (*(double *)(ChemArray->data + (i1p)*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]))
+ - *(double *)(ChemArray->data + (i1 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1])))
+ + *(double *)(ChemArray->data + (i1 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]));
+
+ v2=f2* (*(double *)(ChemArray->data + (i2p)*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]))
+ - *(double *)(ChemArray->data + (i2 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1])))
+ + *(double *)(ChemArray->data + (i2 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]));
+
+ *(double *)(ArrMassSNII->data + (j)*(ArrMassSNII->strides[0])) = v2-v1;
+
+ /* --------- He core therm ---------- */
+
+ j = NbElement+1;
+
+ v1=f1* (*(double *)(ChemArray->data + (i1p)*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]))
+ - *(double *)(ChemArray->data + (i1 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1])))
+ + *(double *)(ChemArray->data + (i1 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]));
+
+ v2=f2* (*(double *)(ChemArray->data + (i2p)*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]))
+ - *(double *)(ChemArray->data + (i2 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1])))
+ + *(double *)(ChemArray->data + (i2 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]));
+
+ *(double *)(ArrMassSNII->data + (j)*(ArrMassSNII->strides[0])) = v2-v1;
+
+
+ /* --------- Metals ---------- */
+
+
+ l1 = ( log10(m1) - *(double *)(ArrayOrigin->data + 1*(ArrayOrigin->strides[0])) ) / *(double *)(ArrayStep->data + 1*(ArrayStep->strides[0])) ;
+ l2 = ( log10(m2) - *(double *)(ArrayOrigin->data + 1*(ArrayOrigin->strides[0])) ) / *(double *)(ArrayStep->data + 1*(ArrayStep->strides[0])) ;
+
+ if (l1 < 0.0) l1 = 0.0;
+ if (l2 < 0.0) l2 = 0.0;
+
+ i1 = (int)l1;
+ i2 = (int)l2;
+
+ i1p = i1 + 1;
+ i2p = i2 + 1;
+
+ f1 = l1 - i1;
+ f2 = l2 - i2;
+
+ /* check (yr) */
+ if (i1<1) i1=1;
+ if (i2<1) i2=1;
+
+
+ for (j=0;j<NbElement;j++)
+ {
+
+ v1=f1* (*(double *)(ChemArray->data + (i1p)*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]))
+ - *(double *)(ChemArray->data + (i1 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1])))
+ + *(double *)(ChemArray->data + (i1 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]));
+
+ v2=f2* (*(double *)(ChemArray->data + (i2p)*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]))
+ - *(double *)(ChemArray->data + (i2 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1])))
+ + *(double *)(ChemArray->data + (i2 )*(ChemArray->strides[0]) + (j)*(ChemArray->strides[1]));
+
+ *(double *)(ArrMassSNII->data + (j)*(ArrMassSNII->strides[0])) = v2-v1;
+
+ }
+
+
+ return Py_BuildValue("O",ArrMassSNII);
+ }
+
+
+
+/* definition of the method table */
+
+static PyMethodDef chemistryMethods[] = {
+
+
+ {"CodeUnits_to_SolarMass_Factor", chemistry_CodeUnits_to_SolarMass_Factor, METH_VARARGS,
+ "convertion factor : CodeUnits -> SolarMass"},
+
+ {"SolarMass_to_CodeUnits_Factor", chemistry_SolarMass_to_CodeUnits_Factor, METH_VARARGS,
+ "convertion factor : SolarMass -> CodeUnits"},
+
+ {"init_chimie", chemistry_init_chimie, METH_VARARGS| METH_KEYWORDS,
+ "Init chimie."},
+
+ {"set_table", chemistry_set_table, METH_VARARGS,
+ "Set the chimie table."},
+
+
+ {"get_imf", chemistry_get_imf, METH_VARARGS,
+ "Compute corresponding imf value."},
+
+
+ {"get_imf_M", chemistry_get_imf_M, METH_VARARGS,
+ "Compute the mass fraction between m1 and m2."},
+
+ {"get_imf_N", chemistry_get_imf_N, METH_VARARGS,
+ "Compute the fraction number between m1 and m2."},
+
+
+
+
+ {"star_lifetime", chemistry_star_lifetime, METH_VARARGS,
+ "Compute star life time."},
+
+ {"star_mass_from_age", chemistry_star_mass_from_age, METH_VARARGS,
+ "Return the stellar mass that has a lifetime equal to t."},
+
+
+ {"DYIN_rate", chemistry_DYIN_rate, METH_VARARGS,
+ "Return the number of dying stars per unit mass with masses between m1 and m2."},
+
+ {"SNII_rate", chemistry_SNII_rate, METH_VARARGS,
+ "Return the number of SNII per unit mass with masses between m1 and m2."},
+
+ {"SNIa_rate", chemistry_SNIa_rate, METH_VARARGS,
+ "Return the number of SNIa per unit mass with masses between m1 and m2."},
+
+
+
+ {"DYIN_mass_ejection", chemistry_DYIN_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements, per unit mass due to the explotion of dying stars with masses between m1 and m2."},
+
+
+ {"DYIN_single_mass_ejection", chemistry_DYIN_single_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements due to the explotion of one dying star of mass m."},
+
+
+
+
+ {"SNII_mass_ejection", chemistry_SNII_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements, per unit mass due to the explotion of SNII with masses between m1 and m2."},
+
+ {"SNII_single_mass_ejection", chemistry_SNII_single_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements due to the explotion of one SNII of mass m."},
+
+
+ {"SNIa_mass_ejection", chemistry_SNIa_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements, per unit mass due to the explotion of SNIa with masses between m1 and m2."},
+
+ {"SNIa_single_mass_ejection", chemistry_SNIa_single_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements due to the explotion of one SNIa of mass m."},
+
+
+
+
+ {"Total_mass_ejection", chemistry_Total_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements, per unit mass due to the explotion of SNIa and SNII with masses between m1 and m2."},
+
+
+
+
+ {"DYIN_Total_single_mass_ejection", chemistry_DYIN_Total_single_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements (including processed and non processed elements) due to the explotion of one dying star of mass m."},
+
+
+ {"SNII_Total_single_mass_ejection", chemistry_SNII_Total_single_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements (including processed and non processed elements) due to the explotion of one SNII of mass m."},
+
+
+ {"SNIa_Total_single_mass_ejection", chemistry_SNIa_Total_single_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements (including processed and non processed elements) due to the explotion of one SNIa of mass m."},
+
+
+
+ {"Total_single_mass_ejection", chemistry_Total_single_mass_ejection, METH_VARARGS,
+ "Mass fraction of ejected elements, per unit mass due to the explotion of one dying star of mass m1."},
+
+
+
+
+
+
+ {"get_Mmax", chemistry_get_Mmax, METH_VARARGS,
+ "Get max star mass of the IMF, in code unit."},
+
+ {"get_Mmin", chemistry_get_Mmin, METH_VARARGS,
+ "Get min star mass of the IMF, in code unit."},
+
+ {"get_Mco", chemistry_get_Mco, METH_VARARGS,
+ "Get mean WD mass, in code unit."},
+
+
+ {"get_SNIa_Mpl", chemistry_get_SNIa_Mpl, METH_VARARGS,
+ "Get min mass of SNIa, in code unit."},
+
+ {"get_SNIa_Mpu", chemistry_get_SNIa_Mpu, METH_VARARGS,
+ "Get max mass of SNIa, in code unit."},
+
+
+ {"get_SNII_Mmin", chemistry_get_SNII_Mmin, METH_VARARGS,
+ "Get min mass of SNII, in code unit."},
+
+ {"get_SNII_Mmax", chemistry_get_SNII_Mmax, METH_VARARGS,
+ "Get max mass of SNII, in code unit."},
+
+ {"get_imf_Ntot", chemistry_get_imf_Ntot, METH_VARARGS,
+ "Get number of stars in the imf, per unit mass."},
+
+
+
+ {"get_as", chemistry_get_as, METH_VARARGS,
+ "Get power coefficients."},
+
+ {"get_bs", chemistry_get_bs, METH_VARARGS,
+ "Get normalisation coefficients."},
+
+ {"get_fs", chemistry_get_fs, METH_VARARGS,
+ "Get fs, mass fraction at ms."},
+
+
+ {"get_allnelts", chemistry_get_allnelts, METH_VARARGS,
+ "Get the number of element considered, including ejected mass (Ej) and non processed ejected mass (Ejnp).."},
+
+ {"get_nelts", chemistry_get_nelts, METH_VARARGS,
+ "Get the number of element considered."},
+
+ {"get_allelts_labels", chemistry_get_allelts_labels, METH_VARARGS,
+ "Get the labels of elements, including ejected mass (Ej) and non processed ejected mass (Ejnp)."},
+
+ {"get_elts_labels", chemistry_get_elts_labels, METH_VARARGS,
+ "Get the labels of elements."},
+
+ {"get_elts_SolarAbundances", chemistry_get_elts_SolarAbundances, METH_VARARGS,
+ "Get the solar abundance of elements."},
+
+
+ {"get_MassFracSNII", chemistry_get_MassFracSNII, METH_VARARGS,
+ "Get the mass fraction per element ejected by a set of SNII."},
+
+ {"get_SingleMassFracSNII", chemistry_get_SingleMassFracSNII, METH_VARARGS,
+ "Get the mass fraction per element ejected by a SNII."},
+
+
+
+ {"get_MSNIa", chemistry_get_MSNIa, METH_VARARGS,
+ "Get the mass per element ejected by a SNIa."},
+
+ {"cooling_function", chemistry_cooling_function, METH_VARARGS,
+ "Compute cooling."},
+
+
+ {"imf_sampling", chemistry_imf_sampling, METH_VARARGS,
+ "Sample imf with n points."},
+
+
+
+
+ /* old poirier */
+
+
+ {"SNIa_rate_P", chemistry_SNIa_rate_P, METH_VARARGS,
+ "Return the number of SNIa per unit mass and time. (Poirier version)"},
+
+ {"SNII_rate_P", chemistry_SNII_rate_P, METH_VARARGS,
+ "Return the number of SNII per unit mass and time. (Poirier version)"},
+
+ {"SNII_mass_ejection_P", chemistry_SNII_mass_ejection_P, METH_VARARGS,
+ "Mass ejection due to SNII per unit mass and time. (Poirier version)"},
+
+
+
+ {NULL, NULL, 0, NULL} /* Sentinel */
+ };
+
+
+
+
+
+
+void initchemistry(void)
+ {
+ (void) Py_InitModule("chemistry", chemistryMethods);
+
+ import_array();
+ }
+
+
+
+
+
+#endif /* PYCHEM */
+#endif /* CHIMIE */
+
diff --git a/src/init.c b/src/init.c
index 9c62897..92634e0 100644
--- a/src/init.c
+++ b/src/init.c
@@ -1,628 +1,666 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <mpi.h>
#include "allvars.h"
#include "proto.h"
/*! \file init.c
* \brief Code for initialisation of a simulation from initial conditions
*/
/*! This function reads the initial conditions, and allocates storage for the
* tree. Various variables of the particle data are initialised and An intial
* domain decomposition is performed. If SPH particles are present, the inial
* SPH smoothing lengths are determined.
*/
void init(void)
{
int i, j;
double a3;
#ifdef SFR
double Mgas=0,sum_Mgas=0;
int nstars=0;
int *numlist;
#endif
All.Time = All.TimeBegin;
switch (All.ICFormat)
{
case 1:
#if (MAKEGLASS > 1)
seed_glass();
#else
read_ic(All.InitCondFile);
#endif
break;
case 2:
case 3:
read_ic(All.InitCondFile);
break;
default:
if(ThisTask == 0)
printf("ICFormat=%d not supported.\n", All.ICFormat);
endrun(0);
}
All.Time = All.TimeBegin;
All.Ti_Current = 0;
if(All.ComovingIntegrationOn)
{
All.Timebase_interval = (log(All.TimeMax) - log(All.TimeBegin)) / TIMEBASE;
a3 = All.Time * All.Time * All.Time;
}
else
{
All.Timebase_interval = (All.TimeMax - All.TimeBegin) / TIMEBASE;
a3 = 1;
}
if (ThisTask==0)
printf("\nMinimum Time Step (Timebase_interval) = %g \n\n", All.Timebase_interval);
set_softenings();
All.NumCurrentTiStep = 0; /* setup some counters */
All.SnapshotFileCount = 0;
if(RestartFlag == 2)
All.SnapshotFileCount = atoi(All.InitCondFile + strlen(All.InitCondFile) - 3) + 1;
All.TotNumOfForces = 0;
All.NumForcesSinceLastDomainDecomp = 0;
if(All.ComovingIntegrationOn)
if(All.PeriodicBoundariesOn == 1)
check_omega();
All.TimeLastStatistics = All.TimeBegin - All.TimeBetStatistics;
#ifdef AGN_ACCRETION
All.TimeLastAccretion = All.TimeBegin - All.TimeBetAccretion;
All.LastMTotInRa = 0;
#endif
#ifdef BONDI_ACCRETION
All.BondiTimeLast = All.TimeBegin - All.BondiTimeBet;
#endif
#ifdef BUBBLES
All.EnergyBubbles=0;
#endif
if(All.ComovingIntegrationOn) /* change to new velocity variable */
{
for(i = 0; i < NumPart; i++)
for(j = 0; j < 3; j++)
P[i].Vel[j] *= sqrt(All.Time) * All.Time;
}
for(i = 0; i < NumPart; i++) /* start-up initialization */
{
for(j = 0; j < 3; j++)
P[i].GravAccel[j] = 0;
#ifdef PMGRID
for(j = 0; j < 3; j++)
P[i].GravPM[j] = 0;
#endif
P[i].Ti_endstep = 0;
P[i].Ti_begstep = 0;
P[i].OldAcc = 0;
P[i].GravCost = 1;
P[i].Potential = 0;
#ifdef PARTICLE_FLAG
P[i].Flag = 0;
#endif
#ifdef TESSEL
P[i].iPref = -1; /* index of the reference particle : -1 for normal particles */
#endif
}
#ifdef PMGRID
All.PM_Ti_endstep = All.PM_Ti_begstep = 0;
#endif
#ifdef FLEXSTEPS
All.PresentMinStep = TIMEBASE;
for(i = 0; i < NumPart; i++) /* start-up initialization */
{
P[i].FlexStepGrp = (int) (TIMEBASE * get_random_number(P[i].ID));
}
#endif
for(i = 0; i < N_gas; i++) /* initialize sph_properties */
{
for(j = 0; j < 3; j++)
{
SphP[i].VelPred[j] = P[i].Vel[j];
SphP[i].HydroAccel[j] = 0;
}
SphP[i].DtEntropy = 0;
#ifdef STELLAR_FLUX
SphP[i].EnergyFlux = 0.;
#endif
#ifdef AGN_HEATING
SphP[i].EgySpecAGNHeat = 0.;
SphP[i].DtEgySpecAGNHeat = 0.;
#endif
#ifdef MULTIPHASE
#ifdef COUNT_COLLISIONS
SphP[i].StickyCollisionNumber = 0;
#endif
#endif
#ifdef FEEDBACK
SphP[i].EgySpecFeedback = 0.;
SphP[i].DtEgySpecFeedback = 0.;
SphP[i].EnergySN = 0.;
SphP[i].EnergySNrem = 0.;
SphP[i].TimeSN = 0.;
for(j = 0; j < 3; j++)
{
SphP[i].FeedbackVel[j] = 0;
}
#endif
#ifdef FEEDBACK_WIND
for(j = 0; j < 3; j++)
{
SphP[i].FeedbackWindVel[j] = 0;
}
#endif
#if defined(ART_VISCO_MM)|| defined(ART_VISCO_RO) || defined(ART_VISCO_CD)
SphP[i].ArtBulkViscConst = All.ArtBulkViscConstMin;
#ifdef ART_VISCO_CD
SphP[i].ArtBulkViscConst = 0.;
SphP[i].DiVelAccurate = 0.;
SphP[i].DiVelTemp = 0.;
#endif
#endif
#ifdef OUTPUTOPTVAR1
SphP[i].OptVar1 = 0.;
#endif
#ifdef OUTPUTOPTVAR2
SphP[i].OptVar2 = 0.;
#endif
#ifdef COMPUTE_VELOCITY_DISPERSION
for(j = 0; j < VELOCITY_DISPERSION_SIZE; j++)
SphP[i].VelocityDispersion[j] = 0.;
#endif
if(RestartFlag == 0)
{
SphP[i].Hsml = 0;
SphP[i].Density = -1;
}
#ifdef MULTIPHASE
/* here, we set the Phase, according to the SpecificEnergy and not Entropy */
if (SphP[i].Entropy > All.CriticalEgySpec)
SphP[i].Phase = GAS_SPH; /* warmer phase */
else
{
if (SphP[i].Entropy >= All.CriticalNonCollisionalEgySpec)
SphP[i].Phase = GAS_STICKY;
else
SphP[i].Phase = GAS_DARK;
}
SphP[i].StickyFlag = 0;
SphP[i].StickyTime = All.Time;
//SphP[i].StickyTime = All.Time + All.StickyIdleTime*get_random_number(P[i].ID);
#endif
#ifdef SFR
Mgas += P[i].Mass;
#endif
}
#ifdef SFR
RearrangeParticlesFlag=0;
if (All.StarFormationStarMass==0)
{
/* compute the mean gas mass */
MPI_Allreduce(&Mgas, &sum_Mgas, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
All.StarFormationStarMass = (sum_Mgas/All.TotN_gas) / All.StarFormationNStarsFromGas;
}
for(i = 0; i < NumPart; i++) /* initialize st_properties */
{
if (P[i].Type==ST)
nstars++;
#ifdef STELLAR_PROP
if (P[i].Type==ST)
{
if (RestartFlag==0) /* only if starting from scratch */
{
#ifndef CHIMIE_INPUT_ALL
- P[i].StPIdx = i;
+ P[i].StPIdx = i-N_gas;
StP[P[i].StPIdx].FormationTime = 0; /* bad */
- StP[P[i].StPIdx].InitialMass = 0; /* bad */
+ StP[P[i].StPIdx].InitialMass = P[i].Mass; /* bad */
StP[P[i].StPIdx].IDProj = P[i].ID;
StP[P[i].StPIdx].Hsml = 0;
StP[P[i].StPIdx].Density = -1;
for(j = 0; j < NELEMENTS; j++)
StP[P[i].StPIdx].Metal[j] = 0.;
StP[P[i].StPIdx].Flag = 0; /*obsolete*/
#else /* here, we restart for a file already processed by gadget */
P[i].StPIdx = i-N_gas;
StP[P[i].StPIdx].Flag = 0; /*obsolete*/
#endif
}
if (RestartFlag==2) /* start from snapshot */
{
P[i].StPIdx = i-N_gas;
StP[P[i].StPIdx].Flag = 0; /*obsolete*/
}
StP[P[i].StPIdx].PIdx = i;
#ifdef CHECK_ID_CORRESPONDENCE
StP[P[i].StPIdx].ID = P[i].ID;
#endif
}
//else
// P[i].StPIdx = -1; /* shoud be set, however, may be a problem in domain.c --> must be corrected */
#endif
#ifdef CHIMIE
if (P[i].Type==0)
{
if (RestartFlag==0 && header.flag_metals==0) /* only if starting from scratch and metal block not present */
{
for(j = 0; j < NELEMENTS; j++)
{
SphP[i].Metal[j] = (pow(10,All.InitGasMetallicity)-1e-10)*get_SolarAbundance(j);
//if (j==FE)
// SphP[i].Metal[j] = (pow(10,All.InitGasMetallicity)-1e-10)*All.CoolingParameters_FeHSolar;
//else
// SphP[i].Metal[j] = 0;
}
}
#ifdef CHIMIE_THERMAL_FEEDBACK
SphP[i].DeltaEgySpec = 0;
SphP[i].NumberOfSNIa = 0;
SphP[i].NumberOfSNII = 0;
SphP[i].SNIaThermalTime = -1;
SphP[i].SNIIThermalTime = -1;
#endif
#ifdef CHIMIE_KINETIC_FEEDBACK
SphP[i].WindTime = All.TimeBegin-2*All.ChimieWindTime;
SphP[i].WindFlag = 0;
#endif
}
#endif /* chimie */
}
+
+
+
+
+
+
+
+
+#ifdef CHECK_ID_CORRESPONDENCE
+#ifdef CHIMIE
+ for(i = N_gas; i < N_gas+N_stars; i++)
+ {
+ if( StP[P[i].StPIdx].PIdx != i )
+ {
+ printf("\nP/StP correspondance error\n");
+ printf("(%d) (in domain before) N_stars=%d N_gas=%d i=%d id=%d P[i].StPIdx=%d StP[P[i].StPIdx].PIdx=%d\n\n",ThisTask,N_stars,N_gas,i,P[i].ID,P[i].StPIdx,StP[P[i].StPIdx].PIdx);
+ endrun(333001);
+ }
+
+
+ if(StP[P[i].StPIdx].ID != P[i].ID)
+ {
+ printf("\nP/StP correspondance error\n");
+ printf("(%d) (in domain before) N_gas=%d N_stars=%d i=%d Type=%d P.Id=%d P[i].StPIdx=%d StP[P[i].StPIdx].ID=%d \n\n",ThisTask,N_gas,N_stars,i,P[i].Type,P[i].ID, P[i].StPIdx, StP[P[i].StPIdx].ID);
+ endrun(333002);
+ }
+ }
+ if (ThisTask==0)
+ printf("Check id correspondence before decomposition done...\n");
+
+
+#endif
+#endif
+
+
+
+
+
/* here, we would like to reduce N_stars to TotN_stars */
/* MPI_Allreduce(&N_stars, &All.TotN_stars, 1, MPI_LONG_LONG, MPI_SUM, MPI_COMM_WORLD); does not works */
numlist = malloc(NTask * sizeof(int) * NTask);
MPI_Allgather(&N_stars, 1, MPI_INT, numlist, 1, MPI_INT, MPI_COMM_WORLD);
for(i = 0, All.TotN_stars = 0; i < NTask; i++)
All.TotN_stars += numlist[i];
free(numlist);
if(ThisTask == 0)
{
printf("Total number of star particles : %d%09d\n\n",(int) (All.TotN_stars / 1000000000), (int) (All.TotN_stars % 1000000000));
fflush(stdout);
}
#endif /*SFR*/
ngb_treeallocate(MAX_NGB);
force_treeallocate(All.TreeAllocFactor * All.MaxPart, All.MaxPart);
All.NumForcesSinceLastDomainDecomp = 1 + All.TotNumPart * All.TreeDomainUpdateFrequency;
Flag_FullStep = 1; /* to ensure that Peano-Hilber order is done */
domain_Decomposition(); /* do initial domain decomposition (gives equal numbers of particles) */
ngb_treebuild(); /* will build tree */
setup_smoothinglengths();
#ifdef CHIMIE
#ifndef CHIMIE_INPUT_ALL
stars_setup_smoothinglengths();
#endif
#endif
#ifdef TESSEL
setup_searching_radius();
#endif
TreeReconstructFlag = 1;
/* at this point, the entropy variable normally contains the
* internal energy, read in from the initial conditions file, unless the file
* explicitly signals that the initial conditions contain the entropy directly.
* Once the density has been computed, we can convert thermal energy to entropy.
*/
#ifndef ISOTHERM_EQS
if(header.flag_entropy_instead_u == 0)
{
for(i = 0; i < N_gas; i++)
#ifdef MULTIPHASE
{
switch(SphP[i].Phase)
{
case GAS_SPH:
SphP[i].Entropy = GAMMA_MINUS1 * SphP[i].Entropy / pow(SphP[i].Density / a3, GAMMA_MINUS1);
break;
case GAS_STICKY:
break;
case GAS_DARK:
SphP[i].Entropy = -SphP[i].Entropy;
break;
}
}
#else
SphP[i].Entropy = GAMMA_MINUS1 * SphP[i].Entropy / pow(SphP[i].Density / a3, GAMMA_MINUS1);
#endif
}
#endif
#ifdef ENTROPYPRED
for(i = 0; i < N_gas; i++)
SphP[i].EntropyPred = SphP[i].Entropy;
#endif
}
/*! This routine computes the mass content of the box and compares it to the
* specified value of Omega-matter. If discrepant, the run is terminated.
*/
void check_omega(void)
{
double mass = 0, masstot, omega;
int i;
for(i = 0; i < NumPart; i++)
mass += P[i].Mass;
MPI_Allreduce(&mass, &masstot, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
omega =
masstot / (All.BoxSize * All.BoxSize * All.BoxSize) / (3 * All.Hubble * All.Hubble / (8 * M_PI * All.G));
if(fabs(omega - All.Omega0) > 1.0e-3)
{
if(ThisTask == 0)
{
printf("\n\nI've found something odd!\n");
printf
("The mass content accounts only for Omega=%g,\nbut you specified Omega=%g in the parameterfile.\n",
omega, All.Omega0);
printf("\nI better stop.\n");
fflush(stdout);
}
endrun(1);
}
}
/*! This function is used to find an initial smoothing length for each SPH
* particle. It guarantees that the number of neighbours will be between
* desired_ngb-MAXDEV and desired_ngb+MAXDEV. For simplicity, a first guess
* of the smoothing length is provided to the function density(), which will
* then iterate if needed to find the right smoothing length.
*/
void setup_smoothinglengths(void)
{
int i, no, p;
if(RestartFlag == 0)
{
for(i = 0; i < N_gas; i++)
{
no = Father[i];
while(10 * All.DesNumNgb * P[i].Mass > Nodes[no].u.d.mass)
{
p = Nodes[no].u.d.father;
if(p < 0)
break;
no = p;
}
#ifndef TWODIMS
SphP[i].Hsml =
pow(3.0 / (4 * M_PI) * All.DesNumNgb * P[i].Mass / Nodes[no].u.d.mass, 1.0 / 3) * Nodes[no].len;
#else
SphP[i].Hsml =
pow(1.0 / (M_PI) * All.DesNumNgb * P[i].Mass / Nodes[no].u.d.mass, 1.0 / 2) * Nodes[no].len;
#endif
}
}
density(0);
}
#ifdef CHIMIE
/*! This function is used to find an initial smoothing length for each SPH
* particle. It guarantees that the number of neighbours will be between
* desired_ngb-MAXDEV and desired_ngb+MAXDEV. For simplicity, a first guess
* of the smoothing length is provided to the function density(), which will
* then iterate if needed to find the right smoothing length.
*/
void stars_setup_smoothinglengths(void)
{
int i, no, p;
if(RestartFlag == 0)
{
for(i = 0; i < NumPart; i++)
{
if(P[i].Type == ST)
{
no = Father[i];
while(10 * All.DesNumNgb * P[i].Mass > Nodes[no].u.d.mass)
{
p = Nodes[no].u.d.father;
if(p < 0)
break;
no = p;
}
#ifndef TWODIMS
StP[P[i].StPIdx].Hsml =
pow(3.0 / (4 * M_PI) * All.DesNumNgb * P[i].Mass / Nodes[no].u.d.mass, 1.0 / 3) * Nodes[no].len;
#else
StP[P[i].StPIdx].Hsml =
pow(1.0 / (M_PI) * All.DesNumNgb * P[i].Mass / Nodes[no].u.d.mass, 1.0 / 2) * Nodes[no].len;
#endif
}
}
}
stars_density();
}
#endif
/*! If the code is run in glass-making mode, this function populates the
* simulation box with a Poisson sample of particles.
*/
#if (MAKEGLASS > 1)
void seed_glass(void)
{
int i, k, n_for_this_task;
double Range[3], LowerBound[3];
double drandom, partmass;
long long IDstart;
All.TotNumPart = MAKEGLASS;
partmass = All.Omega0 * (3 * All.Hubble * All.Hubble / (8 * M_PI * All.G))
* (All.BoxSize * All.BoxSize * All.BoxSize) / All.TotNumPart;
All.MaxPart = All.PartAllocFactor * (All.TotNumPart / NTask); /* sets the maximum number of particles that may */
allocate_memory();
header.npartTotal[1] = All.TotNumPart;
header.mass[1] = partmass;
if(ThisTask == 0)
{
printf("\nGlass initialising\nPartMass= %g\n", partmass);
printf("TotNumPart= %d%09d\n\n",
(int) (All.TotNumPart / 1000000000), (int) (All.TotNumPart % 1000000000));
}
/* set the number of particles assigned locally to this task */
n_for_this_task = All.TotNumPart / NTask;
if(ThisTask == NTask - 1)
n_for_this_task = All.TotNumPart - (NTask - 1) * n_for_this_task;
NumPart = 0;
IDstart = 1 + (All.TotNumPart / NTask) * ThisTask;
/* split the temporal domain into Ntask slabs in z-direction */
Range[0] = Range[1] = All.BoxSize;
Range[2] = All.BoxSize / NTask;
LowerBound[0] = LowerBound[1] = 0;
LowerBound[2] = ThisTask * Range[2];
srand48(ThisTask);
for(i = 0; i < n_for_this_task; i++)
{
for(k = 0; k < 3; k++)
{
drandom = drand48();
P[i].Pos[k] = LowerBound[k] + Range[k] * drandom;
P[i].Vel[k] = 0;
}
P[i].Mass = partmass;
P[i].Type = 1;
P[i].ID = IDstart + i;
NumPart++;
}
}
#endif
diff --git a/src/ngb.c b/src/ngb.c
index 78af500..e166349 100644
--- a/src/ngb.c
+++ b/src/ngb.c
@@ -1,1053 +1,1057 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <mpi.h>
#include "allvars.h"
#include "proto.h"
/*! \file ngb.c
* \brief neighbour search by means of the tree
*
* This file contains routines for neighbour finding. We use the
* gravity-tree and a range-searching technique to find neighbours.
*/
#ifdef PERIODIC
static double boxSize, boxHalf;
#ifdef LONG_X
static double boxSize_X, boxHalf_X;
#else
#define boxSize_X boxSize
#define boxHalf_X boxHalf
#endif
#ifdef LONG_Y
static double boxSize_Y, boxHalf_Y;
#else
#define boxSize_Y boxSize
#define boxHalf_Y boxHalf
#endif
#ifdef LONG_Z
static double boxSize_Z, boxHalf_Z;
#else
#define boxSize_Z boxSize
#define boxHalf_Z boxHalf
#endif
#endif
/*! these macros maps a coordinate difference to the nearest periodic
* image
*/
#define NGB_PERIODIC_X(x) (xtmp=(x),(xtmp>boxHalf_X)?(xtmp-boxSize_X):((xtmp<-boxHalf_X)?(xtmp+boxSize_X):xtmp))
#define NGB_PERIODIC_Y(x) (xtmp=(x),(xtmp>boxHalf_Y)?(xtmp-boxSize_Y):((xtmp<-boxHalf_Y)?(xtmp+boxSize_Y):xtmp))
#define NGB_PERIODIC_Z(x) (xtmp=(x),(xtmp>boxHalf_Z)?(xtmp-boxSize_Z):((xtmp<-boxHalf_Z)?(xtmp+boxSize_Z):xtmp))
/*! This routine finds all neighbours `j' that can interact with the
* particle `i' in the communication buffer.
*
* Note that an interaction can take place if
* \f$ r_{ij} < h_i \f$ OR if \f$ r_{ij} < h_j \f$.
*
* In the range-search this is taken into account, i.e. it is guaranteed that
* all particles are found that fulfil this condition, including the (more
* difficult) second part of it. For this purpose, each node knows the
* maximum h occuring among the particles it represents.
*/
int ngb_treefind_pairs(FLOAT searchcenter[3], FLOAT hsml, int phase, int *startnode)
{
int k, no, p, numngb;
FLOAT hdiff;
FLOAT searchmin[3], searchmax[3];
struct NODE *this;
#ifdef PERIODIC
double xtmp;
#endif
for(k = 0; k < 3; k++) /* cube-box window */
{
searchmin[k] = searchcenter[k] - hsml;
searchmax[k] = searchcenter[k] + hsml;
}
numngb = 0;
no = *startnode;
while(no >= 0)
{
if(no < All.MaxPart) /* single particle */
{
p = no;
no = Nextnode[no];
if(P[p].Type > 0)
continue;
#ifdef MULTIPHASE
/* WARNING - WARNING - WARNING - WARNING */
/* keep only particles of same phase */
//if(SphP[p].Phase != phase)
// continue;
/* WARNING - WARNING - WARNING - WARNING */
/* this may be problematic for the feedback */
/* sticky sees only sticky */
//if ((phase==GAS_STICKY) && SphP[p].Phase!=GAS_STICKY)
// continue;
#endif
hdiff = SphP[p].Hsml - hsml;
if(hdiff < 0)
hdiff = 0;
#ifdef PERIODIC
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) < (-hsml - hdiff))
continue;
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) > (hsml + hdiff))
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) < (-hsml - hdiff))
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) > (hsml + hdiff))
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) < (-hsml - hdiff))
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) > (hsml + hdiff))
continue;
#else
if(P[p].Pos[0] < (searchmin[0] - hdiff))
continue;
if(P[p].Pos[0] > (searchmax[0] + hdiff))
continue;
if(P[p].Pos[1] < (searchmin[1] - hdiff))
continue;
if(P[p].Pos[1] > (searchmax[1] + hdiff))
continue;
if(P[p].Pos[2] < (searchmin[2] - hdiff))
continue;
if(P[p].Pos[2] > (searchmax[2] + hdiff))
continue;
#endif
Ngblist[numngb++] = p;
if(numngb == MAX_NGB)
{
printf
("ThisTask=%d: Need to do a second neighbour loop in hydro-force for (%g|%g|%g) hsml=%g no=%d\n",
ThisTask, searchcenter[0], searchcenter[1], searchcenter[2], hsml, no);
*startnode = no;
return numngb;
}
}
else
{
if(no >= All.MaxPart + MaxNodes) /* pseudo particle */
{
Exportflag[DomainTask[no - (All.MaxPart + MaxNodes)]] = 1;
no = Nextnode[no - MaxNodes];
continue;
}
this = &Nodes[no];
hdiff = Extnodes[no].hmax - hsml;
if(hdiff < 0)
hdiff = 0;
no = this->u.d.sibling; /* in case the node can be discarded */
#ifdef PERIODIC
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) + 0.5 * this->len) < (-hsml - hdiff))
continue;
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) - 0.5 * this->len) > (hsml + hdiff))
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) + 0.5 * this->len) < (-hsml - hdiff))
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) - 0.5 * this->len) > (hsml + hdiff))
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) + 0.5 * this->len) < (-hsml - hdiff))
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) - 0.5 * this->len) > (hsml + hdiff))
continue;
#else
if((this->center[0] + 0.5 * this->len) < (searchmin[0] - hdiff))
continue;
if((this->center[0] - 0.5 * this->len) > (searchmax[0] + hdiff))
continue;
if((this->center[1] + 0.5 * this->len) < (searchmin[1] - hdiff))
continue;
if((this->center[1] - 0.5 * this->len) > (searchmax[1] + hdiff))
continue;
if((this->center[2] + 0.5 * this->len) < (searchmin[2] - hdiff))
continue;
if((this->center[2] - 0.5 * this->len) > (searchmax[2] + hdiff))
continue;
#endif
no = this->u.d.nextnode; /* ok, we need to open the node */
}
}
*startnode = -1;
return numngb;
}
/*! This routine finds all neighbours `j' that can interact with the
* particle `i' in the communication buffer.
*
* Note that an interaction can take place if
* \f$ r_{ij} < h_i \f$ OR if \f$ r_{ij} < h_j \f$.
*
* In the range-search this is taken into account, i.e. it is guaranteed that
* all particles are found that fulfil this condition, including the (more
* difficult) second part of it. For this purpose, each node knows the
* maximum h occuring among the particles it represents.
*
* This function is similar to ngb_treefind_pairs but returns only
* pairs of same phase
*/
#ifdef MULTIPHASE
int ngb_treefind_phase_pairs(FLOAT searchcenter[3], FLOAT hsml, int phase, int *startnode)
{
int k, no, p, numngb;
FLOAT hdiff;
FLOAT searchmin[3], searchmax[3];
struct NODE *this;
#ifdef PERIODIC
double xtmp;
#endif
for(k = 0; k < 3; k++) /* cube-box window */
{
searchmin[k] = searchcenter[k] - hsml;
searchmax[k] = searchcenter[k] + hsml;
}
numngb = 0;
no = *startnode;
while(no >= 0)
{
if(no < All.MaxPart) /* single particle */
{
p = no;
no = Nextnode[no];
if(P[p].Type > 0)
continue;
/* here, we select all gas particles */
#ifdef MULTIPHASE
/* keep only particles of same phase */
if(SphP[p].Phase != phase)
continue;
#endif
hdiff = SphP[p].Hsml - hsml;
if(hdiff < 0)
hdiff = 0;
#ifdef PERIODIC
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) < (-hsml - hdiff))
continue;
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) > (hsml + hdiff))
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) < (-hsml - hdiff))
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) > (hsml + hdiff))
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) < (-hsml - hdiff))
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) > (hsml + hdiff))
continue;
#else
if(P[p].Pos[0] < (searchmin[0] - hdiff))
continue;
if(P[p].Pos[0] > (searchmax[0] + hdiff))
continue;
if(P[p].Pos[1] < (searchmin[1] - hdiff))
continue;
if(P[p].Pos[1] > (searchmax[1] + hdiff))
continue;
if(P[p].Pos[2] < (searchmin[2] - hdiff))
continue;
if(P[p].Pos[2] > (searchmax[2] + hdiff))
continue;
#endif
Ngblist[numngb++] = p;
if(numngb == MAX_NGB)
{
printf
("ThisTask=%d: Need to do a second neighbour loop in hydro-force for (%g|%g|%g) hsml=%g no=%d\n",
ThisTask, searchcenter[0], searchcenter[1], searchcenter[2], hsml, no);
*startnode = no;
return numngb;
}
}
else
{
if(no >= All.MaxPart + MaxNodes) /* pseudo particle */
{
Exportflag[DomainTask[no - (All.MaxPart + MaxNodes)]] = 1;
no = Nextnode[no - MaxNodes];
continue;
}
this = &Nodes[no];
hdiff = Extnodes[no].hmax - hsml;
if(hdiff < 0)
hdiff = 0;
no = this->u.d.sibling; /* in case the node can be discarded */
#ifdef PERIODIC
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) + 0.5 * this->len) < (-hsml - hdiff))
continue;
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) - 0.5 * this->len) > (hsml + hdiff))
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) + 0.5 * this->len) < (-hsml - hdiff))
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) - 0.5 * this->len) > (hsml + hdiff))
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) + 0.5 * this->len) < (-hsml - hdiff))
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) - 0.5 * this->len) > (hsml + hdiff))
continue;
#else
if((this->center[0] + 0.5 * this->len) < (searchmin[0] - hdiff))
continue;
if((this->center[0] - 0.5 * this->len) > (searchmax[0] + hdiff))
continue;
if((this->center[1] + 0.5 * this->len) < (searchmin[1] - hdiff))
continue;
if((this->center[1] - 0.5 * this->len) > (searchmax[1] + hdiff))
continue;
if((this->center[2] + 0.5 * this->len) < (searchmin[2] - hdiff))
continue;
if((this->center[2] - 0.5 * this->len) > (searchmax[2] + hdiff))
continue;
#endif
no = this->u.d.nextnode; /* ok, we need to open the node */
}
}
*startnode = -1;
return numngb;
}
#endif
/*! This function returns neighbours with distance <= hsml and returns them in
* Ngblist. Actually, particles in a box of half side length hsml are
* returned, i.e. the reduction to a sphere still needs to be done in the
* calling routine.
*/
int ngb_treefind_variable(FLOAT searchcenter[3], FLOAT hsml, int phase, int *startnode)
{
int k, numngb;
int no, p;
struct NODE *this;
FLOAT searchmin[3], searchmax[3];
#ifdef PERIODIC
double xtmp;
#endif
for(k = 0; k < 3; k++) /* cube-box window */
{
searchmin[k] = searchcenter[k] - hsml;
searchmax[k] = searchcenter[k] + hsml;
}
numngb = 0;
no = *startnode;
while(no >= 0)
{
if(no < All.MaxPart) /* single particle */
{
p = no;
no = Nextnode[no];
if(P[p].Type > 0)
continue;
#ifdef MULTIPHASE
/* GAS_SPH sees only GAS_SPH */
if((phase == GAS_SPH) && (SphP[p].Phase != GAS_SPH))
continue;
/* GAS_SPH sees only GAS_STICKY (better for sticky interaction) */
if((phase == GAS_STICKY) && (SphP[p].Phase != GAS_STICKY))
continue;
/* GAS_DARK sees everybody */
#endif
#ifdef PERIODIC
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) < -hsml)
continue;
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) > hsml)
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) < -hsml)
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) > hsml)
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) < -hsml)
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) > hsml)
continue;
#else
if(P[p].Pos[0] < searchmin[0])
continue;
if(P[p].Pos[0] > searchmax[0])
continue;
if(P[p].Pos[1] < searchmin[1])
continue;
if(P[p].Pos[1] > searchmax[1])
continue;
if(P[p].Pos[2] < searchmin[2])
continue;
if(P[p].Pos[2] > searchmax[2])
continue;
#endif
Ngblist[numngb++] = p;
if(numngb == MAX_NGB)
{
numngb = ngb_clear_buf(searchcenter, hsml, numngb);
if(numngb == MAX_NGB)
{
printf("ThisTask=%d: Need to do a second neighbour loop for (%g|%g|%g) hsml=%g no=%d\n",
ThisTask, searchcenter[0], searchcenter[1], searchcenter[2], hsml, no);
*startnode = no;
return numngb;
}
}
}
else
{
if(no >= All.MaxPart + MaxNodes) /* pseudo particle */
{
Exportflag[DomainTask[no - (All.MaxPart + MaxNodes)]] = 1;
no = Nextnode[no - MaxNodes];
continue;
}
this = &Nodes[no];
no = this->u.d.sibling; /* in case the node can be discarded */
#ifdef PERIODIC
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) - 0.5 * this->len) > hsml)
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) - 0.5 * this->len) > hsml)
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) - 0.5 * this->len) > hsml)
continue;
#else
if((this->center[0] + 0.5 * this->len) < (searchmin[0]))
continue;
if((this->center[0] - 0.5 * this->len) > (searchmax[0]))
continue;
if((this->center[1] + 0.5 * this->len) < (searchmin[1]))
continue;
if((this->center[1] - 0.5 * this->len) > (searchmax[1]))
continue;
if((this->center[2] + 0.5 * this->len) < (searchmin[2]))
continue;
if((this->center[2] - 0.5 * this->len) > (searchmax[2]))
continue;
#endif
no = this->u.d.nextnode; /* ok, we need to open the node */
}
}
*startnode = -1;
return numngb;
}
#ifdef CHIMIE
/*! This function returns neighbours with distance <= hsml and returns them in
* Ngblist. Actually, particles in a box of half side length hsml are
* returned, i.e. the reduction to a sphere still needs to be done in the
* calling routine.
*/
int ngb_treefind_variable_for_chimie(FLOAT searchcenter[3], FLOAT hsml, int *startnode)
{
int k, numngb;
int no, p;
struct NODE *this;
FLOAT searchmin[3], searchmax[3];
#ifdef PERIODIC
double xtmp;
#endif
for(k = 0; k < 3; k++) /* cube-box window */
{
searchmin[k] = searchcenter[k] - hsml;
searchmax[k] = searchcenter[k] + hsml;
}
numngb = 0;
no = *startnode;
while(no >= 0)
{
if(no < All.MaxPart) /* single particle */
{
p = no;
no = Nextnode[no];
if(P[p].Type > 0)
continue;
#ifdef CHIMIE_KINETIC_FEEDBACK /* no, we need to keep all particles, especially when the wind is low */
// if (SphP[p].WindTime >= (All.Time-All.ChimieWindTime))
// continue;
#endif
#ifdef PERIODIC
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) < -hsml)
continue;
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) > hsml)
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) < -hsml)
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) > hsml)
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) < -hsml)
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) > hsml)
continue;
#else
if(P[p].Pos[0] < searchmin[0])
continue;
if(P[p].Pos[0] > searchmax[0])
continue;
if(P[p].Pos[1] < searchmin[1])
continue;
if(P[p].Pos[1] > searchmax[1])
continue;
if(P[p].Pos[2] < searchmin[2])
continue;
if(P[p].Pos[2] > searchmax[2])
continue;
#endif
Ngblist[numngb++] = p;
if(numngb == MAX_NGB)
{
numngb = ngb_clear_buf(searchcenter, hsml, numngb);
if(numngb == MAX_NGB)
{
printf("ThisTask=%d: Need to do a second neighbour loop for (%g|%g|%g) hsml=%g no=%d\n",
ThisTask, searchcenter[0], searchcenter[1], searchcenter[2], hsml, no);
*startnode = no;
return numngb;
}
}
}
else
{
if(no >= All.MaxPart + MaxNodes) /* pseudo particle */
{
Exportflag[DomainTask[no - (All.MaxPart + MaxNodes)]] = 1;
no = Nextnode[no - MaxNodes];
continue;
}
this = &Nodes[no];
no = this->u.d.sibling; /* in case the node can be discarded */
#ifdef PERIODIC
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) - 0.5 * this->len) > hsml)
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) - 0.5 * this->len) > hsml)
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) - 0.5 * this->len) > hsml)
continue;
#else
if((this->center[0] + 0.5 * this->len) < (searchmin[0]))
continue;
if((this->center[0] - 0.5 * this->len) > (searchmax[0]))
continue;
if((this->center[1] + 0.5 * this->len) < (searchmin[1]))
continue;
if((this->center[1] - 0.5 * this->len) > (searchmax[1]))
continue;
if((this->center[2] + 0.5 * this->len) < (searchmin[2]))
continue;
if((this->center[2] - 0.5 * this->len) > (searchmax[2]))
continue;
#endif
no = this->u.d.nextnode; /* ok, we need to open the node */
}
}
*startnode = -1;
return numngb;
}
#endif
/*! This function returns the first particle that may sticky-interact with
* the given particle, in the sph kernel.
*/
#ifdef MULTIPHASE
int ngb_treefind_sticky_collisions(FLOAT searchcenter[3], FLOAT hsml, int phase, int *startnode)
{
int k, numngb;
int no, p;
struct NODE *this;
FLOAT searchmin[3], searchmax[3];
double dx,dy,dz,dr2;
#ifdef PERIODIC
double xtmp;
#endif
for(k = 0; k < 3; k++) /* cube-box window */
{
searchmin[k] = searchcenter[k] - hsml;
searchmax[k] = searchcenter[k] + hsml;
}
numngb = 0;
no = *startnode;
while(no >= 0)
{
if(no < All.MaxPart) /* single particle */
{
p = no;
no = Nextnode[no];
if((P[p].Type > 0) || (SphP[p].Phase!=GAS_STICKY)) /* keep only GAS_STICKY */
continue;
if(SphP[p].StickyFlag==0) /* the particle may not collide */
continue;
#ifdef PERIODIC
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) < -hsml)
continue;
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) > hsml)
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) < -hsml)
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) > hsml)
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) < -hsml)
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) > hsml)
continue;
#else
if(P[p].Pos[0] < searchmin[0])
continue;
if(P[p].Pos[0] > searchmax[0])
continue;
if(P[p].Pos[1] < searchmin[1])
continue;
if(P[p].Pos[1] > searchmax[1])
continue;
if(P[p].Pos[2] < searchmin[2])
continue;
if(P[p].Pos[2] > searchmax[2])
continue;
#endif
dx = searchcenter[0] - P[p].Pos[0];
dy = searchcenter[1] - P[p].Pos[1];
dz = searchcenter[2] - P[p].Pos[2];
dr2= dx * dx + dy * dy + dz * dz;
if (dr2>hsml*hsml)
continue;
if (dr2==0)
continue;
return p;
}
else
{
if(no >= All.MaxPart + MaxNodes) /* pseudo particle */
{
/* here, we do nothing */
no = Nextnode[no - MaxNodes];
continue;
}
this = &Nodes[no];
no = this->u.d.sibling; /* in case the node can be discarded */
#ifdef PERIODIC
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) - 0.5 * this->len) > hsml)
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) - 0.5 * this->len) > hsml)
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) - 0.5 * this->len) > hsml)
continue;
#else
if((this->center[0] + 0.5 * this->len) < (searchmin[0]))
continue;
if((this->center[0] - 0.5 * this->len) > (searchmax[0]))
continue;
if((this->center[1] + 0.5 * this->len) < (searchmin[1]))
continue;
if((this->center[1] - 0.5 * this->len) > (searchmax[1]))
continue;
if((this->center[2] + 0.5 * this->len) < (searchmin[2]))
continue;
if((this->center[2] - 0.5 * this->len) > (searchmax[2]))
continue;
#endif
no = this->u.d.nextnode; /* ok, we need to open the node */
}
}
return -1;
}
#endif
#ifdef TESSEL
#define NGB_PERIODIC_FLAG_X(x) (xtmp=(x),(xtmp>boxHalf_X)?(1):((xtmp<-boxHalf_X)?(1):0))
#define NGB_PERIODIC_FLAG_Y(x) (xtmp=(x),(xtmp>boxHalf_Y)?(1):((xtmp<-boxHalf_Y)?(1):0))
#define NGB_PERIODIC_FLAG_Z(x) (xtmp=(x),(xtmp>boxHalf_Z)?(1):((xtmp<-boxHalf_Z)?(1):0))
/*! This function returns neighbours with distance <= hsml and returns them in
* Ngblist. Actually, particles in a box of half side length hsml are
* returned, i.e. the reduction to a sphere still needs to be done in the
* calling routine.
*
*
*/
int ngb_treefind_variable_for_tessel(FLOAT searchcenter[3], FLOAT hsml, int phase, int *startnode)
{
int k, numngb;
int no, p;
struct NODE *this;
FLOAT searchmin[3], searchmax[3];
int flag;
#ifdef PERIODIC
double xtmp;
#endif
for(k = 0; k < 3; k++) /* cube-box window */
{
searchmin[k] = searchcenter[k] - hsml;
searchmax[k] = searchcenter[k] + hsml;
}
numngb = 0;
no = *startnode;
while(no >= 0)
{
if(no < All.MaxPart) /* single particle */
{
p = no;
no = Nextnode[no];
if(P[p].Type > 0)
continue;
//if(P[p].IsAdded) /* the point has already be added by another point, skip it */
// continue;
#ifdef MULTIPHASE
/* GAS_SPH sees only GAS_SPH */
if((phase == GAS_SPH) && (SphP[p].Phase != GAS_SPH))
continue;
/* GAS_SPH sees only GAS_STICKY (better for sticky interaction) */
if((phase == GAS_STICKY) && (SphP[p].Phase != GAS_STICKY))
continue;
/* GAS_DARK sees everybody */
#endif
#ifdef PERIODIC
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) < -hsml)
continue;
if(NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]) > hsml)
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) < -hsml)
continue;
if(NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]) > hsml)
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) < -hsml)
continue;
if(NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]) > hsml)
continue;
#else
if(P[p].Pos[0] < searchmin[0])
continue;
if(P[p].Pos[0] > searchmax[0])
continue;
if(P[p].Pos[1] < searchmin[1])
continue;
if(P[p].Pos[1] > searchmax[1])
continue;
if(P[p].Pos[2] < searchmin[2])
continue;
if(P[p].Pos[2] > searchmax[2])
continue;
#endif
/* the particle is inside the search radius */
#ifdef PERIODIC
/* keep it only if the particle is in the radius due to periodicity */
flag = 0; /* !!! here, we should stop once flag=1 */
flag += (NGB_PERIODIC_FLAG_X(P[p].Pos[0] - searchcenter[0]));
flag += (NGB_PERIODIC_FLAG_X(P[p].Pos[0] - searchcenter[0]));
flag += (NGB_PERIODIC_FLAG_Y(P[p].Pos[1] - searchcenter[1]));
flag += (NGB_PERIODIC_FLAG_Y(P[p].Pos[1] - searchcenter[1]));
flag += (NGB_PERIODIC_FLAG_Z(P[p].Pos[2] - searchcenter[2]));
flag += (NGB_PERIODIC_FLAG_Z(P[p].Pos[2] - searchcenter[2]));
if (flag==0)
continue;
#endif
Ngblist[numngb++] = p;
if(numngb == MAX_NGB)
{
numngb = ngb_clear_buf(searchcenter, hsml, numngb);
if(numngb == MAX_NGB)
{
printf("ThisTask=%d: Need to do a second neighbour loop for (%g|%g|%g) hsml=%g no=%d\n",
ThisTask, searchcenter[0], searchcenter[1], searchcenter[2], hsml, no);
*startnode = no;
return numngb;
}
}
}
else
{
if(no >= All.MaxPart + MaxNodes) /* pseudo particle */
{
Exportflag[DomainTask[no - (All.MaxPart + MaxNodes)]] = 1;
no = Nextnode[no - MaxNodes];
continue;
}
this = &Nodes[no];
no = this->u.d.sibling; /* in case the node can be discarded */
#ifdef PERIODIC
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_X(this->center[0] - searchcenter[0]) - 0.5 * this->len) > hsml)
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_Y(this->center[1] - searchcenter[1]) - 0.5 * this->len) > hsml)
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) + 0.5 * this->len) < -hsml)
continue;
if((NGB_PERIODIC_Z(this->center[2] - searchcenter[2]) - 0.5 * this->len) > hsml)
continue;
#else
if((this->center[0] + 0.5 * this->len) < (searchmin[0]))
continue;
if((this->center[0] - 0.5 * this->len) > (searchmax[0]))
continue;
if((this->center[1] + 0.5 * this->len) < (searchmin[1]))
continue;
if((this->center[1] - 0.5 * this->len) > (searchmax[1]))
continue;
if((this->center[2] + 0.5 * this->len) < (searchmin[2]))
continue;
if((this->center[2] - 0.5 * this->len) > (searchmax[2]))
continue;
#endif
no = this->u.d.nextnode; /* ok, we need to open the node */
}
}
*startnode = -1;
return numngb;
}
#endif /* TESSEL */
/*! The buffer for the neighbour list has a finite length MAX_NGB. For a large
* search region, this buffer can get full, in which case this routine can be
* called to eliminate some of the superfluous particles in the "corners" of
* the search box - only the ones in the inscribed sphere need to be kept.
*/
int ngb_clear_buf(FLOAT searchcenter[3], FLOAT hsml, int numngb)
{
int i, p;
FLOAT dx, dy, dz, r2;
#ifdef PERIODIC
double xtmp;
#endif
for(i = 0; i < numngb; i++)
{
p = Ngblist[i];
#ifdef PERIODIC
dx = NGB_PERIODIC_X(P[p].Pos[0] - searchcenter[0]);
dy = NGB_PERIODIC_Y(P[p].Pos[1] - searchcenter[1]);
dz = NGB_PERIODIC_Z(P[p].Pos[2] - searchcenter[2]);
#else
dx = P[p].Pos[0] - searchcenter[0];
dy = P[p].Pos[1] - searchcenter[1];
dz = P[p].Pos[2] - searchcenter[2];
#endif
r2 = dx * dx + dy * dy + dz * dz;
if(r2 > hsml * hsml)
{
Ngblist[i] = Ngblist[numngb - 1];
i--;
numngb--;
}
}
return numngb;
}
/*! Allocates memory for the neighbour list buffer.
*/
void ngb_treeallocate(int npart)
{
double totbytes = 0;
size_t bytes;
#ifdef PERIODIC
boxSize = All.BoxSize;
boxHalf = 0.5 * All.BoxSize;
#ifdef LONG_X
boxHalf_X = boxHalf * LONG_X;
boxSize_X = boxSize * LONG_X;
#endif
#ifdef LONG_Y
boxHalf_Y = boxHalf * LONG_Y;
boxSize_Y = boxSize * LONG_Y;
#endif
#ifdef LONG_Z
boxHalf_Z = boxHalf * LONG_Z;
boxSize_Z = boxSize * LONG_Z;
#endif
#endif
if(!(Ngblist = malloc(bytes = npart * (long) sizeof(int))))
{
printf("Failed to allocate %g MB for ngblist array\n", bytes / (1024.0 * 1024.0));
endrun(78);
}
totbytes += bytes;
if(ThisTask == 0)
printf("allocated %g Mbyte for ngb search.\n", totbytes / (1024.0 * 1024.0));
}
/*! free memory allocated for neighbour list buffer.
*/
void ngb_treefree(void)
{
free(Ngblist);
}
/*! This function constructs the neighbour tree. To this end, we actually need
* to construct the gravitational tree, because we use it now for the
* neighbour search.
*/
void ngb_treebuild(void)
{
if(ThisTask == 0)
printf("Begin Ngb-tree construction.\n");
+#if defined(STELLAR_PROP) && defined(CHIMIE) && !defined(CHIMIE_INPUT_ALL)
+ force_treebuild(N_gas+N_stars);
+#else
force_treebuild(N_gas);
+#endif
if(ThisTask == 0)
printf("Ngb-Tree contruction finished \n");
}

Event Timeline