[cig-commits] [commit] master: add missing files (70ff3b3)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Dec 12 14:05:16 PST 2014


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

On branch  : master
Link       : https://github.com/geodynamics/burnman/compare/53964ef9adcc1f8b89f9e48ae774c2ecb51f216a...6f75d3766c3c8e3bf6599b894e7bbe2993f57419

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

commit 70ff3b35121cc820137c4004893419b78e9d5e80
Author: Timo Heister <timo.heister at gmail.com>
Date:   Fri Dec 12 13:52:35 2014 -0800

    add missing files


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

70ff3b35121cc820137c4004893419b78e9d5e80
 burnman/eos/__init__.py | 20 ++++++++++++++++++++
 burnman/eos/helper.py   | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/burnman/eos/__init__.py b/burnman/eos/__init__.py
new file mode 100644
index 0000000..2009223
--- /dev/null
+++ b/burnman/eos/__init__.py
@@ -0,0 +1,20 @@
+# BurnMan - a lower mantle toolkit
+# Copyright (C) 2012, 2013, Heister, T., Unterborn, C., Rose, I. and Cottaar, S.
+# Released under GPL v2 or later.
+
+"""
+Equation of State
+-----------------
+
+
+"""
+
+from equation_of_state import EquationOfState
+from birch_murnaghan import BM2, BM3
+from mie_grueneisen_debye import MGD2, MGD3
+from slb import SLB2, SLB3
+from modified_tait import MT
+from cork import CORK
+
+from helper import create
+
diff --git a/burnman/eos/helper.py b/burnman/eos/helper.py
new file mode 100644
index 0000000..54b6c4a
--- /dev/null
+++ b/burnman/eos/helper.py
@@ -0,0 +1,43 @@
+# BurnMan - a lower mantle toolkit
+# Copyright (C) 2012, 2013, Heister, T., Unterborn, C., Rose, I. and Cottaar, S.
+# Released under GPL v2 or later.
+
+import inspect
+import slb
+import mie_grueneisen_debye as mgd
+import birch_murnaghan as bm
+import modified_tait as mt
+import cork
+from equation_of_state import EquationOfState
+
+
+def create(method):
+    """
+    Creates an instance of an EquationOfState from a string,
+    a class EquationOfState, or an instance of EquationOfState.
+    """
+    if isinstance(method, basestring):
+        if method == "slb2":
+            return slb.SLB2()
+        elif method == "mgd2":
+            return mgd.MGD2()
+        elif method == "mgd3":
+            return mgd.MGD3()
+        elif method == "slb3":
+            return slb.SLB3()
+        elif method == "bm2":
+            return bm.BM2()
+        elif method == "bm3":
+            return bm.BM3()
+        elif method == "mtait":
+            return mt.MT()
+        elif method == "cork":
+            return cork.CORK()
+        else:
+            raise Exception("unsupported material method " + method)
+    elif isinstance(method, EquationOfState):
+        return method
+    elif inspect.isclass(method) and issubclass(method, EquationOfState):
+        return method()
+    else:
+        raise Exception("unsupported material method " + method.__class__.__name__)



More information about the CIG-COMMITS mailing list