Skip to content

Commit

Permalink
Merge pull request ComputationalThermodynamics#77 from NicolasRiel/main
Browse files Browse the repository at this point in the history
MAGEMin v1.3.8
  • Loading branch information
NicolasRiel authored Feb 28, 2024
2 parents 1bd28eb + 86da7a2 commit a61317a
Show file tree
Hide file tree
Showing 64 changed files with 269 additions and 226 deletions.
Binary file modified PlotPseudosection.mlapp
Binary file not shown.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MAGEMin_C"
uuid = "e5d170eb-415a-4524-987b-12f1bce1ddab"
authors = ["Boris Kaus <[email protected]> & Nicolas Riel <[email protected]>"]
version = "1.3.3"
version = "1.3.8"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Then copy and paste the address `127.0.0.1:8050` in your web-browser
<img src="https://raw.githubusercontent.com/ComputationalThermodynamics/repositories_pictures/main/MAGEMinApp/MAGEMin_app.png?raw=true" alt="drawing" width="640" alt="centered image"/>
> [!CAUTION]
> There is some issues with Windows machine (loading `Kaleido`). `] add MAGEMinApp` works well, however when `using MAGEMinApp` it may hang indefinitely. Currently, the current workaround is to cancel `CTRL+C` and try `using MAGEMinApp` a couple of time.
\
**With Matlab using Julia (not maintained anymore)**
Expand Down
2 changes: 1 addition & 1 deletion doc_raw/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

|
**MAGEMin v1.3.6**
**MAGEMin v1.3.8**
==================

MAGEMin (Mineral Assemblage Gibbs Energy Minimization) is a parallel C library callable from any petrological/geodynamic tool. For a given set of pressure, temperature and bulk-rock composition MAGEMin uses a combination of linear programming, extended Partitioning Gibbs free Energy and gradient-based local minimization to compute the most stable mineral assemblage
Expand Down
22 changes: 5 additions & 17 deletions doc_raw/julia/Run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Initialize database
.. code-block:: shell
# Initialize database - new way
db = "ig" # database: ig, igneous (Holland et al., 2018); mp, metapelite (White et al 2014b); um, ultramafic (Evans & Frost 2021)
data = Initialize_MAGEMin(db, verbose=true);
data = Initialize_MAGEMin("ig", verbose=true); # database: ig, igneous (Holland et al., 2018); mp, metapelite (White et al 2014b); mb, metabasite (Green et al.,2016); um, ultramafic (Evans & Frost 2021)
This initiatizes the global variables and the Database.

Expand All @@ -37,17 +36,16 @@ Set bulk-rock composition
Use a pre-defined bulk-rock "test" composition

.. code-block:: shell
test = 0;
gv = use_predefined_bulk_rock(gv, test, db)
test = 0 #KLB1
data = use_predefined_bulk_rock(data, test);
or a custom bulk-rock composition:

.. code-block:: shell
Xoxides = ["SiO2"; "Al2O3"; "CaO"; "MgO"; "FeO"; "Fe2O3"; "K2O"; "Na2O"; "TiO2"; "Cr2O3"; "H2O"];
X = [48.43; 15.19; 11.57; 10.13; 6.65; 1.64; 0.59; 1.87; 0.68; 0.0; 3.0];
sys_in = "wt"
sys_in = "wt"
Note that the system unit :literal:`[mol,wt]` has to be provided here.

Expand All @@ -64,21 +62,11 @@ Note that if the provided bulk-rock composition includes more oxides than suppor

|
Set the level of verbose :literal:`[false,true,1]`
**************************************************
.. code-block:: shell
gv.verbose = false # switch off any verbose
:literal:`false`, none; :literal:`true`, stable phase assemblage; :literal:`1`, full verbose. By default :literal:`gv.verbose` = true.

|
Call optimization routine for given P-T-X
*****************************************
.. code-block:: shell
out = single_point_minimization(P, T, data, test=0);
out = point_wise_minimization(P,T, data);
if a predefined test is used (see :doc:`/ckbk/predef`) or:

Expand Down
1 change: 0 additions & 1 deletion docs/_modules/MAGEMin.c.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#initialize-database">Initialize database</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-p-t-pressure-temperature">Set P-T-(pressure temperature)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-bulk-rock-composition">Set bulk-rock composition</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-the-level-of-verbose-false-true-1">Set the level of verbose <code class="docutils literal notranslate"><span class="pre">[false,true,1]</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#call-optimization-routine-for-given-p-t-x">Call optimization routine for given P-T-X</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#display-minimized-point">Display minimized point</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#access-output-structure">Access output structure</a></li>
Expand Down
1 change: 0 additions & 1 deletion docs/_modules/NLopt_opt_function.c.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#initialize-database">Initialize database</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-p-t-pressure-temperature">Set P-T-(pressure temperature)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-bulk-rock-composition">Set bulk-rock composition</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-the-level-of-verbose-false-true-1">Set the level of verbose <code class="docutils literal notranslate"><span class="pre">[false,true,1]</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#call-optimization-routine-for-given-p-t-x">Call optimization routine for given P-T-X</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#display-minimized-point">Display minimized point</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#access-output-structure">Access output structure</a></li>
Expand Down
4 changes: 2 additions & 2 deletions docs/_modules/PGE_function.c.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#initialize-database">Initialize database</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-p-t-pressure-temperature">Set P-T-(pressure temperature)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-bulk-rock-composition">Set bulk-rock composition</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#set-the-level-of-verbose-false-true-1">Set the level of verbose <code class="docutils literal notranslate"><span class="pre">[false,true,1]</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#call-optimization-routine-for-given-p-t-x">Call optimization routine for given P-T-X</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#display-minimized-point">Display minimized point</a></li>
<li class="toctree-l3"><a class="reference internal" href="../julia/Run.html#access-output-structure">Access output structure</a></li>
Expand Down Expand Up @@ -1395,8 +1394,9 @@ <h1>Source code for PGE_function.c</h1><div class="highlight"><pre>

<span class="w"> </span><span class="cm">/* get number of duplicated phases and their cp id */</span><span class="w"></span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">gv</span><span class="p">.</span><span class="n">len_cp</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">){</span><span class="w"></span>
<span class="w"> </span><span class="n">ph_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">cp</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">id</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">cp</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">ss_flags</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">){</span><span class="w"></span>
<span class="w"> </span><span class="n">ph_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">cp</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">id</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="n">SS_ref_db</span><span class="p">[</span><span class="n">ph_id</span><span class="p">].</span><span class="n">solvus_id</span><span class="p">[</span><span class="n">gv</span><span class="p">.</span><span class="n">n_solvi</span><span class="p">[</span><span class="n">ph_id</span><span class="p">]]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">i</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="n">gv</span><span class="p">.</span><span class="n">n_solvi</span><span class="p">[</span><span class="n">ph_id</span><span class="p">]</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="p">}</span><span class="w"></span>
Expand Down
Loading

0 comments on commit a61317a

Please sign in to comment.