[cig-commits] r16195 - in short/3D/PyLith/trunk: . libsrc/faults unittests/libtests/faults unittests/libtests/faults/data

brad at geodynamics.org brad at geodynamics.org
Fri Jan 29 11:21:52 PST 2010


Author: brad
Date: 2010-01-29 11:21:52 -0800 (Fri, 29 Jan 2010)
New Revision: 16195

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinHex8.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinQuad4.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTet4.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataHex8.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataHex8.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataQuad4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataQuad4.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/adjustsoln.py
   short/3D/PyLith/trunk/unittests/libtests/faults/data/slipth.py
Log:
Finished unit tests for adjustSolnLumped.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/TODO	2010-01-29 19:21:52 UTC (rev 16195)
@@ -60,15 +60,6 @@
   adjustSolnLumped()
     S (sensitivity matrix) - assume diagonal (check with assert)
 
-Unit tests
-
-  FaultCohesiveKin
-    adjustSolnLumped
-
-  FaultCohesiveDynL
-    integrateJacobian (lumped)
-    adjustSolnLumped
-
 FaultCohesiveDynL (C++)
   integrateJacobian (lumped)
   adjustSolnLumped()
@@ -76,6 +67,12 @@
     calls constrainSolnSpace()
     adjust displacements
 
+Unit tests
+
+  FaultCohesiveDynL
+    integrateJacobian (lumped)
+    adjustSolnLumped
+
 ----------------------------------------------------------------------
 TODO WELL BEFORE WORKSHOP 2010
 ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2010-01-29 19:21:52 UTC (rev 16195)
@@ -921,6 +921,8 @@
 	  const double Cqx = orientationVertex[2];
 	  const double Cqy = orientationVertex[3];
 
+	  // OPTIMIZE THIS
+
 	  const double Spp = 
 	    Cpx*Cpx*(1.0/Ai[0] + 1.0/Aj[0]) +
 	    Cpy*Cpy*(1.0/Ai[1] + 1.0/Aj[1]);
@@ -948,21 +950,7 @@
 	  const double dlp = Sinvpp*Arupslip + Sinvpq*Aruqslip;
 	  const double dlq = Sinvpq*Arupslip + Sinvqq*Aruqslip;
 
-	  std::cout << "slip: " << slipVertex[0]
-		    << ", ri: " << ri[0]
-		    << ", rj: " << rj[0]
-		    << ", ui: " << ui[0]
-		    << ", uj: " << uj[0]
-		    << ", Arup: " << Arup
-		    << ", Aruq: " << Aruq
-		    << ", Arupslip: " << Arupslip
-		    << ", Aruqslip: " << Aruqslip
-		    << ", Sinvpp: " << Sinvpp
-		    << ", Sinvqq: " << Sinvqq
-		    << ", dlp: " << dlp
-		    << ", dlq: " << dlq
-		    << ", wt: " << wt
-		    << std::endl;
+	  // OPTIMIZE THIS
 
 	  // Update displacements at node I
 	  solutionCell[indexI*spaceDim+0] = 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2010-01-29 19:21:52 UTC (rev 16195)
@@ -715,15 +715,9 @@
   jacobian.complete();
 
   const topology::Field<topology::Mesh>& solution = fields.get("dispIncr(t->t+dt)");
-#if 1 // DEBUGGING
-  solution.view("SOLUTION BEFORE ADJUSTMENT");
-#endif // DEBUGGING
-
   fault.adjustSolnLumped(&fields, jacobian);
 
-#if 1 // DEBUGGING
-  solution.view("SOLUTION AFTER ADJUSTMENT");
-#endif // DEBUGGING
+  // solution.view("SOLUTION AFTER ADJUSTMENT"); // DEBUGGING
 
   const ALE::Obj<RealSection>& solutionSection = solution.section();
   CPPUNIT_ASSERT(!solutionSection.isNull());

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinHex8.hh	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinHex8.hh	2010-01-29 19:21:52 UTC (rev 16195)
@@ -42,6 +42,7 @@
   CPPUNIT_TEST( testIntegrateJacobian );
   CPPUNIT_TEST( testIntegrateJacobianAssembled );
   CPPUNIT_TEST( testIntegrateJacobianAssembledLumped );
+  CPPUNIT_TEST( testAdjustSolnLumped );
   CPPUNIT_TEST( testUpdateStateVars );
   CPPUNIT_TEST( testCalcTractionsChange );
   CPPUNIT_TEST( testSplitField );

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinQuad4.hh	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinQuad4.hh	2010-01-29 19:21:52 UTC (rev 16195)
@@ -42,6 +42,7 @@
   CPPUNIT_TEST( testIntegrateJacobian );
   CPPUNIT_TEST( testIntegrateJacobianAssembled );
   CPPUNIT_TEST( testIntegrateJacobianAssembledLumped );
+  CPPUNIT_TEST( testAdjustSolnLumped );
   CPPUNIT_TEST( testUpdateStateVars );
   CPPUNIT_TEST( testCalcTractionsChange );
   CPPUNIT_TEST( testSplitField );

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTet4.hh	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTet4.hh	2010-01-29 19:21:52 UTC (rev 16195)
@@ -40,6 +40,9 @@
   CPPUNIT_TEST( testInitialize );
   CPPUNIT_TEST( testIntegrateResidual );
   CPPUNIT_TEST( testIntegrateJacobian );
+  CPPUNIT_TEST( testIntegrateJacobianAssembled );
+  CPPUNIT_TEST( testIntegrateJacobianAssembledLumped );
+  CPPUNIT_TEST( testAdjustSolnLumped );
   CPPUNIT_TEST( testUpdateStateVars );
   CPPUNIT_TEST( testCalcTractionsChange );
   CPPUNIT_TEST( testSplitField );

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataHex8.cc	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataHex8.cc	2010-01-29 19:21:52 UTC (rev 16195)
@@ -127,7 +127,56 @@
   5.0, 7.0, 9.0, // 21
 };
 
+const double pylith::faults::CohesiveKinDataHex8::_fieldIncr[] = {
+  3.1, 4.1, 5.1,
+  3.2, 4.2, 5.2,
+  3.3, 4.3, 5.3,
+  3.4, 4.4, 5.4,
+  3.5, 4.5, 5.5, // 6
+  3.6, 4.6, 5.6, // 7
+  3.7, 4.7, 5.7, // 8
+  3.8, 4.8, 5.8, // 9
+  3.9, 4.9, 5.9,
+  3.0, 4.0, 5.0,
+  3.1, 4.1, 5.1,
+  3.2, 4.2, 5.2,
+  3.3, 4.3, 5.3, // 14
+  3.5, 4.5, 5.5, // 15
+  3.7, 4.7, 5.7, // 16
+  3.9, 4.9, 5.9, // 17
+  3.4, 4.4, 5.4, // 18
+  3.6, 4.6, 5.6, // 19
+  3.8, 4.8, 5.8, // 20
+  3.0, 4.0, 5.0, // 21
+};
+
+const double pylith::faults::CohesiveKinDataHex8::_jacobianLumped[] = {
+  1.1, 1.1, 1.1,
+  1.2, 1.2, 1.2,
+  1.3, 1.3, 1.3,
+  1.4, 1.4, 1.4,
+  1.5, 1.5, 1.5, // 6
+  1.6, 1.6, 1.6, // 7
+  1.7, 1.7, 1.7, // 8
+  1.8, 1.8, 1.8, // 9
+  1.9, 1.9, 1.9,
+  1.0, 1.0, 1.0,
+  1.1, 1.1, 1.1,
+  1.2, 1.2, 1.2,
+  1.3, 1.3, 1.3, // 14
+  1.5, 1.5, 1.5, // 15
+  1.7, 1.7, 1.7, // 16
+  1.9, 1.9, 1.9, // 17
+  1.4, 1.4, 1.4, // 18
+  1.6, 1.6, 1.6, // 19
+  1.8, 1.8, 1.8, // 20
+  1.0, 1.0, 1.0, // 21
+};
+
 const int pylith::faults::CohesiveKinDataHex8::_numConstraintVert = 4;
+const int pylith::faults::CohesiveKinDataHex8::_constraintVertices[] = {
+  18, 19, 20, 21
+};
 
 const double pylith::faults::CohesiveKinDataHex8::_orientation[] = {
   0.0, -1.0, 0.0,    0.0, 0.0, -1.0,    -1.0, 0.0, 0.0,
@@ -140,11 +189,6 @@
   1.0, 1.0, 1.0, 1.0
 };
 
-const int pylith::faults::CohesiveKinDataHex8::_constraintVertices[] = {
-  18, 19, 20, 21
-};
-
-
 const double pylith::faults::CohesiveKinDataHex8::_residual[] = {
   0.0, 0.0, 0.0,
   0.0, 0.0, 0.0,
@@ -1394,6 +1438,29 @@
   0.0, 0.0, 0.0,
 };
 
+const double pylith::faults::CohesiveKinDataHex8::_fieldIncrAdjusted[] = {
+  3.1, 4.1, 5.1,
+  3.2, 4.2, 5.2,
+  3.3, 4.3, 5.3,
+  3.4, 4.4, 5.4,
+  10.1012399174, 7.62375619614, 11.0627491494, // 6
+  9.96706334677, 7.71443758064, 11.0591659677, // 7
+  9.87367998662, 7.85321557474, 11.0613129813, // 8
+  9.26265302548, 7.47826568661, 10.5092833522, // 9
+  3.9, 4.9, 5.9,
+  3.0, 4.0, 5.0,
+  3.1, 4.1, 5.1,
+  3.2, 4.2, 5.2,
+  -4.31681528934, 0.695665927527, -1.11855671086, // 14
+  -3.29153423656, 1.17793324732, -0.323110365593, // 15
+  -2.47367998662, 1.54678442526, 0.338687018672, // 16
+  -1.27514497151, 2.36269566532, 1.43857366631, // 17
+  8.08563429421, 12.7441237241, 15.3018598761, // 18
+  8.58310012902, 13.3346655484, 15.7873013548, // 19
+  9.16046647706, 13.9142320683, 16.2952559773, // 20
+  7.8208782359, 12.476710034, 14.8327754459, // 21
+};
+
 pylith::faults::CohesiveKinDataHex8::CohesiveKinDataHex8(void)
 { // constructor
   meshFilename = const_cast<char*>(_meshFilename);
@@ -1413,12 +1480,15 @@
   riseTimeFilename = const_cast<char*>(_riseTimeFilename);
   matPropsFilename = const_cast<char*>(_matPropsFilename);
   fieldT = const_cast<double*>(_fieldT);
+  fieldIncr = const_cast<double*>(_fieldIncr);
+  jacobianLumped = const_cast<double*>(_jacobianLumped);
   orientation = const_cast<double*>(_orientation);
   area = const_cast<double*>(_area);
-  constraintVertices = const_cast<int*>(_constraintVertices);
+  residualIncr = const_cast<double*>(_residualIncr);
   residual = const_cast<double*>(_residual);
-  residualIncr = const_cast<double*>(_residualIncr);
   jacobian = const_cast<double*>(_jacobian);
+  fieldIncrAdjusted = const_cast<double*>(_fieldIncrAdjusted);
+  constraintVertices = const_cast<int*>(_constraintVertices);
   numConstraintVert = _numConstraintVert;  
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataHex8.hh	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataHex8.hh	2010-01-29 19:21:52 UTC (rev 16195)
@@ -57,14 +57,17 @@
   static const char* _matPropsFilename; ///< Name of db for bulk mat properties.
   //@}
 
-  static const double _fieldT[]; ///< Solution field at time t.
+  static const double _fieldT[]; ///< Field over domain at time t.
+  static const double _fieldIncr[]; ///< Solution increment field over domain at time t.
+  static const double _jacobianLumped[]; ///< Lumped Jacobian.
 
   static const double _orientation[]; ///< Expected values for fault orientation.
   static const double _area[]; ///< Expected values for fault area.
-  static const int _constraintVertices[]; ///< Expected points for constraint vertices
   static const double _residual[]; ///< Expected values from residual calculation.
-  static const double _residualIncr[]; ///< Expected values from residual calculation using solution increment.
+  static const double _residualIncr[]; ///< Expected values from residual calculation with solution increment.
   static const double _jacobian[]; ///< Expected values from Jacobian calculation.
+  static const double _fieldIncrAdjusted[]; ///< Expected values for colution increment after adjustment.
+  static const int _constraintVertices[]; ///< Expected points for constraint vertices
   static const int _numConstraintVert; ///< Number of constraint vertices
 
 };

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataQuad4.cc	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataQuad4.cc	2010-01-29 19:21:52 UTC (rev 16195)
@@ -105,8 +105,37 @@
   8.0, 9.0, // 11
 };
 
+const double pylith::faults::CohesiveKinDataQuad4::_fieldIncr[] = {
+  3.1, 4.1,
+  3.2, 4.2,
+  3.3, 4.3, // 4
+  3.4, 4.4, // 5
+  3.5, 4.5,
+  3.6, 4.6,
+  3.7, 4.7, // 8
+  3.9, 4.9, // 9
+  3.8, 4.8, // 10
+  3.0, 4.0, // 11
+};
 
+const double pylith::faults::CohesiveKinDataQuad4::_jacobianLumped[] = {
+  1.1, 1.1,
+  1.2, 1.2,
+  1.3, 1.3, // 4
+  1.4, 1.4, // 5
+  1.5, 1.5,
+  1.6, 1.6,
+  1.7, 1.7, // 8
+  1.9, 1.9, // 9
+  1.8, 1.8, // 10
+  1.0, 1.0, // 11
+};
+
+
 const int pylith::faults::CohesiveKinDataQuad4::_numConstraintVert = 2;
+const int pylith::faults::CohesiveKinDataQuad4::_constraintVertices[] = {
+  10, 11
+};
 
 const double pylith::faults::CohesiveKinDataQuad4::_orientation[] = {
   0.0,  1.0,  +1.0, 0.0,
@@ -117,11 +146,7 @@
   1.0, 1.0,
 };
 
-const int pylith::faults::CohesiveKinDataQuad4::_constraintVertices[] = {
-  10, 11
-};
 
-
 const double pylith::faults::CohesiveKinDataQuad4::_residual[] = {
   0.0,  0.0,
   0.0,  0.0,
@@ -351,6 +376,19 @@
   0.0, 0.0,
 };
 
+const double pylith::faults::CohesiveKinDataQuad4::_fieldIncrAdjusted[] = {
+  3.1, 4.1,
+  3.2, 4.2,
+  -3.92795746626, -1.23651523612, // 4
+  -2.69324360432, 0.0649209102031, // 5
+  3.5, 4.5,
+  3.6, 4.6,
+  9.22726159185, 8.9338057688, // 8
+  8.38975844529, 8.09426880301, // 9
+  10.997469807, 14.1963447061, // 10
+  9.06911072572, 12.530541046, // 11
+};
+
 pylith::faults::CohesiveKinDataQuad4::CohesiveKinDataQuad4(void)
 { // constructor
   meshFilename = const_cast<char*>(_meshFilename);
@@ -370,12 +408,15 @@
   riseTimeFilename = const_cast<char*>(_riseTimeFilename);
   matPropsFilename = const_cast<char*>(_matPropsFilename);
   fieldT = const_cast<double*>(_fieldT);
+  fieldIncr = const_cast<double*>(_fieldIncr);
+  jacobianLumped = const_cast<double*>(_jacobianLumped);
   orientation = const_cast<double*>(_orientation);
   area = const_cast<double*>(_area);
-  constraintVertices = const_cast<int*>(_constraintVertices);
+  residualIncr = const_cast<double*>(_residualIncr);
   residual = const_cast<double*>(_residual);
-  residualIncr = const_cast<double*>(_residualIncr);
   jacobian = const_cast<double*>(_jacobian);
+  fieldIncrAdjusted = const_cast<double*>(_fieldIncrAdjusted);
+  constraintVertices = const_cast<int*>(_constraintVertices);
   numConstraintVert = _numConstraintVert;  
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataQuad4.hh	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataQuad4.hh	2010-01-29 19:21:52 UTC (rev 16195)
@@ -57,14 +57,17 @@
   static const char* _matPropsFilename; ///< Name of db for bulk mat properties.
   //@}
 
-  static const double _fieldT[]; ///< Solution field at time t.
+  static const double _fieldT[]; ///< Field over domain at time t.
+  static const double _fieldIncr[]; ///< Solution increment field over domain at time t.
+  static const double _jacobianLumped[]; ///< Lumped Jacobian.
 
   static const double _orientation[]; ///< Expected values for fault orientation.
   static const double _area[]; ///< Expected values for fault area.
-  static const int _constraintVertices[]; ///< Expected points for constraint vertices
   static const double _residual[]; ///< Expected values from residual calculation.
-  static const double _residualIncr[]; ///< Expected values from residual calculation using solution increment.
+  static const double _residualIncr[]; ///< Expected values from residual calculation with solution increment.
   static const double _jacobian[]; ///< Expected values from Jacobian calculation.
+  static const double _fieldIncrAdjusted[]; ///< Expected values for colution increment after adjustment.
+  static const int _constraintVertices[]; ///< Expected points for constraint vertices
   static const int _numConstraintVert; ///< Number of constraint vertices
 
 };

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc	2010-01-29 19:21:52 UTC (rev 16195)
@@ -94,7 +94,38 @@
   7.1, 8.1, 9.1, // 12
 };
 
+const double pylith::faults::CohesiveKinDataTet4::_fieldIncr[] = {
+  3.1, 4.1, 5.1,
+  3.2, 4.2, 5.2, // 3
+  3.3, 4.3, 5.3, // 4
+  3.4, 4.4, 5.4, // 5
+  3.5, 4.5, 5.5,
+  3.6, 4.6, 5.6, // 7
+  3.8, 4.8, 5.8, // 8
+  3.0, 4.0, 5.0, // 9
+  3.7, 4.7, 5.7, // 10
+  3.9, 4.9, 5.9, // 11
+  3.1, 4.1, 5.1, // 12
+};
+
+const double pylith::faults::CohesiveKinDataTet4::_jacobianLumped[] = {
+  1.1, 1.1, 1.1,
+  1.2, 1.2, 1.2, // 3
+  1.3, 1.3, 1.3, // 4
+  1.4, 1.4, 1.4, // 5
+  1.5, 1.5, 1.5,
+  1.6, 1.6, 1.6, // 7
+  1.8, 1.8, 1.8, // 8
+  1.0, 1.0, 1.0, // 9
+  1.7, 1.7, 1.7, // 10
+  1.9, 1.9, 1.9, // 11
+  1.1, 1.1, 1.1, // 12
+};
+
 const int pylith::faults::CohesiveKinDataTet4::_numConstraintVert = 3;
+const int pylith::faults::CohesiveKinDataTet4::_constraintVertices[] = {
+  10, 11, 12
+};
 
 const double pylith::faults::CohesiveKinDataTet4::_orientation[] = {
   0.0, +1.0, 0.0,    0.0, 0.0, +1.0,    +1.0, 0.0, 0.0,
@@ -108,10 +139,6 @@
   1.0/3.0,
 };
 
-const int pylith::faults::CohesiveKinDataTet4::_constraintVertices[] = {
-  10, 11, 12
-};
-
 const double pylith::faults::CohesiveKinDataTet4::_residual[] = {
   0.0,  0.0,  0.0,
   9.7,  7.7,  8.7, // 3
@@ -506,6 +533,20 @@
   0.0, 0.0, 0.0,
 };
 
+const double pylith::faults::CohesiveKinDataTet4::_fieldIncrAdjusted[] = {
+  3.1, 4.1, 5.1,
+  -4.6094015101, -0.944806160821, -2.13895133408, // 3
+  -3.94295740571, -0.501344947885, -1.58424978164, // 4
+  -3.19081175355, -0.205970962145, -0.779945691723, // 5
+  3.5, 4.5, 5.5,
+  9.45705113257, 8.45860462062, 11.1042135006, // 7
+  9.03102479301, 8.26763801792, 10.7719581756, // 8
+  12.227136455, 10.448359347, 13.6519239684, // 9
+  9.87376739299, 13.5067416009, 15.0712818121, // 10
+  10.1417484323, 13.8495247161, 15.3158446274, // 11
+  9.548359347, 12.7519239684, 14.327136455, // 12
+};
+
 pylith::faults::CohesiveKinDataTet4::CohesiveKinDataTet4(void)
 { // constructor
   meshFilename = const_cast<char*>(_meshFilename);
@@ -525,12 +566,15 @@
   riseTimeFilename = const_cast<char*>(_riseTimeFilename);
   matPropsFilename = const_cast<char*>(_matPropsFilename);
   fieldT = const_cast<double*>(_fieldT);
+  fieldIncr = const_cast<double*>(_fieldIncr);
+  jacobianLumped = const_cast<double*>(_jacobianLumped);
   orientation = const_cast<double*>(_orientation);
   area = const_cast<double*>(_area);
-  constraintVertices = const_cast<int*>(_constraintVertices);
+  residualIncr = const_cast<double*>(_residualIncr);
   residual = const_cast<double*>(_residual);
-  residualIncr = const_cast<double*>(_residualIncr);
   jacobian = const_cast<double*>(_jacobian);
+  fieldIncrAdjusted = const_cast<double*>(_fieldIncrAdjusted);
+  constraintVertices = const_cast<int*>(_constraintVertices);
   numConstraintVert = _numConstraintVert;  
 } // constructor
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.hh	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.hh	2010-01-29 19:21:52 UTC (rev 16195)
@@ -57,14 +57,17 @@
   static const char* _matPropsFilename; ///< Name of db for bulk mat properties.
   //@}
 
-  static const double _fieldT[]; ///< Solution field at time t.
+  static const double _fieldT[]; ///< Field over domain at time t.
+  static const double _fieldIncr[]; ///< Solution increment field over domain at time t.
+  static const double _jacobianLumped[]; ///< Lumped Jacobian.
 
   static const double _orientation[]; ///< Expected values for fault orientation.
   static const double _area[]; ///< Expected values for fault area.
-  static const int _constraintVertices[]; ///< Expected points for constraint vertices
   static const double _residual[]; ///< Expected values from residual calculation.
-  static const double _residualIncr[]; ///< Expected values from residual calculation using solution increment.
+  static const double _residualIncr[]; ///< Expected values from residual calculation with solution increment.
   static const double _jacobian[]; ///< Expected values from Jacobian calculation.
+  static const double _fieldIncrAdjusted[]; ///< Expected values for colution increment after adjustment.
+  static const int _constraintVertices[]; ///< Expected points for constraint vertices
   static const int _numConstraintVert; ///< Number of constraint vertices
 
 };

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/adjustsoln.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/adjustsoln.py	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/adjustsoln.py	2010-01-29 19:21:52 UTC (rev 16195)
@@ -1,5 +1,5 @@
-test = "tri3"
-vertex = 1
+test = "hex8"
+vertex = 3
 
 # ----------------------------------------------------------------------
 if test == "line2":
@@ -24,47 +24,90 @@
     print dui+ddui,duj+dduj,l+dlp
 
 # ----------------------------------------------------------------------
-elif test == "tri3":
+elif test == "tri3" or test == "quad4":
 
-    Cpx = 0.0
-    Cpy = -1.0
-    Cqx = -1.0
-    Cqy = 0.0
+    if test == "tri3":
 
-    if vertex == 0:
-        # Lagrange vertex 8, vertex i: 3, vertex j: 6
-        dkp = 1.89546413727; lp = 3.6
-        dkq = 0.08241148423; lq = 4.6
-    
-        # vertex i
-        Aix = 1.2; Aiy = 1.2
-        rix = -9.6; riy = -8.6
-        uix = 8.2; uiy = 9.2
-        duix = 3.2; duiy = 4.2
+        Cpx = 0.0
+        Cpy = -1.0
+        Cqx = -1.0
+        Cqy = 0.0
 
-        # vertex j
-        Ajx = 1.5; Ajy = 1.5
-        rjx = +9.6; rjy = +8.6
-        ujx = 8.5; ujy = 9.5
-        dujx = 3.5; dujy = 4.5
+        if vertex == 0:
+            # Lagrange vertex 8, vertex i: 3, vertex j: 6
+            dkp = 1.89546413727; lp = 3.6
+            dkq = 0.08241148423; lq = 4.6
+            
+            # vertex i
+            Aix = 1.2; Aiy = 1.2
+            rix = -9.6; riy = -8.6
+            uix = 8.2; uiy = 9.2
+            duix = 3.2; duiy = 4.2
+            
+            # vertex j
+            Ajx = 1.5; Ajy = 1.5
+            rjx = +9.6; rjy = +8.6
+            ujx = 8.5; ujy = 9.5
+            dujx = 3.5; dujy = 4.5
+            
+        elif vertex == 1:
+            # Lagrange vertex 9, vertex i: 4, vertex j: 7
+            dkp = 1.77538035254; lp = 3.8
+            dkq = 0.14794836271; lq = 4.8
+            
+            # vertex i
+            Aix = 1.3; Aiy = 1.3
+            rix = -9.8; riy = -8.8
+            uix = 8.3; uiy = 9.3
+            duix = 3.3; duiy = 4.3
+            
+            # vertex j
+            Ajx = 1.7; Ajy = 1.7
+            rjx = +9.8; rjy = +8.8
+            ujx = 8.7; ujy = 9.7
+            dujx = 3.7; dujy = 4.7
+            
+    elif test == "quad4":
 
-    elif vertex == 1:
-        # Lagrange vertex 9, vertex i: 4, vertex j: 7
-        dkp = 1.77538035254; lp = 3.8
-        dkq = 0.14794836271; lq = 4.8
-    
-        # vertex i
-        Aix = 1.3; Aiy = 1.3
-        rix = -9.8; riy = -8.8
-        uix = 8.3; uiy = 9.3
-        duix = 3.3; duiy = 4.3
+        Cpx = 0.0
+        Cpy = 1.0
+        Cqx = 1.0
+        Cqy = 0.0
+        
+        if vertex == 0:
+            # Lagrange vertex 10, vertex i: 4, vertex j: 8
+            dkp = 1.77538035254; lp = 3.8
+            dkq = 0.14794836271; lq = 4.8
+            
+            # vertex i: 4
+            Aix = 1.3; Aiy = 1.3
+            rix = +9.8; riy = +8.8
+            uix = 8.3; uiy = 9.3
+            duix = 3.3; duiy = 4.3
+            
+            # vertex j: 8
+            Ajx = 1.7; Ajy = 1.7
+            rjx = -9.8; rjy = -8.8
+            ujx = 8.7; ujy = 9.7
+            dujx = 3.7; dujy = 4.7
+            
+        elif vertex == 1:
+            # Lagrange vertex 11, vertex i: 5, vertex j: 9
+            dkp = 1.89546413727; lp = 3.0
+            dkq = 0.08241148423; lq = 4.0
+            
+            # vertex i: 5
+            Aix = 1.4; Aiy = 1.4
+            rix = +9.0; riy = +8.0
+            uix = 8.4; uiy = 9.4
+            duix = 3.4; duiy = 4.4
+            
+            # vertex j: 9
+            Ajx = 1.9; Ajy = 1.9
+            rjx = -9.0; rjy = -8.0
+            ujx = 8.9; ujy = 9.9
+            dujx = 3.9; dujy = 4.9
 
-        # vertex j
-        Ajx = 1.7; Ajy = 1.7
-        rjx = +9.8; rjy = +8.8
-        ujx = 8.7; ujy = 9.7
-        dujx = 3.7; dujy = 4.7
-
     Sppi = Aix*Ajx / (Aix + Ajx)
     Sqqi = Aix*Ajx / (Aix + Ajx)
 
@@ -106,3 +149,212 @@
     print duix+dduix,duiy+dduiy
     print dujx+ddujx,dujy+ddujy
     print lp+dlp,lq+dlq
+
+# ----------------------------------------------------------------------
+elif test == "tet4" or test == "hex8":
+
+    if test == "tet4":
+
+        Cpx = 0.0
+        Cpy = 1.0
+        Cpz = 0.0
+        Cqx = 0.0
+        Cqy = 0.0
+        Cqz = 1.0
+        Crx = 1.0
+        Cry = 0.0
+        Crz = 0.0
+
+        if vertex == 0:
+            # Lagrange vertex 10, vertex i: 3, vertex j: 7
+            dkp = 1.82575588523; lp = 3.7
+            dkq = -0.55566483464; lq = 4.7
+            dkr = 0.07938069066; lr = 5.7
+            
+            # vertex i: 3
+            Aix = 1.2; Aiy = 1.2; Aiz = 1.2
+            rix = +9.7; riy = +7.7; riz = +8.7
+            uix = 7.2; uiy = 8.2; uiz = 9.2
+            duix = 3.2; duiy = 4.2; duiz = 5.2
+            
+            # vertex j: 7
+            Ajx = 1.6; Ajy = 1.6; Ajz = 1.6
+            rjx = -9.7; rjy = -7.7; rjz = -8.7
+            ujx = 7.6; ujy = 8.6; ujz = 9.6
+            dujx = 3.6; dujy = 4.6; dujz = 5.6
+            
+        elif vertex == 1:
+            # Lagrange vertex 11, vertex i: 4, vertex j: 8
+            dkp = 1.69682900001; lp = 3.9
+            dkq = -0.56560966667; lq = 4.9
+            dkr = 0.14140241667; lr = 5.9
+            
+            # vertex i: 4
+            Aix = 1.3; Aiy = 1.3; Aiz = 1.3
+            rix = +9.9; riy = +7.9; riz = +8.9
+            uix = 7.3; uiy = 8.3; uiz = 9.3
+            duix = 3.3; duiy = 4.3; duiz = 5.3
+            
+            # vertex j: 8
+            Ajx = 1.8; Ajy = 1.8; Ajz = 1.8
+            rjx = -9.9; rjy = -7.9; rjz = -8.9
+            ujx = 7.8; ujy = 8.8; ujz = 9.8
+            dujx = 3.8; dujy = 4.8; dujz = 5.8
+            
+        elif vertex == 2:
+            # Lagrange vertex 12, vertex i: 5, vertex j: 9
+            dkp = 1.51709826228; lp = 3.1
+            dkq = -0.54615537442; lq = 4.1
+            dkr = 0.18205179147; lr = 5.1
+            
+            # vertex i: 5
+            Aix = 1.4; Aiy = 1.4; Aiz = 1.4
+            rix = +9.1; riy = +7.1; riz = +8.1
+            uix = 7.4; uiy = 8.4; uiz = 9.4
+            duix = 3.4; duiy = 4.4; duiz = 5.4
+            
+            # vertex j: 9
+            Ajx = 1.0; Ajy = 1.0; Ajz = 1.0
+            rjx = -9.1; rjy = -7.1; rjz = -8.1
+            ujx = 7.0; ujy = 8.0; ujz = 9.0
+            dujx = 3.0; dujy = 4.0; dujz = 5.0
+            
+    elif test == "hex8":
+
+        Cpx = 0.0
+        Cpy = -1.0
+        Cpz = 0.0
+        Cqx = 0.0
+        Cqy = 0.0
+        Cqz = -1.0
+        Crx = -1.0
+        Cry = 0.0
+        Crz = 0.0
+
+        if vertex == 0:
+            # Lagrange vertex 18, vertex i: 6, vertex j: 14
+            dkp = 1.82575588523; lp = 3.4
+            dkq = -0.55566483464; lq = 4.4
+            dkr = 0.07938069066; lr = 5.4
+            
+            # vertex i: 6
+            Aix = 1.5; Aiy = 1.5; Aiz = 1.5
+            rix = -9.4; riy = -5.4; riz = -7.4
+            uix = 4.5; uiy = 6.5; uiz = 8.5
+            duix = 3.5; duiy = 4.5; duiz = 5.5
+            
+            # vertex j: 14
+            Ajx = 1.3; Ajy = 1.3; Ajz = 1.3
+            rjx = +9.4; rjy = +5.4; rjz = +7.4
+            ujx = 5.3; ujy = 7.3; ujz = 9.3
+            dujx = 3.3; dujy = 4.3; dujz = 5.3
+            
+        elif vertex == 1:
+            # Lagrange vertex 19, vertex i: 7, vertex j: 15
+            dkp = 1.69682900001; lp = 3.6
+            dkq = -0.56560966667; lq = 4.6
+            dkr = 0.14140241667; lr = 5.6
+            
+            # vertex i: 7
+            Aix = 1.6; Aiy = 1.6; Aiz = 1.6
+            rix = -9.6; riy = -5.6; riz = -7.6
+            uix = 4.6; uiy = 6.6; uiz = 8.6
+            duix = 3.6; duiy = 4.6; duiz = 5.6
+            
+            # vertex j: 15
+            Ajx = 1.5; Ajy = 1.5; Ajz = 1.5
+            rjx = +9.6; rjy = +5.6; rjz = +7.6
+            ujx = 5.5; ujy = 7.5; ujz = 9.5
+            dujx = 3.5; dujy = 4.5; dujz = 5.5
+            
+        elif vertex == 2:
+            # Lagrange vertex 20, vertex i: 8, vertex j: 16
+            dkp = 1.51709826228; lp = 3.8
+            dkq = -0.54615537442; lq = 4.8
+            dkr = 0.18205179147; lr = 5.8
+            
+            # vertex i: 8
+            Aix = 1.7; Aiy = 1.7; Aiz = 1.7
+            rix = -9.8; riy = -5.8; riz = -7.8
+            uix = 4.7; uiy = 6.7; uiz = 8.7
+            duix = 3.7; duiy = 4.7; duiz = 5.7
+            
+            # vertex j: 16
+            Ajx = 1.7; Ajy = 1.7; Ajz = 1.7
+            rjx = +9.8; rjy = +5.8; rjz = +7.8
+            ujx = 5.7; ujy = 7.7; ujz = 9.7
+            dujx = 3.7; dujy = 4.7; dujz = 5.7
+            
+        elif vertex == 3:
+            # Lagrange vertex 21, vertex i: 9, vertex j: 17
+            dkp = 1.29378670385; lp = 3.0
+            dkq = -0.49761027071; lq = 4.0
+            dkr = 0.19904410828; lr = 5.0
+            
+            # vertex i: 9
+            Aix = 1.8; Aiy = 1.8; Aiz = 1.8
+            rix = -9.0; riy = -5.0; riz = -7.0
+            uix = 4.8; uiy = 6.8; uiz = 8.8
+            duix = 3.8; duiy = 4.8; duiz = 5.8
+            
+            # vertex j: 17
+            Ajx = 1.9; Ajy = 1.9; Ajz = 1.9
+            rjx = +9.0; rjy = +5.0; rjz = +7.0
+            ujx = 5.9; ujy = 7.9; ujz = 9.9
+            dujx = 3.9; dujy = 4.9; dujz = 5.9
+            
+    Sppi = Aix*Ajx / (Aix + Ajx)
+    Sqqi = Aiy*Ajy / (Aiy + Ajy)
+    Srri = Aiz*Ajz / (Aiz + Ajz)
+
+    Arux = rix / Aix - rjx / Ajx + uix - ujx
+    Aruy = riy / Aiy - rjy / Ajy + uiy - ujy
+    Aruz = riz / Aiz - rjz / Ajz + uiz - ujz
+
+    Arup = Cpx*Arux + Cpy*Aruy + Cpz*Aruz
+    Aruq = Cqx*Arux + Cqy*Aruy + Cqz*Aruz
+    Arur = Crx*Arux + Cry*Aruy + Crz*Aruz
+    Arupslip = Arup - dkp
+    Aruqslip = Aruq - dkq
+    Arurslip = Arur - dkr
+
+    dlp = Sppi * Arupslip
+    dlq = Sqqi * Aruqslip
+    dlr = Srri * Arurslip
+
+    dduix = -1.0/Aix * (Cpx*dlp + Cqx*dlq + Crx*dlr)
+    dduiy = -1.0/Aiy * (Cpy*dlp + Cqy*dlq + Cry*dlr)
+    dduiz = -1.0/Aiy * (Cpz*dlp + Cqz*dlq + Crz*dlr)
+
+    ddujx = +1.0/Ajx * (Cpx*dlp + Cqx*dlq + Crx*dlr)
+    ddujy = +1.0/Ajy * (Cpy*dlp + Cqy*dlq + Cry*dlr)
+    ddujz = +1.0/Ajz * (Cpz*dlp + Cqz*dlq + Crz*dlr)
+
+    print "Sppi",Sppi
+    print "Sqqi",Sqqi
+    print "Srri",Srri
+
+    print "Arup",Arup
+    print "Aruq",Aruq
+    print "Arur",Arur
+
+    print "Arupslip",Arupslip
+    print "Aruqslip",Aruqslip
+    print "Arurslip",Arurslip
+
+    print "dlp",dlp
+    print "dlq",dlq
+    print "dlr",dlr
+
+    print "dduix:",dduix
+    print "dduiy:",dduiy
+    print "dduiz:",dduiz
+
+    print "ddujx:",ddujx
+    print "ddujy:",ddujy
+    print "ddujz:",ddujz
+
+    print duix+dduix,duiy+dduiy,duiz+dduiz
+    print dujx+ddujx,dujy+ddujy,dujz+ddujz
+    print lp+dlp,lq+dlq,lr+dlr
+

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/slipth.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/slipth.py	2010-01-29 14:48:36 UTC (rev 16194)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/slipth.py	2010-01-29 19:21:52 UTC (rev 16195)
@@ -1,11 +1,11 @@
 from math import *
 
-finalSlip = (2.4, 0.2, 0.0)
-riseTime = 1.5
+finalSlip = (2.6, -1.0, 0.4)
+riseTime = 1.8
 
 slipMag = (finalSlip[0]**2+finalSlip[1]**2+finalSlip[2]**2)**0.5
 
-slipTime1 = 1.3
+slipTime1 = 1.5
 slipTime2 = 1.5
 t = 2.134
 dt = 0.01



More information about the CIG-COMMITS mailing list