[cig-commits] [commit] add_thermodynamic_potentials: Allow multiple instances of same element in endmember formulae (757cd70)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Dec 9 09:57:34 PST 2014


Repository : https://github.com/geodynamics/burnman

On branch  : add_thermodynamic_potentials
Link       : https://github.com/geodynamics/burnman/compare/2e5646d93cedbbf8eae54cc37cffc14e0aa85180...d5ddad03ff9f30f5a4efaddb4e3ec585ea1a7c51

>---------------------------------------------------------------

commit 757cd705f44bebc1748ef785d7bbedc303d6d159
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


>---------------------------------------------------------------

757cd705f44bebc1748ef785d7bbedc303d6d159
 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