Skip to content

Commit

Permalink
MAGEMin v1.6.5
Browse files Browse the repository at this point in the history
- Deactivated pure endmembers swap for epidote as this was leading to mistakenly stabilizing epidote outside the feasible domain. This results in significant improvement of the phase diagram for hydrous systems at low pressure and low temperature conditions for metapelite, metabasite and igneous database.
- Corrected phase_info() function that was displaying wrong phase names for pure phases
  • Loading branch information
NicolasRiel authored Jan 18, 2025
2 parents 409bdf3 + e2fc0c5 commit 23723f0
Show file tree
Hide file tree
Showing 14 changed files with 276 additions and 147 deletions.
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 <kaus@uni-mainz.de> & Nicolas Riel <riel@uni-mainz.de>"]
version = "1.6.4"
version = "1.6.5"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
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.6.4**
**MAGEMin v1.6.5**
==================

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
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MAGEMin v1.6.4 &mdash; MAGEMin 2022 documentation</title>
<title>MAGEMin v1.6.5 &mdash; MAGEMin 2022 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/css/custom.css" type="text/css" />
Expand Down Expand Up @@ -247,7 +247,7 @@
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="#" class="icon icon-home"></a> &raquo;</li>
<li><strong>MAGEMin v1.6.4</strong></li>
<li><strong>MAGEMin v1.6.5</strong></li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
</li>
Expand All @@ -263,7 +263,7 @@
<div class="line"><br /></div>
</div>
<section id="magemin-v1-5-0">
<h1><strong>MAGEMin v1.6.4</strong><a class="headerlink" href="#magemin-v1-5-0" title="Permalink to this headline"></a></h1>
<h1><strong>MAGEMin v1.6.5</strong><a class="headerlink" href="#magemin-v1-5-0" title="Permalink to this headline"></a></h1>
<p>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</p>
<p>A full description of the minimization approach used in MAGEMin is given in:</p>
<p>Riel, N., Kaus, B. J. P., Green, E. C. R., &amp; Berlie, N. (2022). MAGEMin, an efficient Gibbs energy minimizer: Application to igneous systems. Geochemistry, Geophysics, Geosystems, 23, e2022GC010427. <a class="reference external" href="https://doi.org/10.1029/2022GC010427">https://doi.org/10.1029/2022GC010427</a></p>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/stp.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="External libraries" href="stp/Linux.html" />
<link rel="prev" title="MAGEMin v1.6.4" href="index.html" />
<link rel="prev" title="MAGEMin v1.6.5" href="index.html" />
</head>

<body class="wy-body-for-nav">
Expand Down Expand Up @@ -292,7 +292,7 @@ <h1>Optional (developers)<a class="headerlink" href="#optional-developers" title
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="index.html" class="btn btn-neutral float-left" title="MAGEMin v1.6.4" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="index.html" class="btn btn-neutral float-left" title="MAGEMin v1.6.5" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="stp/Linux.html" class="btn btn-neutral float-right" title="External libraries" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

Expand Down
69 changes: 34 additions & 35 deletions gen/magemin_library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,41 +168,40 @@ const nlopt_precond = Ptr{Cvoid}
NLOPT_GN_ORIG_DIRECT_L = 7
NLOPT_GD_STOGO = 8
NLOPT_GD_STOGO_RAND = 9
NLOPT_LD_LBFGS_NOCEDAL = 10
NLOPT_LD_LBFGS = 11
NLOPT_LN_PRAXIS = 12
NLOPT_LD_VAR1 = 13
NLOPT_LD_VAR2 = 14
NLOPT_LD_TNEWTON = 15
NLOPT_LD_TNEWTON_RESTART = 16
NLOPT_LD_TNEWTON_PRECOND = 17
NLOPT_LD_TNEWTON_PRECOND_RESTART = 18
NLOPT_GN_CRS2_LM = 19
NLOPT_GN_MLSL = 20
NLOPT_GD_MLSL = 21
NLOPT_GN_MLSL_LDS = 22
NLOPT_GD_MLSL_LDS = 23
NLOPT_LD_MMA = 24
NLOPT_LN_COBYLA = 25
NLOPT_LN_NEWUOA = 26
NLOPT_LN_NEWUOA_BOUND = 27
NLOPT_LN_NELDERMEAD = 28
NLOPT_LN_SBPLX = 29
NLOPT_LN_AUGLAG = 30
NLOPT_LD_AUGLAG = 31
NLOPT_LN_AUGLAG_EQ = 32
NLOPT_LD_AUGLAG_EQ = 33
NLOPT_LN_BOBYQA = 34
NLOPT_GN_ISRES = 35
NLOPT_AUGLAG = 36
NLOPT_AUGLAG_EQ = 37
NLOPT_G_MLSL = 38
NLOPT_G_MLSL_LDS = 39
NLOPT_LD_SLSQP = 40
NLOPT_LD_CCSAQ = 41
NLOPT_GN_ESCH = 42
NLOPT_GN_AGS = 43
NLOPT_NUM_ALGORITHMS = 44
NLOPT_LD_LBFGS = 10
NLOPT_LN_PRAXIS = 11
NLOPT_LD_VAR1 = 12
NLOPT_LD_VAR2 = 13
NLOPT_LD_TNEWTON = 14
NLOPT_LD_TNEWTON_RESTART = 15
NLOPT_LD_TNEWTON_PRECOND = 16
NLOPT_LD_TNEWTON_PRECOND_RESTART = 17
NLOPT_GN_CRS2_LM = 18
NLOPT_GN_MLSL = 19
NLOPT_GD_MLSL = 20
NLOPT_GN_MLSL_LDS = 21
NLOPT_GD_MLSL_LDS = 22
NLOPT_LD_MMA = 23
NLOPT_LN_COBYLA = 24
NLOPT_LN_NEWUOA = 25
NLOPT_LN_NEWUOA_BOUND = 26
NLOPT_LN_NELDERMEAD = 27
NLOPT_LN_SBPLX = 28
NLOPT_LN_AUGLAG = 29
NLOPT_LD_AUGLAG = 30
NLOPT_LN_AUGLAG_EQ = 31
NLOPT_LD_AUGLAG_EQ = 32
NLOPT_LN_BOBYQA = 33
NLOPT_GN_ISRES = 34
NLOPT_AUGLAG = 35
NLOPT_AUGLAG_EQ = 36
NLOPT_G_MLSL = 37
NLOPT_G_MLSL_LDS = 38
NLOPT_LD_SLSQP = 39
NLOPT_LD_CCSAQ = 40
NLOPT_GN_ESCH = 41
NLOPT_GN_AGS = 42
NLOPT_NUM_ALGORITHMS = 43
end

function nlopt_algorithm_name(a)
Expand Down
10 changes: 5 additions & 5 deletions julia/MAGEMin_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export anhydrous_renormalization, retrieve_solution_phase_information, remove_p

export wt2mol, mol2wt

export adjust_chemical_system, TE_prediction, get_OL_KDs_database, adjust_bulk_4_zircon
export adjust_chemical_system, TE_prediction, get_OL_KDs_database, get_EODC_Exp_KDs_database, get_EODC_Nat_KDs_database, adjust_bulk_4_zircon

export initialize_AMR, split_and_keep, AMR

Expand Down Expand Up @@ -1862,7 +1862,7 @@ function print_info(g::gmin_struct)
end

for i=1:g.n_PP
print("$(lpad(g.ph[i],15," ")) ")
print("$(lpad(g.ph[i+g.n_SS],15," ")) ")
for j=1:length(g.oxides)
print("$(lpad(round(g.PP_vec[i].Comp[j],digits=5),8," ")) ")
end
Expand Down Expand Up @@ -1898,7 +1898,7 @@ function print_info(g::gmin_struct)

print("\n")
for i=1:g.n_PP
print("$(lpad(g.ph[i],15," ")) ")
print("$(lpad(g.ph[i+g.n_SS],15," ")) ")
for j=1:length(g.oxides)
print("$(lpad(round(g.PP_vec[i].Comp_wt[j],digits=5),8," ")) ")
end
Expand Down Expand Up @@ -1934,7 +1934,7 @@ function print_info(g::gmin_struct)
print("\n")
end
for i=1:g.n_PP
print("$(lpad(g.ph[i],15," ")) ")
print("$(lpad(g.ph[i+g.n_SS],15," ")) ")
print("$(lpad(round(g.ph_frac[i],digits=5),13," ")) ")
print("$(lpad(round(g.ph_frac_wt[i],digits=5),8," ")) ")
print("$(lpad(round(g.ph_frac_vol[i],digits=5),8," ")) ")
Expand Down Expand Up @@ -1985,7 +1985,7 @@ function print_info(g::gmin_struct)
println(" $(lpad(g.ph[i],6," ")) $(rpad(g.SS_vec[i].deltaG,15," ")) ")
end
for i=1:g.n_PP
println(" $(lpad(g.ph[i],6," ")) $(rpad(g.PP_vec[i].deltaG,15," ")) ")
println(" $(lpad(g.ph[i+g.n_SS],6," ")) $(rpad(g.PP_vec[i].deltaG,15," ")) ")
end

print("\n")
Expand Down
8 changes: 3 additions & 5 deletions julia/TE_Zr_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ bulk_TE = [50.60777553,0.953497243,13.70435413,0.19,11.28130762,0.202560796,

KDs_dtb = get_OL_KDs_database();

C0 = adjust_chemical_system( KDs_dtb,bulk_TE,elem_TE);

out_TE = TE_prediction(C0,KDs_dtb, "CB",out,dtb);

C0 = adjust_chemical_system( KDs_dtb, bulk_TE, elem_TE );
out_TE = TE_prediction(C0,KDs_dtb,out,dtb; ZrSat_model = "CB");

if ~isnothing(out_TE.bulk_cor_wt) #then we can recompute the equilibrium after removing the SiO2 entering zircon
sys_in = "wt"
out = single_point_minimization(P, T, data, X=out_TE.bulk_cor_wt, Xoxides=out.oxides, sys_in=sys_in)
out_TE = TE_prediction(C0,KDs_dtb, "CB",out,dtb)
out_TE = TE_prediction(C0,KDs_dtb,out,dtb; ZrSat_model = "CB")
end

# add parallel test
Loading

0 comments on commit 23723f0

Please sign in to comment.