[cig-commits] [commit] add_gibbs_energy: Allow multiple instances of same element in endmember formulae (c376611)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Dec 11 17:12:45 PST 2014
Repository : https://github.com/geodynamics/burnman
On branch : add_gibbs_energy
Link : https://github.com/geodynamics/burnman/compare/0000000000000000000000000000000000000000...2148b324d3e8aa7b527f831eb397590942563008
>---------------------------------------------------------------
commit c3766111361f9d0c6a7af857cbf260f8c23586f0
Author: Bob Myhill <myhill.bob at gmail.com>
Date: Thu Oct 2 14:08:21 2014 +0200
Allow multiple instances of same element in endmember formulae
>---------------------------------------------------------------
c3766111361f9d0c6a7af857cbf260f8c23586f0
burnman/processchemistry.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/burnman/processchemistry.py b/burnman/processchemistry.py
index e7de384..eca5eba 100644
--- a/burnman/processchemistry.py
+++ b/burnman/processchemistry.py
@@ -38,7 +38,10 @@ def dictionarize_formula(formula):
nel=1.
else:
nel=float(list[1])
- f[list[0]]=nel
+ if list[0] not in f:
+ f[list[0]]=nel
+ else:
+ f[list[0]]=nel+f[list[0]]
return f
def formula_mass(formula, atomic_masses):
More information about the CIG-COMMITS
mailing list