[cig-commits] r18848 - in short/3D/PyLith/trunk: doc/userguide/boundaryconditions examples libsrc/pylith/faults libsrc/pylith/meshio libsrc/pylith/topology modulesrc/topology pylith/materials pylith/problems pylith/tests pylith/utils tests/2d/frictionslide tests_auto/2d/quad4 unittests/libtests/topology

brad at geodynamics.org brad at geodynamics.org
Tue Aug 23 13:09:13 PDT 2011


Author: brad
Date: 2011-08-23 13:09:12 -0700 (Tue, 23 Aug 2011)
New Revision: 18848

Added:
   short/3D/PyLith/trunk/tests/2d/frictionslide/ratestate.cfg
   short/3D/PyLith/trunk/tests/2d/frictionslide/tension.cfg
   short/3D/PyLith/trunk/tests/2d/frictionslide/tension_axial.timedb
   short/3D/PyLith/trunk/tests/2d/frictionslide/tension_shear.timedb
Modified:
   short/3D/PyLith/trunk/doc/userguide/boundaryconditions/boundaryconditions.lyx
   short/3D/PyLith/trunk/examples/run_examples.sh
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.hh
   short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveKin.cc
   short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc
   short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/Distributor.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/Field.hh
   short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc
   short/3D/PyLith/trunk/modulesrc/topology/Field.i
   short/3D/PyLith/trunk/modulesrc/topology/topology.i
   short/3D/PyLith/trunk/pylith/materials/Material.py
   short/3D/PyLith/trunk/pylith/problems/Explicit.py
   short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py
   short/3D/PyLith/trunk/pylith/problems/Formulation.py
   short/3D/PyLith/trunk/pylith/problems/Implicit.py
   short/3D/PyLith/trunk/pylith/problems/ImplicitCUDA.py
   short/3D/PyLith/trunk/pylith/tests/Solution.py
   short/3D/PyLith/trunk/pylith/utils/VTKDataReader.py
   short/3D/PyLith/trunk/tests/2d/frictionslide/pylithapp.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_compression.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_opening.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_shear_sliding.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_shear_stick.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/lgdeformrigidbody.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/rigidbody_soln.py
   short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_compression.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_opening.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_shear_sliding.cfg
   short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_shear_stick.cfg
   short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc
   short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldSubMesh.cc
Log:
Merge from stable.

Modified: short/3D/PyLith/trunk/doc/userguide/boundaryconditions/boundaryconditions.lyx
===================================================================
--- short/3D/PyLith/trunk/doc/userguide/boundaryconditions/boundaryconditions.lyx	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/doc/userguide/boundaryconditions/boundaryconditions.lyx	2011-08-23 20:09:12 UTC (rev 18848)
@@ -4727,7 +4727,7 @@
 
 \end_inset
 
-where we have replace 
+where we have replaced 
 \begin_inset Formula $\underline{C}$
 \end_inset
 

Modified: short/3D/PyLith/trunk/examples/run_examples.sh
===================================================================
--- short/3D/PyLith/trunk/examples/run_examples.sh	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/examples/run_examples.sh	2011-08-23 20:09:12 UTC (rev 18848)
@@ -7,12 +7,16 @@
 
 # Run specified list of examples (single .cfg file)
 run_examples() {
+  nprocs=1
+  if [ $# == 1 ]; then
+    nprocs=$1
+  fi
   cd ${examples_dir}/$dir
   rm *.vtk
   if [ -d output ]; then rm output/*.vtk; fi
   for example in $examples; do
     echo "RUNNING $dir/$example"
-    pylith $example
+    pylith --nodes=$nprocs $example
   done
 }
 
@@ -57,17 +61,27 @@
 dir="3d/tet4"
 examples="step01.cfg step02.cfg step03.cfg step04.cfg"
 run_examples
+run_examples 2
+run_examples 3
+run_examples 4
+run_examples 5
 
 # 3d/hex8
 dir="3d/hex8"
-examples="step01.cfg step02.cfg step03.cfg step04.cfg step05.cfg step06.cfg step07.cfg step08.cfg step09.cfg step10.cfg step11.cfg step12.cfg step13.cfg step14.cfg step15.cfg step16.cfg step17.cfg"
+examples="step01.cfg step02.cfg step03.cfg step04.cfg step05.cfg step06.cfg step07.cfg step08.cfg step09.cfg step10.cfg step11.cfg step12.cfg step13.cfg step14.cfg step15.cfg step16.cfg step17.cfg step18.cfg step19.cfg"
 run_examples
 
+examples="step01.cfg step03.cfg step06.cfg step15.cfg step19.cfg"
+run_examples 2
+
 # ----------------------------------------------------------------------
 # subduction
 dir="2d/subduction"
 examples="step01.cfg step02.cfg step03.cfg"
 run_examples
+run_examples 2
+run_examples 4
+run_examples 5
 
 # ----------------------------------------------------------------------
 # bar_shearwave/tri3
@@ -93,7 +107,7 @@
 run_examples
 
 
-
+# ----------------------------------------------------------------------
 # Return to examples dir
 cd ${examples_dir}
   

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -60,7 +60,7 @@
 typedef ALE::ISieveVisitor::IndicesVisitor<RealSection,SieveSubMesh::order_type,PetscInt> IndicesVisitor;
 
 // ----------------------------------------------------------------------
-const double pylith::faults::FaultCohesiveDyn::_slipRateTolerance = 1.0e-12;
+const double pylith::faults::FaultCohesiveDyn::_zeroTolerance = 1.0e-12;
 
 // ----------------------------------------------------------------------
 // Default constructor.
@@ -439,9 +439,9 @@
 #if 0 // DEBUGGING
   slipSection->view("SLIP");
   slipRateSection->view("SLIP RATE");
-  areaSection->view("AREA");
-  dispTSection->view("DISP (t)");
-  dispTIncrSection->view("DISP INCR (t->t+dt)");
+  //areaSection->view("AREA");
+  //dispTSection->view("DISP (t)");
+  //dispTIncrSection->view("DISP INCR (t->t+dt)");
 #endif
 
   const int numVertices = _cohesiveVertices.size();
@@ -521,6 +521,9 @@
     orientationSection->restrictPoint(v_fault, &orientationVertex[0],
     orientationVertex.size());
 
+    // Get slip
+    slipSection->restrictPoint(v_fault, &slipVertex[0], slipVertex.size());
+
     // Get change in relative displacement.
     const double* dispRelVertex = dispRelSection->restrictPoint(v_fault);
     assert(0 != dispRelVertex);
@@ -555,12 +558,12 @@
     // Do not allow fault interpenetration and set fault opening to
     // zero if fault is under compression.
     const int indexN = spaceDim - 1;
-    if (dSlipVertex[indexN] < 0.0)
-      dSlipVertex[indexN] = 0.0;
     const double lagrangeTpdtNormal = lagrangeTVertex[indexN] + 
       lagrangeTIncrVertex[indexN] + dLagrangeTpdtVertex[indexN];
-    if (lagrangeTpdtNormal < 0.0)
-      dSlipVertex[indexN] = 0.0;
+    if (lagrangeTpdtNormal < -_zeroTolerance || 
+	slipVertex[indexN] + dSlipVertex[indexN] < 0.0) {
+      dSlipVertex[indexN] = -slipVertex[indexN];
+    } // if
 
     // Set change in slip.
     assert(dSlipVertex.size() ==
@@ -594,7 +597,7 @@
 
 #if 0 // DEBUGGING
   dLagrangeTpdtSection->view("AFTER dLagrange");
-  dispTIncrSection->view("AFTER DISP INCR (t->t+dt)");
+  //dispTIncrSection->view("AFTER DISP INCR (t->t+dt)");
   slipSection->view("AFTER SLIP");
   slipRateSection->view("AFTER SLIP RATE");
 #endif
@@ -1499,7 +1502,7 @@
 
     // Limit velocity to resolvable range
     for (int iDim = 0; iDim < spaceDim; ++iDim)
-      if (fabs(slipRateVertex[iDim]) < _slipRateTolerance)
+      if (fabs(slipRateVertex[iDim]) < _zeroTolerance)
 	slipRateVertex[iDim] = 0.0;
 
     // Update slip rate field.
@@ -1529,7 +1532,7 @@
     const topology::Field<topology::SubMesh>& slip =
         _fields->get("slip");
     solution.cloneSection(slip);
-    solution.createScatter();
+    solution.createScatter(solution.mesh());
   } // if
   const topology::Field<topology::SubMesh>& solution =
       _fields->get("sensitivity solution");
@@ -1539,7 +1542,7 @@
     topology::Field<topology::SubMesh>& residual =
         _fields->get("sensitivity residual");
     residual.cloneSection(solution);
-    residual.createScatter();
+    residual.createScatter(solution.mesh());
   } // if
 
   if (!_fields->hasField("sensitivity dispRel")) {
@@ -1579,8 +1582,8 @@
     int maxIters = 0;
     err = KSPGetTolerances(_ksp, &rtol, &atol, &dtol, &maxIters); 
     CHECK_PETSC_ERROR(err);
-    rtol = 1.0e-15;
-    atol = 1.0e-25;
+    rtol = _zeroTolerance;
+    atol = 0.001*_zeroTolerance;
     err = KSPSetTolerances(_ksp, rtol, atol, dtol, maxIters);
     CHECK_PETSC_ERROR(err);
 
@@ -1792,7 +1795,10 @@
   // Update section view of field.
   solution.scatterVectorToSection();
 
-  //solution.view("SENSITIVITY SOLUTION"); // DEBUGGING
+#if 0 // DEBUGGING
+  residual.view("SENSITIVITY RESIDUAL");
+  solution.view("SENSITIVITY SOLUTION");
+#endif
 } // _sensitivitySolve
 
 // ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.hh	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveDyn.hh	2011-08-23 20:09:12 UTC (rev 18848)
@@ -290,8 +290,8 @@
 
   PetscKSP _ksp; ///< PETSc KSP linear solver for sensitivity problem.
 
-  /// Minimum resolvable slip rate accounting for roundoff errors
-  static const double _slipRateTolerance;
+  /// Minimum resolvable value accounting for roundoff errors
+  static const double _zeroTolerance;
 
 // NOT IMPLEMENTED ////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveKin.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveKin.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -227,7 +227,8 @@
         _fields->get("buffer (vector)");
     buffer.copy(s_iter->second->finalSlip());
     assert(value.length() > 0);
-    const std::string& label = std::string("final_slip_") + std::string(value);
+    const std::string& label = (_eqSrcs.size() > 1) ? 
+      std::string("final_slip_") + std::string(value) : "final_slip";
     buffer.label(label.c_str());
 
     return buffer;
@@ -244,7 +245,8 @@
         _fields->get("buffer (scalar)");
     buffer.copy(s_iter->second->slipTime());
     assert(value.length() > 0);
-    const std::string& label = std::string("slip_time_") + std::string(value);
+    const std::string& label = (_eqSrcs.size() > 1) ? 
+      std::string("slip_time_") + std::string(value) : "slip_time";
     buffer.label(label.c_str());
 
     return buffer;

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -129,7 +129,7 @@
     assert(!vNumbering.isNull());
     //vNumbering->view("VERTEX NUMBERING");
 
-    coordinates.createScatterWithBC(vNumbering, context);
+    coordinates.createScatterWithBC(mesh, vNumbering, context);
     coordinates.scatterSectionToVector(context);
     PetscVec coordinatesVector = coordinates.vector(context);
     assert(coordinatesVector);
@@ -185,8 +185,17 @@
 	const typename ALE::ISieveVisitor::NConeRetriever<sieve_type>::oriented_point_type* cone =
 	  ncV.getOrientedPoints();
 	const int coneSize = ncV.getOrientedSize();
-          for (int c=0; c < coneSize; ++c)
-            tmpVertices[k++] = vNumbering->getIndex(cone[c].first);
+	if (coneSize != numCorners) {
+	  std::ostringstream msg;
+	  msg << "Inconsistency in topology found for mesh '"
+	      << sieveMesh->getName() << "' during output.\n"
+	      << "Number of vertices (" << coneSize << ") in cell '"
+	      << *c_iter << "' does not expected number of vertices ("
+	      << numCorners << ").";
+	  throw std::runtime_error(msg.str());
+	} // if
+	for (int c=0; c < coneSize; ++c)
+	  tmpVertices[k++] = vNumbering->getIndex(cone[c].first);
       } // if
 
     PetscVec elemVec;
@@ -268,7 +277,16 @@
       sieveMesh->getFactory()->getNumbering(sieveMesh, "censored depth", 0) :
       sieveMesh->getFactory()->getNumbering(sieveMesh, 0);
     assert(!vNumbering.isNull());
-    field.createScatterWithBC(vNumbering, context);
+
+#if 0
+    std::cout << "WRITE VERTEX FIELD" << std::endl;
+    mesh.view("MESH");
+    field.view("FIELD");;
+    vNumbering->view("NUMBERING");
+    std::cout << std::endl;
+#endif
+
+    field.createScatterWithBC(mesh, vNumbering, context);
     field.scatterSectionToVector(context);
     PetscVec vector = field.vector(context);
     assert(vector);
@@ -364,7 +382,7 @@
     const ALE::Obj<typename mesh_type::SieveMesh::numbering_type>& numbering = 
       sieveMesh->getFactory()->getNumbering(sieveMesh, labelName, depth);
     assert(!numbering.isNull());
-    field.createScatterWithBC(numbering, context);
+    field.createScatterWithBC(field.mesh(), numbering, context);
     field.scatterSectionToVector(context);
     PetscVec vector = field.vector(context);
     assert(vector);

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -130,7 +130,7 @@
       sieveMesh->getFactory()->getNumbering(sieveMesh, "censored depth", 0) :
       sieveMesh->getFactory()->getNumbering(sieveMesh, 0);
     assert(!vNumbering.isNull());
-    coordinates.createScatterWithBC(vNumbering, context);
+    coordinates.createScatterWithBC(mesh, vNumbering, context);
     coordinates.scatterSectionToVector(context);
     PetscVec coordinatesVector = coordinates.vector(context);
     assert(coordinatesVector);
@@ -201,8 +201,17 @@
 	const typename ALE::ISieveVisitor::NConeRetriever<sieve_type>::oriented_point_type* cone =
 	  ncV.getOrientedPoints();
 	const int coneSize = ncV.getOrientedSize();
-          for (int c=0; c < coneSize; ++c)
-            tmpVertices[k++] = vNumbering->getIndex(cone[c].first);
+	if (coneSize != numCorners) {
+	  std::ostringstream msg;
+	  msg << "Inconsistency in topology found for mesh '"
+	      << sieveMesh->getName() << "' during output.\n"
+	      << "Number of vertices (" << coneSize << ") in cell '"
+	      << *c_iter << "' does not expected number of vertices ("
+	      << numCorners << ").";
+	  throw std::runtime_error(msg.str());
+	} // if
+	for (int c=0; c < coneSize; ++c)
+	  tmpVertices[k++] = vNumbering->getIndex(cone[c].first);
       } // if
 
     PetscVec elemVec;
@@ -300,7 +309,7 @@
       sieveMesh->getFactory()->getNumbering(sieveMesh, "censored depth", 0) :
       sieveMesh->getFactory()->getNumbering(sieveMesh, 0);
     assert(!vNumbering.isNull());
-    field.createScatterWithBC(vNumbering, context);
+    field.createScatterWithBC(mesh, vNumbering, context);
     field.scatterSectionToVector(context);
     PetscVec vector = field.vector(context);
     assert(vector);
@@ -436,7 +445,7 @@
     const ALE::Obj<typename mesh_type::SieveMesh::numbering_type>& numbering = 
       sieveMesh->getFactory()->getNumbering(sieveMesh, labelName, depth);
     assert(!numbering.isNull());
-    field.createScatterWithBC(numbering, context);
+    field.createScatterWithBC(field.mesh(), numbering, context);
     field.scatterSectionToVector(context);
     PetscVec vector = field.vector(context);
     assert(vector);

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Distributor.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Distributor.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Distributor.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -388,6 +388,11 @@
   logger.stagePop();
   logger.stagePop(); // Mesh
   //logger.setDebug(0);
+
+#if 0 // DEBUGGING
+  sendParallelMeshOverlap->view("SEND OVERLAP");
+  recvParallelMeshOverlap->view("RECV OVERLAP");
+#endif
 } // distribute
 
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -745,12 +745,14 @@
 // information from the "global" PETSc vector view to the "local"
 // Sieve section view.
 template<typename mesh_type, typename section_type>
+template<typename scatter_mesh_type>
 void
-pylith::topology::Field<mesh_type, section_type>::createScatter(const char* context)
+pylith::topology::Field<mesh_type, section_type>::createScatter(const scatter_mesh_type& mesh,
+								const char* context)
 { // createScatter
   assert(context);
   assert(!_section.isNull());
-  assert(!_mesh.sieveMesh().isNull());
+  assert(!mesh.sieveMesh().isNull());
 
   PetscErrorCode err = 0;
   const bool createScatterOk = true;
@@ -767,7 +769,7 @@
   // Get global order (create if necessary).
   const std::string& orderLabel = _section->getName();
   const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh =
-    _mesh.sieveMesh();
+    mesh.sieveMesh();
   assert(!sieveMesh.isNull());
   const ALE::Obj<typename mesh_type::SieveMesh::order_type>& order = 
     sieveMesh->getFactory()->getGlobalOrder(sieveMesh, orderLabel,
@@ -775,7 +777,8 @@
   assert(!order.isNull());
 
   // Create scatter
-  err = DMMeshCreateGlobalScatter(_mesh.sieveMesh(), _section, order, false, &sinfo.scatter);
+  err = DMMeshCreateGlobalScatter(sieveMesh, _section, order, false, 
+				  &sinfo.scatter);
   CHECK_PETSC_ERROR(err);
   
   // Create scatterVec
@@ -809,14 +812,17 @@
 // DOF. Use createScatterWithBC() to include the constrained DOF in
 // the PETSc vector.
 template<typename mesh_type, typename section_type>
+template<typename scatter_mesh_type>
 void
-pylith::topology::Field<mesh_type, section_type>::createScatter(const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
-								const char* context)
+pylith::topology::Field<mesh_type, section_type>::createScatter(
+      const scatter_mesh_type& mesh,
+      const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
+      const char* context)
 { // createScatter
   assert(!numbering.isNull());
   assert(context);
   assert(!_section.isNull());
-  assert(!_mesh.sieveMesh().isNull());
+  assert(!mesh.sieveMesh().isNull());
 
   PetscErrorCode err = 0;
   const bool createScatterOk = true;
@@ -838,7 +844,7 @@
     _section->getName() + std::string("_") + std::string(context) :
     _section->getName();
   const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh =
-    _mesh.sieveMesh();
+    mesh.sieveMesh();
   assert(!sieveMesh.isNull());
   const ALE::Obj<typename mesh_type::SieveMesh::order_type>& order = 
     sieveMesh->getFactory()->getGlobalOrder(sieveMesh, orderLabel,
@@ -848,7 +854,8 @@
   assert(!order.isNull());
 
   // Create scatter
-  err = DMMeshCreateGlobalScatter(_mesh.sieveMesh(), _section, order, false, &sinfo.scatter); 
+  err = DMMeshCreateGlobalScatter(sieveMesh, _section, order, false, 
+				  &sinfo.scatter); 
   CHECK_PETSC_ERROR(err);
 
   // Create scatterVec
@@ -862,7 +869,7 @@
   } // if/else
 
   // Create vector
-  err = VecCreate(_mesh.comm(), &sinfo.vector);
+  err = VecCreate(mesh.comm(), &sinfo.vector);
   CHECK_PETSC_ERROR(err);
   err = PetscObjectSetName((PetscObject)sinfo.vector,
 			   _metadata.label.c_str());
@@ -892,12 +899,15 @@
 // DOF. Use createScatterWithBC() to include the constrained DOF in
 // the PETSc vector.
 template<typename mesh_type, typename section_type>
+template<typename scatter_mesh_type>
 void
-pylith::topology::Field<mesh_type, section_type>::createScatterWithBC(const char* context)
+pylith::topology::Field<mesh_type, section_type>::createScatterWithBC(
+        const scatter_mesh_type& mesh,
+	const char* context)
 { // createScatterWithBC
   assert(context);
   assert(!_section.isNull());
-  assert(!_mesh.sieveMesh().isNull());
+  assert(!mesh.sieveMesh().isNull());
 
 
   PetscErrorCode err = 0;
@@ -915,7 +925,7 @@
   // Get global order (create if necessary).
   const std::string& orderLabel = _section->getName();
   const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh =
-    _mesh.sieveMesh();
+    mesh.sieveMesh();
   assert(!sieveMesh.isNull());
   const ALE::Obj<typename mesh_type::SieveMesh::order_type>& order = 
     sieveMesh->getFactory()->getGlobalOrderWithBC(sieveMesh, orderLabel,
@@ -923,7 +933,8 @@
   assert(!order.isNull());
 
   // Create scatter
-  err = DMMeshCreateGlobalScatter(_mesh.sieveMesh(), _section, order, true, &sinfo.scatter); 
+  err = DMMeshCreateGlobalScatter(sieveMesh, _section, order, true, 
+				  &sinfo.scatter); 
   CHECK_PETSC_ERROR(err);
   
   // Create scatterVec
@@ -937,7 +948,7 @@
   } // if/else
   
   // Create vector
-   err = VecCreate(_mesh.comm(), &sinfo.vector);
+   err = VecCreate(mesh.comm(), &sinfo.vector);
   CHECK_PETSC_ERROR(err);
   err = PetscObjectSetName((PetscObject)sinfo.vector,
 			   _metadata.label.c_str());
@@ -957,9 +968,12 @@
 // createScatter() if constrained DOF should be omitted from the PETSc
 // vector.
 template<typename mesh_type, typename section_type>
+template<typename scatter_mesh_type>
 void
-pylith::topology::Field<mesh_type, section_type>::createScatterWithBC(const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
-								const char* context)
+pylith::topology::Field<mesh_type, section_type>::createScatterWithBC(
+       const scatter_mesh_type& mesh,
+       const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
+       const char* context)
 { // createScatterWithBC
   assert(!numbering.isNull());
   assert(context);
@@ -985,7 +999,7 @@
     _section->getName() + std::string("_") + std::string(context) :
     _section->getName();
   const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh =
-    _mesh.sieveMesh();
+    mesh.sieveMesh();
   assert(!sieveMesh.isNull());
   const ALE::Obj<typename mesh_type::SieveMesh::order_type>& order = 
     sieveMesh->getFactory()->getGlobalOrderWithBC(sieveMesh, orderLabel,
@@ -996,7 +1010,8 @@
   //order->view("GLOBAL ORDER"); // DEBUG
 
   // Create scatter
-  err = DMMeshCreateGlobalScatter(_mesh.sieveMesh(), _section, order, true, &sinfo.scatter); 
+  err = DMMeshCreateGlobalScatter(sieveMesh, _section, order, true, 
+				  &sinfo.scatter); 
   CHECK_PETSC_ERROR(err);
 
   // Create scatterVec
@@ -1010,7 +1025,7 @@
   } // if/else
 
   // Create vector
-  err = VecCreate(_mesh.comm(), &sinfo.vector);
+  err = VecCreate(mesh.comm(), &sinfo.vector);
   CHECK_PETSC_ERROR(err);
   err = PetscObjectSetName((PetscObject)sinfo.vector,
 			   _metadata.label.c_str());

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Field.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Field.hh	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Field.hh	2011-08-23 20:09:12 UTC (rev 18848)
@@ -267,9 +267,12 @@
    * DOF. Use createScatterWithBC() to include the constrained DOF in
    * the PETSc vector.
    *
+   * @param mesh Mesh associated with scatter.
    * @param context Label for context associated with vector.
    */
-  void createScatter(const char* context ="");
+  template<typename scatter_mesh_type>
+  void createScatter(const scatter_mesh_type& mesh,
+		     const char* context ="");
 
 
   /** Create PETSc vector scatter for field. This is used to transfer
@@ -278,10 +281,13 @@
    * DOF. Use createScatterWithBC() to include the constrained DOF in
    * the PETSc vector.
    *
+   * @param mesh Mesh associated with scatter.
    * @param numbering Numbering used to select points in section.
    * @param context Label for context associated with vector.
    */
-  void createScatter(const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
+  template<typename scatter_mesh_type>
+  void createScatter(const scatter_mesh_type& mesh,
+		     const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
 		     const char* context ="");
 
   /** Create PETSc vector scatter for field. This is used to transfer
@@ -290,9 +296,12 @@
    * DOF. Use createScatter() if constrained DOF should be omitted
    * from the PETSc vector.
    *
+   * @param mesh Mesh associated with scatter.
    * @param context Label for context associated with vector.
    */
-  void createScatterWithBC(const char* context ="");
+  template<typename scatter_mesh_type>
+  void createScatterWithBC(const scatter_mesh_type& mesh,
+			   const char* context ="");
 
 
   /** Create PETSc vector scatter for field. This is used to transfer
@@ -301,10 +310,13 @@
    * DOF. Use createScatter() if constrained DOF should be omitted
    * from the PETSc vector.
    *
+   * @param mesh Mesh associated with scatter.
    * @param numbering Numbering used to select points in section.
    * @param context Label for context associated with vector.
    */
-  void createScatterWithBC(const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
+  template<typename scatter_mesh_type>
+  void createScatterWithBC(const scatter_mesh_type& mesh,
+			   const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
 		     const char* context ="");
 
   /** Get PETSc vector associated with field.

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -139,6 +139,14 @@
   // Set name
   std::string meshLabel = "subdomain_" + std::string(label);
   _mesh->setName(meshLabel);
+
+  if (sieve->getMaxConeSize() <= 0) {
+    std::ostringstream msg;
+    msg << "Error while creating submesh. Submesh '" 
+	<< label << "' does not contain any cells.\n"
+	<< "Submeshes must be one dimension lower than the domain mesh.";
+    throw std::runtime_error(msg.str());
+  } // if
 } // createSubMesh
 
 // ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/modulesrc/topology/Field.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/Field.i	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/modulesrc/topology/Field.i	2011-08-23 20:09:12 UTC (rev 18848)
@@ -203,9 +203,12 @@
        * information from the "global" PETSc vector view to the "local"
        * Sieve section view.
        *
+       * @param mesh Mesh associated with scatter.
        * @param context Label for context associated with vector.
        */
-      void createScatter(const char* context ="");
+      template<typename scatter_mesh_type>
+      void createScatter(const scatter_mesh_type& mesh,
+			 const char* context ="");
 
       /** Get PETSc vector associated with field.
        *

Modified: short/3D/PyLith/trunk/modulesrc/topology/topology.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/topology.i	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/modulesrc/topology/topology.i	2011-08-23 20:09:12 UTC (rev 18848)
@@ -74,6 +74,7 @@
 %include "ReverseCuthillMcKee.i"
 
 // Template instatiation
+
 %template(MeshField) pylith::topology::Field<pylith::topology::Mesh>;
 %template(SubMeshField) pylith::topology::Field<pylith::topology::SubMesh>;
 %template(MeshFields) pylith::topology::Fields<pylith::topology::Field<pylith::topology::Mesh> >;
@@ -82,5 +83,12 @@
 %template(MeshFieldsNew) pylith::topology::FieldsNew<pylith::topology::Mesh>;
 %template(SubMeshFieldsNew) pylith::topology::FieldsNew<pylith::topology::SubMesh>;
 
+%extend pylith::topology::Field<pylith::topology::Mesh> {
+  %template(createScatterMesh) createScatter<pylith::topology::Mesh>;
+ }
+%extend pylith::topology::Field<pylith::topology::Mesh> {
+  %template(createScatterSubMesh) createScatter<pylith::topology::SubMesh>;
+ }
+
 // End of file
 

Modified: short/3D/PyLith/trunk/pylith/materials/Material.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/Material.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/pylith/materials/Material.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -150,8 +150,9 @@
               "    number of corners: %d" % \
               (self.label(),
                self.quadrature.cellDim(), self.quadrature.spaceDim(),
+               self.quadrature.cell.numCorners, 
                self.mesh.dimension(), self.mesh.coordsys().spaceDim(),
-               self.quadrature.cell.numCorners, self.mesh.coneSize())
+               self.mesh.coneSize())
     self._eventLogger.eventEnd(logEvent)
     return
   

Modified: short/3D/PyLith/trunk/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Explicit.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/pylith/problems/Explicit.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -119,7 +119,7 @@
     dispT.zero()
     residual = self.fields.get("residual")
     residual.zero()
-    residual.createScatter()
+    residual.createScatterMesh(residual.mesh())
 
     lengthScale = normalizer.lengthScale()
     timeScale = normalizer.timeScale()

Modified: short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -112,7 +112,7 @@
     dispT.zero()
     residual = self.fields.get("residual")
     residual.zero()
-    residual.createScatter()
+    residual.createScatterMesh(residual.mesh())
 
     lengthScale = normalizer.lengthScale()
     timeScale = normalizer.timeScale()

Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -491,7 +491,7 @@
     memoryLogger.stagePop()
 
     # This also creates a global order.
-    solution.createScatter()
+    solution.createScatterMesh(solution.mesh())
 
     memoryLogger.stagePush("Problem")
     dispT = self.fields.get("disp(t)")

Modified: short/3D/PyLith/trunk/pylith/problems/Implicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Implicit.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/pylith/problems/Implicit.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -133,7 +133,7 @@
     dispT.zero()
     residual = self.fields.get("residual")
     residual.zero()
-    residual.createScatter()
+    residual.createScatterMesh(residual.mesh())
 
     lengthScale = normalizer.lengthScale()
     timeScale = normalizer.timeScale()

Modified: short/3D/PyLith/trunk/pylith/problems/ImplicitCUDA.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/ImplicitCUDA.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/pylith/problems/ImplicitCUDA.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -133,7 +133,7 @@
     dispT.zero()
     residual = self.fields.get("residual")
     residual.zero()
-    residual.createScatter()
+    residual.createScatterMesh(residual.mesh())
 
     lengthScale = normalizer.lengthScale()
     timeScale = normalizer.timeScale()

Modified: short/3D/PyLith/trunk/pylith/tests/Solution.py
===================================================================
--- short/3D/PyLith/trunk/pylith/tests/Solution.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/pylith/tests/Solution.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -34,13 +34,14 @@
   testcase.assertEqual(mesh['spaceDim'], spaceDim)
 
   # Check displacement solution
-  tolerance = 1.0e-6
+  toleranceMask = 1.0e-3
+  tolerance = 1.0e-5
 
   dispE = testcase.calcDisplacements(data['vertices'])
   disp = data['vertex_fields']['displacement']
 
   # Check x displacements
-  mask = numpy.abs(dispE[:,0]) > tolerance
+  mask = numpy.abs(dispE[:,0]) > toleranceMask
   diff = numpy.abs(disp[:,0] - dispE[:,0])
   diffR = numpy.abs(1.0 - disp[:,0] / dispE[:,0])  
   okay = ~mask * (diff < tolerance) + mask * (diffR < tolerance)
@@ -48,10 +49,13 @@
     print "Error in x-component of displacement field."
     print "Expected values: ",dispE
     print "Output values: ",disp
+    print dispE[~okay]
+    print disp[~okay]
+    print diffR[~okay]
   testcase.assertEqual(nvertices, numpy.sum(okay))    
     
   # Check y displacements
-  mask = numpy.abs(dispE[:,1]) > tolerance
+  mask = numpy.abs(dispE[:,1]) > toleranceMask
   diff = numpy.abs(disp[:,1] - dispE[:,1])
   diffR = numpy.abs(1.0 - disp[:,1] / dispE[:,1])  
   okay = ~mask * (diff < tolerance) + mask * (diffR < tolerance)
@@ -59,10 +63,13 @@
     print "Error in y-component of displacement field."
     print "Expected values: ",dispE
     print "Output values: ",disp
+    print dispE[~okay]
+    print disp[~okay]
+    print diffR[~okay]
   testcase.assertEqual(nvertices, numpy.sum(okay))    
 
   # Check z displacements
-  mask = numpy.abs(dispE[:,2]) > tolerance
+  mask = numpy.abs(dispE[:,2]) > toleranceMask
   diff = numpy.abs(disp[:,2] - dispE[:,2])
   diffR = numpy.abs(1.0 - disp[:,2] / dispE[:,2])  
   okay = ~mask * (diff < tolerance) + mask * (diffR < tolerance)

Modified: short/3D/PyLith/trunk/pylith/utils/VTKDataReader.py
===================================================================
--- short/3D/PyLith/trunk/pylith/utils/VTKDataReader.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/pylith/utils/VTKDataReader.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -25,13 +25,13 @@
 def has_vtk():
   if not "flag" in dir(has_vtk):
     try:
-      from enthought.tvtk.api import tvtk
+      from tvtk.api import tvtk
       has_vtk.flag = True
     except ImportError:
       print "WARNING: Cannot find Mayavi VTK interface to check output."
       print "         Tests limited to running PyLith without errors."
       print "         Install MayaVi2 " \
-          "(https://svn.enthought.com/enthought/wiki/MayaVi)"
+          "(http://code.enthought.com/projects/mayavi/)"
       print "         in order to enable verification of output."
       has_vtk.flag = False
   return has_vtk.flag
@@ -43,7 +43,7 @@
   """
 
   def __init__(self):
-    from enthought.tvtk.api import tvtk
+    from tvtk.api import tvtk
     reader = tvtk.UnstructuredGridReader()
     reader.read_all_scalars = True
     reader.read_all_vectors = True

Modified: short/3D/PyLith/trunk/tests/2d/frictionslide/pylithapp.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/pylithapp.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/pylithapp.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -42,7 +42,6 @@
 normalizer.length_scale = 1.0*m
 normalizer.relaxation_time = 1.0*s
 
-bc = [ypos,yneg]
 interfaces = [fault]
 materials = [elastic]
 
@@ -72,39 +71,6 @@
 quadrature.cell.quad_order = 2
 
 # ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
-[pylithapp.timedependent.bc]
-ypos = pylith.bc.DirichletBC
-yneg = pylith.bc.DirichletBC
-
-# Dirichlet BC on -y
-[pylithapp.timedependent.bc.yneg]
-bc_dof = [0, 1]
-label = yneg
-
-
-# Dirichlet BC on +y
-[pylithapp.timedependent.bc.ypos]
-bc_dof = [0, 1]
-label = ypos
-
-db_change = spatialdata.spatialdb.UniformDB
-db_change.label = Spatial variation of displacement on +y
-db_change.values = [displacement-x,displacement-y,change-start-time]
-db_change.data = [1.0*m, 0.0*m, 0.0*s]
-
-th_change = spatialdata.spatialdb.TimeHistory
-th_change.label = Displacement time history on +y
-th_change.filename = velocitysteps.timedb
-
-
-#db_rate = spatialdata.spatialdb.UniformDB
-#db_rate.label = Dirichlet rate BC on +y
-#db_rate.values = [displacement-rate-x,displacement-rate-y,rate-start-time]
-#db_rate.data = [1.0e-6*m/s, 0.0*m/s, 0.0*s]
-
-# ----------------------------------------------------------------------
 # faults
 # ----------------------------------------------------------------------
 [pylithapp.timedependent.interfaces]
@@ -117,12 +83,6 @@
 quadrature.cell.dimension = 1
 quadrature.cell.quad_order = 2
 
-db_initial_tractions = spatialdata.spatialdb.UniformDB
-db_initial_tractions.label = Initial fault tractions
-db_initial_tractions.values = [traction-shear,traction-normal]
-db_initial_tractions.data = [0.0*MPa, -10.0*MPa]
-
-
 # ----------------------------------------------------------------------
 # PETSc
 # ----------------------------------------------------------------------
@@ -151,17 +111,6 @@
 #snes_view = true
 snes_converged_reason = true
 
-# Friction
-friction_pc_type = asm
-friction_sub_pc_factor_shift_type = nonzero
-friction_ksp_rtol = 1.0e-12
-friction_ksp_atol = 1.0e-15
-friction_ksp_max_it = 25
-friction_ksp_gmres_restart = 30
-#friction_ksp_monitor = true
-#friction_ksp_view = true
-friction_ksp_converged_reason = true
-
 #log_summary = true
 
 # ----------------------------------------------------------------------

Copied: short/3D/PyLith/trunk/tests/2d/frictionslide/ratestate.cfg (from rev 18847, short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide/ratestate.cfg)
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/ratestate.cfg	                        (rev 0)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/ratestate.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -0,0 +1,65 @@
+# -*- Python -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+bc = [ypos,yneg]
+
+# ----------------------------------------------------------------------
+# boundary conditions
+# ----------------------------------------------------------------------
+[pylithapp.timedependent.bc]
+ypos = pylith.bc.DirichletBC
+yneg = pylith.bc.DirichletBC
+
+# Dirichlet BC on -y
+[pylithapp.timedependent.bc.yneg]
+bc_dof = [0, 1]
+label = yneg
+
+
+# Dirichlet BC on +y
+[pylithapp.timedependent.bc.ypos]
+bc_dof = [0, 1]
+label = ypos
+
+db_change = spatialdata.spatialdb.UniformDB
+db_change.label = Spatial variation of displacement on +y
+db_change.values = [displacement-x,displacement-y,change-start-time]
+db_change.data = [1.0*m, 0.0*m, 0.0*s]
+
+th_change = spatialdata.spatialdb.TimeHistory
+th_change.label = Displacement time history on +y
+th_change.filename = velocitysteps.timedb
+
+
+#db_rate = spatialdata.spatialdb.UniformDB
+#db_rate.label = Dirichlet rate BC on +y
+#db_rate.values = [displacement-rate-x,displacement-rate-y,rate-start-time]
+#db_rate.data = [1.0e-6*m/s, 0.0*m/s, 0.0*s]
+
+# ----------------------------------------------------------------------
+# faults
+# ----------------------------------------------------------------------
+db_initial_tractions = spatialdata.spatialdb.UniformDB
+db_initial_tractions.label = Initial fault tractions
+db_initial_tractions.values = [traction-shear,traction-normal]
+db_initial_tractions.data = [0.0*MPa, -10.0*MPa]
+
+
+# ----------------------------------------------------------------------
+# PETSc
+# ----------------------------------------------------------------------
+[pylithapp.petsc]
+
+# Friction
+friction_pc_type = asm
+friction_sub_pc_factor_shift_type = nonzero
+friction_ksp_max_it = 25
+friction_ksp_gmres_restart = 30
+#friction_ksp_monitor = true
+#friction_ksp_view = true
+friction_ksp_converged_reason = true
+

Copied: short/3D/PyLith/trunk/tests/2d/frictionslide/tension.cfg (from rev 18847, short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide/tension.cfg)
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/tension.cfg	                        (rev 0)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/tension.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -0,0 +1,154 @@
+# -*- Conf -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+bc = [ypos_shear,ypos_axial,yneg_shear,yneg_axial]
+
+normalizer.length_scale = 1.0*mm
+
+[pylithapp.timedependent.implicit.time_step]
+total_time = 4.0*s
+dt = 1.0*s
+
+# ----------------------------------------------------------------------
+# boundary conditions
+# ----------------------------------------------------------------------
+[pylithapp.timedependent.bc]
+ypos_shear = pylith.bc.DirichletBC
+yneg_shear = pylith.bc.DirichletBC
+ypos_axial = pylith.bc.DirichletBC
+yneg_axial = pylith.bc.DirichletBC
+
+# Dirichlet BC on +y - SHEAR
+[pylithapp.timedependent.bc.ypos_shear]
+bc_dof = [0]
+label = ypos
+
+db_change = spatialdata.spatialdb.UniformDB
+db_change.label = Spatial variation of shear displacement on +y
+db_change.values = [displacement-x,change-start-time]
+db_change.data = [-8.888888888888889e-05*m, 0.0*s]
+
+th_change = spatialdata.spatialdb.TimeHistory
+th_change.label = Displacement time history on +y
+th_change.filename = tension_shear.timedb
+
+
+# Dirichlet BC on -y - SHEAR
+[pylithapp.timedependent.bc.yneg_shear]
+bc_dof = [0]
+label = yneg
+
+db_change = spatialdata.spatialdb.UniformDB
+db_change.label = Spatial variation of shear displacement on +y
+db_change.values = [displacement-x,change-start-time]
+db_change.data = [8.888888888888889e-05*m, 0.0*s]
+
+th_change = spatialdata.spatialdb.TimeHistory
+th_change.label = Displacement time history on -y
+th_change.filename = tension_shear.timedb
+
+
+# Dirichlet BC on +y - AXIAL
+[pylithapp.timedependent.bc.ypos_axial]
+bc_dof = [1]
+label = ypos
+
+db_change = spatialdata.spatialdb.UniformDB
+db_change.label = Spatial variation of axial displacement on +y
+db_change.values = [displacement-y,change-start-time]
+db_change.data = [2.96290870442297e-05*m, 0.0*s]
+
+th_change = spatialdata.spatialdb.TimeHistory
+th_change.label = Displacement time history on +y
+th_change.filename = tension_axial.timedb
+
+
+# Dirichlet BC on -y - AXIAL
+[pylithapp.timedependent.bc.yneg_axial]
+bc_dof = [1]
+label = yneg
+
+db_change = spatialdata.spatialdb.UniformDB
+db_change.label = Spatial variation of axial displacement on -y
+db_change.values = [displacement-y,change-start-time]
+db_change.data = [-2.96290870442297e-05*m, 0.0*s]
+
+th_change = spatialdata.spatialdb.TimeHistory
+th_change.label = Displacement time history on +y
+th_change.filename = tension_axial.timedb
+
+
+# ----------------------------------------------------------------------
+# faults
+# ----------------------------------------------------------------------
+[pylithapp.timedependent.interfaces.fault]
+friction = pylith.friction.SlipWeakening
+friction.label = Slip weakening
+
+# Set slip-weakening friction model parameters using a uniform DB. Set the
+# parameters as follows:
+friction.db_properties = spatialdata.spatialdb.UniformDB
+friction.db_properties.label = Slip weakening
+friction.db_properties.values = [static-coefficient,dynamic-coefficient,slip-weakening-parameter,cohesion]
+friction.db_properties.data = [0.6,0.0,1.0*mm,0.0*Pa]
+
+db_initial_tractions = spatialdata.spatialdb.UniformDB
+db_initial_tractions.label = Initial fault tractions
+db_initial_tractions.values = [traction-shear,traction-normal]
+db_initial_tractions.data = [0.0*MPa, -0.0*MPa]
+
+[pylithapp.timedependent.interfaces.fault.output]
+vertex_data_fields=[slip,slip_rate,traction]
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+# Set filenames for output.
+[pylithapp.problem.formulation.output.output]
+writer.filename = output/tension.h5
+
+[pylithapp.timedependent.interfaces.fault.output]
+writer.filename = output/tension-fault.h5
+
+[pylithapp.timedependent.materials.elastic.output]
+writer.filename = output/tension-statevars.h5
+
+# ----------------------------------------------------------------------
+# PETSc
+# ----------------------------------------------------------------------
+[pylithapp.petsc]
+
+# Preconditioner settings.
+pc_type = asm
+sub_pc_factor_shift_type = nonzero
+
+# KSP
+ksp_rtol = 1.0e-12
+ksp_atol = 1.0e-15
+ksp_max_it = 50
+ksp_gmres_restart = 100
+
+ksp_monitor = true
+#ksp_view = true
+ksp_converged_reason = true
+
+# SNES
+snes_rtol = 1.0e-8
+snes_atol = 1.0e-12
+snes_max_it = 20
+
+snes_monitor = true
+#snes_view = true
+snes_converged_reason = true
+
+#log_summary = true
+
+# Friction
+#friction_ksp_monitor = true
+#friction_ksp_view = true
+#friction_ksp_converged_reason = true
+

Copied: short/3D/PyLith/trunk/tests/2d/frictionslide/tension_axial.timedb (from rev 18847, short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide/tension_axial.timedb)
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/tension_axial.timedb	                        (rev 0)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/tension_axial.timedb	2011-08-23 20:09:12 UTC (rev 18848)
@@ -0,0 +1,10 @@
+#TIME HISTORY ascii
+TimeHistory {
+  num-points = 5
+  time-units = second
+}
+ 0.0  -5.0
+ 1.0  +7.0
+ 2.0  +7.0
+ 3.0  +9.0
+ 4.0  -5.0

Copied: short/3D/PyLith/trunk/tests/2d/frictionslide/tension_shear.timedb (from rev 18847, short/3D/PyLith/branches/v1.6-stable/tests/2d/frictionslide/tension_shear.timedb)
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/tension_shear.timedb	                        (rev 0)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/tension_shear.timedb	2011-08-23 20:09:12 UTC (rev 18848)
@@ -0,0 +1,10 @@
+#TIME HISTORY ascii
+TimeHistory {
+  num-points = 5
+  time-units = second
+}
+ 0.0  +8.0
+ 1.0  +8.0
+ 2.0  +4.0
+ 3.0  +4.0
+ 4.0  +4.0

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_compression.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_compression.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_compression.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -36,7 +36,6 @@
 # ----------------------------------------------------------------------
 [friction_compression.timedependent]
 dimension = 2
-normalizer.length_scale = 1.0*m
 formulation = pylith.problems.Implicit
 formulation.solver = pylith.problems.SolverNonlinear
 
@@ -46,7 +45,7 @@
 
 [friction_compression.timedependent.formulation.time_step]
 total_time = 0.0*s
-dt = 1.0*s
+dt = 10.0*year
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_opening.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_opening.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_opening.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -43,7 +43,6 @@
 # ----------------------------------------------------------------------
 [friction_opening.timedependent]
 dimension = 2
-normalizer.length_scale = 1.0*m
 formulation = pylith.problems.Implicit
 formulation.solver = pylith.problems.SolverNonlinear
 
@@ -55,7 +54,7 @@
 
 [friction_opening.timedependent.formulation.time_step]
 total_time = 0.0*s
-dt = 1.0*s
+dt = 10.0*year
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_shear_sliding.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_shear_sliding.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_shear_sliding.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -40,7 +40,6 @@
 # ----------------------------------------------------------------------
 [friction_shear_sliding.timedependent]
 dimension = 2
-normalizer.length_scale = 1.0*m
 formulation = pylith.problems.Implicit
 formulation.solver = pylith.problems.SolverNonlinear
 
@@ -54,7 +53,7 @@
 
 [friction_shear_sliding.timedependent.formulation.time_step]
 total_time = 0.0*s
-dt = 1.0*s
+dt = 10.0*year
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_shear_stick.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_shear_stick.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/friction_shear_stick.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -38,7 +38,6 @@
 # ----------------------------------------------------------------------
 [friction_shear_stick.timedependent]
 dimension = 2
-normalizer.length_scale = 1.0*m
 formulation = pylith.problems.Implicit
 formulation.solver = pylith.problems.SolverNonlinear
 
@@ -51,7 +50,7 @@
 
 [friction_shear_stick.timedependent.formulation.time_step]
 total_time = 0.0*s
-dt = 1.0*s
+dt = 10.0*year
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/lgdeformrigidbody.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/lgdeformrigidbody.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/lgdeformrigidbody.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -83,7 +83,8 @@
 # Change the preconditioner settings.
 sub_pc_factor_shift_type = none
 
-ksp_rtol = 1.0e-8
+ksp_rtol = 1.0e-15
+ksp_atol = 1.0e-20
 ksp_max_it = 200
 ksp_gmres_restart = 100
 
@@ -91,6 +92,11 @@
 #ksp_view = true
 #ksp_converged_reason = true
 
+snes_rtol = 1.0e-12
+snes_atol = 1.0e-12
+ksp_max_it = 200
+ksp_gmres_restart = 100
+
 #snes_monitor = true
 #snes_view = true
 #snes_converged_reason = true

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/rigidbody_soln.py
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/rigidbody_soln.py	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/rigidbody_soln.py	2011-08-23 20:09:12 UTC (rev 18848)
@@ -59,11 +59,11 @@
   def displacement(self, locs):
     """
     Compute displacement field at locations.
-    """
-    u0 = 1000.0
-    v0 = 500.0
+    """ 
+    u0 = 200.0
+    v0 = 300.0
     from math import pi
-    theta = -30.0/180.0*pi
+    theta = -25.0/180.0*pi
 
     (npts, dim) = locs.shape
     disp = numpy.zeros( (npts, 3), dtype=numpy.float64)

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_compression.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_compression.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_compression.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -36,7 +36,6 @@
 # ----------------------------------------------------------------------
 [slipweakening_compression.timedependent]
 dimension = 2
-normalizer.length_scale = 1.0*m
 formulation = pylith.problems.Implicit
 formulation.solver = pylith.problems.SolverNonlinear
 
@@ -46,7 +45,7 @@
 
 [slipweakening_compression.timedependent.formulation.time_step]
 total_time = 0.0*s
-dt = 1.0*s
+dt = 10.0*year
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_opening.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_opening.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_opening.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -38,7 +38,6 @@
 # ----------------------------------------------------------------------
 [slipweakening_opening.timedependent]
 dimension = 2
-normalizer.length_scale = 1.0*m
 formulation = pylith.problems.Implicit
 formulation.solver = pylith.problems.SolverNonlinear
 
@@ -50,7 +49,7 @@
 
 [slipweakening_opening.timedependent.formulation.time_step]
 total_time = 0.0*s
-dt = 1.0*s
+dt = 10.0*year
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_shear_sliding.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_shear_sliding.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_shear_sliding.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -38,7 +38,6 @@
 # ----------------------------------------------------------------------
 [slipweakening_shear_sliding.timedependent]
 dimension = 2
-normalizer.length_scale = 1.0*m
 formulation = pylith.problems.Implicit
 formulation.solver = pylith.problems.SolverNonlinear
 
@@ -52,7 +51,7 @@
 
 [slipweakening_shear_sliding.timedependent.formulation.time_step]
 total_time = 0.0*s
-dt = 1.0*s
+dt = 10.0*year
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_shear_stick.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_shear_stick.cfg	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/tests_auto/2d/quad4/slipweakening_shear_stick.cfg	2011-08-23 20:09:12 UTC (rev 18848)
@@ -38,7 +38,6 @@
 # ----------------------------------------------------------------------
 [slipweakening_shear_stick.timedependent]
 dimension = 2
-normalizer.length_scale = 1.0*m
 formulation = pylith.problems.Implicit
 formulation.solver = pylith.problems.SolverNonlinear
 
@@ -51,7 +50,7 @@
 
 [slipweakening_shear_stick.timedependent.formulation.time_step]
 total_time = 0.0*s
-dt = 1.0*s
+dt = 10.0*year
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -346,8 +346,8 @@
 	 ++v_iter, index += nconstraints[i++])
       section->setConstraintDof(*v_iter, &constraints[index]);
     fieldSrc.zero();
-    fieldSrc.createScatter();
-    fieldSrc.createScatter("A");
+    fieldSrc.createScatter(mesh);
+    fieldSrc.createScatter(mesh, "A");
   } // Setup source field
 
   Field<Mesh> field(mesh);
@@ -878,7 +878,7 @@
   const int sizeE = vertices->size() * fiberDim;
 
   CPPUNIT_ASSERT_EQUAL(size_t(0), field._scatters.size());
-  field.createScatter();
+  field.createScatter(mesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
   const Field<Mesh>::ScatterInfo& sinfo = field._getScatter("");
   CPPUNIT_ASSERT(sinfo.scatter);
@@ -895,11 +895,11 @@
   CPPUNIT_ASSERT_EQUAL(label, std::string(vecname));
 
   // Make sure we can do multiple calls to createScatter().
-  field.createScatter();
+  field.createScatter(mesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
 
   // Create another scatter.
-  field.createScatter("B");
+  field.createScatter(mesh, "B");
   CPPUNIT_ASSERT_EQUAL(size_t(2), field._scatters.size());
   const Field<Mesh>::ScatterInfo& sinfoB = field._getScatter("B");
   CPPUNIT_ASSERT(sinfoB.scatter);
@@ -945,7 +945,7 @@
   const int sizeE = vertices->size() * fiberDim;
 
   CPPUNIT_ASSERT_EQUAL(size_t(0), field._scatters.size());
-  field.createScatterWithBC();
+  field.createScatterWithBC(mesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
   const Field<Mesh>::ScatterInfo& sinfo = field._getScatter("");
   CPPUNIT_ASSERT(sinfo.scatter);
@@ -962,11 +962,11 @@
   CPPUNIT_ASSERT_EQUAL(label, std::string(vecname));
 
   // Make sure we can do multiple calls to createScatterWithBC().
-  field.createScatterWithBC();
+  field.createScatterWithBC(mesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
 
   // Create another scatter.
-  field.createScatterWithBC("B");
+  field.createScatterWithBC(mesh, "B");
   CPPUNIT_ASSERT_EQUAL(size_t(2), field._scatters.size());
   const Field<Mesh>::ScatterInfo& sinfoB = field._getScatter("B");
   CPPUNIT_ASSERT(sinfoB.scatter);
@@ -1003,7 +1003,7 @@
   field.allocate();
   
   CPPUNIT_ASSERT_EQUAL(size_t(0), field._scatters.size());
-  field.createScatter();
+  field.createScatter(mesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
   const Field<Mesh>::ScatterInfo& sinfo = field._getScatter("");
   CPPUNIT_ASSERT(sinfo.scatter);
@@ -1061,7 +1061,7 @@
     section->updatePoint(*v_iter, &values[0]);
   } // for
 
-  field.createScatter(context);
+  field.createScatter(mesh, context);
   field.scatterSectionToVector(context);
   const PetscVec vec = field.vector(context);
   CPPUNIT_ASSERT(0 != vec);
@@ -1102,7 +1102,7 @@
   const ALE::Obj<Mesh::SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
 
-  field.createScatter(context);
+  field.createScatter(mesh, context);
   const PetscVec vec = field.vector(context);
   CPPUNIT_ASSERT(0 != vec);
   int size = 0;
@@ -1117,7 +1117,7 @@
     valuesVec[i] = valuesE[i];
   VecRestoreArray(vec, &valuesVec);
 
-  field.createScatter(context);
+  field.createScatter(mesh, context);
   field.scatterVectorToSection(context);
 
   double_array values(fiberDim);

Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldSubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldSubMesh.cc	2011-08-23 20:04:54 UTC (rev 18847)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldSubMesh.cc	2011-08-23 20:09:12 UTC (rev 18848)
@@ -714,7 +714,7 @@
   const int sizeE = vertices->size() * fiberDim;
 
   CPPUNIT_ASSERT_EQUAL(size_t(0), field._scatters.size());
-  field.createScatter();
+  field.createScatter(submesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
   const Field<SubMesh>::ScatterInfo& sinfo = field._getScatter("");
   CPPUNIT_ASSERT(sinfo.scatter);
@@ -726,11 +726,11 @@
   CPPUNIT_ASSERT_EQUAL(sizeE, size);
 
   // Make sure we can do multiple calls to createScatter().
-  field.createScatter();
+  field.createScatter(submesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
 
   // Create another scatter.
-  field.createScatter("B");
+  field.createScatter(submesh, "B");
   CPPUNIT_ASSERT_EQUAL(size_t(2), field._scatters.size());
   const Field<SubMesh>::ScatterInfo& sinfoB = field._getScatter("B");
   CPPUNIT_ASSERT(sinfoB.scatter);
@@ -774,7 +774,7 @@
   const int sizeE = vertices->size() * fiberDim;
 
   CPPUNIT_ASSERT_EQUAL(size_t(0), field._scatters.size());
-  field.createScatterWithBC();
+  field.createScatterWithBC(submesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
   const Field<SubMesh>::ScatterInfo& sinfo = field._getScatter("");
   CPPUNIT_ASSERT(sinfo.scatter);
@@ -786,11 +786,11 @@
   CPPUNIT_ASSERT_EQUAL(sizeE, size);
 
   // Make sure we can do multiple calls to createScatterWithBC().
-  field.createScatterWithBC();
+  field.createScatterWithBC(submesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
 
   // Create another scatter.
-  field.createScatterWithBC("B");
+  field.createScatterWithBC(submesh, "B");
   CPPUNIT_ASSERT_EQUAL(size_t(2), field._scatters.size());
   const Field<SubMesh>::ScatterInfo& sinfoB = field._getScatter("B");
   CPPUNIT_ASSERT(sinfoB.scatter);
@@ -828,7 +828,7 @@
   field.allocate();
 
   CPPUNIT_ASSERT_EQUAL(size_t(0), field._scatters.size());
-  field.createScatter();
+  field.createScatter(submesh);
   CPPUNIT_ASSERT_EQUAL(size_t(1), field._scatters.size());
   const Field<SubMesh>::ScatterInfo& sinfo = field._getScatter("");
   CPPUNIT_ASSERT(sinfo.scatter);
@@ -883,7 +883,7 @@
     section->updatePoint(*v_iter, &values[0]);
   } // for
 
-  field.createScatter(context);
+  field.createScatter(submesh, context);
   field.scatterSectionToVector(context);
   const PetscVec vec = field.vector(context);
   CPPUNIT_ASSERT(0 != vec);
@@ -919,7 +919,7 @@
   Field<SubMesh> field(submesh);
   field.newSection(FieldBase::VERTICES_FIELD, fiberDim);
   field.allocate();
-  field.createScatter(context);
+  field.createScatter(submesh, context);
 
   const ALE::Obj<SubMesh::SieveMesh>& sieveMesh = submesh.sieveMesh();
   CPPUNIT_ASSERT(!sieveMesh.isNull());



More information about the CIG-COMMITS mailing list