[cig-commits] [commit] master: fix SolidSolution (97f785e)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Dec 11 12:20:05 PST 2014
Repository : https://github.com/geodynamics/burnman
On branch : master
Link : https://github.com/geodynamics/burnman/compare/c5ec36a308413012ee5b0763ccb541c2ad56f382...bc315ff9a2ed1d4871962882f0626468342f1ffc
>---------------------------------------------------------------
commit 97f785e0b79bc3bbef1dd29ee71df5f550e965cc
Author: Timo Heister <timo.heister at gmail.com>
Date: Thu Dec 11 02:18:02 2014 -0500
fix SolidSolution
>---------------------------------------------------------------
97f785e0b79bc3bbef1dd29ee71df5f550e965cc
burnman/mineral_helpers.py | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/burnman/mineral_helpers.py b/burnman/mineral_helpers.py
index 94d5a4f..69f73fb 100644
--- a/burnman/mineral_helpers.py
+++ b/burnman/mineral_helpers.py
@@ -48,15 +48,7 @@ class HelperSolidSolution(Mineral):
self.method=base_materials[0].method
- itrange = range(0, len(self.base_materials))
-
self.params = {}
- for prop in self.base_materials[0].params:
- try:
- self.params[prop] = sum([ self.base_materials[i].params[prop] * self.molar_fraction[i] for i in itrange ])
- except TypeError:
- #if there is a type error, it is probably a string. Just go with the value of the first base_material.
- self.params[prop] = self.base_materials[0].params[prop]
@@ -71,12 +63,16 @@ class HelperSolidSolution(Mineral):
for mat in self.base_materials:
mat.method = self.method
mat.set_state(pressure, temperature)
- Mineral.__init__(self)
- def set_state(self, pressure, temperature):
- for mat in self.base_materials:
- mat.method = self.method
- mat.set_state(pressure, temperature)
+ itrange = range(0, len(self.base_materials))
+ self.params = {}
+ for prop in self.base_materials[0].params:
+ try:
+ self.params[prop] = sum([ self.base_materials[i].params[prop] * self.molar_fraction[i] for i in itrange ])
+ except TypeError:
+ #if there is a type error, it is probably a string. Just go with the value of the first base_material.
+ self.params[prop] = self.base_materials[0].params[prop]
+
Mineral.set_state(self,pressure,temperature)
class HelperSpinTransition(Material):
More information about the CIG-COMMITS
mailing list