[cig-commits] [commit] add_thermodynamic_potentials: Bugfix (f1b69f5)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Dec 9 09:57:03 PST 2014
Repository : https://github.com/geodynamics/burnman
On branch : add_thermodynamic_potentials
Link : https://github.com/geodynamics/burnman/compare/2e5646d93cedbbf8eae54cc37cffc14e0aa85180...d5ddad03ff9f30f5a4efaddb4e3ec585ea1a7c51
>---------------------------------------------------------------
commit f1b69f5ea9a52d9b22655864364cd84a1e0be551
Author: ian-r-rose <ian.r.rose at gmail.com>
Date: Fri Sep 26 18:30:20 2014 -0700
Bugfix
>---------------------------------------------------------------
f1b69f5ea9a52d9b22655864364cd84a1e0be551
burnman/equilibriumassemblage.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/burnman/equilibriumassemblage.py b/burnman/equilibriumassemblage.py
index 64504fe..65b2849 100644
--- a/burnman/equilibriumassemblage.py
+++ b/burnman/equilibriumassemblage.py
@@ -89,7 +89,9 @@ class EquilibriumAssemblage(burnman.Material):
if isinstance (phase, burnman.SolidSolution):
n = len(phase.base_material)
phase.set_method('slb3')
- phase.set_composition( np.array( species_vector[i:(i+n)]/np.sum(species_vector[i:(i+n)])) )
+ frac = np.sum(species_vector[i:(i+n)])
+ molar_fractions = ( species_vector[i:(i+n)]/frac if frac > 0.0 else np.ones( n )/n )
+ phase.set_composition( molar_fractions )
phase.set_state( pressure, temperature )
tmp_gibbs += phase.gibbs
i+=n
More information about the CIG-COMMITS
mailing list