[cig-commits] r19702 - in short/3D/PyLith/branches/pylith-scecdynrup: . libsrc/pylith/feassemble libsrc/pylith/materials tests/2d/plasticity tests/3d/plasticity/dynamic unittests/libtests/meshio/data

brad at geodynamics.org brad at geodynamics.org
Wed Feb 29 08:11:12 PST 2012


Author: brad
Date: 2012-02-29 08:11:11 -0800 (Wed, 29 Feb 2012)
New Revision: 19702

Added:
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/cyclic/
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/mesh/
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/static/
Removed:
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/axialdisp2d.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/axialdisp3d.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/output/
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/planestrain2d.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/planestrain3d.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/pylithapp.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/run-models.sh
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/sheardisp2d.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/sheardisp3d.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/twohex8.mesh
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/twoquad4.mesh
Modified:
   short/3D/PyLith/branches/pylith-scecdynrup/TODO
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicit.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicitTri3.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPrager3D.cc
   short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc
   short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/README
   short/3D/PyLith/branches/pylith-scecdynrup/tests/3d/plasticity/dynamic/pylithapp.cfg
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc
   short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk
Log:
Merge from trunk.

Modified: short/3D/PyLith/branches/pylith-scecdynrup/TODO
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/TODO	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/TODO	2012-02-29 16:11:11 UTC (rev 19702)
@@ -41,10 +41,6 @@
   + DruckerPragerPlaneStrain (Drucker-Prager plane strain ) [Charles]
   + PowerLawPlaneStrain (power law plane strain ) [Charles]
 
-* Make nucleation for spontaneous rupture modular [BRAD]
-
-  spatial and temporal variation in shear/normal stress for nucleation
-
 * GenMaxwellQpQs [BRAD]
 
 * Cleanup
@@ -56,6 +52,10 @@
 1.8.0
 ======================================================================
 
+* Make nucleation for spontaneous rupture modular [BRAD]
+
+  spatial and temporal variation in shear/normal stress for nucleation
+
 * GPU utilization
 
   Finite-element integrations

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicit.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicit.cc	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicit.cc	2012-02-29 16:11:11 UTC (rev 19702)
@@ -357,7 +357,7 @@
     calcTotalStrainFn(&strainCell, basisDeriv, dispAdjCell, 
 		      numBasis, numQuadPts);
 
-    const scalar_array& stressCell = _material->calcStress(strainCell, true);
+    const scalar_array& stressCell = _material->calcStress(strainCell, false);
 
 #if defined(DETAILED_EVENT_LOGGING)
     _logger->eventEnd(stressEvent);
@@ -635,7 +635,7 @@
     // Compute B(transpose) * sigma, first computing strains
     calcTotalStrainFn(&strainCell, basisDeriv, dispAdjCell,
           numBasis, numQuadPts);
-    const scalar_array& stressCell = _material->calcStress(strainCell, true);
+    const scalar_array& stressCell = _material->calcStress(strainCell, false);
 
 #if defined(DETAILED_EVENT_LOGGING)
     _logger->eventEnd(stressEvent);

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc	2012-02-29 16:11:11 UTC (rev 19702)
@@ -378,7 +378,7 @@
        d2 * dispAdjCell[3] + b1 * dispAdjCell[2] + 
        b4 * dispAdjCell[11] + d1 * dispAdjCell[0]) / 2.0;
 
-    const scalar_array& stressCell = _material->calcStress(strainCell, true);
+    const scalar_array& stressCell = _material->calcStress(strainCell, false);
 
 #if defined(DETAILED_EVENT_LOGGING)
     PetscLogFlops(196);
@@ -703,7 +703,7 @@
        d2 * dispAdjCell[3] + b1 * dispAdjCell[2] + 
        b4 * dispAdjCell[11] + d1 * dispAdjCell[0]) / 2.0;
 
-    const scalar_array& stressCell = _material->calcStress(strainCell, true);
+    const scalar_array& stressCell = _material->calcStress(strainCell, false);
 
 #if defined(DETAILED_EVENT_LOGGING)
     PetscLogFlops(196);

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicitTri3.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicitTri3.cc	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/ElasticityExplicitTri3.cc	2012-02-29 16:11:11 UTC (rev 19702)
@@ -347,7 +347,7 @@
 		     c1*dispAdjCell[2] + b0*dispAdjCell[1] + c0*dispAdjCell[0]) / 2.0;
 
 
-    const scalar_array& stressCell = _material->calcStress(strainCell, true);
+    const scalar_array& stressCell = _material->calcStress(strainCell, false);
 
 #if defined(DETAILED_EVENT_LOGGING)
     PetscLogFlops(34);
@@ -632,7 +632,7 @@
     strainCell[2] = (b2*dispAdjCell[5] + c2*dispAdjCell[4] + b1*dispAdjCell[3] + 
 		     c1*dispAdjCell[2] + b0*dispAdjCell[1] + c0*dispAdjCell[0]) / 2.0;
 
-    const scalar_array& stressCell = _material->calcStress(strainCell, true);
+    const scalar_array& stressCell = _material->calcStress(strainCell, false);
 
 #if defined(DETAILED_EVENT_LOGGING)
     PetscLogFlops(34);

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPrager3D.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPrager3D.cc	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPrager3D.cc	2012-02-29 16:11:11 UTC (rev 19702)
@@ -534,42 +534,38 @@
       stateVars[s_plasticStrain+5],
     };
     const PylithScalar meanPlasticStrainT = (plasticStrainT[0] +
-				       plasticStrainT[1] +
-				       plasticStrainT[2])/3.0;
+					     plasticStrainT[1] +
+					     plasticStrainT[2])/3.0;
     PylithScalar devPlasticStrainT[tensorSize];
     calcDeviatoric3D(devPlasticStrainT, plasticStrainT, meanPlasticStrainT);
-
+    
     const PylithScalar diag[tensorSize] = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 };
-
+    
     // Initial stress values
     const PylithScalar meanStressInitial = (initialStress[0] +
 					    initialStress[1] +
 					    initialStress[2])/3.0;
     PylithScalar devStressInitial[tensorSize];
     calcDeviatoric3D(devStressInitial, initialStress, meanStressInitial);
-
+    
     // Initial strain values
     const PylithScalar meanStrainInitial = (initialStrain[0] +
-				      initialStrain[1] +
-				      initialStrain[2])/3.0;
+					    initialStrain[1] +
+					    initialStrain[2])/3.0;
     PylithScalar devStrainInitial[tensorSize];
     calcDeviatoric3D(devStrainInitial, initialStrain, meanStrainInitial);
-
+    
     // Values for current time step
     const PylithScalar e11 = totalStrain[0];
     const PylithScalar e22 = totalStrain[1];
     const PylithScalar e33 = totalStrain[2];
     const PylithScalar meanStrainTpdt = (e11 + e22 + e33)/3.0;
-    const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT -
-      meanStrainInitial;
+    const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT - meanStrainInitial;
 
     const PylithScalar strainPPTpdt[tensorSize] = {
-      totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
-      devStrainInitial[0],
-      totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
-      devStrainInitial[1],
-      totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] -
-      devStrainInitial[2],
+      totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] - devStrainInitial[0],
+      totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] - devStrainInitial[1],
+      totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
       totalStrain[3] - devPlasticStrainT[3] - devStrainInitial[3],
       totalStrain[4] - devPlasticStrainT[4] - devStrainInitial[4],
       totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5],
@@ -585,12 +581,9 @@
       strainPPTpdt[4]/ae + devStressInitial[4],
       strainPPTpdt[5]/ae + devStressInitial[5],
     };
-    const PylithScalar trialMeanStress = meanStrainPPTpdt/am +
-      meanStressInitial;
-    const PylithScalar stressInvar2 =
-      sqrt(0.5 * scalarProduct3D(trialDevStress, trialDevStress));
-    const PylithScalar yieldFunction = 3.0 * alphaYield * trialMeanStress +
-      stressInvar2 - beta;
+    const PylithScalar trialMeanStress = meanStrainPPTpdt/am + meanStressInitial;
+    const PylithScalar stressInvar2 = sqrt(0.5 * scalarProduct3D(trialDevStress, trialDevStress));
+    const PylithScalar yieldFunction = 3.0 * alphaYield * trialMeanStress + stressInvar2 - beta;
 #if 0 // DEBUGGING
     std::cout << "Function _calcStressElastoPlastic: elastic" << std::endl;
     std::cout << "  alphaYield:       " << alphaYield << std::endl;
@@ -610,21 +603,26 @@
       const PylithScalar d =
 	sqrt(ae * ae * devStressInitialProd + 2.0 * ae *
 	   scalarProduct3D(devStressInitial, strainPPTpdt) + strainPPTpdtProd);
-      const PylithScalar plasticMult = 2.0 * ae * am *
-	(3.0 * alphaYield * meanStrainPPTpdt/am + d/(sqrt(2.0) * ae) - beta)/
-	(6.0 * alphaYield * alphaFlow * ae + am);
+      const PylithScalar plasticMult = 
+	std::min(sqrt(2.0)*d,
+		 2.0 * ae * am * (3.0 * alphaYield * meanStrainPPTpdt/am + d/(sqrt(2.0) * ae) - beta)/
+		 (6.0 * alphaYield * alphaFlow * ae + am));
       const PylithScalar meanStressTpdt =
 	(meanStrainPPTpdt - plasticMult * alphaFlow)/am + meanStressInitial;
       PylithScalar deltaDevPlasticStrain = 0.0;
       PylithScalar devStressTpdt = 0.0;
-      for (int iComp=0; iComp < tensorSize; ++iComp) {
-	deltaDevPlasticStrain = plasticMult *(strainPPTpdt[iComp] +
-					      ae * devStressInitial[iComp])/
-	  (sqrt(2.0) * d);
-	devStressTpdt = (strainPPTpdt[iComp] - deltaDevPlasticStrain)/ae +
-	  devStressInitial[iComp];
-	stress[iComp] = devStressTpdt + diag[iComp] * meanStressTpdt;
-      } // for
+      if (d > 0.0) {
+	for (int iComp=0; iComp < tensorSize; ++iComp) {
+	  deltaDevPlasticStrain = plasticMult * (strainPPTpdt[iComp] + ae * devStressInitial[iComp]) / (sqrt(2.0) * d);
+	  devStressTpdt = (strainPPTpdt[iComp] - deltaDevPlasticStrain) / ae + devStressInitial[iComp];
+	  stress[iComp] = devStressTpdt + diag[iComp] * meanStressTpdt;
+	} // for
+      } else {
+	for (int iComp=0; iComp < tensorSize; ++iComp) {
+	  devStressTpdt = (strainPPTpdt[iComp])/ae + devStressInitial[iComp];
+	  stress[iComp] = devStressTpdt + diag[iComp] * meanStressTpdt;
+	} // for
+      } // if/else
 
     PetscLogFlops(62 + 11 * tensorSize);
 
@@ -652,18 +650,12 @@
       stateVars[s_plasticStrain+5],
     };
 
-    const PylithScalar e11 = totalStrain[0] - plasticStrainTpdt[0] -
-      initialStrain[0];
-    const PylithScalar e22 = totalStrain[1] - plasticStrainTpdt[1] -
-      initialStrain[1];
-    const PylithScalar e33 = totalStrain[2] - plasticStrainTpdt[2] -
-      initialStrain[2];
-    const PylithScalar e12 = totalStrain[3] - plasticStrainTpdt[3] -
-      initialStrain[3];
-    const PylithScalar e23 = totalStrain[4] - plasticStrainTpdt[4] -
-      initialStrain[4];
-    const PylithScalar e13 = totalStrain[5] - plasticStrainTpdt[5] -
-      initialStrain[5];
+    const PylithScalar e11 = totalStrain[0] - plasticStrainTpdt[0] - initialStrain[0];
+    const PylithScalar e22 = totalStrain[1] - plasticStrainTpdt[1] - initialStrain[1];
+    const PylithScalar e33 = totalStrain[2] - plasticStrainTpdt[2] - initialStrain[2];
+    const PylithScalar e12 = totalStrain[3] - plasticStrainTpdt[3] - initialStrain[3];
+    const PylithScalar e23 = totalStrain[4] - plasticStrainTpdt[4] - initialStrain[4];
+    const PylithScalar e13 = totalStrain[5] - plasticStrainTpdt[5] - initialStrain[5];
 
     const PylithScalar traceStrainTpdt = e11 + e22 + e33;
     const PylithScalar s123 = lambda * traceStrainTpdt;
@@ -836,45 +828,42 @@
     stateVars[s_plasticStrain+5],
   };
   const PylithScalar meanPlasticStrainT = (plasticStrainT[0] +
-				     plasticStrainT[1] +
-				     plasticStrainT[2])/3.0;
+					   plasticStrainT[1] +
+					   plasticStrainT[2])/3.0;
   PylithScalar devPlasticStrainT[tensorSize];
   calcDeviatoric3D(devPlasticStrainT, plasticStrainT, meanPlasticStrainT);
-
+  
   const PylithScalar diag[tensorSize] = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 };
-
+  
   // Initial stress values
   const PylithScalar meanStressInitial = (initialStress[0] +
-				    initialStress[1] +
-				    initialStress[2])/3.0;
+					  initialStress[1] +
+					  initialStress[2])/3.0;
   PylithScalar devStressInitial[tensorSize];
   calcDeviatoric3D(devStressInitial, initialStress, meanStressInitial);
-
+  
   // Initial strain values
   const PylithScalar meanStrainInitial = (initialStrain[0] +
-				    initialStrain[1] +
-				    initialStrain[2])/3.0;
+					  initialStrain[1] +
+					  initialStrain[2])/3.0;
   PylithScalar devStrainInitial[tensorSize];
   calcDeviatoric3D(devStrainInitial, initialStrain, meanStrainInitial);
 
   // Values for current time step
   const PylithScalar meanStrainTpdt = (totalStrain[0] +
-				 totalStrain[1] +
-				 totalStrain[2])/3.0;
+				       totalStrain[1] +
+				       totalStrain[2])/3.0;
   const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT -
     meanStrainInitial;
   
-  const PylithScalar strainPPTpdt[tensorSize] =
-    { totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
-      devStrainInitial[0],
-      totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
-      devStrainInitial[1],
-      totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] -
-      devStrainInitial[2],
-      totalStrain[3] - devPlasticStrainT[3] - devStrainInitial[3],
-      totalStrain[4] - devPlasticStrainT[4] - devStrainInitial[4],
-      totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5]
-    };
+  const PylithScalar strainPPTpdt[tensorSize] = {
+    totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] - devStrainInitial[0],
+    totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] - devStrainInitial[1],
+    totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
+    totalStrain[3] - devPlasticStrainT[3] - devStrainInitial[3],
+    totalStrain[4] - devPlasticStrainT[4] - devStrainInitial[4],
+    totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5],
+  };
   
   // Compute trial elastic stresses and yield function to see if yield should
   // occur.
@@ -915,8 +904,9 @@
       (6.0 * alphaYield * alphaFlow * ae + am);
     const PylithScalar meanStrainFac = 3.0 * alphaYield/am;
     const PylithScalar dFac = 1.0/(sqrt(2.0) * ae);
-    const PylithScalar plasticMult = plasticFac *
-      (meanStrainFac * meanStrainPPTpdt + dFac * d - beta);
+    const PylithScalar plasticMult = 
+      std::min(sqrt(2.0)*d,
+	       plasticFac * (meanStrainFac * meanStrainPPTpdt + dFac * d - beta));
 
     // Define some constants, vectors, and matrices.
     const PylithScalar third = 1.0/3.0;
@@ -935,38 +925,56 @@
       strainPPTpdt[4] + ae * devStressInitial[4],
       strainPPTpdt[5] + ae * devStressInitial[5]
     };
-    const PylithScalar dDdEpsilon[tensorSize] = {vec1[0]/d,
-						 vec1[1]/d,
-						 vec1[2]/d,
-						 2.0 * vec1[3]/d,
-						 2.0 * vec1[4]/d,
-						 2.0 * vec1[5]/d};
-    const PylithScalar dLambdadEpsilon[tensorSize] = {
-      plasticFac * (alphaYield/am + dFac * dDdEpsilon[0]),
-      plasticFac * (alphaYield/am + dFac * dDdEpsilon[1]),
-      plasticFac * (alphaYield/am + dFac * dDdEpsilon[2]),
-      plasticFac * (                dFac * dDdEpsilon[3]),
-      plasticFac * (                dFac * dDdEpsilon[4]),
-      plasticFac * (                dFac * dDdEpsilon[5])
-    };
-    
-    const PylithScalar dFac2 = 1.0/(sqrt(2.0) * d);
     PylithScalar dDeltaEdEpsilon = 0.0;
 
     // Compute elasticity matrix.
-    for (int iComp=0; iComp < tensorSize; ++iComp) {
-      for (int jComp=0; jComp < tensorSize; ++jComp) {
-	int iCount = jComp + tensorSize * iComp;
-	dDeltaEdEpsilon = dFac2 * (vec1[iComp] *
-				   (dLambdadEpsilon[jComp] -
-				    plasticMult * dDdEpsilon[jComp]/d) +
-				   plasticMult * dEdEpsilon[iComp][jComp]);
-	elasticConsts[iCount] = (dEdEpsilon[iComp][jComp] -
-				 dDeltaEdEpsilon)/ae +
-	  diag[iComp] * (third * diag[jComp] -
-			 alphaFlow * dLambdadEpsilon[jComp])/am;
+    if (d > 0.0) {
+      const PylithScalar dDdEpsilon[tensorSize] = {vec1[0]/d,
+						   vec1[1]/d,
+						   vec1[2]/d,
+						   2.0 * vec1[3]/d,
+						   2.0 * vec1[4]/d,
+						   2.0 * vec1[5]/d};
+      const PylithScalar dLambdadEpsilon[tensorSize] = {
+	plasticFac * (alphaYield/am + dFac * dDdEpsilon[0]),
+	plasticFac * (alphaYield/am + dFac * dDdEpsilon[1]),
+	plasticFac * (alphaYield/am + dFac * dDdEpsilon[2]),
+	plasticFac * (                dFac * dDdEpsilon[3]),
+	plasticFac * (                dFac * dDdEpsilon[4]),
+	plasticFac * (                dFac * dDdEpsilon[5])
+      };
+      const PylithScalar dFac2 = 1.0/(sqrt(2.0) * d);
+      for (int iComp=0; iComp < tensorSize; ++iComp) {
+	for (int jComp=0; jComp < tensorSize; ++jComp) {
+	  int iCount = jComp + tensorSize * iComp;
+	  dDeltaEdEpsilon = dFac2 * (vec1[iComp] *
+				     (dLambdadEpsilon[jComp] -
+				      plasticMult * dDdEpsilon[jComp]/d) +
+				     plasticMult * dEdEpsilon[iComp][jComp]);
+	  elasticConsts[iCount] = (dEdEpsilon[iComp][jComp] -
+				   dDeltaEdEpsilon)/ae +
+	    diag[iComp] * (third * diag[jComp] -
+			   alphaFlow * dLambdadEpsilon[jComp])/am;
+	} // for
       } // for
-    } // for
+    } else {
+      const PylithScalar dLambdadEpsilon[tensorSize] = {
+	plasticFac * (alphaYield/am),
+	plasticFac * (alphaYield/am),
+	plasticFac * (alphaYield/am),
+	0.0,
+	0.0,
+	0.0,
+      };
+      for (int iComp=0; iComp < tensorSize; ++iComp) {
+	for (int jComp=0; jComp < tensorSize; ++jComp) {
+	  int iCount = jComp + tensorSize * iComp;
+	  elasticConsts[iCount] = (dEdEpsilon[iComp][jComp])/ae +
+	    diag[iComp] * (third * diag[jComp] -
+			   alphaFlow * dLambdadEpsilon[jComp])/am;
+	} // for
+      } // for
+    } // if/else
 
     PetscLogFlops(109 + tensorSize * tensorSize * 15);
 
@@ -1099,8 +1107,8 @@
     stateVars[s_plasticStrain + 5]
   };
   const PylithScalar meanPlasticStrainT = (plasticStrainT[0] +
-				     plasticStrainT[1] +
-				     plasticStrainT[2])/3.0;
+					   plasticStrainT[1] +
+					   plasticStrainT[2])/3.0;
   PylithScalar devPlasticStrainT[tensorSize];
   calcDeviatoric3D(devPlasticStrainT, plasticStrainT, meanPlasticStrainT);
 
@@ -1108,15 +1116,15 @@
 
   // Initial stress values
   const PylithScalar meanStressInitial = (initialStress[0] +
-				    initialStress[1] +
-				    initialStress[2])/3.0;
+					  initialStress[1] +
+					  initialStress[2])/3.0;
   PylithScalar devStressInitial[tensorSize];
   calcDeviatoric3D(devStressInitial, initialStress, meanStressInitial);
 
   // Initial strain values
   const PylithScalar meanStrainInitial = (initialStrain[0] +
-				    initialStrain[1] +
-				    initialStrain[2])/3.0;
+					  initialStrain[1] +
+					  initialStrain[2])/3.0;
   PylithScalar devStrainInitial[tensorSize];
   calcDeviatoric3D(devStrainInitial, initialStrain, meanStrainInitial);
 
@@ -1129,12 +1137,9 @@
     meanStrainInitial;
 
   const PylithScalar strainPPTpdt[tensorSize] = {
-    totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
-    devStrainInitial[0],
-    totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
-    devStrainInitial[1],
-    totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] -
-    devStrainInitial[2],
+    totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] - devStrainInitial[0],
+    totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] - devStrainInitial[1],
+    totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
     totalStrain[3] - devPlasticStrainT[3] - devStrainInitial[3],
     totalStrain[4] - devPlasticStrainT[4] - devStrainInitial[4],
     totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5]
@@ -1151,10 +1156,8 @@
     strainPPTpdt[5]/ae + devStressInitial[5]
   };
   const PylithScalar trialMeanStress = meanStrainPPTpdt/am + meanStressInitial;
-  const PylithScalar stressInvar2 =
-    sqrt(0.5 * scalarProduct3D(trialDevStress, trialDevStress));
-  const PylithScalar yieldFunction = 3.0 * alphaYield * trialMeanStress +
-    stressInvar2 - beta;
+  const PylithScalar stressInvar2 = sqrt(0.5 * scalarProduct3D(trialDevStress, trialDevStress));
+  const PylithScalar yieldFunction = 3.0 * alphaYield * trialMeanStress + stressInvar2 - beta;
 #if 0 // DEBUGGING
   std::cout << "Function _updateStateVarsElastoPlastic:" << std::endl;
   std::cout << "  alphaYield:       " << alphaYield << std::endl;
@@ -1175,18 +1178,25 @@
     const PylithScalar d =
       sqrt(ae * ae * devStressInitialProd + 2.0 * ae *
 	   scalarProduct3D(devStressInitial, strainPPTpdt) + strainPPTpdtProd);
-    const PylithScalar plasticMult = 2.0 * ae * am *
-      (3.0 * alphaYield * meanStrainPPTpdt/am + d/(sqrt(2.0) * ae) - beta)/
-      (6.0 * alphaYield * alphaFlow * ae + am);
+    const PylithScalar plasticMult = 
+      std::min(sqrt(2.0)*d,
+	       2.0 * ae * am * (3.0 * alphaYield * meanStrainPPTpdt/am + d/(sqrt(2.0) * ae) - beta)/
+	       (6.0 * alphaYield * alphaFlow * ae + am));
     const PylithScalar deltaMeanPlasticStrain = plasticMult * alphaFlow;
     PylithScalar deltaDevPlasticStrain = 0.0;
-    for (int iComp=0; iComp < tensorSize; ++iComp) {
-      deltaDevPlasticStrain = plasticMult *(strainPPTpdt[iComp] +
-					    ae * devStressInitial[iComp])/
-	(sqrt(2.0) * d);
-      stateVars[s_plasticStrain+iComp] += deltaDevPlasticStrain +
-	diag[iComp] * deltaMeanPlasticStrain;
-    } // for
+    if (d > 0.0) {
+      for (int iComp=0; iComp < tensorSize; ++iComp) {
+	deltaDevPlasticStrain = plasticMult *(strainPPTpdt[iComp] +
+					      ae * devStressInitial[iComp])/
+	  (sqrt(2.0) * d);
+	stateVars[s_plasticStrain+iComp] += deltaDevPlasticStrain +
+	  diag[iComp] * deltaMeanPlasticStrain;
+      } // for
+    } else {
+      for (int iComp=0; iComp < tensorSize; ++iComp) {
+	stateVars[s_plasticStrain+iComp] += diag[iComp] * deltaMeanPlasticStrain;
+      } // for
+    } // if/else
 
     PetscLogFlops(60 + 9 * tensorSize);
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc	2012-02-29 16:11:11 UTC (rev 19702)
@@ -542,10 +542,11 @@
     const PylithScalar stressZZInitial = stateVars[s_stressZZInitial];
 
     const PylithScalar plasticStrainT[tensorSizePS] = {
-      stateVars[s_plasticStrain],
+      stateVars[s_plasticStrain    ],
       stateVars[s_plasticStrain + 1],
       stateVars[s_plasticStrain + 2],
-      stateVars[s_plasticStrain + 3]};
+      stateVars[s_plasticStrain + 3]
+    };
     const PylithScalar meanPlasticStrainT = (plasticStrainT[0] +
 					     plasticStrainT[1] +
 					     plasticStrainT[2])/3.0;
@@ -562,7 +563,8 @@
       initialStress[0] - meanStressInitial,
       initialStress[1] - meanStressInitial,
       stressZZInitial - meanStressInitial,
-      initialStress[2]};
+      initialStress[2]
+    };
 
     // Initial strain values
     const PylithScalar meanStrainInitial = (initialStrain[0] +
@@ -570,21 +572,21 @@
     const PylithScalar devStrainInitial[tensorSizePS] = {
       initialStrain[0] - meanStrainInitial,
       initialStrain[1] - meanStrainInitial,
-      -meanStrainInitial,
-      initialStrain[2]};
+                       - meanStrainInitial,
+      initialStrain[2],
+    };
 
     // Values for current time step
     const PylithScalar meanStrainTpdt = (totalStrain[0] + totalStrain[1])/3.0;
-    const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT -
-      meanStrainInitial;
+    const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT - meanStrainInitial;
 
-    const PylithScalar strainPPTpdt[tensorSizePS] =
-      { totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
-	devStrainInitial[0],
-	totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
-	devStrainInitial[1],
-	- meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
-	totalStrain[2] - devPlasticStrainT[3] - devStrainInitial[3] };
+    // devStrainPPTpdt
+    const PylithScalar strainPPTpdt[tensorSizePS] = {
+      totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] - devStrainInitial[0],
+      totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] - devStrainInitial[1],
+                     - meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
+      totalStrain[2] - devPlasticStrainT[3] - devStrainInitial[3]
+    };
 
     // Compute trial elastic stresses and yield function to see if yield should
     // occur.
@@ -594,8 +596,7 @@
       strainPPTpdt[2]/ae + devStressInitial[2],
       strainPPTpdt[3]/ae + devStressInitial[3]
     };
-    const PylithScalar trialMeanStress = meanStrainPPTpdt/am +
-      meanStressInitial;
+    const PylithScalar trialMeanStress = meanStrainPPTpdt/am + meanStressInitial;
     const PylithScalar stressInvar2 =
       sqrt(0.5 * scalarProduct2DPS(trialDevStress, trialDevStress));
     const PylithScalar yieldFunction = 3.0 * alphaYield * trialMeanStress +
@@ -620,26 +621,60 @@
 	sqrt(ae * ae * devStressInitialProd + 2.0 * ae *
 	     scalarProduct2DPS(devStressInitial, strainPPTpdt) +
 	     strainPPTpdtProd);
-      const PylithScalar plasticMult = 2.0 * ae * am *
-	(3.0 * alphaYield * meanStrainPPTpdt/am + d/(sqrt(2.0) * ae) - beta)/
-	(6.0 * alphaYield * alphaFlow * ae + am);
-      const PylithScalar meanStressTpdt =
-	(meanStrainPPTpdt - plasticMult * alphaFlow)/am + meanStressInitial;
+      const PylithScalar plasticMult = 
+	std::min(sqrt(2.0)*d,
+		 2.0 * ae * am * (3.0 * alphaYield * meanStrainPPTpdt/am + d/(sqrt(2.0) * ae) - beta)/
+		 (6.0 * alphaYield * alphaFlow * ae + am));
+      const PylithScalar meanStressTpdt = (meanStrainPPTpdt - plasticMult * alphaFlow) / am + meanStressInitial;
       PylithScalar deltaDevPlasticStrain = 0.0;
       PylithScalar devStressTpdt = 0.0;
       PylithScalar totalStress[tensorSizePS];
-      for (int iComp=0; iComp < tensorSizePS; ++iComp) {
-	deltaDevPlasticStrain = plasticMult *(strainPPTpdt[iComp] +
-					      ae * devStressInitial[iComp])/
-	  (sqrt(2.0) * d);
-	devStressTpdt = (strainPPTpdt[iComp] - deltaDevPlasticStrain)/ae +
-	  devStressInitial[iComp];
-	totalStress[iComp] = devStressTpdt + diag[iComp] * meanStressTpdt;
-      } // for
+
+#if 0 // DEBUGGING
+      std::cout << "YIELDING\n";
+      std::cout << "  totalStrain\n";
+      for (int i=0; i < tensorSize; ++i)
+	std::cout << "    " << totalStrain[i] << "\n";
+      std::cout << "  plasticStrainT\n";
+      for (int i=0; i < tensorSizePS; ++i)
+	std::cout << "    " << plasticStrainT[i] << "\n";
+      std::cout << "  devPlasticStrainT\n";
+      for (int i=0; i < tensorSizePS; ++i)
+	std::cout << "    " << devPlasticStrainT[i] << "\n";
+      std::cout << "  strainPPTpdt\n";
+      for (int i=0; i < tensorSizePS; ++i)
+	std::cout << "    " << strainPPTpdt[i] << "\n";
+      std::cout << "  meanPlasticStrainT: " << meanPlasticStrainT << "\n"
+		<< "  meanStressInitial: " << meanStressInitial << "\n"
+		<< "  meanStrainInitial: " << meanStrainInitial << "\n"
+		<< "  meanStrainTpdt: " << meanStrainTpdt << "\n"
+		<< "  meanStrainPPTpdt: " << meanStrainPPTpdt << "\n"
+		<< "  plasticMult: " << plasticMult
+		<< std::endl;
+#endif
+
+      if (d > 0.0) {
+	for (int iComp=0; iComp < tensorSizePS; ++iComp) {
+	  deltaDevPlasticStrain = plasticMult * (strainPPTpdt[iComp] + ae * devStressInitial[iComp]) / (sqrt(2.0) * d);
+	  devStressTpdt = (strainPPTpdt[iComp] - deltaDevPlasticStrain)/ae + devStressInitial[iComp];
+	  totalStress[iComp] = devStressTpdt + diag[iComp] * meanStressTpdt;
+	} // for
+      } else {
+	for (int iComp=0; iComp < tensorSizePS; ++iComp) {
+	  devStressTpdt = (strainPPTpdt[iComp])/ae + devStressInitial[iComp];
+	  totalStress[iComp] = devStressTpdt + diag[iComp] * meanStressTpdt;
+	} // for
+      } // if/else
       stress[0] = totalStress[0];
       stress[1] = totalStress[1];
       stress[2] = totalStress[3];
 
+#if 0 // DEBUGGING
+      std::cout << "  totalStress\n";
+      for (int i=0; i < tensorSizePS; ++i)
+	std::cout << "    " << totalStress[i] << "\n";
+#endif
+
     PetscLogFlops(51 + 11 * tensorSizePS);
 
     } else {
@@ -811,7 +846,7 @@
   
   // Get state variables from previous time step
   const PylithScalar plasticStrainT[tensorSizePS] = {
-    stateVars[s_plasticStrain],
+    stateVars[s_plasticStrain    ],
     stateVars[s_plasticStrain + 1],
     stateVars[s_plasticStrain + 2],
     stateVars[s_plasticStrain + 3]};
@@ -847,13 +882,12 @@
   const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT -
     meanStrainInitial;
   
-  const PylithScalar strainPPTpdt[tensorSizePS] =
-    { totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
-      devStrainInitial[0],
-      totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
-      devStrainInitial[1],
-      -meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
-      totalStrain[2] - devPlasticStrainT[3] - devStrainInitial[3]};
+  const PylithScalar strainPPTpdt[tensorSizePS] = {
+    totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] - devStrainInitial[0],
+    totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] - devStrainInitial[1],
+                   - meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
+    totalStrain[2] - devPlasticStrainT[3] - devStrainInitial[3],
+  };
   
   // Compute trial elastic stresses and yield function to see if yield should
   // occur.
@@ -861,12 +895,12 @@
     strainPPTpdt[0]/ae + devStressInitial[0],
     strainPPTpdt[1]/ae + devStressInitial[1],
     strainPPTpdt[2]/ae + devStressInitial[2],
-    strainPPTpdt[3]/ae + devStressInitial[3]};
+    strainPPTpdt[3]/ae + devStressInitial[3],
+  };
   const PylithScalar trialMeanStress = meanStrainPPTpdt/am + meanStressInitial;
   const PylithScalar stressInvar2 =
     sqrt(0.5 * scalarProduct2DPS(trialDevStress, trialDevStress));
-  const PylithScalar yieldFunction = 3.0 * alphaYield * trialMeanStress +
-    stressInvar2 - beta;
+  const PylithScalar yieldFunction = 3.0 * alphaYield * trialMeanStress + stressInvar2 - beta;
 #if 0 // DEBUGGING
   std::cout << "Function _calcElasticConstsElastoPlastic:" << std::endl;
   std::cout << "  alphaYield:       " << alphaYield << std::endl;
@@ -892,8 +926,9 @@
       (6.0 * alphaYield * alphaFlow * ae + am);
     const PylithScalar meanStrainFac = 3.0 * alphaYield/am;
     const PylithScalar dFac = 1.0/(sqrt(2.0) * ae);
-    const PylithScalar plasticMult = plasticFac *
-      (meanStrainFac * meanStrainPPTpdt + dFac * d - beta);
+    const PylithScalar plasticMult = 
+      std::min(sqrt(2.0)*d,
+	       plasticFac * (meanStrainFac * meanStrainPPTpdt + dFac * d - beta));
 
     // Define some constants, vectors, and matrices.
     const PylithScalar third = 1.0/3.0;
@@ -901,34 +936,46 @@
       { 2.0 * third,      -third,      0.0},
       {      -third, 2.0 * third,      0.0},
       {         0.0,         0.0,      1.0}};
-    const PylithScalar vec1[3] = {strainPPTpdt[0] + ae * devStressInitial[0],
-				  strainPPTpdt[1] + ae * devStressInitial[1],
-				  strainPPTpdt[3] + ae * devStressInitial[3]};
-    const PylithScalar dDdEpsilon[3] = {vec1[0]/d,
-					vec1[1]/d,
-					2.0 * vec1[2]/d};
-    const PylithScalar dLambdadEpsilon[3] = {
-      plasticFac * (alphaYield/am + dFac * dDdEpsilon[0]),
-      plasticFac * (alphaYield/am + dFac * dDdEpsilon[1]),
-      plasticFac * (                dFac * dDdEpsilon[2])};
+    const PylithScalar vec1[3] = {
+      strainPPTpdt[0] + ae * devStressInitial[0],
+      strainPPTpdt[1] + ae * devStressInitial[1],
+      strainPPTpdt[3] + ae * devStressInitial[3],
+    };
     
-    const PylithScalar dFac2 = 1.0/(sqrt(2.0) * d);
+    const PylithScalar dFac2 = (d > 0.0) ? 1.0/(sqrt(2.0) * d) : 0.0;
     PylithScalar dDeltaEdEpsilon = 0.0;
 
     // Compute elasticity matrix.
-    for (int iComp=0; iComp < tensorSize; ++iComp) {
-      for (int jComp=0; jComp < tensorSize; ++jComp) {
-	int iCount = jComp + tensorSize * iComp;
-	dDeltaEdEpsilon = dFac2 * (vec1[iComp] *
-				   (dLambdadEpsilon[jComp] -
-				    plasticMult * dDdEpsilon[jComp]/d) +
-				   plasticMult * dEdEpsilon[iComp][jComp]);
-	elasticConsts[iCount] = (dEdEpsilon[iComp][jComp] -
-				 dDeltaEdEpsilon)/ae +
-	  diag[iComp] * (third * diag[jComp] -
-			 alphaFlow * dLambdadEpsilon[jComp])/am;
+    if (d > 0.0) {
+      const PylithScalar dDdEpsilon[3] = {vec1[0]/d,
+					  vec1[1]/d,
+					  2.0 * vec1[2]/d};
+      const PylithScalar dLambdadEpsilon[3] = {
+	plasticFac * (alphaYield/am + dFac * dDdEpsilon[0]),
+	plasticFac * (alphaYield/am + dFac * dDdEpsilon[1]),
+	plasticFac * (                dFac * dDdEpsilon[2])};
+      for (int iComp=0; iComp < tensorSize; ++iComp) {
+	for (int jComp=0; jComp < tensorSize; ++jComp) {
+	  int iCount = jComp + tensorSize * iComp;
+	  dDeltaEdEpsilon = dFac2 * (vec1[iComp] * (dLambdadEpsilon[jComp] - plasticMult * dDdEpsilon[jComp]/d) +
+				     plasticMult * dEdEpsilon[iComp][jComp]);
+	  elasticConsts[iCount] = (dEdEpsilon[iComp][jComp] - dDeltaEdEpsilon)/ae +
+	    diag[iComp] * (third * diag[jComp] - alphaFlow * dLambdadEpsilon[jComp])/am;
+	} // for
       } // for
-    } // for
+    } else {
+      const PylithScalar dLambdadEpsilon[3] = {
+	plasticFac * (alphaYield/am),
+	plasticFac * (alphaYield/am),
+	0.0};
+      for (int iComp=0; iComp < tensorSize; ++iComp) {
+	for (int jComp=0; jComp < tensorSize; ++jComp) {
+	  int iCount = jComp + tensorSize * iComp;
+	  elasticConsts[iCount] = (dEdEpsilon[iComp][jComp])/ae +
+	    diag[iComp] * (third * diag[jComp] - alphaFlow * dLambdadEpsilon[jComp])/am;
+	} // for
+      } // for
+    } // if/else
 
     PetscLogFlops(76 + tensorSize * tensorSize * 15);
 
@@ -1030,7 +1077,7 @@
   const PylithScalar stressZZInitial = stateVars[s_stressZZInitial];
 
   const PylithScalar plasticStrainT[tensorSizePS] = {
-    stateVars[s_plasticStrain],
+    stateVars[s_plasticStrain    ],
     stateVars[s_plasticStrain + 1],
     stateVars[s_plasticStrain + 2],
     stateVars[s_plasticStrain + 3]};
@@ -1050,7 +1097,8 @@
     initialStress[0] - meanStressInitial,
     initialStress[1] - meanStressInitial,
     stressZZInitial - meanStressInitial,
-    initialStress[2]};
+    initialStress[2]
+  };
 
   // Initial strain values
   const PylithScalar meanStrainInitial = (initialStrain[0] +
@@ -1058,7 +1106,7 @@
   const PylithScalar devStrainInitial[tensorSizePS] = {
     initialStrain[0] - meanStrainInitial,
     initialStrain[1] - meanStrainInitial,
-    -meanStrainInitial,
+    0.0 - meanStrainInitial,
     initialStrain[2]};
 
   // Values for current time step
@@ -1066,13 +1114,12 @@
   const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT -
     meanStrainInitial;
 
-  const PylithScalar strainPPTpdt[tensorSizePS] =
-    { totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
-      devStrainInitial[0],
-      totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
-      devStrainInitial[1],
-      -meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
-      totalStrain[2] - devPlasticStrainT[3] - devStrainInitial[3]};
+  const PylithScalar strainPPTpdt[tensorSizePS] = {
+    totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] - devStrainInitial[0],
+    totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] - devStrainInitial[1],
+    0.0 - meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
+    totalStrain[2] - devPlasticStrainT[3] - devStrainInitial[3]
+  };
 
   // Compute trial elastic stresses and yield function to see if yield should
   // occur.
@@ -1107,19 +1154,26 @@
       sqrt(ae * ae * devStressInitialProd + 2.0 * ae *
 	   scalarProduct2DPS(devStressInitial, strainPPTpdt) +
 	   strainPPTpdtProd);
-    const PylithScalar plasticMult = 2.0 * ae * am *
-      (3.0 * alphaYield * meanStrainPPTpdt/am + d/(sqrt(2.0) * ae) - beta)/
-      (6.0 * alphaYield * alphaFlow * ae + am);
+    const PylithScalar plasticMult = 
+      std::min(sqrt(2.0)*d, 
+	       2.0 * ae * am * (3.0 * alphaYield * meanStrainPPTpdt/am + d/(sqrt(2.0) * ae) - beta)/
+	       (6.0 * alphaYield * alphaFlow * ae + am));
     const PylithScalar deltaMeanPlasticStrain = plasticMult * alphaFlow;
     PylithScalar deltaDevPlasticStrain = 0.0;
-    for (int iComp=0; iComp < tensorSizePS; ++iComp) {
-      deltaDevPlasticStrain = plasticMult *(strainPPTpdt[iComp] +
-					    ae * devStressInitial[iComp])/
-	(sqrt(2.0) * d);
-      stateVars[s_plasticStrain+iComp] += deltaDevPlasticStrain +
-	diag[iComp] * deltaMeanPlasticStrain;
-    } // for
-
+    if (d > 0.0) {
+      for (int iComp=0; iComp < tensorSizePS; ++iComp) {
+	deltaDevPlasticStrain = plasticMult *(strainPPTpdt[iComp] +
+					      ae * devStressInitial[iComp])/
+	  (sqrt(2.0) * d);
+	stateVars[s_plasticStrain+iComp] += deltaDevPlasticStrain +
+	  diag[iComp] * deltaMeanPlasticStrain;
+      } // for
+    } else {
+      for (int iComp=0; iComp < tensorSizePS; ++iComp) {
+	stateVars[s_plasticStrain+iComp] += diag[iComp] * deltaMeanPlasticStrain;
+      } // for
+    } // if/else
+    
     PetscLogFlops(48 + 9 * tensorSizePS);
 
   } // if

Modified: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/README
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/README	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/README	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,6 +1,9 @@
 This is a simple test of the DruckerPragerPlaneStrain elastoplastic model.
 The results may be compared against the results from a 3D model with the
-z-displacements constrained to zero.  There are four models:
+z-displacements constrained to zero.  There are two sets of models:  cyclic
+and static. The cyclic models involve time-varying displacement BC applied
+to a single cell. The static models involve initial displacements (either
+axial or shear), followed by yield occurring in the time-dependent solution.
 
 Plane strain axial displacement problem:
 pylith planestrain2d.cfg axialdisp2d.cfg

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/axialdisp2d.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/axialdisp2d.cfg	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/axialdisp2d.cfg	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,104 +0,0 @@
-# -*- Python -*-
-
-# To run this problem, type "pylith planestrain2d.cfg axialdisp2d.cfg".
-# The settings in pylithapp.cfg will be read by default. See the README for
-# how to run other problems in this directory.
-#
-#
-#  <- ----------------------- ->
-#     |                     |
-#  <- |                     | ->
-#     |                     |
-#  <- |                     | ->
-#     |                     |
-#  <- ----------------------- ->
-#     ^          ^          ^
-#
-# Axial tension is applied by pulling on the left and right boundaries
-# in the horizontal direction.
-# Bottom boundary is pinned in the vertical direction.
-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-# Specify the problem settings.
-[pylithapp.timedependent]
-# Set bc to an array with 3 boundary conditions: 'x_neg', 'x_pos', 'y_neg'.
-bc = [x_neg,x_pos,y_neg]
-
-# ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
-
-# BC for the left (-x) side of the domain.
-[pylithapp.timedependent.bc.x_neg]
-
-# Fix the 0 (x) degree of freedom.
-bc_dof = [0]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'x_neg'.
-label = x_neg
-
-# Change the spatial database for the Dirichlet BC initial values from
-# ZeroDispDB (which has a uniform zero spatial distribution) to UniformDB.
-db_initial = spatialdata.spatialdb.UniformDB
-
-# Assign the label 'Dirichlet BC -x edge' to the database.
-db_initial.label = Dirichlet BC -x edge
-
-# Assign the displacement BC values
-db_initial.values = [displacement-x]
-db_initial.data = [-1.0*cm]
-
-# Boundary conditions to be applied to the positive x-side of the mesh.
-[pylithapp.timedependent.bc.x_pos]
-
-# Fix the 0 (x) degree of freedom.
-bc_dof = [0]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'x_pos'.
-label = x_pos
-
-# Change the spatial database for the Dirichlet BC initial values from
-# ZeroDispDB (which has a uniform spatial distribution) to UniformDB
-db_initial = spatialdata.spatialdb.UniformDB
-
-# Assign the label 'Dirichlet BC +x edge' to the database.
-db_initial.label = Dirichlet BC +x edge
-
-# Assign the displacement BC values
-db_initial.values = [displacement-x]
-db_initial.data = [1.0*cm]
-
-# Boundary conditions to be applied to the bottom boundary of the mesh.
-[pylithapp.timedependent.bc.y_neg]
-
-# We are fixing the 1 (y) degree of freedom.
-bc_dof = [1]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'y_neg'.
-label = y_neg
-
-# Assign the label 'Dirichlet BC -y corners' to the database.
-db_initial.label = Dirichlet BC -y edge
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-# Give basename for VTK output of solution over domain.
-[pylithapp.problem.formulation.output.output.writer]
-filename = output/axialdisp2d.vtk
-time_format = %04.0f
-time_constant = 1.0*year
-
-# Give basename for VTK output of state variables.
-[pylithapp.timedependent.materials.material.output]
-cell_filter = pylith.meshio.CellFilterAvgMesh
-writer.filename = output/axialdisp2d-statevars.vtk
-writer.time_format = %04.0f
-writer.time_constant = 1.0*year

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/axialdisp3d.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/axialdisp3d.cfg	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/axialdisp3d.cfg	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,133 +0,0 @@
-# -*- Python -*-
-
-# To run this problem, type "pylith planestrain.cfg axialdisp3d.cfg".
-# The settings in pylithapp.cfg will be read by default. See the README for
-# how to run other problems in this directory.
-#
-#
-#  <- ----------------------- ->
-#     |                     |
-#  <- |                     | ->
-#     |                     |
-#  <- |                     | ->
-#     |                     |
-#  <- ----------------------- ->
-#     ^          ^          ^
-#
-# Axial tension is applied by pulling on the left and right boundaries
-# in the horizontal direction.
-# Bottom boundary is pinned in the vertical direction.
-# In this problem, we are simulating plane strain, so all z-displacements
-# are fixed.
-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-# Specify the problem settings.
-[pylithapp.timedependent]
-# Set bc to an array with 5 boundary conditions: 'x_neg', 'x_pos', 'y_neg',
-# 'z_neg', 'z_pos'.
-bc = [x_neg,x_pos,y_neg,z_neg,z_pos]
-
-# ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
-
-# BC for the left (-x) side of the domain.
-[pylithapp.timedependent.bc.x_neg]
-
-# Fix the 0 (x) degree of freedom.
-bc_dof = [0]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'x_neg'.
-label = x_neg
-
-# Change the spatial database for the Dirichlet BC initial values from
-# ZeroDispDB (which has a uniform zero spatial distribution) to UniformDB.
-db_initial = spatialdata.spatialdb.UniformDB
-
-# Assign the label 'Dirichlet BC -x edge' to the database.
-db_initial.label = Dirichlet BC -x edge
-
-# Assign the displacement BC values
-db_initial.values = [displacement-x]
-db_initial.data = [-1.0*cm]
-
-# Boundary conditions to be applied to the positive x-side of the mesh.
-[pylithapp.timedependent.bc.x_pos]
-
-# Fix the 0 (x) degree of freedom.
-bc_dof = [0]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'x_pos'.
-label = x_pos
-
-# Change the spatial database for the Dirichlet BC initial values from
-# ZeroDispDB (which has a uniform spatial distribution) to UniformDB
-db_initial = spatialdata.spatialdb.UniformDB
-
-# Assign the label 'Dirichlet BC +x edge' to the database.
-db_initial.label = Dirichlet BC +x edge
-
-# Assign the displacement BC values
-db_initial.values = [displacement-x]
-db_initial.data = [1.0*cm]
-
-# Boundary conditions to be applied to the bottom boundary of the mesh.
-[pylithapp.timedependent.bc.y_neg]
-
-# We are fixing the 1 (y) degree of freedom.
-bc_dof = [1]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'y_neg'.
-label = y_neg
-
-# Assign the label 'Dirichlet BC -y corners' to the database.
-db_initial.label = Dirichlet BC -y edge
-
-# Boundary conditions to be applied to the front of the mesh.
-[pylithapp.timedependent.bc.z_pos]
-
-# We are fixing the 2 (z) degree of freedom.
-bc_dof = [2]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'z_pos'.
-label = z_pos
-
-# Assign the label 'Dirichlet BC +z corners' to the database.
-db_initial.label = Dirichlet BC +z edge
-
-# Boundary conditions to be applied to the back of the mesh.
-[pylithapp.timedependent.bc.z_neg]
-
-# We are fixing the 2 (z) degree of freedom.
-bc_dof = [2]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'z_neg'.
-label = z_neg
-
-# Assign the label 'Dirichlet BC -z corners' to the database.
-db_initial.label = Dirichlet BC -z edge
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-# Give basename for VTK output of solution over domain.
-[pylithapp.problem.formulation.output.output.writer]
-filename = output/axialdisp3d.vtk
-time_format = %04.0f
-time_constant = 1.0*year
-
-# Give basename for VTK output of state variables.
-[pylithapp.timedependent.materials.material.output]
-cell_filter = pylith.meshio.CellFilterAvgMesh
-writer.filename = output/axialdisp3d-statevars.vtk
-writer.time_format = %04.0f
-writer.time_constant = 1.0*year

Copied: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/cyclic (from rev 19701, short/3D/PyLith/trunk/tests/2d/plasticity/cyclic)

Copied: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/mesh (from rev 19701, short/3D/PyLith/trunk/tests/2d/plasticity/mesh)

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/planestrain2d.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/planestrain2d.cfg	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/planestrain2d.cfg	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,34 +0,0 @@
-# -*- Python -*-
-
-# The settings in this file define the setting specific to a 2D
-# (plane strain) problem.
-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# mesh_generator
-# ----------------------------------------------------------------------
-# This component specification means we are using PyLith ASCII format,
-# and we then specify the filename and number of space dimensions for
-# the mesh.
-[pylithapp.mesh_generator.reader]
-filename = twoquad4.mesh
-coordsys.space_dim = 2
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-# We define this as a 2D problem.
-# All other problem settings are in pylithapp.cfg.
-[pylithapp.timedependent]
-dimension = 2
-
-# ----------------------------------------------------------------------
-# materials
-# ----------------------------------------------------------------------
-# Define a single material that is DruckerPragerPlaneStrain.
-# Other material settings are defined in pylithapp.cfg.
-[pylithapp.timedependent.materials]
-material = pylith.materials.DruckerPragerPlaneStrain
-# The cell dimension for this material is 2.
-material.quadrature.cell.dimension = 2

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/planestrain3d.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/planestrain3d.cfg	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/planestrain3d.cfg	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,34 +0,0 @@
-# -*- Python -*-
-
-# The settings in this file define the setting specific to a 3D
-# problem simulating plane strain.
-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# mesh_generator
-# ----------------------------------------------------------------------
-# This component specification means we are using PyLith ASCII format,
-# and we then specify the filename and number of space dimensions for
-# the mesh.
-[pylithapp.mesh_generator.reader]
-filename = twohex8.mesh
-coordsys.space_dim = 3
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-# We define this as a 3D problem.
-# All other problem settings are in pylithapp.cfg.
-[pylithapp.timedependent]
-dimension = 3
-
-# ----------------------------------------------------------------------
-# materials
-# ----------------------------------------------------------------------
-# Define a single material that is DruckerPrager3D.
-# Other material settings are defined in pylithapp.cfg.
-[pylithapp.timedependent.materials]
-material = pylith.materials.DruckerPrager3D
-# The cell dimension for this material is 3.
-material.quadrature.cell.dimension = 3

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/pylithapp.cfg	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/pylithapp.cfg	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,105 +0,0 @@
-# -*- Python -*-
-
-# The settings in this file (pylithapp.cfg) will be read automatically
-# by pylith, as long as the file is placed in the run directory.
-
-# The settings in this file will override any settings in:
-# PREFIX/etc/pylithapp.cfg
-# $HOME/.pyre/pylithapp/pylithapp.cfg
-
-# The settings in this file will be overridden by any .cfg file given
-# on the command line or by any command line settings.
-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# journal
-# ----------------------------------------------------------------------
-# The settings below turn on journal info for the specified components.
-# If you want less output to stdout, you can turn these off.
-[pylithapp.journal.info]
-timedependent = 1
-implicit = 1
-petsc = 1
-solverlinear = 1
-meshioascii = 1
-homogeneous = 1
-elasticityimplicit = 1
-fiatlagrange = 1
-
-# ----------------------------------------------------------------------
-# mesh_generator
-# ----------------------------------------------------------------------
-# The settings below control the mesh generation (importing mesh info).
-# Turn on debugging output for mesh generation.
-[pylithapp.mesh_generator]
-#debug = 1
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-# Specify the problem settings.
-# This is a time-dependent problem, so we select this as our problem type.
-# We select a total time of 1 year, and a time step size of 0.1 year.
-[pylithapp.timedependent]
-implicit.solver = pylith.problems.SolverNonlinear
-normalizer.length_scale = 1.0*m
-
-[pylithapp.timedependent.formulation.time_step]
-total_time = 100.0*year
-dt = 10.0*year
-
-# ----------------------------------------------------------------------
-# materials
-# ----------------------------------------------------------------------
-# Specify the material information for the problem.
-[pylithapp.timedependent.materials.material]
-
-# We give a label of 'Elastoplastic material' to this material.
-label = Elastoplastic material
-
-# The cells associated with this material are given a material ID of 0
-# in the mesh file.
-id = 0
-
-# We specify a uniform DB and give the properties in this file.
-db_properties = spatialdata.spatialdb.UniformDB
-db_properties.label = DP elastoplastic db
-db_properties.values = [vp,vs,density,friction-angle,cohesion,dilatation-angle]
-db_properties.data = [5291.502622129181*m/s,3000.0*m/s,2700.0*kg/m**3,30.0*degree,5.0*kPa,30.0*degree]
-
-# Set cell type to FIAT Lagrange.
-quadrature.cell = pylith.feassemble.FIATLagrange
-
-# Set cell info and output fields
-output.cell_info_fields = [density,mu,lambda,alpha_yield,beta,alpha_flow]
-output.cell_data_fields = [total_strain,stress,plastic_strain]
-
-# ----------------------------------------------------------------------
-# PETSc
-# ----------------------------------------------------------------------
-[pylithapp.petsc]
-pc_type = asm
-
-# Change the preconditioner settings.
-sub_pc_factor_shift_type = nonzero
-
-ksp_rtol = 1.0e-10
-ksp_atol = 1.0e-20
-ksp_max_it = 100
-ksp_gmres_restart = 50
-
-ksp_monitor = true
-ksp_view = true
-ksp_converged_reason = true
-
-snes_rtol = 1.0e-10
-snes_atol = 1.0e-16
-snes_max_it = 100
-snes_monitor = true
-snes_ls_monitor = true
-snes_view = true
-snes_converged_reason = true
-
-log_summary = true
-# start_in_debugger = true

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/run-models.sh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/run-models.sh	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/run-models.sh	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,4 +0,0 @@
-pylith planestrain2d.cfg axialdisp2d.cfg
-pylith planestrain3d.cfg axialdisp3d.cfg
-pylith planestrain2d.cfg sheardisp2d.cfg
-pylith planestrain3d.cfg sheardisp3d.cfg

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/sheardisp2d.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/sheardisp2d.cfg	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/sheardisp2d.cfg	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,88 +0,0 @@
-# -*- Python -*-
-
-# To run this problem, type "pylith planestrain2d.cfg sheardisp2d.cfg".
-# The settings in pylithapp.cfg will be read by default. See the README for
-# how to run other problems in this directory.
-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-# Specify the problem settings.
-[pylithapp.timedependent]
-
-# Set bc to an array with 2 boundary conditions: 'x_neg' and 'x_pos'.
-bc = [x_neg,x_pos]
-
-# ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
-# Provide information on the boundary conditions.
-
-# Boundary conditions to be applied to the negative x-side of the mesh.
-[pylithapp.timedependent.bc.x_neg]
-
-# We are fixing the 0 (x) and 1 (y) degrees of freedom.
-bc_dof = [0, 1]
-
-# The nodes associated with this boundary condition have the name
-# 'x_neg' in the mesh file.
-label = x_neg
-
-# Change spatial database for initial value from ZeroDispDB (which has
-# a uniform zero spatial distribution) to UniformDB.
-db_initial = spatialdata.spatialdb.UniformDB
-
-# We are assigning the label 'Dirichlet BC -x edge' to the database.
-db_initial.label = Dirichlet BC -x edge
-
-# Assign the displacement BC values.
-db_initial.values = [displacement-x,displacement-y]
-db_initial.data = [0.0*cm,-0.0001*cm]
-
-
-# Boundary conditions to be applied to the positive x-side of the mesh.
-[pylithapp.timedependent.bc.x_pos]
-
-# We are fixing the 0 (x) and 1 (y) degrees of freedom.
-bc_dof = [0, 1]
-
-# The nodes associated with this boundary condition have the name
-# 'x_pos' in the mesh file.
-label = x_pos
-
-# Change spatial database for initial value from ZeroDispDB (which has
-# a uniform zero spatial distribution) to UniformDB.
-db_initial = spatialdata.spatialdb.UniformDB
-
-# We are assigning the label 'Dirichlet BC +x edge' to the database.
-db_initial.label = Dirichlet BC +x edge
-
-# Assign the displacement BC values.
-db_initial.values = [displacement-x,displacement-y]
-db_initial.data = [0.0*cm,0.0001*cm]
-
-# ----------------------------------------------------------------------
-# PETSc
-# ----------------------------------------------------------------------
-[pylithapp.petsc]
-ksp_rtol = 1.0e-18
-snes_rtol = 1.0e-10
-snes_atol = 1.0e-18
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-# Give basename for VTK output of solution over domain.
-[pylithapp.problem.formulation.output.output.writer]
-filename = output/sheardisp2d.vtk
-time_format = %04.0f
-time_constant = 1.0*year
-
-# Give basename for VTK output of state variables.
-[pylithapp.timedependent.materials.material.output]
-cell_filter = pylith.meshio.CellFilterAvgMesh
-writer.filename = output/sheardisp2d-statevars.vtk
-writer.time_format = %04.0f
-writer.time_constant = 1.0*year

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/sheardisp3d.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/sheardisp3d.cfg	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/sheardisp3d.cfg	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,115 +0,0 @@
-# -*- Python -*-
-
-# To run this problem, type "pylith planestrain3d.cfg sheardisp3d.cfg".
-# The settings in pylithapp.cfg will be read by default. See the README for
-# how to run other problems in this directory.
-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-# Specify the problem settings.
-[pylithapp.timedependent]
-
-# Set bc to an array with 4 boundary conditions: 'x_neg', 'x_pos', 'z_neg'
-# and 'z_pos'.
-bc = [x_neg,x_pos,z_neg,z_pos]
-
-# ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
-# Provide information on the boundary conditions.
-
-# Boundary conditions to be applied to the negative x-side of the mesh.
-[pylithapp.timedependent.bc.x_neg]
-
-# We are fixing the 0 (x) and 1 (y) degrees of freedom.
-bc_dof = [0, 1]
-
-# The nodes associated with this boundary condition have the name
-# 'x_neg' in the mesh file.
-label = x_neg
-
-# Change spatial database for initial value from ZeroDispDB (which has
-# a uniform zero spatial distribution) to UniformDB.
-db_initial = spatialdata.spatialdb.UniformDB
-
-# We are assigning the label 'Dirichlet BC -x edge' to the database.
-db_initial.label = Dirichlet BC -x edge
-
-# Assign the displacement BC values.
-db_initial.values = [displacement-x,displacement-y]
-db_initial.data = [0.0*cm,-0.0001*cm]
-
-
-# Boundary conditions to be applied to the positive x-side of the mesh.
-[pylithapp.timedependent.bc.x_pos]
-
-# We are fixing the 0 (x) and 1 (y) degrees of freedom.
-bc_dof = [0, 1]
-
-# The nodes associated with this boundary condition have the name
-# 'x_pos' in the mesh file.
-label = x_pos
-
-# Change spatial database for initial value from ZeroDispDB (which has
-# a uniform zero spatial distribution) to UniformDB.
-db_initial = spatialdata.spatialdb.UniformDB
-
-# We are assigning the label 'Dirichlet BC +x edge' to the database.
-db_initial.label = Dirichlet BC +x edge
-
-# Assign the displacement BC values.
-db_initial.values = [displacement-x,displacement-y]
-db_initial.data = [0.0*cm,0.0001*cm]
-
-# Boundary conditions to be applied to the front of the mesh.
-[pylithapp.timedependent.bc.z_pos]
-
-# We are fixing the 2 (z) degree of freedom.
-bc_dof = [2]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'z_pos'.
-label = z_pos
-
-# Assign the label 'Dirichlet BC +z corners' to the database.
-db_initial.label = Dirichlet BC +z edge
-
-# Boundary conditions to be applied to the back of the mesh.
-[pylithapp.timedependent.bc.z_neg]
-
-# We are fixing the 2 (z) degree of freedom.
-bc_dof = [2]
-
-# The group of vertices in the mesh file associated with this boundary
-# condition have the name 'z_neg'.
-label = z_neg
-
-# Assign the label 'Dirichlet BC -z corners' to the database.
-db_initial.label = Dirichlet BC -z edge
-
-# ----------------------------------------------------------------------
-# PETSc
-# ----------------------------------------------------------------------
-[pylithapp.petsc]
-ksp_rtol = 1.0e-18
-snes_rtol = 1.0e-10
-snes_atol = 1.0e-18
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-# Give basename for VTK output of solution over domain.
-[pylithapp.problem.formulation.output.output.writer]
-filename = output/sheardisp3d.vtk
-time_format = %04.0f
-time_constant = 1.0*year
-
-# Give basename for VTK output of state variables.
-[pylithapp.timedependent.materials.material.output]
-cell_filter = pylith.meshio.CellFilterAvgMesh
-writer.filename = output/sheardisp3d-statevars.vtk
-writer.time_format = %04.0f
-writer.time_constant = 1.0*year

Copied: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/static (from rev 19701, short/3D/PyLith/trunk/tests/2d/plasticity/static)

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/twohex8.mesh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/twohex8.mesh	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/twohex8.mesh	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,188 +0,0 @@
-// Finite-element mesh with two hex8 cells.
-//
-//
-//  1 ----- 3 ----- 5
-//  |       |       |
-//  |       |       |
-//  |       |       |
-//  0 ----- 2 ----- 4
-//
-// The layer behind (in the z-direction) is numbered similarly, with vertex
-// numbers beginning with 6.
-//
-// Each edge has a length of 2.0.
-//
-mesh = {
-
-  // Dimension associated with topology of mesh.
-  dimension = 3
-
-  // We are using zero-based indexing (default, C style) rather than 
-  // one-based (Fortran style) indexing.
-  use-index-zero = true
-
-  // Vertices in the mesh.
-  vertices = {
-
-    // Dimension of coordinate system for vertices.
-    dimension = 3
-
-    // Number of vertices in mesh.
-    count = 12
-
-    // Coordinates are listed as:
-    // Vertex number (starting from zero), x-coord, y-coord, z-coord
-    // Use coordinate units that are consistent with the other units used.
-    coordinates = {
-             0     -2.0 -1.0 -1.0
-             1     -2.0  1.0 -1.0
-             2      0.0 -1.0 -1.0
-             3      0.0  1.0 -1.0
-             4      2.0 -1.0 -1.0
-             5      2.0  1.0 -1.0
-             6     -2.0 -1.0  1.0
-             7     -2.0  1.0  1.0
-             8      0.0 -1.0  1.0
-             9      0.0  1.0  1.0
-            10      2.0 -1.0  1.0
-            11      2.0  1.0  1.0
-    }
-  }
-
-  // Finite-element cells in the mesh.
-  cells = {
-
-    // There are 2 cells.
-    count = 2
-
-    // These are trilinear hexahedral cells, so there are 8 corners per cell.
-    num-corners = 8
-
-    // List the vertices composing each cell, moving counter-clockwise 
-    // around the cell.
-    // List the information as:
-    // Cell number (starting from zero), vertex 0, vertex 1, vertex 2, vertex 3
-    simplices = {
-             0       0  2  3  1  6  8  9  7
-             1       2  4  5  3  8 10 11  9
-    }
-
-    // List the material ID's associated with each cell.
-    // Different ID's may be used to specify a different material type, or
-    // to use a different spatial database for each material ID.
-    // In this example, cells 0 and 1 both are associated with material ID 0.
-    material-ids = {
-             0   0
-             1   0
-    }
-  }
-
-  // Here we list different groups (cells or vertices) that we want to 
-  // associate with a particular name.
-
-  // This group of vertices may be used to define a fault.
-  // There are 4 vertices corresponding to indices 2, 8, 9 and 3.
-  group = {
-    name = fault
-    type = vertices
-    count = 4
-    indices = {
-      2
-      3
-      8
-      9
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 4 vertices corresponding to indices 0, 1, 6, and 7.
-  group = {
-    name = x_neg
-    type = vertices
-    count = 4
-    indices = {
-      0
-      1
-      6
-      7
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 4 vertices corresponding to indices 4, 5, 10, and 11.
-  group = {
-    name = x_pos
-    type = vertices
-    count = 4
-    indices = {
-      4
-      5
-     10
-     11
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 6 vertices corresponding to indices 0, 2, 4, 6, 8, and 10.
-  group = {
-    name = y_neg
-    type = vertices
-    count = 6
-    indices = {
-      0
-      2
-      4
-      6
-      8
-     10
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 6 vertices corresponding to indices 1, 3, 5, 7, 9, and 11.
-  group = {
-    name = y_pos
-    type = vertices
-    count = 6
-    indices = {
-      1
-      3
-      5
-      7
-      9
-     11
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 6 vertices, corresponding to indices 6, 7, 8, 9, 10, and 11.
-  group = {
-    name = z_neg
-    type = vertices
-    count = 6
-    indices = {
-      6
-      7
-      8
-      9
-     10
-     11
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 6 vertices, corresponding to indices 0, 1, 2, 3, 4, and 5.
-  group = {
-    name = z_pos
-    type = vertices
-    count = 6
-    indices = {
-      0
-      1
-      2
-      3
-      4
-      5
-    }
-  }
-}

Deleted: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/twoquad4.mesh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/twoquad4.mesh	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/twoquad4.mesh	2012-02-29 16:11:11 UTC (rev 19702)
@@ -1,133 +0,0 @@
-// Finite-element mesh with two quad4 cells.
-//
-//
-//  1 ----- 3 ----- 5
-//  |       |       |
-//  |       |       |
-//  |       |       |
-//  0 ----- 2 ----- 4
-//
-// Each edge has a length of 2.0.
-//
-mesh = {
-
-  // Dimenion associated with topology of mesh.
-  dimension = 2
-
-  // We are using zero-based indexing (default, C style) rather than 
-  // one-based (Fortran style) indexing.
-  use-index-zero = true
-
-  // Vertices in the mesh.
-  vertices = {
-
-    // Dimension of coordinate system for vertices.
-    dimension = 2
-
-    // Number of vertices in mesh.
-    count = 6
-
-    // Coordinates are listed as:
-    // Vertex number (starting from zero), x-coord, y-coord
-    // Use coordinate units that are consistent with the other units used.
-    coordinates = {
-             0     -2.0 -1.0
-             1     -2.0  1.0
-             2      0.0 -1.0
-             3      0.0  1.0
-             4      2.0 -1.0
-             5      2.0  1.0
-    }
-  }
-
-  // Finite-element cells in the mesh.
-  cells = {
-
-    // There are 2 cells.
-    count = 2
-
-    // These are bilinear quadrilateral cells, so there are 4 corners per cell.
-    num-corners = 4
-
-    // List the vertices composing each cell, moving counter-clockwise 
-    // around the cell.
-    // List the information as:
-    // Cell number (starting from zero), vertex 0, vertex 1, vertex 2, vertex 3
-    simplices = {
-             0       0  2  3  1
-             1       4  5  3  2
-    }
-
-    // List the material ID's associated with each cell.
-    // Different ID's may be used to specify a different material type, or
-    // to use a different spatial database for each material ID.
-    // In this example, cells 0 and 1 both are associated with material ID 0.
-    material-ids = {
-             0   0
-             1   0
-    }
-  }
-
-  // Here we list different groups (cells or vertices) that we want to 
-  // associate with a particular name.
-
-  // This group of vertices may be used to define a fault.
-  // There are 2 vertices corresponding to indices 2 and 3.
-  group = {
-    name = fault
-    type = vertices
-    count = 2
-    indices = {
-      2
-      3
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 3 vertices corresponding to indices 0, 2, and 4.
-  group = {
-    name = y_neg
-    type = vertices
-    count = 3
-    indices = {
-      0
-      2
-      4
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 2 vertices corresponding to indices 0 and 1.
-  group = {
-    name = x_neg
-    type = vertices
-    count = 2
-    indices = {
-      0
-      1
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There are 2 vertices corresponding to indices 4 and 5.
-  group = {
-    name = x_pos
-    type = vertices
-    count = 2
-    indices = {
-      4
-      5
-    }
-  }
-
-  // This group of vertices may be used to specify boundary conditions.
-  // There is 1 vertex corresponding to index 3.
-  group = {
-    name = y_pos
-    type = vertices
-    count = 1
-    indices = {
-      3
-    }
-  }
-}

Modified: short/3D/PyLith/branches/pylith-scecdynrup/tests/3d/plasticity/dynamic/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/3d/plasticity/dynamic/pylithapp.cfg	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/3d/plasticity/dynamic/pylithapp.cfg	2012-02-29 16:11:11 UTC (rev 19702)
@@ -44,8 +44,6 @@
 db_properties.label = Elastic properties
 db_properties.values = [density, vs, vp, cohesion, friction-angle, dilatation-angle]
 db_properties.data = [2700*kg/m**3, 3300.0*m/s, 5716.0*m/s, 5.0*MPa, 40.36453657309736*degree, 0.0*degree]
-# This permits matching SCEC Drucker-Prager formulation for shear wave.
-#db_properties.data = [2700*kg/m**3, 3300.0*m/s, 5716.0*m/s, 3.395327044716203*MPa, 40.36453657309736*degree, 0.0*degree]
 
 
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc	2012-02-29 16:11:11 UTC (rev 19702)
@@ -93,7 +93,7 @@
   -0.33333333, 0.0, 0.33333333,
   +0.00000001, 0.0, 0.33333333,
   +0.00000001, 0.0, 0.00000001,
-  +0.00000001, -0.99999999, 0.00000001,
+  0.0, -0.99999999, 0.00000001,
 };
 
 

Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk	2012-02-29 16:08:32 UTC (rev 19701)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk	2012-02-29 16:11:11 UTC (rev 19702)
@@ -4,8 +4,8 @@
 DATASET UNSTRUCTURED_GRID
 POINTS 3 double
 -5.000000e-01 0.000000e+00 0.0
-1.000000e-07 0.000000e+00 0.0
-9.999999e-01 -1.000000e+00 0.0
+1.000000e-08 0.000000e+00 0.0
+1.000000e+00 -1.000000e+00 0.0
 CELLS 3 6
 1  0
 1  1



More information about the CIG-COMMITS mailing list