[cig-commits] [commit] split_mt: Tweak blurb and add equation of state redefinition in mineral.py (478aeeb)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Dec 31 17:20:34 PST 2014


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

On branch  : split_mt
Link       : https://github.com/geodynamics/burnman/compare/975b8a5aaacd0de3cfdeb40d8a762643ecc70b39...478aeeb8db67a1aa0c9c36f4db0d99ae9c40d702

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

commit 478aeeb8db67a1aa0c9c36f4db0d99ae9c40d702
Author: Bob Myhill <myhill.bob at gmail.com>
Date:   Thu Jan 1 01:20:15 2015 +0000

    Tweak blurb and add equation of state redefinition in mineral.py


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

478aeeb8db67a1aa0c9c36f4db0d99ae9c40d702
 burnman/mineral.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/burnman/mineral.py b/burnman/mineral.py
index 1269143..fec6ad9 100644
--- a/burnman/mineral.py
+++ b/burnman/mineral.py
@@ -15,8 +15,9 @@ class Mineral(Material):
     This is the base class for all minerals. States of the mineral
     can only be queried after setting the pressure and temperature
     using set_state(). The method for computing properties of
-    the material is set using set_method(), which should be done
-    once after creating the material.
+    the material is set using set_method(). This is done during 
+    initialisation if the param 'equation_of_state' has been defined.
+    The method can be overridden later by the user.
 
     This class is available as ``burnman.Mineral``.
 
@@ -64,6 +65,7 @@ class Mineral(Material):
             raise Exception("Please derive your method from object (see python old style classes)")
 
         if self.method is not None and type(new_method) is not type(self.method):
+            self.params['equation_of_state']=equation_of_state
             warnings.warn('Overriding database equation of state. From ' + self.method.__class__.__name__ + ' to ' + new_method.__class__.__name__, stacklevel=2)
 
         self.method = new_method



More information about the CIG-COMMITS mailing list