[cig-commits] r17043 - in short/3D/PyLith/branches/pylith-scecdynrup: . doc/userguide/governingeqns doc/userguide/tutorials/3dhex8 doc/userguide/tutorials/3dhex8/friction doc/userguide/tutorials/3dhex8/gravity doc/userguide/tutorials/3dhex8/quasistatic doc/userguide/tutorials/3dhex8/static doc/userguide/tutorials/3dtet4 doc/userguide/tutorials/shearwave examples/3d/hex8 examples/3d/hex8/spatialdb examples/3d/tet4 examples/greensfns/hex8 examples/meshing/surface_nurbs examples/meshing/surface_nurbs/dem libsrc libsrc/faults libsrc/friction libsrc/topology modulesrc/friction playpen/postproc pylith pylith/faults pylith/friction pylith/meshio unittests/libtests/friction unittests/libtests/friction/data unittests/libtests/materials unittests/libtests/materials/data unittests/pytests/friction

brad at geodynamics.org brad at geodynamics.org
Wed Jul 14 08:21:24 PDT 2010


Author: brad
Date: 2010-07-14 08:21:24 -0700 (Wed, 14 Jul 2010)
New Revision: 17043

Added:
   short/3D/PyLith/branches/pylith-scecdynrup/examples/greensfns/hex8/gfgen.py
   short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/triangles/
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.hh
   short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i
   short/3D/PyLith/branches/pylith-scecdynrup/playpen/postproc/princaxes.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/playpen/postproc/princaxes.py
   short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/TimeWeakening.py
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestTimeWeakening.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestTimeWeakening.hh
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.hh
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/TestTimeWeakening.py
Modified:
   short/3D/PyLith/branches/pylith-scecdynrup/TODO
   short/3D/PyLith/branches/pylith-scecdynrup/configure.ac
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/governingeqns/governingeqns.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/3dhex8.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/friction/friction.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/gravity/gravity.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/quasistatic/quasistatic.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/static/static.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dtet4/3dtet4.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/hex8.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/quad4.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/shearwave.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/tet4.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/tri3.lyx
   short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/spatialdb/fixeddisp_axial_shear.spatialdb
   short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step03.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step08.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/tet4/dislocation.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/Makefile.am
   short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/README
   short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/dem/README
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/Makefile.am
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.hh
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveKin.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveKin.hh
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveLagrange.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveLagrange.hh
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/Makefile.am
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/RateStateAgeing.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/SlipWeakening.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/StaticFriction.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/frictionfwd.hh
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/topology/RefineUniform.cc
   short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/Makefile.am
   short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/friction.i
   short/3D/PyLith/branches/pylith-scecdynrup/pylith/Makefile.am
   short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveDyn.py
   short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveKin.py
   short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/__init__.py
   short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultDyn.py
   short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultKin.py
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/Makefile.am
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestFrictionModel.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/SlipWeakeningData.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/TestMaterial.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DElasticData.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/PowerLaw3DElasticData.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/Makefile.am
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/testfriction.py
Log:
Merge from trunk.

Modified: short/3D/PyLith/branches/pylith-scecdynrup/TODO
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/TODO	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/TODO	2010-07-14 15:21:24 UTC (rev 17043)
@@ -2,18 +2,19 @@
 CURRENT ISSUES/PRIORITIES
 ======================================================================
 
-----------------------------------------------------------------------
-SECONDARY PRIORITIES
-----------------------------------------------------------------------
+* Uniform global refinement for tets with faults
 
-* Better preconditioning [Matt/Brad]
-
-  Need field split working for both SolverLinear and SolverNonlinear.
-
 * Output to HDF5 files.
 
-* Uniform global refinement for tets with faults
+* Reformulate solves in terms of Schur complement
 
+  + adjustSolnLumped()
+    Compute Lagrange multipliers then displacements
+  + form C as sparse matrix, use PETSc operations for computation
+    (will work parallel)
+  + Refactor friction sensitivity solve, fault preconditioner, and
+    adjustSolnLumped()
+
 * Cleanup
   + memory model
   + full-scale testing
@@ -31,10 +32,23 @@
   + Specialized elasticity integrator objects for Quad4, Hex8
     - Add for lgdeform, implicit time integration?
 
-* Testing
-  + Need full-scale test with variation in physical properties
-    within a material.
+* Lumped elasticity formulation for large deformations
 
+----------------------------------------------------------------------
+SECONDARY PRIORITIES
+----------------------------------------------------------------------
+
+* Combined kinematic and dynamic fault implementation
+
+  FaultCohesiveKinDyn
+
+  Kinematic slip in confined space/time region, otherwise governed by
+  fault constitutive model.
+
+* Better preconditioning [Matt/Brad]
+
+  Need field split working for both SolverLinear and SolverNonlinear.
+
 * utilities
   + pylith_eqsummary
     Calculate eq statistics for given slip model (VTK output).
@@ -42,18 +56,6 @@
 
 * GenMaxwellPlaneStrain (plane strain Generalize Maxwell model) [Charles]
 
-* VTKDataReaderZip (obsolete if use VTK XML files?)
-
-  Read VTK files from zipfile.
-
-  import zipfile
-  zip = zipfile.open("test.zip")
-  for filename in zip.namelist():
-    bytes = zip.read(filename)
-    reader.input_string = bytes
-    reader.update()
-    data = reader.get_output()
-
 * Lumped solver [Brad]
   + Need to finish unit tests
 
@@ -65,8 +67,6 @@
   Make fault nucleation (initial tractions) modular (allow space/time
   variation).
 
-* Lumped elasticity formulation for large deformations
-
 * Manual
 
   Are material models consistent with governing equations discussion?
@@ -112,9 +112,6 @@
       problems C++, SWIG
       topology C++, SWIG
 
-1. Savage-Presscott benchmark
-    Tet mesh
-
 2. Analytic BC for reverse-slip benchmark [Charles or Brad]
     a. Create BC for CUBIT mesh.
     b. Create BC for LaGriT mesh.
@@ -215,8 +212,6 @@
 RELEASE 1.5
 ----------------------------------------------------------------------
 
-2. 2-D Plane strain Maxwell viscoelastic rheology [Charles]
-
 3. 2-D Plane strain Generalized Maxwell viscoelastic rheology [Charles]
 
 4. 2-D Power-law rheology [Charles]
@@ -235,11 +230,6 @@
 7. Body forces? [Charles is going to discuss this with Brad Hager to
 see if this will satisfy their needs]
 
-Modularize output? [Matt]
-
-Uniform refinement (debug, check, all cell types)
-
-
 ======================================================================
 KNOWN DEFICIENCIES
 ======================================================================
@@ -309,12 +299,8 @@
      Interpolate solution to desired location
      Solution field (time history)
 
-  3. Output velocity field
-
   4. Uniform global refinement
 
-  5. Drucker-Prager viscoelastoplastic
-
   6. FaultCohesiveTract (dikes)
 
 ----------------------------------------------------------------------

Modified: short/3D/PyLith/branches/pylith-scecdynrup/configure.ac
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/configure.ac	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/configure.ac	2010-07-14 15:21:24 UTC (rev 17043)
@@ -336,6 +336,7 @@
 		examples/meshing/surface_nurbs/dem/Makefile
 		examples/meshing/surface_nurbs/dem/ulines/Makefile
 		examples/meshing/surface_nurbs/dem/vlines/Makefile
+		examples/meshing/surface_nurbs/triangles/Makefile
 		templates/Makefile
 		share/Makefile
 		])

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/governingeqns/governingeqns.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/governingeqns/governingeqns.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/governingeqns/governingeqns.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1537,7 +1537,7 @@
  The Green-Lagrange strain provides a measure of the strain relative to
  the original, undeformed configuration.
 \begin_inset Formula \begin{gather}
-\varepsilon_{ij}=\frac{1}{2}(u_{i,j}+u_{j,i}+u_{k,i}u_{k,i}),\text{ or}\\
+\varepsilon_{ij}=\frac{1}{2}(u_{i,j}+u_{j,i}+u_{k,i}u_{k,j}),\text{ or}\\
 \varepsilon_{ij}=X_{ji}X_{ij}-\delta_{ij},\text{ where}\\
 X_{ij}=x_{i,j}(t)=\frac{\partial}{\partial x_{j}}(x_{i}(0)+u_{i}(t)),\end{gather}
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/3dhex8.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/3dhex8.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/3dhex8.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -56,7 +56,7 @@
 
 \end_inset
 
-Tutorial Using Hexahedral Mesh Created by CUBIT
+Tutorials Using Hexahedral Mesh Created by CUBIT
 \end_layout
 
 \begin_layout Standard
@@ -173,7 +173,7 @@
 
 \begin_layout Standard
 This tutorial is meant to demonstrate most of the important features of
- PyLith as a quasi-static finite element code, using a sequence of example
+ PyLith as a quasi-static finite-element code, using a sequence of example
  problems.
  All problems use the same 3D hexahedral mesh generated using the CUBIT
  
@@ -195,17 +195,17 @@
  The tutorial demonstrates the usage of the CUBIT mesh generation package
  to create a mesh, as well as describing how to use a CUBIT-generated mesh
  in PyLith.
- Following the discussion of how to generate the mesh, there is a discussion
- of the 
+ Following the discussion of how to generate the mesh, we discuss the 
 \family typewriter
 pylithapp.cfg
 \family default
  file, which contains information common to all the simulations.
- The tutorial is then subdivided into four sections, each pertaining to
- a particular set of PyLith features.
- It is suggested that users go through each of these sections in order as
- the complexity increases at each step.
- All of the files to run the examples are contained in the directory 
+ We group the examples into four sections, each pertaining to a particular
+ set of PyLith features.
+ We suggest users go through each of these sections in order as the complexity
+ increases at each step.
+ All of the files necessary to run the examples are contained in the directory
+ 
 \family typewriter
 examples/3d/hex8
 \family default
@@ -226,8 +226,7 @@
 
 ).
  Although it would be possible to generate this mesh by hand, it is much
- simpler to use a mesh generation package, and we use the CUBIT mesh generation
- package for this example.
+ simpler to use a mesh generation package, and we use CUBIT for this example.
  We provide documented journal files in 
 \family typewriter
 examples/3d/hex8/mesh.
@@ -402,7 +401,7 @@
 pylithapp.cfg
 \family default
 .
- Since these examples use CUBIT format, in this file we set the importer
+ Since these examples use a mesh from CUBIT, in this file we set the importer
  to 
 \family typewriter
 MeshIOCubit
@@ -500,8 +499,8 @@
 \end_layout
 
 \begin_layout Standard
-The two material groups correspond to the two different colors in Figure
- 
+The two material groups correspond to the two different colored regions
+ in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:3dhex8-mesh"
@@ -509,8 +508,8 @@
 \end_inset
 
 .
- The usage of two material groups allows us to specify different material
- types or material variations for the upper crust and lower crust, if desired.
+ Using two material groups allows us to specify different material types
+ or material variations for the upper crust and lower crust, if desired.
  For now, we retain the default 
 \family typewriter
 ElasticIsotropic3D

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/friction/friction.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/friction/friction.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/friction/friction.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -56,7 +56,7 @@
 
 \end_inset
 
-Tutorial Using Hexahedral Mesh Created by CUBIT - Fault Friction Examples
+Fault Friction Examples
 \end_layout
 
 \begin_layout Standard
@@ -86,16 +86,21 @@
 \begin_layout Standard
 This set of examples provides an introduction to using fault friction in
  static and quasi-static problems with PyLith.
+ Dynamic problems with fault friction are discussed in Section 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:tutorial:shearwave:quad4"
+
+\end_inset
+
+.
  The boundary conditions are all either static or quasi-static Dirichlet
  conditions, and only elastic materials are used.
- Thus, the only aspects that were not covered in previous examples involve
- the use of fault friction.
- Note that in all the fault friction examples we apply axial (x) displacements
- on both the positive and negative x-faces to maintain a compressive normal
- stress on the fault.
+ In all the fault friction examples we apply axial (x) displacements on
+ both the positive and negative x-faces to maintain a compressive normal
+ tractions on the fault.
  Otherwise, there would be no frictional resistance.
- All of the fault friction models are nonlinear, and they therefore require
- the usage of the nonlinear solver.
+ Fault friction generates nonlinear behavior, so we use the nonlinear solver.
  All of the examples are contained in the directory 
 \family typewriter
 examples/3d/hex8
@@ -129,7 +134,7 @@
 \end_layout
 
 \begin_layout LyX-Code
-pylith stepxx.cfg
+pylith stepXX.cfg
 \end_layout
 
 \begin_layout Standard
@@ -140,7 +145,7 @@
 , and then override or augment them with the additional parameters in the
  
 \family typewriter
-stepxx.cfg
+stepXX.cfg
 \family default
  file.
  Each 
@@ -160,11 +165,10 @@
 \family typewriter
 step10.cfg
 \family default
- file describes a problem that is identical to example step01, except for
+ file defines a problem that is identical to example step01, except for
  the presence of a vertical fault with static friction.
  In this case, the applied displacements are insufficient to cause the fault
- to slip, so the solution should be identical to the results of example
- step01.
+ to slip, so the solution is identical to that in example step01.
  As in previous examples involving faults, we must first provide an array
  defining the fault interfaces:
 \end_layout
@@ -211,7 +215,7 @@
 \family typewriter
 FaultCohesiveDyn
 \family default
-, and we must also define the friction model to use:
+ and we set the friction model to use:
 \end_layout
 
 \begin_layout LyX-Code
@@ -248,7 +252,7 @@
 StaticFriction
 \family default
  model requires values for the coefficient of friction and the cohesion
- (see 
+ (see Section 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "sub:Fault-Constitutive-Models"
@@ -362,8 +366,8 @@
 \family typewriter
 step10
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step10-fault-traction-slip"
@@ -396,8 +400,7 @@
 \begin_layout Plain Layout
 Magnitude of tractions on the fault for example step10 visualized using
  ParaView.
- Vectors of fault slip are also plotted; however, since slip does not occur
- for this example they do not appear.
+ 
 \begin_inset CommandInset label
 LatexCommand label
 name "fig:step10-fault-traction-slip"
@@ -422,12 +425,7 @@
 \end_layout
 
 \begin_layout Standard
-The 
-\family typewriter
-step11.cfg
-\family default
- file describes a problem that is nearly identical to example step10, except
- that for this example we apply twice as much shear displacement, which
+In step11 we apply twice as much shear displacement as in step10, which
  is sufficient to induce slip on the fault.
  All other settings are identical.
  To change the amount of shear displacement, we change the spatial database
@@ -520,8 +518,8 @@
 \family typewriter
 step11
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step11-fault-traction-slip"
@@ -555,8 +553,11 @@
 Magnitude of tractions on the fault for example step10 visualized using
  ParaView.
  Vectors of fault slip are also plotted.
- Note that to get the proper slip orientation it is necessary to use the
- Calculator in ParaView.
+ Note that PyLith outputs slip in the fault coordinate system, so we transform
+ them to the global coordinate system using the Calculator in ParaView.
+ A more general approach involves outputing the fault coordinate system
+ information and using these fields in the Calculator.
+ 
 \begin_inset CommandInset label
 LatexCommand label
 name "fig:step11-fault-traction-slip"
@@ -751,8 +752,8 @@
 \family typewriter
 step12
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step12-displ-t200"
@@ -811,12 +812,8 @@
 \end_layout
 
 \begin_layout Standard
-The 
-\family typewriter
-step13.cfg
-\family default
- file describes a problem that is identical to example step12, except that
- we use a slip-weakening friction model rather than a static friction model.
+In this example we replace the static friction fault constitutive model
+ in step12 with a slip-weakening friction fault constitutive model.
  Fault friction is overcome at about t = 80 years, the fault slips in each
  subsequent time step.
  We again use a constant time step size of 5 years and apply the same intial
@@ -842,7 +839,7 @@
 \begin_layout Standard
 The slip-weakening constitutive model requires a static coefficient of friction,
  a dynamic coefficient of friction, a slip weakening parameter, and a cohesion
- (see 
+ (see Section 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "sub:Fault-Constitutive-Models"
@@ -911,8 +908,8 @@
 \family typewriter
 step1
 \family default
-3), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+3).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step13-displ-t200"
@@ -971,13 +968,8 @@
 \end_layout
 
 \begin_layout Standard
-The 
-\family typewriter
-step14.cfg
-\family default
- file describes a problem that is identical to example step13, except that
- we use a rate-and-state friction model with an aging law instead of a slip-weak
-ening friction model.
+In step14 we use a rate-and-state friction model with an ageing law instead
+ of a slip-weakening friction model.
  Slip begins to occur at about t = 45 years, and continues in each subsequent
  time step.
  We again use a constant time step size of 5 years and apply the same intial
@@ -1110,8 +1102,8 @@
 \family typewriter
 step1
 \family default
-4), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+4).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step14-displ-t200"

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/gravity/gravity.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/gravity/gravity.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/gravity/gravity.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -56,7 +56,7 @@
 
 \end_inset
 
-Tutorial Using Hexahedral Mesh Created by CUBIT - Gravity Examples
+Gravitational Body Force Examples
 \end_layout
 
 \begin_layout Standard
@@ -86,8 +86,7 @@
 \begin_layout Standard
 This set of examples describes a set of problems for PyLith involving gravitatio
 nal body forces.
- All of the examples are quasi-static and all of them run for a time period
- of 200 years.
+ All of the examples are quasi-static and run for a time period of 200 years.
  These examples also demonstrate the use of a generalized Maxwell viscoelastic
  material, which is used for the lower crust in all examples.
  The final example (step17) demonstrates the usage of a finite strain formulatio
@@ -117,7 +116,7 @@
 \end_layout
 
 \begin_layout LyX-Code
-pylith stepxx.cfg
+pylith stepXX.cfg
 \end_layout
 
 \begin_layout Standard
@@ -128,7 +127,7 @@
 , and then override or augment them with the additional parameters in the
  
 \family typewriter
-stepxx.cfg
+stepXX.cfg
 \family default
  file.
  Each 
@@ -148,13 +147,12 @@
 \family typewriter
 step15.cfg
 \family default
- file describes a problem with extremely simple Dirichlet boundary conditions.
+ file defines a problem with extremely simple Dirichlet boundary conditions.
  On the positive and negative x-faces, the positive and negative y-faces,
  and the negative z-face, the displacements normal to the face are set to
  zero.
- We then apply gravitational body forces.
- Since all the material in the example has the same density, for the elastic
- solution, the resultant stresses should be:
+ Because all of the materials in the example have the same density, the
+ elastic solution for loading via gravitational body forces is
 \begin_inset Formula \begin{equation}
 \sigma_{zz}=\rho gh;\:\sigma_{xx}=\sigma_{yy}=\frac{\nu\rho gh}{1-\nu}\:.\label{eq:1-1}\end{equation}
 
@@ -237,7 +235,7 @@
 \end_layout
 
 \begin_layout Standard
-We use a generalized Maxwell model for the lower crust (see 
+We use a generalized Maxwell model for the lower crust (see Section 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "sub:Formulation-for-Gen-Max"
@@ -321,8 +319,8 @@
 \family typewriter
 step15
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step15-displ-t200"
@@ -389,7 +387,7 @@
 \family typewriter
 step16.cfg
 \family default
- file describes a problem that is identical to example step15, except that
+ file defines a problem that is identical to example step15, except that
  initial stresses are used to prevent the initial large displacements due
  to 'turning on' gravity.
  Since all normal stress components are given an initial stress of 
@@ -397,7 +395,8 @@
 \end_inset
 
 , the initial stress state is lithostatic, which is an appropriate condition
- for many tectonic problems in the absence of tectonic stresses (e.g., 
+ for many tectonic problems in the absence of tectonic stresses (e.g., McGarr
+ 
 \begin_inset CommandInset citation
 LatexCommand cite
 key "McGarr:1988"
@@ -411,10 +410,9 @@
 \end_layout
 
 \begin_layout Standard
-We set the gravity field, as for example step15, and we again use adaptive
- time stepping and use a generalized Maxwell rheology for the lower crust.
- We then must provide values for the initial stress for both the upper and
- lower crust.
+We set the gravity field, as in example step15, and we again use adaptive
+ time stepping with a generalized Maxwell rheology for the lower crust.
+ We provide values for the initial stress for both the upper and lower crust.
  Since the materials have the same density, we are able to use the same
  
 \family typewriter
@@ -498,8 +496,8 @@
 \family typewriter
 step16
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step16-stress_xx-t200"
@@ -567,8 +565,8 @@
 \family typewriter
 step17.cfg
 \family default
- file describes a problem that is identical to example step15, except that
- we now use a small strain formulation (see 
+ file defines a problem that is identical to example step15, except that
+ we now use a small strain formulation (see Section 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "sec:Small-Strain-Formulation"
@@ -576,22 +574,22 @@
 \end_inset
 
 ).
- All of the problems up to this point have assumed infinitesimal (linear)
- strain, meaning that the change in shape of the domain during deformation
- is not taken into account.
+ All of the problems up to this point have assumed infinitesimal strain,
+ meaning that the change in shape of the domain during deformation is not
+ taken into account.
  In many problems it is important to consider the change in shape of the
  domain.
  This is particularly important in many problems involving gravitational
  body forces, since a change in shape of the domain results in a different
- system of forces.
+ stress field.
  By examining the stress and deformation fields for this example in comparison
  with those of example step15, we can see what effect the infinitesimal
  strain approximation has on our solution.
 \end_layout
 
 \begin_layout Standard
-We set the gravity field, as for example step15, and we again use adaptive
- time stepping and use a generalized Maxwell rheology for the lower crust.
+We set the gravity field, as in example step15 and again use adaptive time
+ stepping withs a generalized Maxwell rheology for the lower crust.
  The only change is that we change the problem formulation from the default
  
 \family typewriter
@@ -642,8 +640,8 @@
 \family typewriter
 step17
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step17-disp-t200"

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/quasistatic/quasistatic.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/quasistatic/quasistatic.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/quasistatic/quasistatic.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -56,7 +56,7 @@
 
 \end_inset
 
-Tutorial Using Hexahedral Mesh Created by CUBIT - Quasi-static Examples
+Quasi-static Examples
 \end_layout
 
 \begin_layout Standard
@@ -84,6 +84,10 @@
 \end_layout
 
 \begin_layout Itemize
+UniformDB spatial database
+\end_layout
+
+\begin_layout Itemize
 CompositeDB spatial database
 \end_layout
 
@@ -167,7 +171,7 @@
 \end_layout
 
 \begin_layout LyX-Code
-pylith stepxx.cfg
+pylith stepXX.cfg
 \end_layout
 
 \begin_layout Standard
@@ -178,7 +182,7 @@
 , and then override or augment them with the additional parameters in the
  
 \family typewriter
-stepxx.cfg
+stepXX.cfg
 \family default
  file.
  Each 
@@ -198,10 +202,10 @@
 \family typewriter
 step04.cfg
 \family default
- file describes a problem with x-displacements fixed at zero on the positive
+ file defines a problem with x-displacements fixed at zero on the positive
  and negative x-faces while velocity boundary conditions are applied in
  the y-directions on the same faces, yielding a left-lateral sense of movement.
- The bottom (minimum z) boundary is held fixed in the z-direction.
+ The bottom (negative z) boundary is held fixed in the z-direction.
  We also use a Maxwell viscoelastic material for the lower crust, and the
  simulation is run for 200 years using a constant time step size of 20 years.
  The default time stepping behavior is 
@@ -438,7 +442,7 @@
 \begin_layout Standard
 Finally, we must provide information on VTK output.
  This is slightly more complicated than the static case, because we must
- decide the frequency with which output occurs for each output type.
+ decide the frequency with which output occurs for each output manager.
  We also assign a more user-friendly format to the output file time stamp,
  and we request that the time stamp is in units of 1 year (rather than the
  default value of seconds):
@@ -555,8 +559,8 @@
 \family typewriter
 step04
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step04-displ-t200"
@@ -605,10 +609,6 @@
 
 \end_layout
 
-\begin_layout Plain Layout
-
-\end_layout
-
 \end_inset
 
 
@@ -797,8 +797,8 @@
 \family typewriter
 step05
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step05-displ-t40"
@@ -840,10 +840,6 @@
 
 \end_layout
 
-\begin_layout Plain Layout
-
-\end_layout
-
 \end_inset
 
 
@@ -859,14 +855,15 @@
 \family typewriter
 step06.cfg
 \family default
- file describes a problem with Dirichlet (displacement) boundary conditions
+ file defines a problem with Dirichlet (displacement) boundary conditions
  corresponding to zero x and y-displacements applied on the negative and
  positive x-faces and a vertical fault that includes multiple earthquake
  ruptures as well as steady fault creep.
  The upper (locked) portion of the fault has 4 m of left-lateral slip every
  200 years, while the lower (creeping) portion of the fault slips at a steady
  rate of 2 cm/year.
- The problem bears some similarity to the strike-slip fault model of 
+ The problem bears some similarity to the strike-slip fault model of Savange
+ and Prescott 
 \begin_inset CommandInset citation
 LatexCommand cite
 key "Savage:Prescott:1978"
@@ -891,9 +888,8 @@
 .
  For adaptive time stepping, we provide the maximum permissible time step
  size, along with a stability factor.
- The stability factor controls how the time step size is allowed to deviate
- from the stable time step size provided by the different materials in the
- model.
+ The stability factor controls the time step size relative to the stable
+ time step size provided by the different materials in the model.
  A 
 \family typewriter
 stability_factor
@@ -1110,7 +1106,7 @@
 \end_layout
 
 \begin_layout Standard
-Note that for all earthquake sources we provide both an 
+For all earthquake sources we provide both an 
 \family typewriter
 origin_time
 \family default
@@ -1128,8 +1124,7 @@
  (if any).
  Since there are multiple earthquake sources of different types, there are
  a number of additional fault information fields available for output.
- We therefore request that these additional fields be output to the fault
- information file:
+ We add these additional fields be output to the fault information file:
 \end_layout
 
 \begin_layout LyX-Code
@@ -1165,8 +1160,8 @@
 \family typewriter
 step06
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step06-displ-t300"
@@ -1220,15 +1215,11 @@
 \end_layout
 
 \begin_layout Standard
-The 
-\family typewriter
-step07.cfg
-\family default
- file describes a problem nearly identical to example step06.
- The only difference is that velocity boundary conditions in the positive
- and negative y-directions on the positive and negative x-faces, so that
- the external boundaries keep pace with the average fault slip.
- This problem is nearly identical to the strike-slip fault model of 
+In step07 we add velocity boundary conditions in the positive and negative
+ y-directions on the positive and negative x-faces, so that the external
+ boundaries keep pace with the average fault slip.
+ This problem is nearly identical to the strike-slip fault model of Savage
+ and Prescott 
 \begin_inset CommandInset citation
 LatexCommand cite
 key "Savage:Prescott:1978"
@@ -1332,12 +1323,13 @@
 \begin_layout Standard
 The fault definition information is identical to example step06.
  In previous examples, we have just used the default output for the domain
- and subdomain (ground surface), which just provides the displacements.
- In many cases, it is also useful to provide the velocities.
- PyLith is able to provide this information, approximating the velocities
- for the current time step as the difference between the current displacements
- and the displacements from the previous time step, divided by the time
- step size.
+ and subdomain (ground surface), which includes the displacements.
+ In many cases, it is also useful to include the velocities.
+ PyLith provides this information, computing the velocities for the current
+ time step as the difference between the current displacements and the displacem
+ents from the previous time step, divided by the time step size.
+ This is more accurate than computing the velocities from the displacement
+ field output that has been decimated in time.
  We can obtain this information by explicitly requesting it in 
 \family typewriter
 vertex_data_fields
@@ -1460,8 +1452,8 @@
 \family typewriter
 step07
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step07-displ-vel-t300"
@@ -1526,8 +1518,8 @@
 \family typewriter
 step08.cfg
 \family default
- file describes a problem that is identical to example step07, except the
- the lower crust is composed of power-law viscoelastic material.
+ file defines a problem that is identical to example step07, except the
+ the lower crust is composed of a power-law viscoelastic material.
  Since the material behavior is now nonlinear, we must use the nonlinear
  solver:
 \end_layout
@@ -1588,27 +1580,25 @@
 \end_layout
 
 \begin_layout Standard
-These settings are unused unless we are using the nonlinear solver.
+These settings are ignored unless we are using the nonlinear solver.
 \end_layout
 
 \begin_layout Standard
-When using laboratory results for power-law viscoelastic materials, the
- properties provided do not generally match those expected by PyLith (see
- 
+When setting the physical properties for the power-law material in PyLith,
+ the parameters (see Section 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "sub:Power-Law-Maxwell-Viscoelastic"
 
 \end_inset
 
-).
- A utility code, 
+) do not generally correspond to the values provided in laboratory results.
+ PyLith include a utility code, 
 \family typewriter
 powerlaw_gendb.py
 \family default
-, has been provided to simplify the process of using laboratory results
- with PyLith.
- This utility code should be installed in the same location as PyLith.
+, to simplify the process of using laboratory results with PyLith.
+ This utility code is installed in the same location as PyLith.
  An example of how to use it is in 
 \family typewriter
 examples/3d/hex8/spatialdb/powerlaw
@@ -1661,8 +1651,6 @@
 \family default
  can compute the other property.
  Default values of 1.0e-6 1/s and 1 MPa are provided.
- A spatial database must then be provided for each laboratory-derived parameter
- and for the temperature.
  In this example, the same database was used for all parameters, and a separate
  database was used to define the temperature distribution.
  In practice, the user can provide any desired thermal model to provide
@@ -1680,8 +1668,8 @@
 \end_layout
 
 \begin_layout Standard
-This will cause the code to automatically read the parameters in powerlaw_gendb.c
-fg, and the file
+This code will automatically read the parameters in powerlaw_gendb.cfg in
+ creating the file
 \begin_inset Newline newline
 \end_inset
 
@@ -1689,7 +1677,7 @@
 \family typewriter
 examples/3d/hex8/spatialdb/mat_powerlaw.spatialdb
 \family default
- will be created.
+.
 \end_layout
 
 \begin_layout Standard
@@ -1760,12 +1748,8 @@
 \end_layout
 
 \begin_layout Standard
-Each subset of properties comes from a 
-\family typewriter
-SimpleDB
-\family default
-, so we must first define the properties that come from each spatial database
- and then provide the database filename:
+We must define the properties that come from each spatial database and then
+ provide the database parameters:
 \end_layout
 
 \begin_layout LyX-Code
@@ -1866,8 +1850,8 @@
 \family typewriter
 step08
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step08-strain-displ-t150"
@@ -1933,18 +1917,13 @@
 \end_layout
 
 \begin_layout Standard
-The 
-\family typewriter
-step09.cfg
-\family default
- file describes a problem that is nearly identical to example step08, except
- the the lower crust is composed of Drucker-Prager elastoplastic material.
- As for example step08, the material behavior is nonlinear so we again use
+In this example we use a Drucker-Prager elastoplastic rheology in the lower
+ crust.
+ As in example step08, the material behavior is nonlinear so we again use
  the nonlinear solver.
- Since the material is elastoplastic, there is no inherent time-dependence,
- which means that there is no stable time step size for the material.
- Depending on the loading conditions, this may make it difficult to obtain
- convergence.
+ The material is elastoplastic, there is no inherent time-dependent response
+ and the stable time step size for the material depends on the loading condition
+s.
  To avoid this, we set the maximum time step size to 5 years rather than
  the value of 10 years used in example step08:
 \end_layout
@@ -2137,8 +2116,8 @@
 \family typewriter
 step09
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step09-strain-displ-t150"

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/static/static.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/static/static.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dhex8/static/static.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -56,7 +56,7 @@
 
 \end_inset
 
-Tutorial Using Hexahedral Mesh Created by CUBIT - Static Examples
+Static Examples
 \end_layout
 
 \begin_layout Standard
@@ -138,7 +138,7 @@
 \end_layout
 
 \begin_layout LyX-Code
-pylith stepxx.cfg
+pylith stepXX.cfg
 \end_layout
 
 \begin_layout Standard
@@ -149,15 +149,15 @@
 , and then override or augment them with the additional parameters in the
  
 \family typewriter
-stepxx.cfg
+stepXX.cfg
 \family default
  file.
  Each 
 \family typewriter
 .cfg
 \family default
- file is extensively documented, to provide detailed information on the
- various parameters.
+ file is extensively documented to provide detailed information on the various
+ parameters.
 \end_layout
 
 \begin_layout Subsubsection
@@ -169,14 +169,15 @@
 \family typewriter
 step01.cfg
 \family default
- file describes a problem with pure Dirichlet (displacement) boundary conditions
+ file defines a problem with pure Dirichlet (displacement) boundary conditions
  corresponding to compression in the x-direction and shear in the y-direction.
  The bottom (minimum z) boundary is held fixed in the z-direction.
  On the positive and negative x-faces, compressional displacements of 1
  m are applied in the x-direction and shear displacements yielding a left-latera
 l sense of shear are applied in the y-direction.
- In this example and in subsequent examples we would like to output a subset
- of the displacement solution corresponding to the ground surface.
+ In this example and in subsequent examples we would like to output the
+ displacement solution over a subset of the domain corresponding to the
+ ground surface.
  To do this, we first set the output to an array of two output managers
  as follows:
 \end_layout
@@ -199,7 +200,7 @@
 
 \begin_layout Standard
 We then define the subdomain output manager to correspond to a subset of
- the solution:
+ the domain:
 \end_layout
 
 \begin_layout LyX-Code
@@ -241,8 +242,8 @@
 \family typewriter
 bc_dof
 \family default
-), we must provide a label that describes the Cubit nodeset to which to
- apply the BC, and we must specify what type of spatial database is being
+), we must provide a the label associated with the CUBIT nodeset associated
+ with the BC, and we must specify the type of spatial database is being
  used to describe the boundary conditions.
  For the x-faces, we use a 
 \family typewriter
@@ -360,8 +361,8 @@
 \family typewriter
 step01
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step01-displ"
@@ -409,10 +410,6 @@
 
 \end_layout
 
-\begin_layout Plain Layout
-
-\end_layout
-
 \end_inset
 
 
@@ -427,11 +424,11 @@
 \family typewriter
 step02.cfg
 \family default
- file describes a problem with Dirichlet (displacement) boundary conditions
+ file defines a problem with Dirichlet (displacement) boundary conditions
  corresponding to zero x and y-displacements applied on the negative x-face
  and Neumann (traction) boundary conditions corresponding to normal compression
  and horizontal shear applied on the positive x-face.
- The bottom (minimum z) boundary is held fixed in the z-direction.
+ The bottom (negative z) boundary is held fixed in the z-direction.
  The problem is similar to example step01, except that 1 MPa of normal compressi
 on and 1 MPa of shear (in a left-lateral sense) are applied on the positive
  x-face, and the negative x-face is pinned in both the x and y-directions.
@@ -560,8 +557,8 @@
 \family typewriter
 step02
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step02-displ"
@@ -603,10 +600,6 @@
 
 \end_layout
 
-\begin_layout Plain Layout
-
-\end_layout
-
 \end_inset
 
 
@@ -745,6 +738,10 @@
 \end_layout
 
 \begin_layout LyX-Code
+slip.query_type = linear
+\end_layout
+
+\begin_layout LyX-Code
 slip_time.iohandler.filename = spatialdb/sliptime.spatialdb 
 \end_layout
 
@@ -788,8 +785,8 @@
 \family typewriter
 step03
 \family default
-), and the results may be visualized using a tool such as ParaView or mayavi2.
- Results using ParaView are shown in 
+).
+ Results using ParaView are shown in Figure 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "fig:step03-displ"

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dtet4/3dtet4.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dtet4/3dtet4.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/3dtet4/3dtet4.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.2 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -384,7 +384,7 @@
 \end_layout
 
 \begin_layout Standard
-Since these examples use LaGriT format, we set the importer to 
+Since these examples use a mesh from LaGriT, we set the importer to 
 \family typewriter
 MeshIO
 \family default

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/hex8.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/hex8.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/hex8.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -175,8 +175,8 @@
 
 \begin_layout Standard
 The simulation parameters match those in the tri3 and tet4 examples.
- As in the tet4 example, we both the longitudinal degree of freedom and
- the out-of-plane transverse degree of freedom.
+ As in the tet4 example, we fix both the longitudinal degree of freedom
+ and the out-of-plane transverse degree of freedom.
  Using eight-point quadrature permits use of a time step of 1/20 s, which
  is slightly larger than the time step of 1/30 s used in the tri3 and tet4
  simulations.
@@ -202,7 +202,7 @@
  If the problem ran correctly, you should be able to generate a figure such
  as Figure 
 \begin_inset CommandInset ref
-LatexCommand vref
+LatexCommand ref
 reference "fig:shearwave:hex8:deform"
 
 \end_inset

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/quad4.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/quad4.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/quad4.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -120,8 +120,6 @@
 \end_inset
 
 ).
- This mesh could be generated via a simple script, but it is even easier
- to generate this mesh using CUBIT.
  We provide documented CUBIT journal files in 
 \family typewriter
 examples/bar_shearwave/quad4.
@@ -228,7 +226,7 @@
  If the problem ran correctly, you should be able to generate a figure such
  as Figure 
 \begin_inset CommandInset ref
-LatexCommand vref
+LatexCommand ref
 reference "fig:shearwave:quad4:kinematic"
 
 \end_inset
@@ -289,6 +287,15 @@
 In this set of examples we replace the kinematic fault interface with the
  dynamic fault interface, resulting in fault slip controlled by a fault-constitu
 tive model.
+ See Section 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Fault-Constitutive-Models"
+
+\end_inset
+
+ for detailed information about the fault constitutive models available
+ in PyLith.
  Because this is a dynamic simulation we want the generated shear wave to
  continue to be absorbed at the ends of the bar, so we drive the fault by
  imposing initial tractions directly on the fault surface rather than through
@@ -319,7 +326,7 @@
 
 \begin_layout Standard
 The parameters specific to this example are related to the use of the static
- friction fault constitutive model (see Section ??).
+ friction fault constitutive model.
  We set the fault constitutive model via
 \end_layout
 
@@ -334,9 +341,9 @@
 \begin_layout Standard
 and use a UniformDB to set the static friction parameters.
  We use a coefficient of friction of 0.6 and no cohesion (0 MPa).
- The parameters specific to this example are in dynamic_
+ The parameters specific to this example are in 
 \family typewriter
-staticfriction.cfg
+dynamic_staticfriction.cfg
 \family default
 , so we run the problem via:
 \end_layout
@@ -363,16 +370,16 @@
  If the problem ran correctly, you should be able to generate a figure such
  as Figure 
 \begin_inset CommandInset ref
-LatexCommand vref
+LatexCommand ref
 reference "fig:shearwave:quad4:staticfriction"
 
 \end_inset
 
 , which was generated using ParaView.
- The steady-state solution is a constant slip rate of 0.08 m/s and shear
- traction of 6.0 MPa on the fault surface, a uniform shear strain of 2e-5
- in the bar with uniform, constant velocities in the y-direction of +0.04
- m/s and -0.04 m/s on the -x and +x sides of the fault, respectively.
+ The steady-state solution is a constant slip rate of 0.08 m/s, a shear traction
+ of 6.0 MPa on the fault surface, and a uniform shear strain of 2e-5 in the
+ bar with uniform, constant velocities in the y-direction of +0.04 m/s and
+ -0.04 m/s on the -x and +x sides of the fault, respectively.
 \end_layout
 
 \begin_layout Standard
@@ -466,9 +473,9 @@
 \end_layout
 
 \begin_layout Standard
-The parameters specific to this example are in dynamic_
+The parameters specific to this example are in 
 \family typewriter
-slipweakening.cfg
+dynamic_slipweakening.cfg
 \family default
 , so we run the problem via:
 \end_layout
@@ -490,7 +497,7 @@
  If the problem ran correctly, you should be able to generate a figure such
  as Figure 
 \begin_inset CommandInset ref
-LatexCommand vref
+LatexCommand ref
 reference "fig:shearwave:quad4:slipweakening"
 
 \end_inset
@@ -572,9 +579,9 @@
  We use a reference coefficient of friction of 0.6, reference slip rate of
  1.0e-6 m/s, characteristic slip distance of 0.037 m, coefficients a and b
  of 0.0125 and 0.0172, and no cohesion (0 MPa).
- The parameters specific to this example are in dynamic_
+ The parameters specific to this example are in 
 \family typewriter
-ratestateageing.cfg
+dynamic_ratestateageing.cfg
 \family default
 , so we run the problem via:
 \end_layout
@@ -596,7 +603,7 @@
  If the problem ran correctly, you should be able to generate a figure such
  as Figure 
 \begin_inset CommandInset ref
-LatexCommand vref
+LatexCommand ref
 reference "fig:shearwave:quad4:ratestateageing"
 
 \end_inset

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/shearwave.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/shearwave.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/shearwave.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -62,9 +62,9 @@
  using a kinematic fault rupture with simultaneous slip over the fault surface,
  which we place at the center of the bar.
  The discretization size is 200 m in all cases.
- The slip time histories follows the integral of Brune's far-field time
- function with slip initiating at 0.1 s, a left-lateral final slip of 1.0
- m, and a rise time of 2.0 s.
+ The slip time histories follow the integral of Brune's far-field time function
+ with slip initiating at 0.1 s, a left-lateral final slip of 1.0 m, and a
+ rise time of 2.0 s.
  The shear wave speed in the bar is 1.0 km/s, so the shear wave reaches each
  end of the bar at 4.1 s.
  Absorbing boundaries on the ends of the bar prevent significant reflections.

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/tet4.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/tet4.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/tet4.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -202,7 +202,7 @@
  If the problem ran correctly, you should be able to generate a figure such
  as Figure 
 \begin_inset CommandInset ref
-LatexCommand vref
+LatexCommand ref
 reference "fig:shearwave:tet4:deform"
 
 \end_inset

Modified: short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/tri3.lyx
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/tri3.lyx	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/doc/userguide/tutorials/shearwave/tri3.lyx	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1,4 +1,4 @@
-#LyX 1.6.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -220,7 +220,7 @@
 \end_inset
 
 .
- We simulation 12.0 s of motion with a time step of 1/30 s.
+ We simulate 12.0 s of motion with a time step of 1/30 s.
  This time step must follow the Courant–Friedrichs–Lewy condition; that
  is, the time step must be smaller than the time it takes the P wave to
  propagate across the shortest edge of a cell.
@@ -266,8 +266,8 @@
  If the problem ran correctly, you should be able to generate a figure such
  as Figure 
 \begin_inset CommandInset ref
-LatexCommand vref
-reference "fig:shearwave:tet4:deform"
+LatexCommand ref
+reference "fig:shearwave:tri3:deform"
 
 \end_inset
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/spatialdb/fixeddisp_axial_shear.spatialdb
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/spatialdb/fixeddisp_axial_shear.spatialdb	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/spatialdb/fixeddisp_axial_shear.spatialdb	2010-07-14 15:21:24 UTC (rev 17043)
@@ -4,7 +4,7 @@
 // displacement field for Dirichlet boundary conditions associated
 // with shear in the xy plane and axial displacements on -x and +x.
 //
-// dof-0: Ux(x) = 0
+// dof-0: Ux(x) = -1.0 m * x / 3 km
 // dof-1: Uy(x) = 1.0 m * x / 3 km
 // dof-2: Uz(x) = 0
 //

Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step03.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step03.cfg	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step03.cfg	2010-07-14 15:21:24 UTC (rev 17043)
@@ -101,6 +101,7 @@
 # The slip time and final slip are defined in spatial databases.
 [pylithapp.timedependent.interfaces.fault.eq_srcs.rupture.slip_function]
 slip.iohandler.filename = spatialdb/finalslip.spatialdb
+slip.query_type = linear
 slip_time.iohandler.filename = spatialdb/sliptime.spatialdb
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step08.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step08.cfg	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step08.cfg	2010-07-14 15:21:24 UTC (rev 17043)
@@ -89,6 +89,7 @@
 values_B = [reference-stress,reference-strain-rate,power-law-exponent]   ; Power-law properties.
 db_B.label = Power-law properties
 db_B.iohandler.filename = spatialdb/mat_powerlaw.spatialdb
+db_B.query_type = linear
 
 # Since there are additional properties and state variables for the
 # power-law model, we explicitly request that they be output. Properties are

Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/tet4/dislocation.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/tet4/dislocation.cfg	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/tet4/dislocation.cfg	2010-07-14 15:21:24 UTC (rev 17043)
@@ -87,8 +87,8 @@
 writer.filename = dislocation-groundsurf.vtk
 
 # Give basename for vtk fault output.
-[pylithapp.timedependent.interfaces.fault.output.writer]
-filename = dislocation-fault.vtk
+[pylithapp.timedependent.interfaces.fault.output]
+writer.filename = dislocation-fault.vtk
 
 # Give basename for VTK output of state variables.
 [pylithapp.timedependent.materials.elastic.output]

Copied: short/3D/PyLith/branches/pylith-scecdynrup/examples/greensfns/hex8/gfgen.py (from rev 17042, short/3D/PyLith/trunk/examples/greensfns/hex8/gfgen.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/greensfns/hex8/gfgen.py	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/greensfns/hex8/gfgen.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,357 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file greensfns/gfgen
+
+## @brief Python application to set up impulses for generating Green's functions
+## using PyLith. This application creates the necessary spatialdb files, a
+## metadata file describing each impulse, and a PyLith .cfg file to set up the
+## impulses.
+
+import math
+import numpy
+import os
+import re
+import glob
+from pyre.units.time import s
+
+from pyre.applications.Script import Script as Application
+
+class GfGen(Application):
+  """
+  Python application to set up impulses for generating Green's functions
+  using PyLith. This application creates the necessary spatialdb files, a
+  metadata file describing each impulse, and a PyLith .cfg file to set up the
+  impulses.
+  """
+  
+  class Inventory(Application.Inventory):
+    """
+    Python object for managing GfGen facilities and properties.
+    """
+
+    ## @class Inventory
+    ## Python object for managing GfGen facilities and properties.
+    ##
+    ## \b Properties
+    ## @li \b fault_info_file  Name of VTK file containing fault info.
+    ## @li \b spatialdb_output_root Root name for output spatialdb files.
+    ## @li \b metadata_output_file Name of output file containing metadata.
+    ## @li \b response_output_root Root name for files containing responses.
+    ## @li \b impulse_type Type of impulse to be applied.
+    ## @li \b impulse_value Amount of impulse to apply.
+    ## @li \b timestamp_width Width of timestamp field.
+    ##
+    ## \b Facilities
+    ## @li \b geometry  Geometry for output database.
+    ## @li \b iohandler  Object for writing database.
+
+    import pyre.inventory
+
+    faultInfoFile = pyre.inventory.str("fault_info_file",
+                                       default="fault_info.vtk")
+    faultInfoFile.meta['tip'] = "Name of VTK file containing fault info."
+
+    spatialdbOutputRoot = pyre.inventory.str("spatialdb_output_root",
+                                             default="impulse.spatialdb")
+    spatialdbOutputRoot.meta['tip'] = "Root name for output spatialdb files."
+
+    metadataOutputFile = pyre.inventory.str("metadata_output_file",
+                                       default="impulse_description.txt")
+    metadataOutputFile.meta['tip'] = "Name of output file containing metadata."
+
+    responseOutputRoot = pyre.inventory.str("response_output_root",
+                                            default="response.vtk")
+    responseOutputRoot.meta['tip'] = "Root name for files containing responses."
+
+    impulseType = pyre.inventory.str("impulse_type",
+                                     default="left-lateral-slip",
+                                     validator=pyre.inventory.choice([
+      "left-lateral-slip","reverse-slip","fault-opening"]))
+    impulseType.meta['tip'] = "Type of impulse to apply."
+
+    impulseValue = pyre.inventory.dimensional("impulse_value", default=1.0*m)
+    impulseValue.meta['tip'] = "Impulse value."
+
+    timestampWidth = pyre.inventory.int("timestamp_width", default=4)
+    timestampWidth.meta['tip'] = "Width of timestamp field in spatialdb files."
+
+    from spatialdata.spatialdb.generator.Geometry import Geometry
+    geometry = pyre.inventory.facility("geometry", family="geometry",
+                                       factory=Geometry)
+    geometry.meta['tip'] = "Geometry for output database."
+
+    from spatialdata.spatialdb.SimpleIOAscii import SimpleIOAscii
+    iohandler = pyre.inventory.facility("iohandler", family="simpledb_io",
+                                        factory=SimplIOAscii)
+    iohandler.meta['tip'] = "Object for writing database."
+    
+  
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="gfgen"):
+    Application.__init__(self, name)
+
+    self.numFaultVertices = 0
+    self.numFaultCells = 0
+    self.spaceDim = 0
+    self.cellType = ""
+
+    self.faultCoords = None
+    self.faultNormals = None
+    self.integratedSlip = None
+
+    return
+
+
+  def main(self):
+    # import pdb
+    # pdb.set_trace()
+    self._readFaultInfo()
+    self._makeSpatialdb()
+    self._makeConfig()
+    self._makeMetadata()
+    return
+
+
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _configure(self):
+    """
+    Setup members using inventory.
+    """
+    Application._configure(self)
+    # import pdb
+    # pdb.set_trace()
+
+    # File info.
+    self.faultInfoFile = self.inventory.faultInfoFile
+    self.spatialdbOutputRoot = self.inventory.spatialdbOutputRoot
+    self.metadataOutputFile = self.inventory.metadataOutputFile
+    self.responseOutputRoot = self.inventory.responseOutputRoot
+
+    # Impulse information
+    self.impulseType = self.inventory.impulseType
+    self.impulseValue = self.inventory.impulseValue.value
+    self.timestampWidth = self.inventory.timestampWidth
+
+    # Spatialdb output facilities
+    self.geometry = self.inventory.geometry
+    self.iohandler = self.inventory.iohandler
+
+    return
+      
+
+  def _readFaultInfo(self):
+    """
+    Function to read fault information from VTK file.
+    """
+    from enthought.mayavi.sources.vtk_file_reader import VTKFileReader
+    from enthought.tvtk.api import tvtk
+
+    reader = VTKFileReader()
+    reader.initialize(self.faultInfoFile)
+    data = reader.outputs[0]
+
+    # Get cell and vertex info.
+    cellVtk = data.get_cells()
+    self.numFaultCells = cellVtk.number_of_cells
+    self.faultCellArray = cellVtk.to_array()
+    self.faultVertices = data._get_points().to_array()
+    self.cellType = data.get_cell_type(0)
+    (self.numFaultVertices, self.spaceDim) = self.faultVertices.shape
+
+    # Get vertex fields and extract normal vectors.
+    vertData = data._get_point_data()
+    numVertDataArrays = vertData._get_number_of_arrays()
+    for vertDataArray in range(numVertDataArrays):
+      arrayName = vertData.get_array_name(vertDataArray)
+      if (arrayName == "normal_dir"):
+        self.faultNormals = vertData.get_array(vertDataArray).to_array()
+        break
+
+    return
+
+
+  def _makeSpatialdb(self):
+    """
+    Function to generate a set of spatial databases (one for each impulse).
+    """
+
+    # Create empty arrays for impulse values.
+    # Only array1 will be modified.
+    array1 = numpy.zeros( (self.numFaultVertices,), dtype=numpy.float64)
+    array2 = numpy.zeros( (self.numFaultVertices,), dtype=numpy.float64)
+
+    # Set up info for arrays that won't be modified.
+    if (self.impulseType == "left-lateral-slip"):
+      info2 = {'name': "fault-opening",
+               'units': "m",
+               'data': array2.flatten()}
+      if (self.spaceDim == 3):
+        info3 = {'name': "reverse-slip",
+                 'units': "m",
+                 'data': array2.flatten()}
+    elif (self.impulseType == "fault-opening"):
+      info2 = {'name': "left-lateral-slip",
+               'units': "m",
+               'data': array2.flatten()}
+      if (self.spaceDim == 3):
+        info3 = {'name': "reverse-slip",
+                 'units': "m",
+                 'data': array2.flatten()}
+    elif (self.impulseType == "reverse-slip"):
+      info2 = {'name': "left-lateral-slip",
+               'units': "m",
+               'data': array2.flatten()}
+      info3 = {'name': "reverse-slip",
+               'units': "m",
+               'data': array2.flatten()}
+
+    # Create root output filename.
+    suffIndex = self.spatialdbOutputRoot.rfind(".spatialdb")
+    if (suffIndex == -1):
+      outputRoot = self.spatialdbOutputRoot
+    else:
+      outputRoot = self.spatialdbOutputRoot[:suffIndex - 1]
+    
+    # Loop over impulses to generate and modify the appropriate entries.
+    for impulse in range(self.numFaultVertices):
+
+      # Set filename
+      impulseNum = int(impulse)
+      impulseString = repr(impulseNum).rjust(self.timestampWidth, '0')
+      filename = outputRoot + "_i" + impulseString + ".spatialdb"
+      self.iohandler.filename = filename
+
+      # Modify database values.
+      array1[impulse] = self.impulseValue
+      if (impulse > 0):
+        array1[impulse -1] = -self.impulseValue
+      
+      info1 = {'name': self.impulseType,
+               'units': "m",
+               'data': array1.flatten()}
+
+      # Create data and write it to a database.
+      if (self.spaceDim == 2):
+        data = {'points': self.faultVertices,
+                'coordsys': self.geometry.coordsys,
+                'data_dim': self.geometry.dataDim,
+                'values': [info1, info2]}
+      else:
+        data = {'points': self.faultVertices,
+                'coordsys': self.geometry.coordsys,
+                'data_dim': self.geometry.dataDim,
+                'values': [info1, info2, info3]}
+
+      self.iohandler.write(data)
+
+    return
+
+    
+  def _getGfGen(self):
+    """
+    Function to loop over integration points and compute principal axes for
+    each point.
+    """
+    # Create empty arrays for each principal axis and eigenvalue.
+    self.minPrincAxis = numpy.empty((self.numTensorPoints, self.spaceDim),
+                                    dtype=numpy.float64)
+    self.intPrincAxis = numpy.empty((self.numTensorPoints, self.spaceDim),
+                                    dtype=numpy.float64)
+    self.maxPrincAxis = numpy.empty((self.numTensorPoints, self.spaceDim),
+                                    dtype=numpy.float64)
+    self.minEigenValue = numpy.empty(self.numTensorPoints, dtype=numpy.float64)
+    self.intEigenValue = numpy.empty(self.numTensorPoints, dtype=numpy.float64)
+    self.maxEigenValue = numpy.empty(self.numTensorPoints, dtype=numpy.float64)
+    # Loop over integration points.
+    for point in xrange(self.numTensorPoints):
+      tensor = self.tensorSorted[point, :]
+      tensorOrdered, eigenValuesOrdered = self._compGfGen(tensor)
+      self.minPrincAxis[point,:] = tensorOrdered[0]
+      self.intPrincAxis[point,:] = tensorOrdered[1]
+      self.maxPrincAxis[point,:] = tensorOrdered[2]
+      self.minEigenValue[point] = eigenValuesOrdered[0]
+      self.intEigenValue[point] = eigenValuesOrdered[1]
+      self.maxEigenValue[point] = eigenValuesOrdered[2]
+
+    return
+  
+
+  def _compGfGen(self, tensor):
+    """
+    Function to compute 3D principal axes, sort them, and multiply by
+    corresponding eigenvalue.
+    """
+    tensorMat = numpy.array([(tensor[0], tensor[3], tensor[5]),
+                             (tensor[3], tensor[1], tensor[4]),
+                             (tensor[5], tensor[4], tensor[2])],
+                            dtype=numpy.float64)
+    (eigenValue, princAxes) = numpy.linalg.eigh(tensorMat)
+    idx = eigenValue.argsort()
+    eigenValuesOrdered = eigenValue[idx]
+    princAxesOrdered = princAxes[:,idx]
+    tensorOrdered = numpy.empty_like(princAxesOrdered)
+    tensorOrdered[0,:] = eigenValuesOrdered[0] * princAxesOrdered[0,:]
+    tensorOrdered[1,:] = eigenValuesOrdered[1] * princAxesOrdered[1,:]
+    tensorOrdered[2,:] = eigenValuesOrdered[2] * princAxesOrdered[2,:]
+    return tensorOrdered, eigenValuesOrdered
+  
+
+  def _writeVtkFile(self):
+    """
+    Function to write out vertex and cell info along with principal axes
+    computed as vectors.
+    """
+    from enthought.tvtk.api import tvtk
+
+    # Set up mesh info for VTK file.
+    mesh = tvtk.UnstructuredGrid(points=self.vertArray)
+    mesh.set_cells(self.cellType, self.cells)
+
+    # Add scalar fields.
+    minEigenName = "min_eigenvalue"
+    intEigenName = "int_eigenvalue"
+    maxEigenName = "max_eigenvalue"
+    mesh.cell_data.scalars = self.minEigenValue
+    mesh.cell_data.scalars.name = minEigenName
+    s2 = mesh.cell_data.add_array(self.intEigenValue)
+    mesh.cell_data.get_array(s2).name = intEigenName
+    s3 = mesh.cell_data.add_array(self.maxEigenValue)
+    mesh.cell_data.get_array(s3).name = maxEigenName
+    mesh.update()
+
+    # Add vector fields and write VTK file
+    minAxisName = "min_principal_axis"
+    intAxisName = "int_principal_axis"
+    maxAxisName = "max_principal_axis"
+    mesh.cell_data.vectors = self.minPrincAxis
+    mesh.cell_data.vectors.name = minAxisName
+    v2 = mesh.cell_data.add_array(self.intPrincAxis)
+    mesh.cell_data.get_array(v2).name = intAxisName
+    v3 = mesh.cell_data.add_array(self.maxPrincAxis)
+    mesh.cell_data.get_array(v3).name = maxAxisName
+    mesh.update()
+    w = tvtk.UnstructuredGridWriter(file_name=self.vtkOutputFile,
+		    input=mesh)
+    w.write()
+
+    return
+  
+
+# ----------------------------------------------------------------------
+if __name__ == '__main__':
+  app = GfGen()
+  app.run()
+
+# End of file

Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/Makefile.am	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/Makefile.am	2010-07-14 15:21:24 UTC (rev 17043)
@@ -12,7 +12,8 @@
 
 SUBDIRS = \
 	contours \
-	dem
+	dem \
+	triangles
 
 
 dist_noinst_DATA = \

Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/README
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/README	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/README	2010-07-14 15:21:24 UTC (rev 17043)
@@ -5,3 +5,6 @@
 
 dem - Example of creating a topographic surface using a grid of spline
       curves.
+
+triangles - Example of creating a NURBS surface from a triangulated
+            surface in Facets format.

Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/dem/README
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/dem/README	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/dem/README	2010-07-14 15:21:24 UTC (rev 17043)
@@ -3,7 +3,7 @@
 from a DEM. We create the surface as a net surface (see Cubit
 documentation); this requires either a mapped mesh or a set of
 intersecting lines (u-lines and v-lines). In either case, the
-intersecting lines must for a logically structured quadrilateral
+intersecting lines must form a logically structured quadrilateral
 mesh. The Python script, dem2lines.py, creates the lines and resamples
 the original data outside a specified region for which full resolution
 is desired. This is useful because using a full-resolution surface for
@@ -12,9 +12,9 @@
 The steps for creating the NURBS surface are as follows:
 
 1.  We start with a very coarse DEM of Mt. Ruapehu volcano in New
-Zealand in ASCII format. Note that the DEM must be in ASCII format and
-it must be ordered in either rows or columns. The DEM used in this
-example was produced using the GMT grd2xyz utility.
+Zealand (NZMG coordinates) in ASCII format. Note that the DEM must be in
+ASCII format and it must be ordered in either rows or columns. The DEM used
+in this example was produced using the GMT grd2xyz utility.
 
 2.  The parameters for the Python script are contained in the file
 dem2lines.cfg. In this file we specify the name of the input
@@ -34,14 +34,14 @@
 VTK file to make sure it looks OK.
 
 4.  Once you have created the u-lines and v-lines, you must create a
-journal file the Cubit can use to create the NURBS surface. Each file
+journal file that Cubit can use to create the NURBS surface. Each file
 in the ulines and vlines directories is a separate Cubit command to
 create a single spline curve. To create the desired surface, we first
 create a ulines.jou file and a vlines.jou file to execute each of
 these. We then create a mktopo.jou file that executes these two
-journal files and then creates the NURBS surface
-(ruapehu_topo.sab). You can create the surface yourself by running
-Cubit and playing back the 'mktopo.jou' file.
+journal files and then creates the NURBS surface (ruapehu_topo.sab).
+You can create the surface yourself by running Cubit and playing back the
+'mktopo.jou' file.
 
 5.  Once the surface has been created, you can import it in future
 Cubit sessions and use it just as you would any surface created within

Copied: short/3D/PyLith/branches/pylith-scecdynrup/examples/meshing/surface_nurbs/triangles (from rev 17042, short/3D/PyLith/trunk/examples/meshing/surface_nurbs/triangles)

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/Makefile.am	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/Makefile.am	2010-07-14 15:21:24 UTC (rev 17043)
@@ -84,6 +84,7 @@
 	friction/StaticFriction.cc \
 	friction/SlipWeakening.cc \
 	friction/RateStateAgeing.cc \
+	friction/TimeWeakening.cc \
 	materials/Metadata.cc \
 	materials/Material.cc \
 	materials/ElasticMaterial.cc \

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -1090,24 +1090,6 @@
 } // vertexField
 
 // ----------------------------------------------------------------------
-// Get cell field associated with integrator.
-const pylith::topology::Field<pylith::topology::SubMesh>&
-pylith::faults::FaultCohesiveDyn::cellField(const char* name,
-                                             const topology::SolutionFields* fields) { // cellField
-  // Should not reach this point if requested field was found
-  std::ostringstream msg;
-  msg << "Request for unknown cell field '" << name << "' for fault '"
-      << label() << ".";
-  throw std::runtime_error(msg.str());
-
-  // Satisfy return values
-  assert(0 != _fields);
-  const topology::Field<topology::SubMesh>& buffer = _fields->get(
-    "buffer (vector)");
-  return buffer;
-} // cellField
-
-// ----------------------------------------------------------------------
 void
 pylith::faults::FaultCohesiveDyn::_setupInitialTractions(void)
 { // _setupInitialTractions

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.hh	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.hh	2010-07-14 15:21:24 UTC (rev 17043)
@@ -125,16 +125,6 @@
   vertexField(const char* name,
 	      const topology::SolutionFields* fields =0);
 
-  /** Get cell field associated with integrator.
-   *
-   * @param name Name of cell field.
-   * @param fields Solution fields.
-   * @returns Cell field.
-   */
-  const topology::Field<topology::SubMesh>&
-  cellField(const char* name,
-	    const topology::SolutionFields* fields =0);
-
   // PRIVATE METHODS ////////////////////////////////////////////////////
 private :
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveKin.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveKin.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -245,24 +245,4 @@
   return buffer;
 } // vertexField
 
-// ----------------------------------------------------------------------
-// Get cell field associated with integrator.
-const pylith::topology::Field<pylith::topology::SubMesh>&
-pylith::faults::FaultCohesiveKin::cellField(const char* name,
-                                            const topology::SolutionFields* fields)
-{ // cellField
-  // Should not reach this point if requested field was found
-  std::ostringstream msg;
-  msg << "Request for unknown cell field '" << name << "' for fault '"
-      << label() << ".";
-  throw std::runtime_error(msg.str());
-
-  // Satisfy return values
-  assert(0 != _fields);
-  const topology::Field<topology::SubMesh>& buffer = _fields->get(
-    "buffer (vector)");
-  return buffer;
-} // cellField
-
-
 // End of file 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveKin.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveKin.hh	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveKin.hh	2010-07-14 15:21:24 UTC (rev 17043)
@@ -90,16 +90,6 @@
   vertexField(const char* name,
 	      const topology::SolutionFields* fields =0);
 
-  /** Get cell field associated with integrator.
-   *
-   * @param name Name of cell field.
-   * @param fields Solution fields.
-   * @returns Cell field.
-   */
-  const topology::Field<topology::SubMesh>&
-  cellField(const char* name,
-	    const topology::SolutionFields* fields =0);
-
   // PRIVATE TYPEDEFS ///////////////////////////////////////////////////
 private :
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveLagrange.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveLagrange.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveLagrange.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -122,6 +122,19 @@
   _quadrature->computeGeometry(*_faultMesh, cells);
 #endif
 
+  _fields->add("distribution", "distribution", pylith::topology::FieldBase::CELLS_FIELD, 1);
+  topology::Field<topology::SubMesh>& dist = _fields->get("distribution");
+  dist.allocate();
+  const ALE::Obj<RealSection>& distSection = dist.section();
+  assert(!distSection.isNull());
+  const double rank = (double) distSection->commRank();
+
+  // Loop over cells in fault mesh, compute area
+  for (SieveSubMesh::label_sequence::iterator c_iter = cellsBegin; c_iter
+      != cellsEnd; ++c_iter) {
+    distSection->updatePoint(*c_iter, &rank);
+  }
+
   // Compute orientation at vertices in fault mesh.
   _calcOrientation(upDir);
 
@@ -2203,5 +2216,28 @@
   PetscLogFlops(72);
 } // _adjustSoln3D
 
+// ----------------------------------------------------------------------
+// Get cell field associated with integrator.
+const pylith::topology::Field<pylith::topology::SubMesh>&
+pylith::faults::FaultCohesiveLagrange::cellField(const char* name,
+                                                 const topology::SolutionFields* fields)
+{ // cellField
+  if (0 == strcasecmp("distribution", name)) {
+    const topology::Field<topology::SubMesh>& dist = _fields->get("distribution");
+    return dist;
+  }
+  // Should not reach this point if requested field was found
+  std::ostringstream msg;
+  msg << "Request for unknown cell field '" << name << "' for fault '"
+      << label() << ".";
+  throw std::runtime_error(msg.str());
 
+  // Satisfy return values
+  assert(0 != _fields);
+  const topology::Field<topology::SubMesh>& buffer = _fields->get(
+    "buffer (vector)");
+  return buffer;
+} // cellField
+
+
 // End of file 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveLagrange.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveLagrange.hh	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveLagrange.hh	2010-07-14 15:21:24 UTC (rev 17043)
@@ -188,6 +188,16 @@
   virtual
   void checkConstraints(const topology::Field<topology::Mesh>& solution) const;
 
+  /** Get cell field associated with integrator.
+   *
+   * @param name Name of cell field.
+   * @param fields Solution fields.
+   * @returns Cell field.
+   */
+  const topology::Field<topology::SubMesh>&
+  cellField(const char* name,
+	    const topology::SolutionFields* fields =0);
+
   // PROTECTED STRUCTS //////////////////////////////////////////////////
 protected :
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/Makefile.am	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/Makefile.am	2010-07-14 15:21:24 UTC (rev 17043)
@@ -19,6 +19,7 @@
 	StaticFriction.hh \
 	SlipWeakening.hh \
 	RateStateAgeing.hh \
+	TimeWeakening.hh \
 	frictionfwd.hh
 
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/RateStateAgeing.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/RateStateAgeing.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/RateStateAgeing.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -143,9 +143,9 @@
   const double b = dbValues[db_b];
   const double cohesion = dbValues[db_cohesion];
  
-  if (frictionCoef <= 0.0) {
+  if (frictionCoef < 0.0) {
     std::ostringstream msg;
-    msg << "Spatial database returned nonpositive value for reference coefficient "
+    msg << "Spatial database returned negative value for reference coefficient "
 	<< "of Rate and State friction Ageing Law.\n"
 	<< "reference coefficient of friction: " << frictionCoef << "\n";
     throw std::runtime_error(msg.str());

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/SlipWeakening.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/SlipWeakening.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/SlipWeakening.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -133,17 +133,17 @@
   const double db_do = dbValues[db_d0];
   const double db_c = dbValues[db_cohesion];
 
-  if (db_static <= 0.0) {
+  if (db_static < 0.0) {
     std::ostringstream msg;
-    msg << "Spatial database returned nonpositive value for static coefficient "
+    msg << "Spatial database returned negative value for static coefficient "
 	<< "of friction.\n"
 	<< "static coefficient of friction: " << db_static << "\n";
     throw std::runtime_error(msg.str());
   } // if
 
-  if (db_dynamic <= 0.0) {
+  if (db_dynamic < 0.0) {
     std::ostringstream msg;
-    msg << "Spatial database returned nonpositive value for dynamic coefficient "
+    msg << "Spatial database returned negative value for dynamic coefficient "
 	<< "of friction.\n"
 	<< "dynamic coefficient of friction: " << db_dynamic << "\n";
     throw std::runtime_error(msg.str());
@@ -300,11 +300,16 @@
   assert(0 != numStateVars);
   assert(0 != numProperties);
 
-  const double slipPrev = stateVars[s_slipPrev];
- 
-  stateVars[s_slipPrev] = stateVars[s_slipCum];
-  stateVars[s_slipCum] += fabs(slip - slipPrev);
- 
+  if (slipRate != 0.0) {
+    const double slipPrev = stateVars[s_slipPrev];
+
+    stateVars[s_slipPrev] = stateVars[s_slipCum];
+    stateVars[s_slipCum] += fabs(slip - slipPrev);
+  } else {
+    // Sliding has stopped, so reset state variables.
+    stateVars[s_slipPrev] = slip;
+    stateVars[s_slipCum] = 0.0;
+  } // else
 } // _updateStateVars
 
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/StaticFriction.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/StaticFriction.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/StaticFriction.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -93,9 +93,9 @@
   const double coef = dbValues[db_coef];
   const double cohesion = dbValues[db_cohesion];
  
-  if (coef <= 0.0) {
+  if (coef < 0.0) {
     std::ostringstream msg;
-    msg << "Spatial database returned nonpositive value for coefficient "
+    msg << "Spatial database returned negative value for coefficient "
 	<< "of friction.\n"
 	<< "coefficient of friction: " << coef << "\n";
     throw std::runtime_error(msg.str());

Copied: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.cc (from rev 17042, short/3D/PyLith/trunk/libsrc/friction/TimeWeakening.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.cc	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,302 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TimeWeakening.hh" // implementation of object methods
+
+#include "pylith/materials/Metadata.hh" // USES Metadata
+
+#include "pylith/utils/array.hh" // USES double_array
+#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+
+#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
+
+#include "petsc.h" // USES PetscLogFlops
+
+#include <cassert> // USES assert()
+#include <sstream> // USES std::ostringstream
+#include <stdexcept> // USES std::runtime_error
+#include <iostream>
+// ----------------------------------------------------------------------
+namespace pylith {
+  namespace friction {
+    namespace _TimeWeakening {
+
+      // Number of physical properties.
+      const int numProperties = 4;
+
+      // Physical properties.
+      const pylith::materials::Metadata::ParamDescription properties[] = {
+	{ "static_coefficient", 1, pylith::topology::FieldBase::SCALAR },
+	{ "dynamic_coefficient", 1, pylith::topology::FieldBase::SCALAR },
+        { "time_weakening_parameter", 1, pylith::topology::FieldBase::SCALAR },
+	{ "cohesion", 1, pylith::topology::FieldBase::SCALAR },
+      };
+
+      // Number of State Variables.
+      const int numStateVars = 1;
+
+      // State Variables.
+      const pylith::materials::Metadata::ParamDescription stateVars[] = {
+	{ "elapsed_time", 1, pylith::topology::FieldBase::SCALAR },
+      };
+
+      // Values expected in spatial database
+      const int numDBProperties = 4;
+      const char* dbProperties[4] = { "static-coefficient",
+				      "dynamic-coefficient",
+				      "time-weakening-parameter",
+				      "cohesion",
+      };
+
+      const int numDBStateVars = 1;
+      const char* dbStateVars[1] = { "elapsed-time",
+      };      
+      
+    } // _TimeWeakening
+  } // friction
+} // pylith
+
+// Indices of physical properties
+const int pylith::friction::TimeWeakening::p_coefS = 0;
+const int pylith::friction::TimeWeakening::p_coefD = 
+  pylith::friction::TimeWeakening::p_coefS + 1;
+const int pylith::friction::TimeWeakening::p_Tc = 
+  pylith::friction::TimeWeakening::p_coefD + 1;
+const int pylith::friction::TimeWeakening::p_cohesion =
+  pylith::friction::TimeWeakening::p_Tc + 1;
+
+// Indices of database values (order must match dbProperties)
+const int pylith::friction::TimeWeakening::db_coefS = 0;
+const int pylith::friction::TimeWeakening::db_coefD = 
+  pylith::friction::TimeWeakening::db_coefS + 1;
+const int pylith::friction::TimeWeakening::db_Tc = 
+  pylith::friction::TimeWeakening::db_coefD + 1;
+const int pylith::friction::TimeWeakening::db_cohesion =
+  pylith::friction::TimeWeakening::db_Tc + 1;
+
+// Indices of state variables.
+const int pylith::friction::TimeWeakening::s_time = 0;
+
+// Indices of database values (order must match dbProperties)
+const int pylith::friction::TimeWeakening::db_time = 0;
+
+// ----------------------------------------------------------------------
+// Default constructor.
+pylith::friction::TimeWeakening::TimeWeakening(void) :
+  FrictionModel(materials::Metadata(_TimeWeakening::properties,
+				    _TimeWeakening::numProperties,
+				    _TimeWeakening::dbProperties,
+				    _TimeWeakening::numDBProperties,
+				    _TimeWeakening::stateVars,
+				    _TimeWeakening::numStateVars,
+				    _TimeWeakening::dbStateVars,
+				    _TimeWeakening::numDBStateVars))
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor.
+pylith::friction::TimeWeakening::~TimeWeakening(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Compute properties from values in spatial database.
+void
+pylith::friction::TimeWeakening::_dbToProperties(
+					   double* const propValues,
+					   const double_array& dbValues) const
+{ // _dbToProperties
+  assert(0 != propValues);
+  const int numDBValues = dbValues.size();
+  assert(_TimeWeakening::numDBProperties == numDBValues);
+
+  const double db_static = dbValues[db_coefS];
+  const double db_dynamic = dbValues[db_coefD];
+  const double db_To = dbValues[db_Tc];
+  const double db_c = dbValues[db_cohesion];
+
+  if (db_static < 0.0) {
+    std::ostringstream msg;
+    msg << "Spatial database returned negative value for static coefficient "
+	<< "of friction.\n"
+	<< "static coefficient of friction: " << db_static << "\n";
+    throw std::runtime_error(msg.str());
+  } // if
+
+  if (db_dynamic < 0.0) {
+    std::ostringstream msg;
+    msg << "Spatial database returned negative value for dynamic coefficient "
+	<< "of friction.\n"
+	<< "dynamic coefficient of friction: " << db_dynamic << "\n";
+    throw std::runtime_error(msg.str());
+  } // if
+
+  if (db_To <= 0.0) {
+    std::ostringstream msg;
+    msg << "Spatial database returned nonpositive value for time weakening parameter "
+	<< "of friction.\n"
+	<< "time weakening parameter of friction: " << db_To << "\n";
+    throw std::runtime_error(msg.str());
+  } // if
+
+  propValues[p_coefS] = db_static;
+  propValues[p_coefD] = db_dynamic;
+  propValues[p_Tc] = db_To;
+  propValues[p_cohesion] = db_c;
+
+} // _dbToProperties
+
+// ----------------------------------------------------------------------
+// Nondimensionalize properties.
+void
+pylith::friction::TimeWeakening::_nondimProperties(double* const values,
+						    const int nvalues) const
+{ // _nondimProperties
+  assert(0 != _normalizer);
+  assert(0 != values);
+  assert(nvalues == _TimeWeakening::numProperties);
+
+  const double timeScale = _normalizer->timeScale();
+  const double pressureScale = _normalizer->pressureScale();
+
+  values[p_Tc] /= timeScale;
+  values[p_cohesion] /= pressureScale;
+} // _nondimProperties
+
+// ----------------------------------------------------------------------
+// Dimensionalize properties.
+void
+pylith::friction::TimeWeakening::_dimProperties(double* const values,
+						      const int nvalues) const
+{ // _dimProperties
+  assert(0 != _normalizer);
+  assert(0 != values);
+  assert(nvalues == _TimeWeakening::numProperties);
+
+  const double timeScale = _normalizer->timeScale();
+  const double pressureScale = _normalizer->pressureScale();
+
+  values[p_Tc] *= timeScale;
+  values[p_cohesion] *= pressureScale;
+} // _dimProperties
+
+// ----------------------------------------------------------------------
+// Compute state variables from values in spatial database.
+void
+pylith::friction::TimeWeakening::_dbToStateVars(
+					   double* const stateValues,
+					   const double_array& dbValues) const
+{ // _dbToStateVars
+  assert(0 != stateValues);
+  const int numDBValues = dbValues.size();
+  assert(_TimeWeakening::numDBStateVars == numDBValues);
+
+  const double timeElasped = dbValues[db_time];
+  
+  stateValues[s_time] = timeElasped;
+} // _dbToStateVars
+
+// ----------------------------------------------------------------------
+// Nondimensionalize state variables.
+void
+pylith::friction::TimeWeakening::_nondimStateVars(double* const values,
+						  const int nvalues) const
+{ // _nondimStateVars
+  assert(0 != _normalizer);
+  assert(0 != values);
+  assert(nvalues == _TimeWeakening::numStateVars);
+
+  const double timeScale = _normalizer->timeScale();
+
+  values[s_time] /= timeScale;
+} // _nondimStateVars
+
+// ----------------------------------------------------------------------
+// Dimensionalize state variables.
+void
+pylith::friction::TimeWeakening::_dimStateVars(double* const values,
+					       const int nvalues) const
+{ // _dimStateVars
+  assert(0 != _normalizer);
+  assert(0 != values);
+  assert(nvalues == _TimeWeakening::numStateVars);
+
+  const double timeScale = _normalizer->timeScale();
+
+  values[s_time] *= timeScale;
+} // _dimStateVars
+
+// ----------------------------------------------------------------------
+// Compute friction from properties and state variables.
+double
+pylith::friction::TimeWeakening::_calcFriction(const double slip,
+						const double slipRate,
+						const double normalTraction,
+						const double* properties,
+						const int numProperties,
+						const double* stateVars,
+						const int numStateVars)
+{ // _calcFriction
+  assert(0 != properties);
+  assert(_numPropsVertex == numProperties);
+  assert(0 != numStateVars);
+  assert(_numVarsVertex == numStateVars);
+
+  double friction = 0.0;
+  double mu_f = 0.0;
+  if (normalTraction <= 0.0) {
+    // if fault is in compression
+    if (stateVars[s_time] < properties[p_Tc]) {
+	// if/else linear time-weakening form of mu_f 
+	mu_f = properties[p_coefS] -
+	  (properties[p_coefS] - properties[p_coefD]) * 
+	  stateVars[s_time] / properties[p_Tc];
+      } else {
+	mu_f = properties[p_coefD];
+      } // if/else
+    friction = - mu_f * normalTraction + properties[p_cohesion];
+  } // if
+
+  PetscLogFlops(6);
+
+  return friction;
+} // _calcFriction
+
+// ----------------------------------------------------------------------
+// Update state variables (for next time step).
+void
+pylith::friction::TimeWeakening::_updateStateVars(const double slip,
+						  const double slipRate,
+						  const double normalTraction,
+						  double* const stateVars,
+						  const int numStateVars,
+						  const double* properties,
+						  const int numProperties)
+{ // _updateStateVars
+  assert(0 != numStateVars);
+  assert(0 != numProperties);
+
+  if (slipRate != 0.0) {
+    const double dt = _dt;
+
+    stateVars[s_time] += dt;
+  } else {
+    stateVars[s_time] = 0.0;
+  } // else
+ 
+} // _updateStateVars
+
+
+// End of file 

Copied: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.hh (from rev 17042, short/3D/PyLith/trunk/libsrc/friction/TimeWeakening.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.hh	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.hh	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,168 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file libsrc/friction/TimeWeakening.hh
+ *
+ * @brief C++ time weakening fault constitutive model.
+ */
+
+#if !defined(pylith_friction_timeweakening_hh)
+#define pylith_friction_timeweakening_hh
+
+// Include directives ---------------------------------------------------
+#include "FrictionModel.hh" // ISA FrictionModel
+
+// TimeWeakening -------------------------------------------------------
+/** @brief C++ time weakening fault constitutive model.
+ *
+ * Friction is equal to the product of a coefficient of friction
+ * (function of time since slipping started) and the normal traction.
+ */
+
+class pylith::friction::TimeWeakening : public FrictionModel
+{ // class TimeWeakening
+  friend class TestTimeWeakening; // unit testing
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Default constructor.
+  TimeWeakening(void);
+
+  /// Destructor.
+  ~TimeWeakening(void);
+
+  // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
+  /// These methods should be implemented by every constitutive model.
+
+  /** Compute properties from values in spatial database.
+   *
+   * @param propValues Array of property values.
+   * @param dbValues Array of database values.
+   */
+  void _dbToProperties(double* const propValues,
+		       const double_array& dbValues) const;
+
+  /** Nondimensionalize properties.
+   *
+   * @param values Array of property values.
+   * @param nvalues Number of values.
+   */
+  void _nondimProperties(double* const values,
+			 const int nvalues) const;
+
+  /** Dimensionalize properties.
+   *
+   * @param values Array of property values.
+   * @param nvalues Number of values.
+   */
+  void _dimProperties(double* const values,
+		      const int nvalues) const;
+
+  /** Compute friction from properties and state variables.
+   *
+   * @param slip Current slip at location.
+   * @param slipRate Current slip rate at location.
+   * @param normalTraction Normal traction at location.
+   * @param properties Properties at location.
+   * @param numProperties Number of properties.
+   * @param stateVars State variables at location.
+   * @param numStateVars Number of state variables.
+   */
+  void _dbToStateVars(double* const stateValues,
+		      const double_array& dbValues) const;
+
+  /** Nondimensionalize state variables.
+   *
+   * @param values Array of initial state values.
+   * @param nvalues Number of values.
+   */
+  void _nondimStateVars(double* const values,
+			   const int nvalues) const;
+  
+  /** Dimensionalize state variables.
+   *
+   * @param values Array of initial state values.
+   * @param nvalues Number of values.
+   */
+  void _dimStateVars(double* const values,
+			const int nvalues) const;
+
+  /** Compute friction from properties and state variables.
+   *
+   * @param slip Current slip at location.
+   * @param slipRate Current slip rate at location.
+   * @param normalTraction Normal traction at location.
+   * @param properties Properties at location.
+   * @param numProperties Number of properties.
+   * @param stateVars State variables at location.
+   * @param numStateVars Number of state variables.
+   */
+  double _calcFriction(const double slip,
+		       const double slipRate,
+		       const double normalTraction,
+		       const double* properties,
+		       const int numProperties,
+		       const double* stateVars,
+		       const int numStateVars);
+
+  /** Update state variables (for next time step).
+   *
+   * @param slip Current slip at location.
+   * @param slipRate Current slip rate at location.
+   * @param normalTraction Normal traction at location.
+   * @param stateVars State variables at location.
+   * @param numStateVars Number of state variables.
+   * @param properties Properties at location.
+   * @param numProperties Number of properties.
+   */
+  void _updateStateVars(const double slip,
+      const double slipRate,
+      const double normalTraction,
+      double* const stateVars,
+      const int numStateVars,
+      const double* properties,
+      const int numProperties);
+
+  // PRIVATE MEMBERS ////////////////////////////////////////////////////
+private :
+
+  /// Indices for properties in section and spatial database.
+  static const int p_coefS;
+  static const int p_coefD;
+  static const int p_Tc;
+  static const int p_cohesion;
+
+  static const int db_coefS;
+  static const int db_coefD;
+  static const int db_Tc;
+  static const int db_cohesion;
+
+  /// Indices for state variables in section and spatial database.
+  static const int s_time;
+
+  static const int db_time;
+
+  // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+  TimeWeakening(const TimeWeakening&); ///< Not implemented.
+  const TimeWeakening& operator=(const TimeWeakening&); ///< Not implemented
+
+}; // class TimeWeakening
+
+#endif // pylith_friction_timeweakening_hh
+
+
+// End of file 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/frictionfwd.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/frictionfwd.hh	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/frictionfwd.hh	2010-07-14 15:21:24 UTC (rev 17043)
@@ -32,6 +32,8 @@
     
     class RateStateAgeing;
 
+    class TimeWeakening;
+
   } // friction
 } // pylith
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/topology/RefineUniform.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/topology/RefineUniform.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/topology/RefineUniform.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -107,10 +107,12 @@
     new SieveMesh::sieve_type(mesh.comm(), mesh.debug());
 
   std::map<edge_type, point_type> edge2vertex;
-    
+   
+#if 0 // DON'T KNOW NEW INTERFACE 
   newSieveMesh->setSieve(newSieve);
   ALE::MeshBuilder<Mesh>::refineTetrahedra(*mesh.sieveMesh(), * newSieveMesh,
 					   edge2vertex);
+#endif
 
   // Fix material ids
   const int numCells = sieveMesh->heightStratum(0)->size();

Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/Makefile.am	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/Makefile.am	2010-07-14 15:21:24 UTC (rev 17043)
@@ -22,7 +22,8 @@
 	FrictionModel.i \
 	StaticFriction.i \
 	SlipWeakening.i \
-	RateStateAgeing.i
+	RateStateAgeing.i \
+	TimeWeakening.i
 
 swigincludedir = $(pkgdatadir)/swig/$(subpackage)
 swiginclude_HEADERS = \

Copied: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i (from rev 17042, short/3D/PyLith/trunk/modulesrc/friction/TimeWeakening.i)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/** @file modulesrc/friction/TimeWeakening.i
+ *
+ * Python interface to C++ TimeWeakening object.
+ */
+
+namespace pylith {
+  namespace friction {
+
+    class TimeWeakening : public FrictionModel
+    { // class TimeWeakening
+
+      // PUBLIC METHODS /////////////////////////////////////////////////
+    public :
+
+      /// Default constructor.
+      TimeWeakening(void);
+
+      /// Destructor.
+      ~TimeWeakening(void);
+
+      // PROTECTED METHODS //////////////////////////////////////////////
+    protected :
+
+      /** Compute properties from values in spatial database.
+       *
+       * @param propValues Array of property values.
+       * @param dbValues Array of database values.
+       */
+      void _dbToProperties(double* const propValues,
+			   const double_array& dbValues) const;
+
+      /** Nondimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _nondimProperties(double* const values,
+			     const int nvalues) const;
+
+      /** Dimensionalize properties.
+       *
+       * @param values Array of property values.
+       * @param nvalues Number of values.
+       */
+      void _dimProperties(double* const values,
+			  const int nvalues) const;
+
+      /** Compute friction from properties and state variables.
+       *
+       * @param slip Current slip at location.
+       * @param slipRate Current slip rate at location.
+       * @param normalTraction Normal traction at location.
+       * @param properties Properties at location.
+       * @param numProperties Number of properties.
+       * @param stateVars State variables at location.
+       * @param numStateVars Number of state variables.
+       */
+      double _calcFriction(const double slip,
+			   const double slipRate,
+			   const double normalTraction,
+			   const double* properties,
+			   const int numProperties,
+			   const double* stateVars,
+			   const int numStateVars);
+
+    }; // class TimeWeakening
+
+  } // friction
+} // pylith
+
+
+// End of file 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/friction.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/friction.i	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/friction.i	2010-07-14 15:21:24 UTC (rev 17043)
@@ -24,6 +24,7 @@
 #include "pylith/friction/StaticFriction.hh"
 #include "pylith/friction/SlipWeakening.hh"
 #include "pylith/friction/RateStateAgeing.hh"
+#include "pylith/friction/TimeWeakening.hh"
 
 #include "pylith/utils/arrayfwd.hh"
 #include "pylith/utils/sievetypes.hh"
@@ -57,6 +58,7 @@
 %include "StaticFriction.i"
 %include "SlipWeakening.i"
 %include "RateStateAgeing.i"
+%include "TimeWeakening.i"
 
 
 // End of file

Copied: short/3D/PyLith/branches/pylith-scecdynrup/playpen/postproc/princaxes.cfg (from rev 17042, short/3D/PyLith/trunk/playpen/postproc/princaxes.cfg)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/playpen/postproc/princaxes.cfg	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/playpen/postproc/princaxes.cfg	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,8 @@
+# -*- Python -*-
+[princaxes]
+
+# Top-level info
+vtk_input_file = ../../examples/3d/hex8/output/step01-lower_crust_t0000000.vtk
+vtk_output_file = ../../examples/3d/hex8/output/step01-lower_crust_princstress_t0.vtk
+vtk_tensor_index = 1
+vtk_tensor_components_order = [0,1,2,3,4,5]

Copied: short/3D/PyLith/branches/pylith-scecdynrup/playpen/postproc/princaxes.py (from rev 17042, short/3D/PyLith/trunk/playpen/postproc/princaxes.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/playpen/postproc/princaxes.py	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/playpen/postproc/princaxes.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,252 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file postproc/princaxes
+
+## @brief Python application to compute principal axes for a tensor respresented
+## as a vector. Information is read from a VTK file and a VTK file with the
+## same dimensions is output.
+
+import math
+import numpy
+import os
+import re
+import glob
+from pyre.units.time import s
+
+from pyre.applications.Script import Script as Application
+
+class PrincAxes(Application):
+  """
+  Python application to compute principal axes for a tensor respresented
+  as a vector. Information is read from a VTK file and a VTK file with the
+  same dimensions is output.
+  """
+  
+  class Inventory(Application.Inventory):
+    """
+    Python object for managing PrincAxes facilities and properties.
+    """
+
+    ## @class Inventory
+    ## Python object for managing PrincAxes facilities and properties.
+    ##
+    ## \b Properties
+    ## @li \b vtk_input_file  Name of VTK input file.
+    ## @li \b vtk_output_file Name of VTK output file.
+    ## @li \b vtk_tensor_index Index indicating which VTK field array contains desired tensor.
+    ## @li \b vtk_tensor_components_order Indices corresponding to xx,yy,zz,xy,yz,xz.
+
+    import pyre.inventory
+
+    vtkInputFile = pyre.inventory.str("vtk_input_file",
+                                          default="stress_t0001.vtk")
+    vtkInputFile.meta['tip'] = "Name of VTK input file."
+
+    vtkOutputFile = pyre.inventory.str("vtk_output_file", default="output.vtk")
+    vtkOutputFile.meta['tip'] = "Name of VTK output file."
+
+    vtkTensorIndex = pyre.inventory.int("vtk_tensor_index", default=1)
+    vtkTensorIndex.meta['tip'] = "Index indicating which VTK field array contains desired tensor."
+
+    vtkTensorComponentsOrder = pyre.inventory.list("vtk_tensor_components_order",
+                                                default=[0, 1, 2, 3, 4, 5])
+    vtkTensorComponentsOrder.meta['tip'] = "Indices corresponding to xx, yy, zz, xy, yz, xz."
+    
+  
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="princaxes"):
+    Application.__init__(self, name)
+
+    self.cells = None
+    self.vertArray = None
+    self.spaceDim = 0
+    self.cellType = ""
+
+    self.numTensorPoints = 0
+    self.tensorSorted = None
+
+    self.minPrincAxis = None
+    self.intPrincAxis = None
+    self.maxPrincAxis = None
+    self.minEigenvalue = None
+    self.intEigenvalue = None
+    self.maxEigenvalue = None
+    return
+
+
+  def main(self):
+    # import pdb
+    # pdb.set_trace()
+    self._readVtkFile()
+    self._getPrincAxes()
+    self._writeVtkFile()
+    return
+
+
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _configure(self):
+    """
+    Setup members using inventory.
+    """
+    Application._configure(self)
+    # import pdb
+    # pdb.set_trace()
+
+    # File info.
+    self.vtkInputFile = self.inventory.vtkInputFile
+    self.vtkOutputFile = self.inventory.vtkOutputFile
+
+    # Index information
+    self.vtkTensorIndex = self.inventory.vtkTensorIndex
+    self.vtkTensorComponentsOrder = self.inventory.vtkTensorComponentsOrder
+
+    return
+      
+
+  def _readVtkFile(self):
+    """
+    Function to read tensor from a file and store the info in a numpy array.
+    """
+    from enthought.mayavi.sources.vtk_file_reader import VTKFileReader
+    from enthought.tvtk.api import tvtk
+
+    reader = VTKFileReader()
+    reader.initialize(self.vtkInputFile)
+    data = reader.outputs[0]
+
+    # Get vertex and cell info.
+    cellVtk = data.get_cells()
+    numCells = cellVtk.number_of_cells
+    cellArray = cellVtk.to_array()
+    self.cells = tvtk.CellArray()
+    self.cells.set_cells(numCells, cellArray)
+    self.vertArray = data._get_points().to_array()
+    self.cellType = data.get_cell_type(0)
+    (numVerts, self.spaceDim) = self.vertArray.shape
+
+
+    # Get cell fields and extract tensor.
+    cellData = data._get_cell_data()
+    numCellDataArrays = cellData._get_number_of_arrays()
+    tensor = cellData.get_array(self.vtkTensorIndex).to_array()
+    (self.numTensorPoints, numCols) = tensor.shape
+    
+    sxx = tensor[:,self.vtkTensorComponentsOrder[0]]
+    syy = tensor[:,self.vtkTensorComponentsOrder[1]]
+    szz = tensor[:,self.vtkTensorComponentsOrder[2]]
+    sxy = tensor[:,self.vtkTensorComponentsOrder[3]]
+    syz = tensor[:,self.vtkTensorComponentsOrder[4]]
+    sxz = tensor[:,self.vtkTensorComponentsOrder[5]]
+    self.tensorSorted = numpy.column_stack((sxx, syy, szz, sxy, syz, sxz))
+
+    return
+
+
+  def _getPrincAxes(self):
+    """
+    Function to loop over integration points and compute principal axes for
+    each point.
+    """
+    # Create empty arrays for each principal axis and eigenvalue.
+    self.minPrincAxis = numpy.empty((self.numTensorPoints, self.spaceDim),
+                                    dtype=numpy.float64)
+    self.intPrincAxis = numpy.empty((self.numTensorPoints, self.spaceDim),
+                                    dtype=numpy.float64)
+    self.maxPrincAxis = numpy.empty((self.numTensorPoints, self.spaceDim),
+                                    dtype=numpy.float64)
+    self.minEigenValue = numpy.empty(self.numTensorPoints, dtype=numpy.float64)
+    self.intEigenValue = numpy.empty(self.numTensorPoints, dtype=numpy.float64)
+    self.maxEigenValue = numpy.empty(self.numTensorPoints, dtype=numpy.float64)
+    # Loop over integration points.
+    for point in xrange(self.numTensorPoints):
+      tensor = self.tensorSorted[point, :]
+      tensorOrdered, eigenValuesOrdered = self._compPrincAxes(tensor)
+      self.minPrincAxis[point,:] = tensorOrdered[0]
+      self.intPrincAxis[point,:] = tensorOrdered[1]
+      self.maxPrincAxis[point,:] = tensorOrdered[2]
+      self.minEigenValue[point] = eigenValuesOrdered[0]
+      self.intEigenValue[point] = eigenValuesOrdered[1]
+      self.maxEigenValue[point] = eigenValuesOrdered[2]
+
+    return
+  
+
+  def _compPrincAxes(self, tensor):
+    """
+    Function to compute 3D principal axes, sort them, and multiply by
+    corresponding eigenvalue.
+    """
+    tensorMat = numpy.array([(tensor[0], tensor[3], tensor[5]),
+                             (tensor[3], tensor[1], tensor[4]),
+                             (tensor[5], tensor[4], tensor[2])],
+                            dtype=numpy.float64)
+    (eigenValue, princAxes) = numpy.linalg.eigh(tensorMat)
+    idx = eigenValue.argsort()
+    eigenValuesOrdered = eigenValue[idx]
+    princAxesOrdered = princAxes[:,idx]
+    tensorOrdered = numpy.empty_like(princAxesOrdered)
+    tensorOrdered[0,:] = eigenValuesOrdered[0] * princAxesOrdered[0,:]
+    tensorOrdered[1,:] = eigenValuesOrdered[1] * princAxesOrdered[1,:]
+    tensorOrdered[2,:] = eigenValuesOrdered[2] * princAxesOrdered[2,:]
+    return tensorOrdered, eigenValuesOrdered
+  
+
+  def _writeVtkFile(self):
+    """
+    Function to write out vertex and cell info along with principal axes
+    computed as vectors.
+    """
+    from enthought.tvtk.api import tvtk
+
+    # Set up mesh info for VTK file.
+    mesh = tvtk.UnstructuredGrid(points=self.vertArray)
+    mesh.set_cells(self.cellType, self.cells)
+
+    # Add scalar fields.
+    minEigenName = "min_eigenvalue"
+    intEigenName = "int_eigenvalue"
+    maxEigenName = "max_eigenvalue"
+    mesh.cell_data.scalars = self.minEigenValue
+    mesh.cell_data.scalars.name = minEigenName
+    s2 = mesh.cell_data.add_array(self.intEigenValue)
+    mesh.cell_data.get_array(s2).name = intEigenName
+    s3 = mesh.cell_data.add_array(self.maxEigenValue)
+    mesh.cell_data.get_array(s3).name = maxEigenName
+    mesh.update()
+
+    # Add vector fields and write VTK file
+    minAxisName = "min_principal_axis"
+    intAxisName = "int_principal_axis"
+    maxAxisName = "max_principal_axis"
+    mesh.cell_data.vectors = self.minPrincAxis
+    mesh.cell_data.vectors.name = minAxisName
+    v2 = mesh.cell_data.add_array(self.intPrincAxis)
+    mesh.cell_data.get_array(v2).name = intAxisName
+    v3 = mesh.cell_data.add_array(self.maxPrincAxis)
+    mesh.cell_data.get_array(v3).name = maxAxisName
+    mesh.update()
+    w = tvtk.UnstructuredGridWriter(file_name=self.vtkOutputFile,
+		    input=mesh)
+    w.write()
+
+    return
+  
+
+# ----------------------------------------------------------------------
+if __name__ == '__main__':
+  app = PrincAxes()
+  app.run()
+
+# End of file

Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/Makefile.am	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/Makefile.am	2010-07-14 15:21:24 UTC (rev 17043)
@@ -61,6 +61,7 @@
 	friction/StaticFriction.py \
 	friction/SlipWeakening.py \
 	friction/RateStateAgeing.py \
+	friction/TimeWeakening.py \
 	materials/__init__.py \
 	materials/ElasticMaterial.py \
 	materials/ElasticIsotropic3D.py \

Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveDyn.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveDyn.py	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveDyn.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -81,7 +81,7 @@
                      "slip_rate",
                      "traction"]},
          'cell': \
-           {'info': [],
+           {'info': ["distribution"],
             'data': []}}
     return
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveKin.py	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveKin.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -87,7 +87,7 @@
             'data': ["slip",
                      "traction_change"]},
          'cell': \
-           {'info': [],
+           {'info': ["distribution"],
             'data': []}}
     return
 

Copied: short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/TimeWeakening.py (from rev 17042, short/3D/PyLith/trunk/pylith/friction/TimeWeakening.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/TimeWeakening.py	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/TimeWeakening.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,70 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/friction/TimeWeakening.py
+##
+## @brief Python object implementing time Weakening.
+##
+## Factory: friction_model.
+
+from FrictionModel import FrictionModel
+from friction import TimeWeakening as ModuleTimeWeakening
+
+# TimeWeakening class
+class TimeWeakening(FrictionModel, ModuleTimeWeakening):
+  """
+  Python object implementing Time Weakening.
+
+  Factory: friction_model.
+  """
+
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="timeweakening"):
+    """
+    Constructor.
+    """
+    FrictionModel.__init__(self, name)
+    self.availableFields = \
+        {'vertex': \
+           {'info': ["static_coefficient",
+                     "dynamic_coefficient",
+                     "time_weakening_parameter",
+                     "cohesion"],
+            'data': ["Elapsed_time"]},
+         'cell': \
+           {'info': [],
+            'data': []}}
+    self._loggingPrefix = "FrStat "
+    return
+
+
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _createModuleObj(self):
+    """
+    Call constructor for module object for access to C++ object.
+    """
+    ModuleTimeWeakening.__init__(self)
+    return
+  
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def friction_model():
+  """
+  Factory associated with TimeWeakening.
+  """
+  return TimeWeakening()
+
+
+# End of file 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/__init__.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/__init__.py	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/__init__.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -18,6 +18,7 @@
            'StaticFriction',
            'SlipWeakening',
            'RateStateAgeing',
+           'TimeWeakening',
            ]
 
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultDyn.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultDyn.py	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultDyn.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -53,7 +53,11 @@
                                                   "traction"])
   vertexDataFields.meta['tip'] = "Names of vertex data fields to output."
 
+  cellInfoFields = pyre.inventory.list("cell_info_fields",
+                                       default=["distribution"])
+  cellInfoFields.meta['tip'] = "Names of cell info fields to output."
 
+
   # PUBLIC METHODS /////////////////////////////////////////////////////
 
   def __init__(self, name="outputfaultdyn"):
@@ -73,6 +77,7 @@
     OutputManagerSubMesh._configure(self)
     self.vertexInfoFields = self.inventory.vertexInfoFields
     self.vertexDataFields = self.inventory.vertexDataFields
+    self.cellInfoFields   = self.inventory.cellInfoFields
     return
 
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultKin.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultKin.py	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultKin.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -55,7 +55,11 @@
                                                   "traction_change"])
   vertexDataFields.meta['tip'] = "Names of vertex data fields to output."
 
+  cellInfoFields = pyre.inventory.list("cell_info_fields",
+                                       default=["distribution"])
+  cellInfoFields.meta['tip'] = "Names of cell info fields to output."
 
+
   # PUBLIC METHODS /////////////////////////////////////////////////////
 
   def __init__(self, name="outputfaultkin"):
@@ -75,6 +79,7 @@
     OutputManagerSubMesh._configure(self)
     self.vertexInfoFields = self.inventory.vertexInfoFields
     self.vertexDataFields = self.inventory.vertexDataFields
+    self.cellInfoFields   = self.inventory.cellInfoFields
     return
 
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/Makefile.am	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/Makefile.am	2010-07-14 15:21:24 UTC (rev 17043)
@@ -25,28 +25,32 @@
 	TestFrictionModel.cc \
 	TestStaticFriction.cc \
 	TestSlipWeakening.cc \
-	TestRateStateAgeing.cc
+	TestRateStateAgeing.cc \
+	TestTimeWeakening.cc
 
 
 noinst_HEADERS = \
 	TestFrictionModel.hh \
 	TestStaticFriction.hh \
 	TestSlipWeakening.hh \
-	TestRateStateAgeing.hh
+	TestRateStateAgeing.hh \
+	TestTimeWeakening.hh
 
 # Source files associated with testing data
 testfriction_SOURCES += \
 	data/FrictionModelData.cc \
 	data/StaticFrictionData.cc \
 	data/SlipWeakeningData.cc \
-	data/RateStateAgeingData.cc
+	data/RateStateAgeingData.cc \
+	data/TimeWeakeningData.cc
 
 
 noinst_HEADERS += \
 	data/FrictionModelData.hh \
 	data/StaticFrictionData.hh \
 	data/SlipWeakeningData.hh \
-	data/RateStateAgeingData.hh
+	data/RateStateAgeingData.hh \
+	data/TimeWeakeningData.hh
 
 AM_CPPFLAGS = \
 	$(PYTHON_EGG_CPPFLAGS) -I$(PYTHON_INCDIR) \

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestFrictionModel.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestFrictionModel.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestFrictionModel.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -402,8 +402,18 @@
   CPPUNIT_ASSERT(0 != _friction);
   CPPUNIT_ASSERT(0 != _data);
   
+  // Check to make sure names of Metadata values match names of test
+  // data values (consistency check).
+  const int numDBProperties = _data->numDBProperties;
+  char** dbPropertyLabelsE = _data->dbPropertyValues;
+  CPPUNIT_ASSERT_EQUAL(numDBProperties, _friction->_metadata.numDBProperties());
+  const char* const* dbPropertyLabels = _friction->_metadata.dbProperties();
+  for (int i=0; i < numDBProperties; ++i) 
+    CPPUNIT_ASSERT_EQUAL(std::string(dbPropertyLabelsE[i]),
+			 std::string(dbPropertyLabels[i]));
+
+  // Test _dbToProperties()
   const int numLocs = _data->numLocs;
-  const int numDBProperties = _data->numDBProperties;
   double_array dbValues(numDBProperties);
 
   const int propertiesSize = _data->numPropsVertex;
@@ -506,8 +516,18 @@
   CPPUNIT_ASSERT(0 != _friction);
   CPPUNIT_ASSERT(0 != _data);
   
+  // Check to make sure names of Metadata values match names of test
+  // data values (consistency check).
+  const int numDBStateVars = _data->numDBStateVars;
+  char** dbStateVarsLabelsE = _data->dbStateVarValues;
+  CPPUNIT_ASSERT_EQUAL(numDBStateVars, _friction->_metadata.numDBStateVars());
+  const char* const* dbStateVarsLabels = _friction->_metadata.dbStateVars();
+  for (int i=0; i < numDBStateVars; ++i) 
+    CPPUNIT_ASSERT_EQUAL(std::string(dbStateVarsLabelsE[i]),
+			 std::string(dbStateVarsLabels[i]));
+
+  // Test _dbToStateVars()
   const int numLocs = _data->numLocs;
-  const int numDBStateVars = _data->numDBStateVars;
   double_array dbValues(numDBStateVars);
 
   const int stateVarsSize = _data->numVarsVertex;
@@ -691,7 +711,7 @@
 
     const double tolerance = 1.0e-06;
     for (int i=0; i < numVarsVertex; ++i) {
-#if 1 // DEBUGGING
+#if 0 // DEBUGGING
       std::cout << "valE: " << stateVarsE[i] 
 		<< ", val: " << stateVars[i]
 		<< std::endl;

Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestTimeWeakening.cc (from rev 17042, short/3D/PyLith/trunk/unittests/libtests/friction/TestTimeWeakening.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestTimeWeakening.cc	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestTimeWeakening.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestTimeWeakening.hh" // Implementation of class methods
+
+#include "data/TimeWeakeningData.hh" // USES TimeWeakeningData
+
+#include "pylith/friction/TimeWeakening.hh" // USES TimeWeakening
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::friction::TestTimeWeakening );
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::friction::TestTimeWeakening::setUp(void)
+{ // setUp
+  _friction = new TimeWeakening();
+  _data = new TimeWeakeningData();
+  setupNormalizer();
+} // setUp
+
+// ----------------------------------------------------------------------
+// Test properties metadata.
+void
+pylith::friction::TestTimeWeakening::testPropertiesMetadata(void)
+{ // testPropertiesMetadata
+  TimeWeakening model;
+
+  CPPUNIT_ASSERT_EQUAL(4, model._metadata.numDBProperties());
+  const char* const* names = model._metadata.dbProperties();
+  CPPUNIT_ASSERT_EQUAL(std::string("static-coefficient"), 
+		       std::string(names[0]));
+  CPPUNIT_ASSERT_EQUAL(std::string("dynamic-coefficient"), 
+		       std::string(names[1]));
+  CPPUNIT_ASSERT_EQUAL(std::string("time-weakening-parameter"), 
+		       std::string(names[2]));
+  CPPUNIT_ASSERT_EQUAL(std::string("cohesion"),
+		       std::string(names[3]));
+} // testPropertiesMetadata
+
+// ----------------------------------------------------------------------
+// Test state variable metadata.
+void
+pylith::friction::TestTimeWeakening::testStateVarsMetadata(void)
+{ // testStateVarsMetadata
+  TimeWeakening model;
+
+  CPPUNIT_ASSERT_EQUAL(1, model._metadata.numDBStateVars());
+  const char* const* names = model._metadata.dbStateVars();
+  CPPUNIT_ASSERT_EQUAL(std::string("elapsed-time"), 
+		       std::string(names[0]));
+} // testStateVarsMetadata
+
+// ----------------------------------------------------------------------
+// Test hasProperty().
+void
+pylith::friction::TestTimeWeakening::testHasProperty(void)
+{ // testHasProperty
+  TimeWeakening material;
+
+  CPPUNIT_ASSERT(material.hasProperty("static_coefficient"));
+  CPPUNIT_ASSERT(material.hasProperty("dynamic_coefficient"));
+  CPPUNIT_ASSERT(material.hasProperty("time_weakening_parameter"));
+  CPPUNIT_ASSERT(!material.hasProperty("aaa"));
+} // testHasProperty
+
+// ----------------------------------------------------------------------
+// Test hasStateVar().
+void
+pylith::friction::TestTimeWeakening::testHasStateVar(void)
+{ // testHasStateVar
+  TimeWeakening material;
+
+  CPPUNIT_ASSERT(material.hasStateVar("elapsed_time"));
+  CPPUNIT_ASSERT(!material.hasStateVar("aaa"));
+} // testHasStateVar
+
+
+// End of file 

Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestTimeWeakening.hh (from rev 17042, short/3D/PyLith/trunk/unittests/libtests/friction/TestTimeWeakening.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestTimeWeakening.hh	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/TestTimeWeakening.hh	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/friction/TestTimeWeakening.hh
+ *
+ * @brief C++ TestTimeWeakening object
+ *
+ * C++ unit testing for TimeWeakening.
+ */
+
+#if !defined(pylith_friction_testelasticisotropic3d_hh)
+#define pylith_friction_testelasticisotropic3d_hh
+
+#include "TestFrictionModel.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+  namespace friction {
+    class TestTimeWeakening;
+  } // friction
+} // pylith
+
+/// C++ unit testing for TimeWeakening
+class pylith::friction::TestTimeWeakening : public TestFrictionModel
+{ // class TestTimeWeakening
+
+  // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+  CPPUNIT_TEST_SUITE( TestTimeWeakening );
+
+  CPPUNIT_TEST( testPropertiesMetadata );
+  CPPUNIT_TEST( testStateVarsMetadata );
+  CPPUNIT_TEST( testDBToProperties );
+  CPPUNIT_TEST( testNonDimProperties );
+  CPPUNIT_TEST( testDimProperties );
+  CPPUNIT_TEST( testDBToStateVars );
+  CPPUNIT_TEST( testNonDimStateVars );
+  CPPUNIT_TEST( testDimStateVars );
+  CPPUNIT_TEST( testHasProperty );
+  CPPUNIT_TEST( testHasStateVar );
+  CPPUNIT_TEST( test_calcFriction );
+  CPPUNIT_TEST( test_updateStateVars );
+
+  CPPUNIT_TEST_SUITE_END();
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Setup testing data.
+  void setUp(void);
+
+  /// Test properties metadata.
+  void testPropertiesMetadata(void);
+
+  /// Test state variable metadata.
+  void testStateVarsMetadata(void);
+
+  /// Test hasProperty().
+  void testHasProperty(void);
+
+  /// Test hasStateVar().
+  void testHasStateVar(void);
+
+}; // class TestTimeWeakening
+
+#endif // pylith_friction_testelasticisotropic3d_hh
+
+
+// End of file 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/SlipWeakeningData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/SlipWeakeningData.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/SlipWeakeningData.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -51,7 +51,7 @@
 const char* pylith::friction::SlipWeakeningData::_dbPropertyValues[] = {
   "static-coefficient",
   "dynamic-coefficient",
-  "slip-weakeneing-parameter",
+  "slip-weakening-parameter",
   "cohesion",
 };
 

Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.cc (from rev 17042, short/3D/PyLith/trunk/unittests/libtests/friction/data/TimeWeakeningData.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.cc	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,169 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "TimeWeakeningData.hh"
+
+const int pylith::friction::TimeWeakeningData::_numLocs = 2;
+
+const int pylith::friction::TimeWeakeningData::_numProperties = 4;
+
+const int pylith::friction::TimeWeakeningData::_numStateVars = 1;
+
+const int pylith::friction::TimeWeakeningData::_numDBProperties = 4;
+
+const int pylith::friction::TimeWeakeningData::_numDBStateVars = 1;
+
+const int pylith::friction::TimeWeakeningData::_numPropsVertex = 4;
+
+const int pylith::friction::TimeWeakeningData::_numVarsVertex = 1;
+
+const double pylith::friction::TimeWeakeningData::_lengthScale =   1.00000000e+03;
+
+const double pylith::friction::TimeWeakeningData::_timeScale =   1.00000000e+00;
+
+const double pylith::friction::TimeWeakeningData::_pressureScale =   2.25000000e+10;
+
+const double pylith::friction::TimeWeakeningData::_densityScale =   1.00000000e+03;
+
+const double pylith::friction::TimeWeakeningData::_dt = 0.01;
+
+const int pylith::friction::TimeWeakeningData::_numPropertyValues[] = {
+  1,
+  1,
+  1,
+  1,
+};
+
+const int pylith::friction::TimeWeakeningData::_numStateVarValues[] = {
+  1,
+};
+
+const char* pylith::friction::TimeWeakeningData::_dbPropertyValues[] = {
+  "static-coefficient",
+  "dynamic-coefficient",
+  "time-weakening-parameter",
+  "cohesion",
+};
+
+const char* pylith::friction::TimeWeakeningData::_dbStateVarValues[] = {
+  "elapsed-time",
+};
+
+const double pylith::friction::TimeWeakeningData::_dbProperties[] = {
+  0.6,
+  0.5,
+  0.8,
+  1000000,
+  0.6,
+  0.5,
+  0.4,
+  1000000,
+};
+
+const double pylith::friction::TimeWeakeningData::_dbStateVars[] = {
+  0.4,
+  0.5,
+};
+
+const double pylith::friction::TimeWeakeningData::_properties[] = {
+  0.6,
+  0.5,
+  0.8,
+  1000000,
+  0.6,
+  0.5,
+  0.4,
+  1000000,
+};
+
+const double pylith::friction::TimeWeakeningData::_stateVars[] = {
+  0.4,
+  0.5,
+};
+
+const double pylith::friction::TimeWeakeningData::_propertiesNondim[] = {
+  0.6,
+  0.5,
+  0.8,
+  0.000044444444,
+  0.6,
+  0.5,
+  0.4,
+  0.000044444444,
+};
+
+const double pylith::friction::TimeWeakeningData::_stateVarsNondim[] = {
+  0.4,
+  0.5,
+};
+
+const double pylith::friction::TimeWeakeningData::_friction[] = {
+  1000001.21,
+  1000001.15,
+};
+
+const double pylith::friction::TimeWeakeningData::_slip[] = {
+  0.12,
+  0.25,
+};
+
+const double pylith::friction::TimeWeakeningData::_slipRate[] = {
+  0.74,
+  0.64,
+};
+
+const double pylith::friction::TimeWeakeningData::_normalTraction[] = {
+  -2.2,
+  -2.3,
+};
+
+const double pylith::friction::TimeWeakeningData::_stateVarsUpdated[] = {
+  0.41,
+  0.51,
+};
+
+pylith::friction::TimeWeakeningData::TimeWeakeningData(void)
+{ // constructor
+  numLocs = _numLocs;
+  numProperties = _numProperties;
+  numStateVars = _numStateVars;
+  numDBProperties = _numDBProperties;
+  numDBStateVars = _numDBStateVars;
+  numPropsVertex = _numPropsVertex;
+  numVarsVertex = _numVarsVertex;
+  lengthScale = _lengthScale;
+  timeScale = _timeScale;
+  pressureScale = _pressureScale;
+  densityScale = _densityScale;
+  numPropertyValues = const_cast<int*>(_numPropertyValues);
+  numStateVarValues = const_cast<int*>(_numStateVarValues);
+  dbPropertyValues = const_cast<char**>(_dbPropertyValues);
+  dbStateVarValues = const_cast<char**>(_dbStateVarValues);
+  dbProperties = const_cast<double*>(_dbProperties);
+  dbStateVars = const_cast<double*>(_dbStateVars);
+  dt = _dt;
+  properties = const_cast<double*>(_properties);
+  stateVars = const_cast<double*>(_stateVars);
+  propertiesNondim = const_cast<double*>(_propertiesNondim);
+  stateVarsNondim = const_cast<double*>(_stateVarsNondim);
+  friction = const_cast<double*>(_friction);
+  slip = const_cast<double*>(_slip);
+  slipRate = const_cast<double*>(_slipRate);
+  normalTraction = const_cast<double*>(_normalTraction);
+  stateVarsUpdated = const_cast<double*>(_stateVarsUpdated);
+} // constructor
+
+pylith::friction::TimeWeakeningData::~TimeWeakeningData(void)
+{}
+
+
+// End of file

Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.hh (from rev 17042, short/3D/PyLith/trunk/unittests/libtests/friction/data/TimeWeakeningData.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.hh	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.hh	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_friction_timeweakeningdata_hh)
+#define pylith_friction_timeweakeningdata_hh
+
+#include "FrictionModelData.hh"
+
+namespace pylith {
+  namespace friction {
+     class TimeWeakeningData;
+  } // pylith
+} // friction
+
+class pylith::friction::TimeWeakeningData : public FrictionModelData
+{
+
+public: 
+
+  /// Constructor
+  TimeWeakeningData(void);
+
+  /// Destructor
+  ~TimeWeakeningData(void);
+
+private:
+
+  static const int _numLocs;
+
+  static const int _numProperties;
+
+  static const int _numStateVars;
+
+  static const int _numDBProperties;
+
+  static const int _numDBStateVars;
+
+  static const int _numPropsVertex;
+
+  static const int _numVarsVertex;
+
+  static const double _lengthScale;
+
+  static const double _timeScale;
+
+  static const double _pressureScale;
+
+  static const double _densityScale;
+
+  static const double _dt;
+
+  static const int _numPropertyValues[];
+
+  static const int _numStateVarValues[];
+
+  static const char* _dbPropertyValues[];
+
+  static const char* _dbStateVarValues[];
+
+  static const double _dbProperties[];
+
+  static const double _dbStateVars[];
+
+  static const double _properties[];
+
+  static const double _stateVars[];
+
+  static const double _propertiesNondim[];
+
+  static const double _stateVarsNondim[];
+
+  static const double _friction[];
+
+  static const double _slip[];
+
+  static const double _slipRate[];
+
+  static const double _normalTraction[];
+
+  static const double _stateVarsUpdated[];
+
+};
+
+#endif // pylith_friction_timeweakeningdata_hh
+
+// End of file

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/TestMaterial.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/TestMaterial.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/TestMaterial.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -337,8 +337,18 @@
   CPPUNIT_ASSERT(0 != _material);
   CPPUNIT_ASSERT(0 != _data);
   
+  // Check to make sure names of Metadata values match names of test
+  // data values (consistency check).
+  const int numDBProperties = _data->numDBProperties;
+  char** dbPropertyLabelsE = _data->dbPropertyValues;
+  CPPUNIT_ASSERT_EQUAL(numDBProperties, _material->_metadata.numDBProperties());
+  const char* const* dbPropertyLabels = _material->_metadata.dbProperties();
+  for (int i=0; i < numDBProperties; ++i) 
+    CPPUNIT_ASSERT_EQUAL(std::string(dbPropertyLabelsE[i]),
+			 std::string(dbPropertyLabels[i]));
+
+  // Test _dbToProperties()
   const int numLocs = _data->numLocs;
-  const int numDBProperties = _data->numDBProperties;
   double_array dbValues(numDBProperties);
 
   const int propertiesSize = _data->numPropsQuadPt;
@@ -443,8 +453,18 @@
   CPPUNIT_ASSERT(0 != _material);
   CPPUNIT_ASSERT(0 != _data);
   
+  // Check to make sure names of Metadata values match names of test
+  // data values (consistency check).
+  const int numDBStateVars = _data->numDBStateVars;
+  char** dbStateVarsLabelsE = _data->dbStateVarValues;
+  CPPUNIT_ASSERT_EQUAL(numDBStateVars, _material->_metadata.numDBStateVars());
+  const char* const* dbStateVarsLabels = _material->_metadata.dbStateVars();
+  for (int i=0; i < numDBStateVars; ++i) 
+    CPPUNIT_ASSERT_EQUAL(std::string(dbStateVarsLabelsE[i]),
+			 std::string(dbStateVarsLabels[i]));
+
+  // Test _dbToStateVars()
   const int numLocs = _data->numLocs;
-  const int numDBStateVars = _data->numDBStateVars;
   double_array dbValues(numDBStateVars);
 
   const int stateVarsSize = _data->numVarsQuadPt;

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DElasticData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DElasticData.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DElasticData.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -58,9 +58,9 @@
 "density",
 "vs",
 "vp",
-"friction_angle",
+"friction-angle",
 "cohesion",
-"dilatation_angle",
+"dilatation-angle",
 };
 
 const char* pylith::materials::DruckerPrager3DElasticData::_dbStateVarValues[] = {

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -64,12 +64,12 @@
 "density",
 "vs",
 "vp",
-"shear_ratio_1",
-"shear_ratio_2",
-"shear_ratio_3",
-"viscosity_1",
-"viscosity_2",
-"viscosity_3",
+"shear-ratio-1",
+"shear-ratio-2",
+"shear-ratio-3",
+"viscosity-1",
+"viscosity-2",
+"viscosity-3",
 };
 
 const char* pylith::materials::GenMaxwellIsotropic3DElasticData::_dbStateVarValues[] = {

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/PowerLaw3DElasticData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/PowerLaw3DElasticData.cc	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/PowerLaw3DElasticData.cc	2010-07-14 15:21:24 UTC (rev 17043)
@@ -59,9 +59,9 @@
 "density",
 "vs",
 "vp",
-"reference_strain_rate",
-"reference_stress",
-"power_law_exponent",
+"reference-strain-rate",
+"reference-stress",
+"power-law-exponent",
 };
 
 const char* pylith::materials::PowerLaw3DElasticData::_dbStateVarValues[] = {

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/Makefile.am	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/Makefile.am	2010-07-14 15:21:24 UTC (rev 17043)
@@ -24,7 +24,8 @@
 	TestFrictionModel.py \
 	TestStaticFriction.py \
 	TestSlipWeakening.py \
-	TestRateStateAgeing.py
+	TestRateStateAgeing.py \
+	TestTimeWeakening.py
 
 
 # End of file 

Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/TestTimeWeakening.py (from rev 17042, short/3D/PyLith/trunk/unittests/pytests/friction/TestTimeWeakening.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/TestTimeWeakening.py	                        (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/TestTimeWeakening.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/pytests/friction/TestTimeWeakening.py
+
+## @brief Unit testing of TimeWeakening object.
+
+import unittest
+
+from pylith.friction.TimeWeakening import TimeWeakening
+
+# ----------------------------------------------------------------------
+class TestTimeWeakening(unittest.TestCase):
+  """
+  Unit testing of TimeWeakening object.
+  """
+
+  def setUp(self):
+    """
+    Setup test subject.
+    """
+    self.friction = TimeWeakening()
+    return
+  
+
+  def test_constructor(self):
+    """
+    Test constructor.
+    """
+    return
+
+
+  def test_factory(self):
+    """
+    Test factory method.
+    """
+    from pylith.friction.TimeWeakening import friction_model
+    m = friction_model()
+    return
+
+
+# End of file 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/testfriction.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/testfriction.py	2010-07-13 19:15:11 UTC (rev 17042)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/friction/testfriction.py	2010-07-14 15:21:24 UTC (rev 17043)
@@ -65,6 +65,9 @@
     from TestRateStateAgeing import TestRateStateAgeing
     suite.addTest(unittest.makeSuite(TestRateStateAgeing))
 
+    from TestTimeWeakening import TestTimeWeakening
+    suite.addTest(unittest.makeSuite(TestTimeWeakening))
+
     from TestFrictionModel import TestFrictionModel
     suite.addTest(unittest.makeSuite(TestFrictionModel))
 



More information about the CIG-COMMITS mailing list