[cig-commits] r19959 - in short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott: . utils

brad at geodynamics.org brad at geodynamics.org
Fri Apr 20 15:21:41 PDT 2012


Author: brad
Date: 2012-04-20 15:21:41 -0700 (Fri, 20 Apr 2012)
New Revision: 19959

Added:
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/creeprate.spatialdb
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip.spatialdb
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell.spatialdb
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py
Removed:
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/fault_lock20.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip_rupture_lock20.spatialdb
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell_tau0-4.spatialdb
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_hex8.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_hex8.sh
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_tet4.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_tet4.sh
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff.py
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_hex8_graded_20km.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_hex8_unif_20km.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_tet4_graded_20km.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_tet4_unif_20km.cfg
Modified:
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/README
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/fieldsplit.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/hex8.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_elastic.spatialdb
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/pylithapp.cfg
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/tet4.cfg
Log:
More cleanup of parameter files. Use simpler names (values can be overwritten in other files if adding more cases with different locking depths, etc).

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/README
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/README	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/README	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,23 +1,14 @@
 This directory contains the files necessary to run a simulation of the
-Savage and Prescott [1978] solution for a strike-slip fault in an elastic
+Savage and Prescott (1978) solution for a strike-slip fault in an elastic
 layer overlying a viscoelastic half-space. In this model, coseismic slip
 occurs at regular recurrence intervals on the upper locked part of the
 fault, while constant-velocity creep occurs on the lower part of the fault.
+
 This directory contains the files necessary to run the problem using
 PyLith, as well as a utils directory that contains Python scripts and
 .cfg files to compute the analytical solution, and to generate velocity
 results for the PyLith solutions.
 
-To run the PyLith simulation, you must first unzip the desired mesh file(s).
-Go to the meshes directory, and unzip the desired mesh(es). The geometry
-of each mesh is described in the corresponding Cubit journal file (.jou
-files). To run the simulation, go to the parameters directory and run one
-of the shell scripts, or just run PyLith directly using the appropriate
-.cfg files on the command line (see the README in the parameters directory).
-Note that the problem will take quite a while to run. Once the problem has
-finished running, there will be a number of .vtk files in a subdirectory of
-the results directory, which may be viewed with a package such as ParaView.
-
 There are several scripts in the utils directory to aid the process of
 comparing analytical and numerical results. Look at the README in the utils
 directory.
@@ -28,15 +19,10 @@
 solution requires several earthquake cycles to reach this state. For direct
 comparison, you can either reference all results to the displacement field
 immediately following an earthquake, or you can look at velocity results.
-There are scripts in the utils directory to do the referencing as well as
-scripts to compute velocity results. See the README in the utils directory
-for details.
 
 The most accurate comparison between analytical and numerical results is to
 compare the displacements referenced to the displacements at a particular
 time (e.g., the first time step following an earthquake). This is because
 the analytical velocity results are computed exactly, while for the PyLith
 results we approximate velocities by differencing displacements over a time
-step. There is a script in the figures directory to create plots comparing
-the analytical and numerical displacement results. See the README in that
-directory for details.
+step. 

Added: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/creeprate.spatialdb
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/creeprate.spatialdb	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/creeprate.spatialdb	2012-04-20 22:21:41 UTC (rev 19959)
@@ -0,0 +1,36 @@
+// -*- C++ -*- (syntax highlighting)
+//
+// This spatial database specifies the distribution of slip rate on
+// the fault surface for a constant slip rate time function. In this
+// case we specify a uniform slip rate of -2.0 cm/year for z < -16.0 km and
+// zero slip for z >= -16.0 km. There is no reverse-slip or fault
+// opening.
+//
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 3
+  value-names =  left-lateral-slip  reverse-slip  fault-opening
+  value-units =  cm/year  cm/year  cm/year
+  num-locs = 8
+  data-dim = 1 // Values are specified along a line.
+  space-dim = 3
+  cs-data = cartesian {
+    to-meters = 1.0e+3 // Specify coordinates in km for convenience.
+    space-dim = 3
+  } // cs-data
+} // SimpleDB
+// Columns are
+// (1) x coordinate (km)
+// (2) y coordinate (km)
+// (3) z coordinate (km)
+// (4) left-lateral-slip rate (m/s) (right-lateral is negative)
+// (5) reverse-slip rate (m/s)
+// (6) fault-opening rate (m/s)
+0.0   0.0     0.00     0.00  0.0  0.0
+0.0   0.0   -19.00     0.00  0.0  0.0
+0.0   0.0   -20.00     1.00  0.0  0.0
+0.0   0.0   -21.00     2.00  0.0  0.0
+0.0   0.0   -39.00     2.00  0.0  0.0
+0.0   0.0   -40.00     2.00  0.0  0.0
+0.0   0.0   -41.00     0.00  0.0  0.0
+0.0   0.0   -1000.0    0.00  0.0  0.0

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/fault_lock20.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/fault_lock20.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/fault_lock20.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,108 +0,0 @@
-# -*- Python -*-
-[pylithapp]
-
-# This is not a self-contained simulation configuration file. This
-# file only specifies parameters specific to the time-dependent
-# interface conditions. The general parameters are specificed in the
-# pylithapp.cfg file which PyLith reads by default. Mesh information is
-# contained in hex8.cfg and tet4.cfg and solution parameters are contained
-# in asm.cfg and fieldsplit.cfg.
-
-# ----------------------------------------------------------------------
-# faults
-# ----------------------------------------------------------------------
-[pylithapp.timedependent.interfaces.fault]
-output.vertex_info_fields = [normal_dir,strike_dir,dip_dir,final_slip_creep,final_slip_one,final_slip_two,final_slip_three,final_slip_four,final_slip_five,final_slip_six,final_slip_seven,final_slip_eight,final_slip_nine,final_slip_ten,slip_time_creep,slip_time_one,slip_time_two,slip_time_three,slip_time_four,slip_time_five,slip_time_six,slip_time_seven,slip_time_eight,slip_time_nine,slip_time_ten]
-
-# Set earthquake ruptures
-eq_srcs = [creep,one,two,three,four,five,six,seven,eight,nine,ten]
-eq_srcs.creep.origin_time = 00.0*year
-eq_srcs.one.origin_time = 200.0*year
-eq_srcs.two.origin_time = 400.0*year
-eq_srcs.three.origin_time = 600.0*year
-eq_srcs.four.origin_time = 800.0*year
-eq_srcs.five.origin_time = 1000.0*year
-eq_srcs.six.origin_time = 1200.0*year
-eq_srcs.seven.origin_time = 1400.0*year
-eq_srcs.eight.origin_time = 1600.0*year
-eq_srcs.nine.origin_time = 1800.0*year
-eq_srcs.ten.origin_time = 2000.0*year
-
-# one
-[pylithapp.timedependent.interfaces.fault.eq_srcs.one.slip_function]
-slip.label = Slip for rupture source 1
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 1
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# two
-[pylithapp.timedependent.interfaces.fault.eq_srcs.two.slip_function]
-slip.label = Slip for rupture source 2
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 2
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# three
-[pylithapp.timedependent.interfaces.fault.eq_srcs.three.slip_function]
-slip.label = Slip for rupture source 3
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 3
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# four
-[pylithapp.timedependent.interfaces.fault.eq_srcs.four.slip_function]
-slip.label = Slip for rupture source 4
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 4
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# five
-[pylithapp.timedependent.interfaces.fault.eq_srcs.five.slip_function]
-slip.label = Slip for rupture source 5
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 5
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# six
-[pylithapp.timedependent.interfaces.fault.eq_srcs.six.slip_function]
-slip.label = Slip for rupture source 6
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 6
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# seven
-[pylithapp.timedependent.interfaces.fault.eq_srcs.seven.slip_function]
-slip.label = Slip for rupture source 7
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 7
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# eight
-[pylithapp.timedependent.interfaces.fault.eq_srcs.eight.slip_function]
-slip.label = Slip for rupture source 8
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 8
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# nine
-[pylithapp.timedependent.interfaces.fault.eq_srcs.nine.slip_function]
-slip.label = Slip for rupture source 9
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 9
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# ten
-[pylithapp.timedependent.interfaces.fault.eq_srcs.ten.slip_function]
-slip.label = Slip for rupture source 10
-slip.iohandler.filename = finalslip_rupture_lock20.spatialdb
-slip_time.label = Slip time for rupture source 10
-slip_time.iohandler.filename = sliptime.spatialdb
-
-# creep
-[pylithapp.timedependent.interfaces.fault.eq_srcs.creep]
-slip_function = pylith.faults.ConstRateSlipFn
-origin_time = 0.0*s
-slip_function.slip_rate.label = Slip rate for creep slip function
-slip_function.slip_rate.iohandler.filename = sliprate_creep_lock20.spatialdb
-slip_function.slip_time.label = Slip time for creep slip function
-slip_function.slip_time.iohandler.filename = sliptime.spatialdb

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/fieldsplit.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/fieldsplit.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/fieldsplit.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,15 +1,13 @@
-# -*- Python -*-
 [pylithapp]
-# nodes = 4
 
-# Field split
+# AMG with custom fault block PC
 [pylithapp.timedependent.formulation]
 split_fields = True
 use_custom_constraint_pc = True
 matrix_type = aij
 
 [pylithapp.petsc]
-ksp_gmres_restart = 500
+ksp_gmres_restart = 100
 fs_pc_type = fieldsplit
 fs_pc_fieldsplit_real_diagonal = True
 fs_pc_fieldsplit_type = multiplicative

Copied: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip.spatialdb (from rev 19957, short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip_rupture_lock20.spatialdb)
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip.spatialdb	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip.spatialdb	2012-04-20 22:21:41 UTC (rev 19959)
@@ -0,0 +1,32 @@
+// -*- C++ -*- (syntax highlighting)
+//
+// This spatial database specifies the distribution of slip on the
+// fault surface. We apply 4.0 m of left-lateral slip, corresponding to
+// the accumulated slip deficit assuming a slip rate of 2 cm/yr over
+// 200 years. This slip is applied from the surface down to z = -20 km.
+//
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 3
+  value-names =  left-lateral-slip  reverse-slip  fault-opening
+  value-units =  m  m  m
+  num-locs = 5
+  data-dim = 1 // Data is specified along a line.
+  space-dim = 3
+  cs-data = cartesian {
+    to-meters = 1.0e+3 // Specify coordinates in km for convenience.
+    space-dim = 3
+  } // cs-data
+} // SimpleDB
+// Columns are
+// (1) x coordinate (km)
+// (2) y coordinate (km)
+// (3) z coordinate (km)
+// (4) left-lateral-slip (m) (right-lateral is negative)
+// (5) reverse-slip (m)
+// (6) fault-opening (m)
+0.0  0.0   0.00     4.0  0.0  0.0
+0.0  0.0  -19.00    4.0  0.0  0.0
+0.0  0.0  -20.00    2.0  0.0  0.0
+0.0  0.0  -21.00    0.0  0.0  0.0
+0.0  0.0  -1000.0   0.0  0.0  0.0

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip_rupture_lock20.spatialdb
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip_rupture_lock20.spatialdb	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/finalslip_rupture_lock20.spatialdb	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,32 +0,0 @@
-// -*- C++ -*- (tell Emacs to use C++ mode for syntax highlighting)
-//
-// This spatial database specifies the distribution of slip on the
-// fault surface. We apply 4.0 m of left-lateral slip, corresponding to
-// the accumulated slip deficit assuming a slip rate of 2 cm/yr over
-// 200 years. This slip is applied from the surface down to z = -20 km.
-//
-#SPATIAL.ascii 1
-SimpleDB {
-  num-values = 3
-  value-names =  left-lateral-slip  reverse-slip  fault-opening
-  value-units =  m  m  m
-  num-locs = 5
-  data-dim = 1 // Data is specified along a line.
-  space-dim = 3
-  cs-data = cartesian {
-    to-meters = 1.0e+3 // Specify coordinates in km for convenience.
-    space-dim = 3
-  } // cs-data
-} // SimpleDB
-// Columns are
-// (1) x coordinate (km)
-// (2) y coordinate (km)
-// (3) z coordinate (km)
-// (4) left-lateral-slip (m) (right-lateral is negative)
-// (5) reverse-slip (m)
-// (6) fault-opening (m)
-0.0  0.0   0.00     4.0  0.0  0.0
-0.0  0.0  -19.00    4.0  0.0  0.0
-0.0  0.0  -20.00    2.0  0.0  0.0
-0.0  0.0  -21.00    0.0  0.0  0.0
-0.0  0.0  -1000.0   0.0  0.0  0.0

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/hex8.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/hex8.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/hex8.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,17 +1,9 @@
-# -*- Python -*-
 [pylithapp]
 
-# This is not a self-contained simulation configuration file. This
-# file only specifies parameters specific to the mesh used.
-# The general parameters are specificed in the pylithapp.cfg file which
-# PyLith reads by default. Information controlling time-dependent fault
-# behavior is contained in the files fault_lock20.cfg and fault_lock40.cfg.
-
 # ----------------------------------------------------------------------
 # mesh_generator
 # ----------------------------------------------------------------------
 [pylithapp.mesh_generator.reader]
-# Set filename of mesh to import.
 filename = meshes/hex8_refined_20km.exo
 
 # ----------------------------------------------------------------------
@@ -29,3 +21,24 @@
 [pylithapp.timedependent.interfaces.fault]
 quadrature.cell = pylith.feassemble.FIATLagrange
 quadrature.cell.dimension = 2
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+[pylithapp.problem.formulation.output.domain]
+writer.filename = output/hex8.h5
+
+[pylithapp.problem.formulation.output.subdomain]
+writer.filename = output/hex8-groundsurf.h5
+
+[pylithapp.timedependent.interfaces.fault.output]
+writer.filename = output/hex8-fault.h5
+
+[pylithapp.timedependent.materials.elastic.output]
+writer.filename = output/hex8-elastic.h5
+
+[pylithapp.timedependent.materials.maxwell.output]
+writer.filename = output/hex8-maxwell.h5
+
+
+# End of file

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_elastic.spatialdb
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_elastic.spatialdb	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_elastic.spatialdb	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,4 +1,4 @@
-// -*- C++ -*- (tell Emacs to use C++ mode for syntax highlighting)
+// -*- C++ -*- (syntax highlighting)
 //
 // This spatial database specifies the distribution of material
 // properties. In this case, the material properties are uniform.

Copied: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell.spatialdb (from rev 19957, short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell_tau0-4.spatialdb)
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell.spatialdb	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell.spatialdb	2012-04-20 22:21:41 UTC (rev 19959)
@@ -0,0 +1,30 @@
+// -*- C++ -*- (syntax highlighting)
+//
+// This spatial database specifies the distribution of material
+// properties. In this case, the material properties are uniform.
+// The properties here correspond to lambda = mu = 30 GPa, and a viscosity
+// that provides a relaxation time (2 * vis/mu) of 50 years. This
+// corresponds to a value of tau0 (recurrence_time/relaxation_time) of 4.
+//
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 4 // number of material property values
+  value-names =  density vs vp viscosity // names of the material property values
+  value-units =  kg/m**3  m/s  m/s Pa*s
+  num-locs = 1 // number of locations
+  data-dim = 0
+  space-dim = 3
+  cs-data = cartesian {
+    to-meters = 1.0
+    space-dim = 3
+  }
+}
+// Columns are
+// (1) x coordinate (m)
+// (2) y coordinate (m)
+// (3) z coordinate (m)
+// (4) density (kg/m**3)
+// (5) vs (m/s)
+// (6) vp (m/s)
+// (7) viscosity (Pa*s)
+0.0  0.0  0.0   2700.0  3333.333333333333  5773.502691896258 2.36682e+19

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell_tau0-4.spatialdb
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell_tau0-4.spatialdb	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/mat_maxwell_tau0-4.spatialdb	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,30 +0,0 @@
-// -*- C++ -*- (tell Emacs to use C++ mode for syntax highlighting)
-//
-// This spatial database specifies the distribution of material
-// properties. In this case, the material properties are uniform.
-// The properties here correspond to lambda = mu = 30 GPa, and a viscosity
-// that provides a relaxation time (2 * vis/mu) of 50 years. This
-// corresponds to a value of tau0 (recurrence_time/relaxation_time) of 4.
-//
-#SPATIAL.ascii 1
-SimpleDB {
-  num-values = 4 // number of material property values
-  value-names =  density vs vp viscosity // names of the material property values
-  value-units =  kg/m**3  m/s  m/s Pa*s
-  num-locs = 1 // number of locations
-  data-dim = 0
-  space-dim = 3
-  cs-data = cartesian {
-    to-meters = 1.0
-    space-dim = 3
-  }
-}
-// Columns are
-// (1) x coordinate (m)
-// (2) y coordinate (m)
-// (3) z coordinate (m)
-// (4) density (kg/m**3)
-// (5) vs (m/s)
-// (6) vp (m/s)
-// (7) viscosity (Pa*s)
-0.0  0.0  0.0   2700.0  3333.333333333333  5773.502691896258 2.36682e+19

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/pylithapp.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/pylithapp.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/pylithapp.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,12 +1,5 @@
-# -*- Python -*-
 [pylithapp]
 
-# This file contains the problem parameters common to all the examples,
-# and is read automatically.  To run a specific example, it is also
-# necessary to specify the file describing the mesh, the file describing
-# the time-dependent fault behavior, the file describing the solution
-# parameters, and the problem-specific file.
-
 # ----------------------------------------------------------------------
 # journal
 # ----------------------------------------------------------------------
@@ -18,24 +11,20 @@
 solverlinear = 1
 meshimporter = 1
 meshiocubit = 1
-meshiolagrit = 1
-gmvfile = 1
-psetfile = 1
 implicitelasticity = 1
 faultcohesivekin = 1
 #quadrature3d = 1
 #fiatlagrange = 1
 
 [pylithapp.journal.debug]
-# pylithapp = 1
-# problem = 1
-# implicit = 1
+#pylithapp = 1
+#problem = 1
+#implicit = 1
 
 # ----------------------------------------------------------------------
 # mesh_generator
 # ----------------------------------------------------------------------
 [pylithapp.mesh_generator]
-# Change the mesh reader to the CUBIT reader.
 reader = pylith.meshio.MeshIOCubit
 reorder_mesh = true
 
@@ -45,43 +34,25 @@
 # ----------------------------------------------------------------------
 # problem
 # ----------------------------------------------------------------------
-[pylithapp.timedependent]
-bc = [x_pos,x_neg,z_neg,y_pos,y_neg]
-
-interfaces = [fault]
-
-[pylithapp.timedependent.implicit]
-# We will output the solution over the domain and the ground surface.
-output = [domain,subdomain]
-
-# Set subdomain component to OutputSolnSubset (subset of domain).
-output.subdomain = pylith.meshio.OutputSolnSubset
-
-# ----------------------------------------------------------------------
-# time stepping
-# ----------------------------------------------------------------------
 [pylithapp.timedependent.formulation.time_step]
-# Define the total time for the simulation and the default time step size.
-total_time = 2000.0*year ; total time of simulation
-dt = 5.0*year ; time step
+total_time = 2000.0*year
+dt = 5.0*year
 
 # ----------------------------------------------------------------------
 # materials
 # ----------------------------------------------------------------------
 [pylithapp.timedependent]
-# Set materials to an array of 2 materials:
-#   'elastic' and 'maxwell'
 materials = [elastic,maxwell]
 materials.maxwell = pylith.materials.MaxwellIsotropic3D
 
 [pylithapp.timedependent.materials.elastic]
-label = Upper elastic layer
+label = Elastic layer
 id = 1
 db_properties.iohandler.filename = mat_elastic.spatialdb
 db_properties.label = Elastic material properties
 
 [pylithapp.timedependent.materials.maxwell]
-label = Lower Maxwell material
+label = Maxwell material
 id = 2
 db_properties.iohandler.filename = mat_maxwell_tau0-4.spatialdb
 db_properties.label = Viscoelastic material properties yielding tau0=4
@@ -91,40 +62,33 @@
 # ----------------------------------------------------------------------
 # boundary conditions
 # ----------------------------------------------------------------------
+[pylithapp.timedependent]
+bc = [x_pos,x_neg,z_neg,y_pos,y_neg]
+
 [pylithapp.timedependent.bc.x_pos]
 bc_dof = [0, 1]
 label = face_xpos
 db_initial.label = Dirichlet BC on +x
-# We change spatial database for the rate of change from FixedDOFDB
-# (which has zero velocity) to UniformDB (which allows nonzero
-# velocities).
 db_rate = spatialdata.spatialdb.UniformDB
 db_rate.label = Dirichlet rate BC on +x
 db_rate.values = [displacement-rate-x,displacement-rate-y,rate-start-time]
-# Apply a rate of +1 cm/year.
 db_rate.data = [0.0*cm/year,1.0*cm/year,0.0*year]
 
 [pylithapp.timedependent.bc.x_neg]
 bc_dof = [0, 1]
 label = face_xneg
 db_initial.label = Dirichlet BC on -x
-# We change spatial database for the rate of change from FixedDOFDB
-# (which has zero velocity) to UniformDB (which allows nonzero
-# velocities).
 db_rate = spatialdata.spatialdb.UniformDB
 db_rate.label = Dirichlet rate BC on -x
 db_rate.values = [displacement-rate-x,displacement-rate-y,rate-start-time]
-# Apply a rate of -1 cm/year.
 db_rate.data = [0.0*cm/year,-1.0*cm/year,0.0*year]
 
-# Fix z-displacements on bottom boundary.
 [pylithapp.timedependent.bc.z_neg]
 bc_dof = [2]
 label = face_zneg
 db_initial.label = Dirichlet BC on -z
 
-# Fix x-displacements on y-boundaries to prevent movement perpendicular to
-# the fault.
+# Dirichlet BC enforcing symmetry
 [pylithapp.timedependent.bc.y_pos]
 bc_dof = [0]
 label = face_ypos_nofault
@@ -138,34 +102,135 @@
 # ----------------------------------------------------------------------
 # faults
 # ----------------------------------------------------------------------
-# Set the parameters for the fault interface conditions.
+[pylithapp.timedependent]
+interfaces = [fault]
+
 [pylithapp.timedependent.interfaces.fault]
 label = fault
 
+# Add info for first two ruptures to double-check parameters.
+output.vertex_info_fields = [normal_dir,strike_dir,dip_dir,final_slip_creep,final_slip_one,final_slip_two,slip_time_creep,slip_time_one,slip_time_two]
+
+# Set earthquake ruptures
+eq_srcs = [creep,one,two,three,four,five,six,seven,eight,nine,ten]
+eq_srcs.creep.origin_time = 0.0*year
+eq_srcs.one.origin_time = 200.0*year
+eq_srcs.two.origin_time = 400.0*year
+eq_srcs.three.origin_time = 600.0*year
+eq_srcs.four.origin_time = 800.0*year
+eq_srcs.five.origin_time = 1000.0*year
+eq_srcs.six.origin_time = 1200.0*year
+eq_srcs.seven.origin_time = 1400.0*year
+eq_srcs.eight.origin_time = 1600.0*year
+eq_srcs.nine.origin_time = 1800.0*year
+eq_srcs.ten.origin_time = 2000.0*year
+
+# one
+[pylithapp.timedependent.interfaces.fault.eq_srcs.one.slip_function]
+slip.label = Slip for rupture source 1
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 1
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# two
+[pylithapp.timedependent.interfaces.fault.eq_srcs.two.slip_function]
+slip.label = Slip for rupture source 2
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 2
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# three
+[pylithapp.timedependent.interfaces.fault.eq_srcs.three.slip_function]
+slip.label = Slip for rupture source 3
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 3
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# four
+[pylithapp.timedependent.interfaces.fault.eq_srcs.four.slip_function]
+slip.label = Slip for rupture source 4
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 4
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# five
+[pylithapp.timedependent.interfaces.fault.eq_srcs.five.slip_function]
+slip.label = Slip for rupture source 5
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 5
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# six
+[pylithapp.timedependent.interfaces.fault.eq_srcs.six.slip_function]
+slip.label = Slip for rupture source 6
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 6
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# seven
+[pylithapp.timedependent.interfaces.fault.eq_srcs.seven.slip_function]
+slip.label = Slip for rupture source 7
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 7
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# eight
+[pylithapp.timedependent.interfaces.fault.eq_srcs.eight.slip_function]
+slip.label = Slip for rupture source 8
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 8
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# nine
+[pylithapp.timedependent.interfaces.fault.eq_srcs.nine.slip_function]
+slip.label = Slip for rupture source 9
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 9
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# ten
+[pylithapp.timedependent.interfaces.fault.eq_srcs.ten.slip_function]
+slip.label = Slip for rupture source 10
+slip.iohandler.filename = finalslip_lock20.spatialdb
+slip_time.label = Slip time for rupture source 10
+slip_time.iohandler.filename = sliptime.spatialdb
+
+# creep
+[pylithapp.timedependent.interfaces.fault.eq_srcs.creep]
+slip_function = pylith.faults.ConstRateSlipFn
+origin_time = 0.0*s
+slip_function.slip_rate.label = Slip rate for creep slip function
+slip_function.slip_rate.iohandler.filename = creeprate_lock20.spatialdb
+slip_function.slip_time.label = Slip time for creep slip function
+slip_function.slip_time.iohandler.filename = sliptime.spatialdb
+
 # ----------------------------------------------------------------------
 # output
 # ----------------------------------------------------------------------
-# Give basename for VTK domain output of solution over domain.
+[pylithapp.timedependent.implicit]
+output = [domain,subdomain]
+
+# Set subdomain component to OutputSolnSubset (subset of domain).
+output.subdomain = pylith.meshio.OutputSolnSubset
+
+
 [pylithapp.problem.formulation.output.domain]
 output_freq = time_step
 time_step = 50*year
 writer = pylith.meshio.DataWriterHDF5Mesh
 
-# Give basename for VTK domain output of solution over ground surface.
 [pylithapp.problem.formulation.output.subdomain]
-label = face_zpos ; nodeset for subdomain
+label = face_zpos
 vertex_data_fields = [displacement,velocity]
 output_freq = time_step
 time_step = 10*year
 writer = pylith.meshio.DataWriterHDF5SubMesh
 
-# Give basename for vtk fault rupture output.
 [pylithapp.timedependent.interfaces.fault.output]
 output_freq = time_step
 time_step = 10*year
 writer = pylith.meshio.DataWriterHDF5SubSubMesh
 
-# Give basename for VTK output of state variables.
 [pylithapp.timedependent.materials.elastic.output]
 output_freq = time_step
 time_step = 50*year
@@ -189,11 +254,10 @@
 ksp_atol = 1.0e-20
 ksp_max_it = 500
 
-ksp_monitor = true
-ksp_view = true
-ksp_converged_reason = true
+ksp_monitor = True
+ksp_converged_reason = True
+#ksp_view = True
 
 log_summary = true
-# start_in_debugger = true
 
 # End of file

Added: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py	2012-04-20 22:21:41 UTC (rev 19959)
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+#
+# Python script to facilitate running Savage and Prescott benchmark.
+
+import os
+import sys
+import subprocess
+
+if len(sys.argv) >= 3:
+    cell = sys.argv[1]
+    nprocs = int(sys.argv[2])
+    batch = None
+    if len(sys.argv) == 4:
+        batch = sys.argv[3].upper()
+else:
+    raise ValueError("usage: run_sims.py CELL NPROCS [BATCH_SYSTEM]")
+
+if not cell in ["hex8", "tet4"]:
+    raise ValueError("Cell type (%s) must be 'hex8' or 'tet4'." % cell)
+
+if not batch is None and not batch in ["PBS"]:
+    raise ValueError("Unknown batch system '%s'." % batch)
+
+for d in ["output"]:
+  if not os.path.isdir(d):
+      os.mkdir(d)
+
+args = "%s.cfg fieldsplit.cfg --nodes=%d" % (cell, nprocs)
+if batch == "PBS":
+    pbsfile = os.environ['HOME'] + "/.pyre/pylithapp/pylithapp_pbs.cfg"
+    args += " " + pbsfile + " --job.name=savageprescott_%s --job.stdout=%s.log" % (cell, cell)
+
+    if nprocs < 8:
+        ppn = nprocs
+    else:
+        ppn = 8
+    args += " --scheduler.ppn=%d" % ppn
+
+
+cmd = "pylith " + args
+print cmd
+subprocess.call(cmd, shell=True)


Property changes on: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py
___________________________________________________________________
Name: svn:executable
   + *

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_hex8.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_hex8.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_hex8.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,33 +0,0 @@
-# -*- Python -*-
-[pylithapp]
-
-# This is not a self-contained simulation configuration file. This
-# file only specifies material information and output file names for a
-# particular mesh and set of parameters.
-# The general parameters are specificed in the pylithapp.cfg file which
-# PyLith reads by default. Mesh information is contained in hex8.cfg,
-# fault slip information is contained in fault_lock20.cfg, and solution
-# parameters are contained in asm.cfg and fieldsplit.cfg.
-#
-# To run the simulation:
-# pylith hex8.cfg fault_lock20.cfg fieldsplit.cfg sp_hex8.cfg
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-# Give basename for VTK files.
-[pylithapp.problem.formulation.output.domain.writer]
-filename = output/sp_hex8/sp_hex8.h5
-
-[pylithapp.problem.formulation.output.subdomain]
-writer.filename = output/sp_hex8/sp_hex8-groundsurf.h5
-
-[pylithapp.timedependent.interfaces.fault.output.writer]
-filename = output/sp_hex8/sp_hex8-fault.h5
-
-[pylithapp.timedependent.materials.elastic.output]
-writer.filename = output/sp_hex8/sp_hex8-elastic.h5
-
-[pylithapp.timedependent.materials.maxwell.output]
-writer.filename = output/sp_hex8/sp_hex8-maxwell.h5
-

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_hex8.sh
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_hex8.sh	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_hex8.sh	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,2 +0,0 @@
-#!/bin/bash
-pylith hex8.cfg fault_lock20.cfg fieldsplit.cfg sp_hex8.cfg

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_tet4.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_tet4.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_tet4.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,32 +0,0 @@
-# -*- Python -*-
-[pylithapp]
-
-# This is not a self-contained simulation configuration file. This
-# file only specifies material information and output file names for a
-# particular mesh and set of parameters.
-# The general parameters are specificed in the pylithapp.cfg file which
-# PyLith reads by default. Mesh information is contained in tet4.cfg,
-# fault locking information is contained in fault_lockxx.cfg, and solution
-# parameters are contained in asm.cfg and fieldsplit.cfg.
-#
-# To run the simulation:
-# pylith tet4.cfg fault_lock20.cfg fieldsplit.cfg sp_tet4.cfg
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-# Give basename for VTK files.
-[pylithapp.problem.formulation.output.domain.writer]
-filename = output/sp_tet4/sp_tet4.h5
-
-[pylithapp.problem.formulation.output.subdomain]
-writer.filename = output/sp_tet4/sp_tet4-groundsurf.h5
-
-[pylithapp.timedependent.interfaces.fault.output.writer]
-filename = output/sp_tet4/sp_tet4-fault.h5
-
-[pylithapp.timedependent.materials.elastic.output]
-writer.filename = output/sp_tet4/sp_tet4-elastic.h5
-
-[pylithapp.timedependent.materials.maxwell.output]
-writer.filename = output/sp_tet4/sp_tet4-maxwell.h5

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_tet4.sh
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_tet4.sh	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/sp_tet4.sh	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,2 +0,0 @@
-#!/bin/bash
-pylith tet4.cfg fault_lock20.cfg fieldsplit.cfg sp_tet4.cfg

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/tet4.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/tet4.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/tet4.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,17 +1,11 @@
-# -*- Python -*-
 [pylithapp]
 
-# This is not a self-contained simulation configuration file. This
-# file only specifies parameters specific to the mesh used.
-# The general parameters are specificed in the pylithapp.cfg file which
-# PyLith reads by default. Information controlling time-dependent fault
-# behavior is contained in the files fault_lock20.cfg and fault_lock40.cfg.
+# This is not a self-contained simulation configuration file. 
 
 # ----------------------------------------------------------------------
 # mesh_generator
 # ----------------------------------------------------------------------
 [pylithapp.mesh_generator.reader]
-# Set filename of mesh to import.
 filename = meshes/tet4_graded_6.7km.exo
 
 # ----------------------------------------------------------------------
@@ -29,3 +23,24 @@
 [pylithapp.timedependent.interfaces.fault]
 quadrature.cell = pylith.feassemble.FIATSimplex
 quadrature.cell.shape = triangle
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+[pylithapp.problem.formulation.output.domain]
+writer.filename = output/tet4.h5
+
+[pylithapp.problem.formulation.output.subdomain]
+writer.filename = output/tet4-groundsurf.h5
+
+[pylithapp.timedependent.interfaces.fault.output]
+writer.filename = output/tet4-fault.h5
+
+[pylithapp.timedependent.materials.elastic.output]
+writer.filename = output/tet4-elastic.h5
+
+[pylithapp.timedependent.materials.maxwell.output]
+writer.filename = output/tet4-maxwell.h5
+
+
+# End of file

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,6 +0,0 @@
-# -*- Python -*-
-[vtkdiff]
-
-# Top-level info
-# Convert meters to cm, so results will be in cm/year.
-scale_factor = 100.0

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff.py	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff.py	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,304 +0,0 @@
-#!/usr/bin/env python
-#
-# ----------------------------------------------------------------------
-#
-#                           Brad T. Aagaard
-#                        U.S. Geological Survey
-#
-# <LicenseText>
-#
-# ----------------------------------------------------------------------
-#
-
-## @file postproc/vtkdiff
-
-## @brief Python application to compute the difference between fields
-## in a set of VTK files.
-
-import math
-import numpy
-from pyre.units.time import s
-
-from pyre.applications.Script import Script as Application
-
-class VtkDiff(Application):
-  """
-  Python application to compute the difference between fields in a set of VTK
-  files.
-  """
-  
-  class Inventory(Application.Inventory):
-    """
-    Python object for managing VtkDiff facilities and properties.
-    """
-
-    ## @class Inventory
-    ## Python object for managing VtkDiff facilities and properties.
-    ##
-    ## \b Properties
-    ## @li \b vtk_input_root Root filename for VTK input files.
-    ## @li \b vtk_output_root Root filename for VTK output files.
-    ## @li \b scale_factor Scale factor to apply to results.
-
-    import pyre.inventory
-
-    vtkInputRoot = pyre.inventory.str("vtk_input_root", default="input.vtk")
-    vtkInputRoot.meta['tip'] = "Root filename for VTK input files."
-
-    vtkOutputRoot = pyre.inventory.str("vtk_output_root", default="output.vtk")
-    vtkOutputRoot.meta['tip'] = "Root filename for VTK output files."
-
-    scaleFactor = pyre.inventory.float("scale_factor", default=1.0)
-    scaleFactor.meta['tip'] = "Scaling factor to apply to results."
-
-
-  class TooFewFilesError(IOError):
-    """
-    Exception raised when not enough VTK input files are found.
-    """
-
-    def __init__(self, value):
-      self.value = value
-
-
-    def __str__(self):
-      return repr(self.value)
-    
-  
-  # PUBLIC METHODS /////////////////////////////////////////////////////
-
-  def __init__(self, name="vtkdiff"):
-    Application.__init__(self, name)
-    self.vtkInputList = []
-    self.numVtkInputFiles = 0
-    self.vtkInputTimes = []
-    self.timeStampWidth = 0
-
-    self.numVertsPerCell = 0
-    self.numCells = 0
-    self.numVerts = 0
-    self.spaceDim = 0
-    self.cellType = None
-    self.readMesh = False
-    return
-
-
-  def main(self):
-    # import pdb
-    # pdb.set_trace()
-    self._getFileInfo()
-    self._computeDiffs()
-    return
-
-
-  # PRIVATE METHODS ////////////////////////////////////////////////////
-
-  def _configure(self):
-    """
-    Setup members using inventory.
-    """
-    Application._configure(self)
-    import os
-    import re
-
-    # Set up info for input files
-    totalInputPath = os.path.normpath(os.path.join(os.getcwd(),
-                                                   self.inventory.vtkInputRoot))
-    self.vtkInputDir = os.path.dirname(totalInputPath)
-    baseInputName = os.path.basename(totalInputPath)
-    baseInputNameLen = len(baseInputName)
-    if baseInputName.endswith(".vtk"):
-      baseInputNameStripped = baseInputName[0:baseInputNameLen-4]
-    else:
-      baseInputNameStripped = baseInputName
-    testFind = re.search('_t[0-9]*$', baseInputNameStripped)
-    if testFind != None:
-      timeInd = baseInputNameStripped.rfind(testFind.group(0))
-      self.vtkInputRoot = baseInputNameStripped[0:timeInd]
-    else:
-      self.vtkInputRoot = baseInputNameStripped
-
-    # Set up info for output files
-    totalOutputPath = os.path.normpath(os.path.join(
-      os.getcwd(), self.inventory.vtkOutputRoot))
-    self.vtkOutputDir = os.path.dirname(totalOutputPath)
-    baseOutputName = os.path.basename(totalOutputPath)
-    baseOutputNameLen = len(baseOutputName)
-    if baseOutputName.endswith(".vtk"):
-      baseOutputNameStripped = baseOutputName[0:baseOutputNameLen-4]
-    else:
-      baseOutputNameStripped = baseOutputName
-    testFind = re.search('_t[0-9]*$', baseOutputNameStripped)
-    if testFind != None:
-      timeInd = baseOutputNameStripped.rfind(testFind.group(0))
-      self.vtkOutputRoot = baseOutputNameStripped[0:timeInd]
-    else:
-      self.vtkOutputRoot = baseOutputNameStripped
-
-    self.scaleFactor = self.inventory.scaleFactor
-
-    return
-
-
-  def _getFileInfo(self):
-    """
-    Find input files and set up filenames for input and output.
-    """
-    import os
-    import glob
-
-    # Create list of input files and associated times
-    fileString = self.vtkInputRoot + "_t[0-9]*.vtk"
-    searchString = os.path.join(self.vtkInputDir, fileString)
-    self.vtkInputList = glob.glob(searchString)
-    self.vtkInputList.sort()
-    self.numVtkInputFiles = len(self.vtkInputList)
-    if self.numVtkInputFiles < 2:
-      try:
-        raise TooFewFilesError(self.numVtkInputFiles)
-      except TooFewFilesError, e:
-        print 'Not enough files found for search string:  ', searchString
-        print 'Number of files found:  ', e.value
-    index1 = self.vtkInputList[0].rfind("_t")
-    index2 = self.vtkInputList[0].rfind(".vtk")
-    self.timeStampWidth = index2 - index1 - 2
-    for vtkFile in self.vtkInputList:
-      timeString = vtkFile[index1+2:index2]
-      self.vtkInputTimes.append(float(timeString))
-
-    # Create output directory if it doesn't exist
-    if not os.path.isdir(self.vtkOutputDir):
-      os.mkdir(self.vtkOutputDir)
-
-    return
-      
-
-  def _computeDiffs(self):
-    """
-    Function to loop over input files, compute differences in the fields, and
-    write the results to output files.
-    """
-    import os
-
-    # Loop over input VTK files.
-    for fileInd in range(self.numVtkInputFiles - 1):
-      timeStamp1 = self.vtkInputTimes[fileInd]
-      timeStamp2 = self.vtkInputTimes[fileInd + 1]
-      dt = (timeStamp2 - timeStamp1)/self.scaleFactor
-      # We assume that differences correspond to midpoint of the 2 time steps.
-      timeStampOut = int(0.5 * (timeStamp1 + timeStamp2))
-      timeStampOutString = repr(timeStampOut).rjust(self.timeStampWidth, '0')
-      #outputFileName = self.vtkOutputRoot + "_t" + timeStampOutString + ".vtk"
-      outputFileName = self.vtkOutputRoot + "_t" + timeStampOutString + ".vtu"
-      vtkOutputFile = os.path.join(self.vtkOutputDir, outputFileName)
-      self._diffFiles(self.vtkInputList[fileInd],
-                      self.vtkInputList[fileInd + 1],
-                      vtkOutputFile,
-                      dt)
-
-    return
-      
-
-  def _diffFiles(self, vtkFile1, vtkFile2, vtkFileOut, dt):
-    """
-    Function to compute field differences between two VTK files, divide the
-    differences by dt, and output the results to a new VTK file.
-    """
-    from enthought.mayavi.sources.vtk_file_reader import VTKFileReader
-    from enthought.tvtk.api import tvtk
-
-    # Set up input files
-    reader1 = VTKFileReader()
-    reader2 = VTKFileReader()
-    reader1.initialize(vtkFile1)
-    reader2.initialize(vtkFile2)
-    data1 = reader1.outputs[0]
-    data2 = reader2.outputs[0]
-
-    # Get vertex and cell info if it hasn't already been done
-    if not self.readMesh:
-      cellVtk = data1.get_cells()
-      self.numVertsPerCell = cellVtk._get_max_cell_size()
-      self.numCells = cellVtk.number_of_cells
-      cellArray = cellVtk.to_array()
-      self.cells = tvtk.CellArray()
-      self.cells.set_cells(self.numCells, cellArray)
-      self.vertArray = data1._get_points().to_array()
-      self.cellType = data1.get_cell_type(0)
-      (self.numVerts, self.spaceDim) = self.vertArray.shape
-      self.readMesh = True
-
-    # Set up mesh info for VTK file
-    mesh = tvtk.UnstructuredGrid(points=self.vertArray)
-    mesh.set_cells(self.cellType, self.cells)
-
-    # Get vertex fields and compute differences if the fields exist
-    vertData1 = data1._get_point_data()
-    numVertDataArrays = vertData1._get_number_of_arrays()
-    if numVertDataArrays != 0:
-      vertData2 = data2._get_point_data()
-      # This is very kludgy because I haven't yet figured out how to include
-      # multiple scalar or vector fields, and I also don't know how to put in
-      # a name for a general array (represented as a field).
-      numScalarsUsed = 0
-      numVectorsUsed = 0
-      for vertDataArray in range(numVertDataArrays):
-        array1 = vertData1.get_array(vertDataArray).to_array()
-        (numPoints, numCols) = array1.shape
-        arrayName = vertData1.get_array_name(vertDataArray) + "/dt"
-        array2 = vertData2.get_array(vertDataArray).to_array()
-        arrayOut = (array2 - array1)/dt
-        # This is wrong if we have a scalar field with 3 components
-        if (numCols == 3 and numVectorsUsed == 0):
-          mesh.point_data.vectors = arrayOut
-          mesh.point_data.vectors.name = arrayName
-          numVectorsUsed += 1
-        elif numScalarsUsed == 0:
-          mesh.point_data.scalars = arrayOut
-          mesh.point_data.scalars.name = arrayName
-          numScalarsUsed += 1
-        # Kludge to add a general array
-        else:
-          mesh.point_data.add_array(arrayOut)
-
-    # Get cell fields and compute differences if the fields exist
-    cellData1 = data1._get_cell_data()
-    numCellDataArrays = cellData1._get_number_of_arrays()
-    if numCellDataArrays != 0:
-      cellData2 = data2._get_cell_data()
-      # This is very kludgy because I haven't yet figured out how to include
-      # multiple scalar or vector fields, and I also don't know how to put in
-      # a name for a general array (represented as a field).
-      numScalarsUsed = 0
-      numVectorsUsed = 0
-      for cellDataArray in range(numCellDataArrays):
-        array1 = cellData1.get_array(cellDataArray).to_array()
-        (numPoints, numCols) = array1.shape
-        arrayName = cellData1.get_array_name(cellDataArray) + "/dt"
-        array2 = cellData2.get_array(cellDataArray).to_array()
-        arrayOut = (array2 - array1)/dt
-        # This is wrong if we have a scalar field with 3 components
-        if (numCols == 3 and numVectorsUsed == 0):
-          mesh.cell_data.vectors = arrayOut
-          mesh.cell_data.vectors.name = arrayName
-          numVectorsUsed += 1
-        elif numScalarsUsed == 0:
-          mesh.cell_data.scalars = arrayOut
-          mesh.cell_data.scalars.name = arrayName
-          numScalarsUsed += 1
-        # Kludge to add a general array
-        else:
-          mesh.cell_data.add_array(arrayOut)
-
-    # Write results to VTK file
-    #w = tvtk.UnstructuredGridWriter(file_name=vtkFileOut, input=mesh)
-    w = tvtk.XMLDataSetWriter(file_name=vtkFileOut, input=mesh)
-    w.write()
-
-    return
-# ----------------------------------------------------------------------
-if __name__ == '__main__':
-  app = VtkDiff()
-  app.run()
-
-# End of file

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_hex8_graded_20km.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_hex8_graded_20km.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_hex8_graded_20km.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,6 +0,0 @@
-# -*- Python -*-
-[vtkdiff]
-
-# Top-level info
-vtk_input_root = ../results/spbm_hex8_graded_20km/spbm_hex8_graded_20km-groundsurf
-vtk_output_root = ../results/spbm_hex8_graded_20km/spbm_hex8_graded_20km-groundsurf-diff

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_hex8_unif_20km.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_hex8_unif_20km.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_hex8_unif_20km.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,6 +0,0 @@
-# -*- Python -*-
-[vtkdiff]
-
-# Top-level info
-vtk_input_root = ../results/spbm_hex8_unif_20km/spbm_hex8_unif_20km-groundsurf
-vtk_output_root = ../results/spbm_hex8_unif_20km/spbm_hex8_unif_20km-groundsurf-diff

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_tet4_graded_20km.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_tet4_graded_20km.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_tet4_graded_20km.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,6 +0,0 @@
-# -*- Python -*-
-[vtkdiff]
-
-# Top-level info
-vtk_input_root = ../results/spbm_tet4_graded_20km/spbm_tet4_graded_20km-groundsurf
-vtk_output_root = ../results/spbm_tet4_graded_20km/spbm_tet4_graded_20km-groundsurf-diff

Deleted: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_tet4_unif_20km.cfg
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_tet4_unif_20km.cfg	2012-04-20 21:39:00 UTC (rev 19958)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/utils/vtkdiff_tet4_unif_20km.cfg	2012-04-20 22:21:41 UTC (rev 19959)
@@ -1,6 +0,0 @@
-# -*- Python -*-
-[vtkdiff]
-
-# Top-level info
-vtk_input_root = ../results/spbm_tet4_unif_20km/spbm_tet4_unif_20km-groundsurf
-vtk_output_root = ../results/spbm_tet4_unif_20km/spbm_tet4_unif_20km-groundsurf-diff



More information about the CIG-COMMITS mailing list