[cig-commits] [commit] master: Add set_method to solid solution (a0ff0f1)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Dec 29 08:11:53 PST 2014


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

On branch  : master
Link       : https://github.com/geodynamics/burnman/compare/62ae59543bbffc17009a1dbde145782df113c7ba...b732698b07e4d06f763ec6e0905b1422a94b509e

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

commit a0ff0f19e41072a09a05aa9270a6aca04e62ecf2
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Sun Dec 28 21:45:23 2014 -0800

    Add set_method to solid solution


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

a0ff0f19e41072a09a05aa9270a6aca04e62ecf2
 burnman/solidsolution.py    | 5 +++++
 tests/test_solidsolution.py | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/burnman/solidsolution.py b/burnman/solidsolution.py
index cee8daf..998d27c 100644
--- a/burnman/solidsolution.py
+++ b/burnman/solidsolution.py
@@ -64,6 +64,11 @@ class SolidSolution(Mineral):
         assert(sum(molar_fraction) < 1.0001)
         self.molar_fraction = molar_fraction 
 
+    def set_method(self, method):
+        for i in range(self.n_endmembers):
+            self.base_material[i][0].set_method(method)
+        self.method = self.base_material[0][0].method
+
     def set_state(self, pressure, temperature):
         self.pressure=pressure
         self.temperature=temperature
diff --git a/tests/test_solidsolution.py b/tests/test_solidsolution.py
index 5580489..8fe8839 100644
--- a/tests/test_solidsolution.py
+++ b/tests/test_solidsolution.py
@@ -201,5 +201,9 @@ class test_solidsolution(BurnManTest):
 
         self.assertArraysAlmostEqual(site_fill, ones)
 
+    def test_set_method(self):
+       ss = olivine_ss()
+       ss.set_method('mtait')
+
 if __name__ == '__main__':
     unittest.main()



More information about the CIG-COMMITS mailing list