[cig-commits] r20000 - short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott

willic3 at geodynamics.org willic3 at geodynamics.org
Wed Apr 25 22:47:35 PDT 2012


Author: willic3
Date: 2012-04-25 22:47:34 -0700 (Wed, 25 Apr 2012)
New Revision: 20000

Modified:
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/plot_profiles.py
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/plot_soln.py
Log:
Made a few changes.
Can't run plot_soln.py because I don't have Mayavi 4.



Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/plot_profiles.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/plot_profiles.py	2012-04-25 23:32:07 UTC (rev 19999)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/plot_profiles.py	2012-04-26 05:47:34 UTC (rev 20000)
@@ -30,8 +30,8 @@
 sys.path.append("../../../figures")
 import matplotlibext
 
-# import pdb
-# pdb.set_trace()
+import pdb
+pdb.set_trace()
 
 header = 0.45
 
@@ -39,7 +39,7 @@
          "Tet4",
          ]
 res = ["20km",
-       #"6.7km",
+       "6.7km",
        ]
 #symdict = {'Hex8': 's',
 #           'Tet4': '^',
@@ -106,7 +106,13 @@
     dist = vertices[indices,0].squeeze()
     disp = disp[:,indices,1].squeeze()
     
-    indices = numpy.argsort(dist)
+    # Remove value on negative side of fault and sort distances.
+    numSteps = disp.shape[0]
+    dispTest = disp[numSteps -1,:]
+    negInd = numpy.nonzero(dispTest < 0.0)[0][0]
+    distPos = numpy.delete(dist, negInd)
+    indices = numpy.argsort(distPos)
+
     self.dist = dist[indices] / elastThick.value # Normalize by elastic thickness
     self.disp = disp[:,indices] / eqslip.value # Normalize by eqslip
     self.time = time
@@ -132,7 +138,9 @@
 ax = figure.axes(2.0+header, 1, 1.0+header, 1)
 
 analytic = AnalyticSoln("output/analytic_disp.txt")
-sims = {}
+import collections
+
+sims = collections.defaultdict(dict)
 for r in res:
   for c in cells:
     sims[c][r] = PyLithOutput(c, r)

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/plot_soln.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/plot_soln.py	2012-04-25 23:32:07 UTC (rev 19999)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/plot_soln.py	2012-04-26 05:47:34 UTC (rev 20000)
@@ -9,6 +9,7 @@
 #
 
 cell = "hex8"
+resolution = "6.7km"
 scaleFactor = 0.5
 tindex = 38
 pngfile = "savageprescott_soln.png"
@@ -164,7 +165,7 @@
     import tables
     import numpy
 
-    filename = "output/%s.h5" % cell
+    filename = "output/%s_%s.h5" % (cell, resolution)
     h5 = tables.openFile(filename, 'r')
 
     elastThick = 40.0e+3
@@ -187,6 +188,9 @@
         cellType = tvtk.Hexahedron().cell_type
     else:
         raise ValueError("Unknown cell '%s'." % cell)
+    
+    if (resolution != "6.7km" or resolution != "20km"):
+        raise ValueError("Unavailable resolution '%s'." % resolution)
 
     data = tvtk.UnstructuredGrid()
     data.points = vertices



More information about the CIG-COMMITS mailing list