[cig-commits] r19738 - short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide
brad at geodynamics.org
brad at geodynamics.org
Wed Mar 7 16:52:51 PST 2012
Author: brad
Date: 2012-03-07 16:52:51 -0800 (Wed, 07 Mar 2012)
New Revision: 19738
Modified:
short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide/plot_friction.py
Log:
Improved plotting script for test.
Modified: short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide/plot_friction.py
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide/plot_friction.py 2012-03-07 20:33:18 UTC (rev 19737)
+++ short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide/plot_friction.py 2012-03-08 00:52:51 UTC (rev 19738)
@@ -1,7 +1,15 @@
#!/usr/bin/env python
-sim = "ratestate_stable"
+import sys
+if len(sys.argv) != 2:
+ raise ValueError("usage: plot_friction.py [weak | stable]")
+
+sim = sys.argv[1]
+
+if not sim in ['weak', 'stable']:
+ raise ValueError("Unknown sim '%s'." % sim)
+
# ======================================================================
import tables
import pylab
@@ -12,10 +20,10 @@
dt = 0.01
t = numpy.arange(0.0, 14.001, dt)
mu0 = 0.6
-if sim == "ratestate_stable":
+if sim == "stable":
a = 0.016
b = 0.012
-elif sim == "ratestate_weak":
+elif sim == "weak":
a = 0.008
b = 0.012
else:
@@ -64,7 +72,7 @@
# ----------------------------------------------------------------------
-h5 = tables.openFile("output/%s-fault.h5" % sim, "r")
+h5 = tables.openFile("output/ratestate_%s-fault.h5" % sim, "r")
time = h5.root.time[:].ravel()
slip = h5.root.vertex_fields.slip[:]
slipRate = h5.root.vertex_fields.slip_rate[:]
More information about the CIG-COMMITS
mailing list