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

brad at geodynamics.org brad at geodynamics.org
Mon Apr 12 13:12:48 PDT 2010


Author: brad
Date: 2010-04-12 13:12:47 -0700 (Mon, 12 Apr 2010)
New Revision: 16532

Added:
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynTri3d.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynTri3d.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_initialtract.spatialdb
Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am
   short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py
   short/3D/PyLith/trunk/unittests/libtests/faults/test_faults.cc
Log:
Fixed bug in computing change in displacement increment for friction. Added unit test with nonplanar fault. Updated corresponding unit tests (unit test did not account for fault orientation).

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/TODO	2010-04-12 20:12:47 UTC (rev 16532)
@@ -56,7 +56,7 @@
 FRICTION
 ----------------------------------------------------------------------
 
-Full scale tests of sliding bar. [Surendra]
+Full scale friction tests. [Surendra]
 
   check fault output
     fault constitutive parameters
@@ -72,12 +72,6 @@
 LUMPED SOLVER
 ----------------------------------------------------------------------
 
-FaultCohesiveDyn (C++)
-  adjustSolnLumped()
-    compute Lagrange multipliers (zero increment of slip)
-    calls constrainSolnSpace()
-    adjust displacements
-
 Unit tests
 
   setting up cohesive info
@@ -90,13 +84,8 @@
     integrateResidualLumped()
   AbsorbingDampers
     integrateResidualLumped()
-
-
   FaultCohesiveDyn
-
     adjustSolnLumped()
-    _adjustSolnLumpedXD()
-    _constrainSolnSpaceXD()
 
 ----------------------------------------------------------------------
 TODO WELL BEFORE WORKSHOP 2010

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc	2010-04-12 20:12:47 UTC (rev 16532)
@@ -531,16 +531,23 @@
 	   dispTIncrSection->getFiberDimension(v_lagrange));
     dispTIncrSection->updateAddPoint(v_lagrange, &dLagrangeTpdtVertex[0]);
 
+    // Compute change in displacement field.
+    dispTIncrVertexN = 0.0;
+    for (int iDim = 0; iDim < spaceDim; ++iDim)
+      for (int kDim = 0; kDim < spaceDim; ++kDim)
+        dispTIncrVertexN[iDim] += 
+	  orientationVertex[kDim*spaceDim+iDim] * dSlipVertex[kDim];
+    
     // Update displacement field
-    dSlipVertex *= -0.5;
-    assert(dSlipVertex.size() ==
+    dispTIncrVertexN *= -0.5;
+    assert(dispTIncrVertexN.size() ==
 	   dispTIncrSection->getFiberDimension(v_negative));
-    dispTIncrSection->updateAddPoint(v_negative, &dSlipVertex[0]);
+    dispTIncrSection->updateAddPoint(v_negative, &dispTIncrVertexN[0]);
     
-    dSlipVertex *= -1.0;
-    assert(dSlipVertex.size() ==
+    dispTIncrVertexP = -dispTIncrVertexN;
+    assert(dispTIncrVertexP.size() ==
 	   dispTIncrSection->getFiberDimension(v_positive));
-    dispTIncrSection->updateAddPoint(v_positive, &dSlipVertex[0]);
+    dispTIncrSection->updateAddPoint(v_positive, &dispTIncrVertexP[0]);
     
   } // for
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am	2010-04-12 20:12:47 UTC (rev 16532)
@@ -47,6 +47,7 @@
 	TestFaultCohesiveKinSrcsHex8.cc \
 	TestFaultCohesiveDyn.cc \
 	TestFaultCohesiveDynTri3.cc \
+	TestFaultCohesiveDynTri3d.cc \
 	TestFaultCohesiveDynQuad4.cc \
 	TestFaultCohesiveDynTet4.cc \
 	TestFaultCohesiveDynHex8.cc \
@@ -79,6 +80,7 @@
 	TestFaultCohesiveKinSrcsHex8.hh \
 	TestFaultCohesiveDyn.hh \
 	TestFaultCohesiveDynTri3.hh \
+	TestFaultCohesiveDynTri3d.hh \
 	TestFaultCohesiveDynQuad4.hh \
 	TestFaultCohesiveDynTet4.hh \
 	TestFaultCohesiveDynHex8.hh 
@@ -141,6 +143,7 @@
 	data/CohesiveKinSrcsDataHex8.cc \
 	data/CohesiveDynData.cc \
 	data/CohesiveDynDataTri3.cc \
+	data/CohesiveDynDataTri3d.cc \
 	data/CohesiveDynDataQuad4.cc \
 	data/CohesiveDynDataTet4.cc \
 	data/CohesiveDynDataHex8.cc
@@ -202,6 +205,7 @@
 	data/CohesiveKinSrcsDataHex8.hh \
 	data/CohesiveDynData.hh \
 	data/CohesiveDynDataTri3.hh \
+	data/CohesiveDynDataTri3d.hh \
 	data/CohesiveDynDataQuad4.hh \
 	data/CohesiveDynDataTet4.hh \
 	data/CohesiveDynDataHex8.hh 

Added: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynTri3d.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynTri3d.cc	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynTri3d.cc	2010-04-12 20:12:47 UTC (rev 16532)
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestFaultCohesiveDynTri3d.hh" // Implementation of class methods
+
+#include "data/CohesiveDynDataTri3d.hh" // USES CohesiveDynDataTri3d
+
+#include "pylith/topology/SubMesh.hh" // USES SubMesh
+#include "pylith/feassemble/Quadrature.hh" // USES Quadrature<SubMesh>
+#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestFaultCohesiveDynTri3d );
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::faults::TestFaultCohesiveDynTri3d::setUp(void)
+{ // setUp
+  TestFaultCohesiveDyn::setUp();
+  _data = new CohesiveDynDataTri3d();
+
+  CPPUNIT_ASSERT(0 != _quadrature);
+  feassemble::GeometryLine2D geometry;
+  _quadrature->refGeometry(&geometry);
+  
+  _flipFault = true;
+} // setUp
+
+
+// End of file 

Added: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynTri3d.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynTri3d.hh	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynTri3d.hh	2010-04-12 20:12:47 UTC (rev 16532)
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/faults/TestFaultCohesiveDynTri3d.hh
+ *
+ * @brief C++ TestFaultCohesiveDynTri3d object.
+ *
+ * C++ unit testing for FaultCohesiveDyn for mesh with 2-D triangular cells.
+ */
+
+#if !defined(pylith_faults_testfaultcohesivedyntri3d_hh)
+#define pylith_faults_testfaultcohesivedyntri3d_hh
+
+#include "TestFaultCohesiveDyn.hh" // ISA TestFaultCohesiveDyn
+
+/// Namespace for pylith package
+namespace pylith {
+  namespace faults {
+    class TestFaultCohesiveDynTri3d;
+  } // bc
+} // pylith
+
+/// C++ unit testing for FaultCohesiveDyn for mesh with 2-D triangular cells.
+class pylith::faults::TestFaultCohesiveDynTri3d : public TestFaultCohesiveDyn
+{ // class TestFaultCohesiveDynTri3d
+
+  // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+  CPPUNIT_TEST_SUITE( TestFaultCohesiveDynTri3d );
+
+  CPPUNIT_TEST( testInitialize );
+  CPPUNIT_TEST( testConstrainSolnSpaceStick );
+  CPPUNIT_TEST( testConstrainSolnSpaceSlip );
+  CPPUNIT_TEST( testConstrainSolnSpaceOpen );
+  CPPUNIT_TEST( testUpdateStateVars );
+  CPPUNIT_TEST( testCalcTractions );
+
+  CPPUNIT_TEST_SUITE_END();
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Setup testing data.
+  void setUp(void);
+
+}; // class TestFaultCohesiveDynTri3d
+
+#endif // pylith_faults_testfaultcohesivedyntri3d_hh
+
+
+// End of file 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc	2010-04-12 20:12:47 UTC (rev 16532)
@@ -1410,26 +1410,26 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataHex8::_fieldIncrSlipE[] = {
-  5.100000000000,   7.100000000000,  9.1,
-  5.200000000000,   7.200000000000,  9.2,
-  5.300000000000,   7.300000000000,  9.3,
-  5.400000000000,   7.400000000000,  9.4,
-  5.497852353454,   7.498145012417,  9.5,
-  5.598633150732,   7.598835934589,  9.6,
-  5.699186008481,   7.699335886445,  9.7,
-  5.799600882460,   7.799716783656,  9.8,
-  5.900000000000,   7.900000000000,  9.9,
-  5.000000000000,   7.000000000000,  9.0,
-  6.100000000000,   8.100000000000,  10.1,
-  6.200000000000,   8.200000000000,  10.2,
-  6.302147646546,   8.301854987583,  10.3,
-  6.501366849268,   8.501164065411,  10.5,
-  6.700813991519,   8.700664113555,  10.7,
-  6.900399117540,   8.900283216344,  10.9,
- -5.824264068712,  -7.824264068712, -10.4,
- -6.024264068712,  -8.024264068712, -10.6,
- -6.224264068712,  -8.224264068712, -10.8,
- -5.424264068712,  -7.424264068712, -10.0,
+   5.100000000000,   7.100000000000,   9.100000000000,
+   5.200000000000,   7.200000000000,   9.200000000000,
+   5.300000000000,   7.300000000000,   9.300000000000,
+   5.400000000000,   7.400000000000,   9.400000000000,
+   5.500000000000,   7.502147646546,   9.501854987583,
+   5.600000000000,   7.601366849268,   9.601164065411,
+   5.700000000000,   7.700813991519,   9.700664113555,
+   5.800000000000,   7.800399117540,   9.800283216344,
+   5.900000000000,   7.900000000000,   9.900000000000,
+   5.000000000000,   7.000000000000,   9.000000000000,
+   6.100000000000,   8.100000000000,  10.100000000000,
+   6.200000000000,   8.200000000000,  10.200000000000,
+   6.300000000000,   8.297852353454,  10.298145012417,
+   6.500000000000,   8.498633150732,  10.498835934589,
+   6.700000000000,   8.699186008481,  10.699335886445,
+   6.900000000000,   8.899600882460,  10.899716783656,
+  -5.824264068712,  -7.824264068712, -10.400000000000,
+  -6.024264068712,  -8.024264068712, -10.600000000000,
+  -6.224264068712,  -8.224264068712, -10.800000000000,
+  -5.424264068712,  -7.424264068712, -10.000000000000,
 };
 
 const double pylith::faults::CohesiveDynDataHex8::_slipSlipE[] = {
@@ -1468,22 +1468,22 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataHex8::_fieldIncrOpenE[] = {
-  5.100000000000,   7.100000000000,   9.100000000000,
-  5.200000000000,   7.200000000000,   9.200000000000,
-  5.300000000000,   7.300000000000,   9.300000000000,
-  5.400000000000,   7.400000000000,   9.400000000000,
-  5.479235316138,   7.506377670060,   9.560964099927,
-  5.566675616467,   7.590571311651,   9.633724303282,
-  5.657842717320,   7.679191979990,   9.715001379770,
-  5.739890640676,   7.759602313470,   9.789443715898,
-  5.900000000000,   7.900000000000,   9.900000000000,
-  5.000000000000,   7.000000000000,   9.000000000000,
-  6.100000000000,   8.100000000000,  10.100000000000,
-  6.200000000000,   8.200000000000,  10.200000000000,
-  6.320764683862,   8.293622329940,  10.239035900073,
-  6.533324383533,   8.509428688349,  10.466275696718,
-  6.742157282680,   8.720808020010,  10.684998620230,
-  6.960109359324,   8.940397686530,  10.910556284102,
+   5.100000000000,   7.100000000000,   9.100000000000,
+   5.200000000000,   7.200000000000,   9.200000000000,
+   5.300000000000,   7.300000000000,   9.300000000000,
+   5.400000000000,   7.400000000000,   9.400000000000,
+   5.439035900073,   7.520764683862,   9.493622329940,
+   5.566275696718,   7.633324383533,   9.609428688349,
+   5.684998620230,   7.742157282680,   9.720808020010,
+   5.810556284102,   7.860109359324,   9.840397686530,
+   5.900000000000,   7.900000000000,   9.900000000000,
+   5.000000000000,   7.000000000000,   9.000000000000,
+   6.100000000000,   8.100000000000,  10.100000000000,
+   6.200000000000,   8.200000000000,  10.200000000000,
+   6.360964099927,   8.279235316138,  10.306377670060,
+   6.533724303282,   8.466675616467,  10.490571311651,
+   6.715001379770,   8.657842717320,  10.679191979990,
+   6.889443715898,   8.839890640676,  10.859602313470,
   -5.400000000000,  -7.400000000000,  -9.400000000000,
   -5.600000000000,  -7.600000000000,  -9.600000000000,
   -5.800000000000,  -7.800000000000,  -9.800000000000,

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc	2010-04-12 20:12:47 UTC (rev 16532)
@@ -367,19 +367,19 @@
 // Output
 // :TODO: Update Lagrange multiplier values
 const double pylith::faults::CohesiveDynDataQuad4::_fieldIncrSlipE[] = {
-  9.100000000000000,  10.100000000000000,
-  9.199999999999999,  10.199999999999999,
-  9.286920998131288,  10.300000000000001,
-  9.394134746089865,  10.400000000000000,
-  9.500000000000000,  10.500000000000000,
-  9.600000000000000,  10.600000000000000,
-  9.713079001868712,  10.699999999999999,
-  9.905865253910136,  10.900000000000000,
-  -9.400000000000000, -10.800000000000001,
-  -8.600000000000000, -10.000000000000000,
+  9.1,  10.100000000000,
+  9.2,  10.200000000000,
+  9.3,  10.313079001869,
+  9.4,  10.405865253910,
+  9.5,  10.500000000000,
+  9.6,  10.600000000000,
+  9.7,  10.686920998131,
+  9.9,  10.894134746090,
+ -9.4, -10.800000000000,
+ -8.6, -10.000000000000,
 };
 
-// :TODO: Update slip values based on changes in Lagrange multiplier values
+// Update slip values based on changes in Lagrange multiplier values
 const double pylith::faults::CohesiveDynDataQuad4::_slipSlipE[] = {
   0.026158003737426,                   0.0,
   0.011730507820273,                   0.0,
@@ -404,16 +404,16 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataQuad4::_fieldIncrOpenE[] = {
-  9.100000000000000,  10.100000000000000,
-  9.199999999999999,  10.199999999999999,
-  8.914952803328358,  10.355407708860280,
-  8.623050724474377,   9.867290667695217,
-  9.500000000000000,  10.500000000000000,
-  9.600000000000000,  10.600000000000000,
-  10.085047196671642,  10.644592291139720,
-  10.676949275525624, 11.432709332304784,
-  -8.800000000000001,  -9.800000000000001,
-  -8.000000000000000, -9.000000000000000,
+  9.100000000000,  10.100000000000,
+  9.200000000000,  10.200000000000,
+  9.244592291100,  10.685047196672,
+  9.932709332305,  11.176949275526,
+  9.500000000000,  10.500000000000,
+  9.600000000000,  10.600000000000,
+  9.755407708860,  10.314952803328,
+  9.367290667695,  10.123050724474,
+ -8.800000000000,  -9.800000000000,
+ -8.000000000000,  -9.000000000000,
 };
 
 const double pylith::faults::CohesiveDynDataQuad4::_slipOpenE[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc	2010-04-12 20:12:47 UTC (rev 16532)
@@ -523,17 +523,17 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataTet4::_fieldIncrSlipE[] = {
-  8.10000000,   9.10000000,  10.1,
-  8.59076786,   9.53782633,  10.2,
-  8.40966771,   9.41274070,  10.3,
-  8.34627041,   9.36296925,  10.4,
-  8.50000000,   9.50000000,  10.5,
-  8.20923214,   9.26217367,  10.6,
-  8.69033229,   9.68725930,  10.8,
-  8.05372959,   9.03703075,  10.0,
- -7.30077769,  -8.25209204, -10.7,
- -7.50020141,  -8.45260634, -10.9,
- -6.70268132,  -7.65040255, -10.1,
+  8.100000000000,   9.100000000000,  10.100000000000,
+  8.200000000000,   8.809232141461,   9.862173674926,
+  8.300000000000,   9.190332288811,  10.187259296949,
+  8.400000000000,   9.453729592911,  10.437030750553,
+  8.500000000000,   9.500000000000,  10.500000000000,
+  8.600000000000,   9.990767858539,  10.937826325074,
+  8.800000000000,   9.909667711189,  10.912740703051,
+  8.000000000000,   8.946270407089,   9.962969249447,
+ -7.300777685147,  -8.252092036995, -10.700000000000,
+ -7.500201409882,  -8.452606339630, -10.900000000000,
+ -6.702681322117,  -7.650402548711, -10.100000000000,
 };
 
 const double pylith::faults::CohesiveDynDataTet4::_slipSlipE[] = {
@@ -562,17 +562,17 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataTet4::_fieldIncrOpenE[] = {
-  8.10000000,   9.10000000,  10.10000000,      
-  8.26450273,   9.22052313,  10.74092582,
-  8.10095371,   9.10742023,  10.30803112,
-  8.04369654,   9.06244062,  10.17317662,
-  8.50000000,   9.50000000,  10.50000000,
-  8.53549727,   9.57947687,  10.05907418,
-  8.99904629,   9.99257977,  10.79196888,
-  8.35630346,   9.33755938,  10.22682338,
-  -7.70000000,  -8.70000000,  -9.70000000,
-  -7.90000000,  -8.90000000,  -9.90000000,
-  -7.10000000,  -8.10000000,  -9.10000000,
+  8.100000000000,   9.100000000000,  10.100000000000,
+  7.659074183975,   9.135497272962,  10.179476872604,
+  8.291968881040,   9.499046287062,  10.492579766051,
+  8.626823377123,   9.756303461532,  10.737559383723,
+  8.500000000000,   9.500000000000,  10.500000000000,
+  9.140925816025,   9.664502727038,  10.620523127396,
+  8.808031118960,   9.600953712938,  10.607420233949,
+  7.773176622877,   8.643696538468,   9.662440616277,
+ -7.700000000000,  -8.700000000000,  -9.700000000000,
+ -7.900000000000,  -8.900000000000,  -9.900000000000,
+ -7.100000000000,  -8.100000000000,  -9.100000000000,
 };
 
 const double pylith::faults::CohesiveDynDataTet4::_slipOpenE[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc	2010-04-12 20:12:47 UTC (rev 16532)
@@ -292,14 +292,14 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataTri3::_fieldIncrSlipE[] = {
-  9.100000000000000,  10.100000000000000,
-  10.095813434316561,  10.199999999999999,
-  9.533356619439068,  10.300000000000001,
-  9.400000000000000,  10.400000000000000,
-  8.604186565683438,  10.500000000000000,
-  9.466643380560932,  10.699999999999999,
-  -8.000000000000002, -10.600000000000000,
-  -8.199999999999999, -10.800000000000001,
+  9.1,  10.100000000000,
+  9.2,   9.304186565683,
+  9.3,  10.066643380561,
+  9.4,  10.400000000000,
+  9.5,  11.395813434317,
+  9.7,  10.933356619439,
+ -8.0, -10.600000000000,
+ -8.2, -10.800000000000,
 };
 
 const double pylith::faults::CohesiveDynDataTri3::_slipSlipE[] = {
@@ -324,14 +324,14 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataTri3::_fieldIncrOpenE[] = {
-  9.100000000000000,  10.100000000000000,
-  8.548311056150768,  10.583675543292014,
-  8.112550361510577,   9.408791154844559,
-  9.400000000000000,  10.400000000000000,
-  10.151688943849232,  10.116324456707986,
-  10.887449638489423, 11.591208845155441,
-  -8.600000000000000,  -9.600000000000000,
-  -8.800000000000001,  -9.800000000000001,
+ 9.100000000000,  10.100000000000,
+ 8.816324456708,  10.851688943849,
+10.191208845155,  11.487449638489,
+ 9.400000000000,  10.400000000000,
+ 9.883675543292,   9.848311056151,
+ 8.808791154845,   9.512550361511,
+-8.600000000000,  -9.600000000000,
+-8.800000000000,  -9.800000000000,
 };
 
 const double pylith::faults::CohesiveDynDataTri3::_slipOpenE[] = {

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc	2010-04-12 20:12:47 UTC (rev 16532)
@@ -0,0 +1,592 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-3, vertices are 4-9.
+ *
+ *
+ *         9
+ *        / \
+ *       /   \
+ *      /     \
+ *     /       \
+ *    8---------5
+ *     \       /|\
+ *      \     / | \
+ *       \   /  |  \
+ *        \ /   |   \
+ *         4    |    7
+ *          \   |   /
+ *           \  |  /
+ *            \ | /
+ *             \|/
+ *              6
+ *
+ *
+ * After adding cohesive elements
+ *
+ * Cells are 0-3, 13-14, vertices are 4-12.
+ *
+ *         9
+ *        / \
+ *       /   \
+ *      /     \
+ *     /       \
+ *    8---------  5
+ * 15 |        13/|
+ *   12--------10 |
+ *     \       /| |\
+ *      \     / | | \
+ *       \   /  | |  \
+ *        \ /   | |   \
+ *         4    | |    7
+ *          \   | |   /
+ *           \  | |  /
+ *            \ | | /
+ *             \| |/
+ *             11-6
+ *               14
+ */
+
+
+#include "CohesiveDynDataTri3d.hh"
+
+const char* pylith::faults::CohesiveDynDataTri3d::_meshFilename =
+  "data/tri3d.mesh";
+
+const int pylith::faults::CohesiveDynDataTri3d::_spaceDim = 2;
+
+const int pylith::faults::CohesiveDynDataTri3d::_cellDim = 1;
+
+const int pylith::faults::CohesiveDynDataTri3d::_numBasis = 2;
+
+const int pylith::faults::CohesiveDynDataTri3d::_numQuadPts = 1;
+
+const double pylith::faults::CohesiveDynDataTri3d::_quadPts[] = {
+  0.0,
+};
+
+const double pylith::faults::CohesiveDynDataTri3d::_quadWts[] = {
+  2.0,
+};
+
+const double pylith::faults::CohesiveDynDataTri3d::_basis[] = {
+  0.5,
+  0.5
+};
+
+const double pylith::faults::CohesiveDynDataTri3d::_basisDeriv[] = {
+  -0.5,
+   0.5
+};
+
+const double pylith::faults::CohesiveDynDataTri3d::_verticesRef[] = {
+  -1.0, 1.0
+};
+
+const int pylith::faults::CohesiveDynDataTri3d::_id = 10;
+
+const char* pylith::faults::CohesiveDynDataTri3d::_label = "fault";
+
+const char* pylith::faults::CohesiveDynDataTri3d::_initialTractFilename = 
+  "data/tri3d_initialtract.spatialdb";
+
+const double pylith::faults::CohesiveDynDataTri3d::_fieldT[] = {
+  6.1, 8.1,
+  6.2, 8.2, // 5
+  6.3, 8.3, // 6
+  6.4, 8.4,
+  6.5, 8.5, // 8
+  6.6, 8.6,
+  6.7, 8.7, // 10
+  6.9, 8.9, // 11
+  7.1, 9.1, // 12
+  6.8, 8.8, // 13
+  6.0, 8.0, // 14
+  7.2, 9.2, // 15
+};
+
+// :TODO: Make sensible values for Jacobian for DOF on positive and
+// negative sides of the fault. Add semi-random values for other DOF.
+const double pylith::faults::CohesiveDynDataTri3d::_jacobian[] = {
+  1.0, 1.1, // 4x
+  1.1, 2.1,
+  1.2, 2.2,
+  1.3, 2.3,
+  1.4, 2.4,
+  1.5, 2.5,
+  1.6, 2.6,
+  1.7, 2.7,
+  1.8, 2.8,
+  1.9, 2.9,
+  2.0, 3.0,
+  2.1, 3.1,
+  3.1, 1.0, // 4y
+  3.2, 4.1,
+  3.3, 4.2,
+  3.4, 4.3,
+  3.5, 4.4,
+  3.6, 4.5,
+  3.7, 4.6,
+  3.8, 4.7,
+  3.9, 4.8,
+  3.0, 4.9,
+  3.1, 4.0,
+  3.2, 4.1,
+  6.1, 7.2, // 5x
+  6.0, 7.3,
+  6.9, 7.4,
+  6.8, 7.5,
+  6.7, 7.6,
+  6.6, 7.7,
+  6.5, 7.8,
+  6.4, 7.9,
+  6.3, 7.0,
+ -0.70710678118654757, +0.70710678118654757, // 13
+  6.2, 7.1,
+  6.1, 7.2,
+  3.0, 5.1, // 5y
+  3.1, 5.2,
+  3.2, 5.2,
+  3.3, 5.1,
+  3.4, 5.3,
+  3.5, 5.0,
+  3.6, 5.4,
+  3.7, 5.9,
+  3.8, 5.5,
+ +0.70710678118654757, +0.70710678118654757, // 13
+  4.2, 5.6,
+  4.1, 5.8,
+  3.0, 2.7, // 6x
+  3.9, 2.7,
+  3.8, 2.8,
+  3.7, 2.6,
+  3.6, 2.9,
+  3.5, 2.5,
+  3.4, 2.1,
+  3.3, 2.4,
+  3.2, 2.2,
+  3.1, 2.3,
+  0.0,+1.0, // 14
+  3.0, 2.4,
+  4.1, 6.1, // 6y
+  4.1, 6.6,
+  4.2, 6.2,
+  4.2, 6.5,
+  4.3, 6.3,
+  4.3, 6.4,
+  4.4, 6.4,
+  4.4, 6.3,
+  4.5, 6.5,
+  4.5, 6.2,
+ +1.0, 0.0, // 14
+  4.6, 6.1,
+  4.6, 6.6, // 7x
+  5.7, 9.7,
+  5.7, 9.9,
+  5.8, 9.8,
+  5.8, 9.8,
+  5.9, 9.9,
+  5.1, 9.7,
+  5.2, 9.1,
+  5.3, 9.6,
+  5.1, 9.2,
+  5.4, 9.5,
+  5.2, 9.3,
+  5.5, 9.4, // 7y
+  6.3, 9.4,
+  6.6, 9.3,
+  6.4, 9.5,
+  6.7, 9.2,
+  6.5, 9.6,
+  6.8, 9.1,
+  6.6, 9.7,
+  7.9, 8.9,
+  7.7, 8.8,
+  7.1, 8.8,
+  7.8, 8.9,
+  7.2, 8.7, // 8x
+  7.9, 8.1,
+  7.3, 8.6,
+  7.1, 8.2,
+  7.4, 8.5,
+  7.2, 8.3,
+  7.5, 8.4,
+  7.3, 8.4,
+  7.6, 8.3,
+  7.4, 8.5,
+  7.7, 8.6,
+ -1.0, 0.0, // 15
+  6.5, 3.3, // 8y
+  6.4, 3.4,
+  6.3, 3.8,
+  6.2, 3.9,
+  6.1, 3.8,
+  6.0, 3.7,
+  6.9, 3.6,
+  5.7, 3.5,
+  5.6, 3.4,
+  5.5, 3.3,
+  5.4, 3.2,
+  0.0,+1.0, // 15
+  4.4, 2.0, // 9x
+  4.3, 2.1,
+  4.2, 2.2,
+  4.1, 2.3,
+  4.0, 2.3,
+  4.9, 2.4,
+  4.8, 2.5,
+  3.7, 2.6,
+  3.6, 2.8,
+  3.5, 2.9,
+  3.4, 2.1,
+  3.3, 2.9,
+  2.2, 2.8, // 9y
+  2.1, 3.7,
+  2.0, 3.6,
+  2.1, 3.5,
+  2.2, 3.4,
+  2.3, 3.3,
+  2.4, 3.1,
+  2.5, 3.0,
+  2.6, 3.9,
+  2.7, 3.8,
+  2.8, 3.7,
+  2.9, 3.6,
+  1.0, 3.5, // 10x
+  1.1, 4.4,
+  1.2, 4.3,
+  1.3, 4.2,
+  1.4, 4.1,
+  1.5, 4.0,
+  1.6, 4.1,
+  1.7, 4.2,
+  1.8, 4.3,
+ +0.70710678118654757, -0.70710678118654757, // 13
+  1.9, 5.4,
+  9.0, 5.5,
+  8.0, 4.7, // 10y
+  7.1, 4.5,
+  6.2, 4.4,
+  6.3, 4.6,
+  6.4, 4.7,
+  6.5, 4.4,
+  4.6, 4.8,
+  4.7, 4.4,
+  4.8, 4.2,
+ -0.70710678118654757, -0.70710678118654757, // 13
+  6.1, 4.8,
+  6.2, 4.7,
+  6.3, 5.6, // 11x
+  6.4, 5.5,
+  6.5, 5.4,
+  6.6, 5.3,
+  6.7, 5.1,
+  6.8, 5.2,
+  6.9, 5.3,
+  7.0, 5.9,
+  7.7, 5.8,
+  7.6, 5.7,
+  0.0,-1.0, // 14
+  7.5, 5.5,
+  7.4, 6.4, // 11y
+  7.3, 6.2,
+  7.2, 6.0,
+  7.2, 6.9,
+  7.1, 6.8,
+  7.0, 6.7,
+  7.2, 6.6,
+  7.3, 6.5,
+  7.4, 6.3,
+  7.5, 6.2,
+ -1.0, 0.0, // 14
+  8.6, 6.2,
+  8.7, 6.3, // 12x
+  8.8, 6.3,
+  8.9, 7.4,
+  8.0, 7.5,
+  8.6, 7.6,
+  8.5, 7.7,
+  8.4, 7.8,
+  8.0, 7.9,
+  8.3, 7.1,
+  8.0, 7.2,
+  8.2, 7.3,
+ +1.0, 0.0, // 15
+  7.2, 8.6, // 12y
+  6.6, 8.5,
+  6.7, 8.4,
+  6.9, 8.2,
+  6.5, 8.3,
+  6.4, 8.5,
+  6.3, 8.6,
+  6.5, 8.8,
+  4.7, 8.7,
+  4.9, 8.5,
+  7.5, 8.3,
+  6.0,-1.0, // 15
+  3.2, 8.3, // 13x
+ -0.70710678118654757, +0.70710678118654757, // 5
+  5.4, 9.3,
+  5.6, 9.7,
+  3.7, 9.0,
+  5.9, 9.9,
+ +0.70710678118654757, -0.70710678118654757, // 10
+  4.4, 4.8,
+  4.6, 4.7,
+  4.8, 4.6,
+  4.9, 4.4,
+  4.0, 4.2,
+  4.2, 4.3, // 13y
+ +0.70710678118654757, +0.70710678118654757, // 5
+  7.5, 3.4,
+  6.7, 3.5,
+  6.4, 3.6,
+  4.6, 3.9,
+ -0.70710678118654757, -0.70710678118654757, // 10
+  8.9, 2.8,
+  7.6, 2.7,
+  6.4, 2.6,
+  5.3, 2.5,
+  3.8, 2.3,
+  4.5, 2.2, // 14x
+  8.5, 2.4,
+  0.0,+1.0, // 6
+  7.4, 3.6,
+  6.6, 3.5,
+  4.7, 3.4,
+  3.8, 3.5,
+  0.0,-1.0, // 11
+  5.9, 3.7,
+  8.7, 4.6,
+  7.6, 4.5,
+  6.5, 4.4,
+  5.5, 4.3, // 14y
+  4.3, 4.8,
+ +1.0, 0.0, // 6
+  4.3, 4.7,
+  6.5, 4.6,
+  9.6, 4.5,
+  8.7, 4.3,
+ -1.0, 0.0, // 11
+  7.9, 4.5,
+  6.7, 5.3,
+  5.6, 5.8,
+  3.5, 5.7,
+  2.4, 5.6, // 15x
+  3.3, 5.5,
+  4.2, 5.3,
+  5.4, 5.6,
+ -1.0, 6.0, // 8
+  0.8, 6.6,
+  9.8, 6.5,
+  8.5, 6.5,
+ +1.0, 0.0, // 12
+  7.5, 7.3,
+  6.4, 7.6,
+  5.2, 7.8,
+  4.5, 7.7, // 15y
+  3.7, 8.6,
+  3.8, 8.5,
+  2.9, 8.3,
+  0.0,+1.0, // 8
+  2.0, 9.9,
+  2.7, 9.8,
+  1.6, 9.7,
+  0.0,-1.0, // 12
+  1.5, 5.5,
+  1.2, 5.4,
+  1.1, 5.3,
+};
+
+
+// ----------------------------------------------------------------------
+// Computed values
+// ----------------------------------------------------------------------
+
+const double pylith::faults::CohesiveDynDataTri3d::_orientation[] = {
+  +0.70710678118654757, -0.70710678118654757,  
+  -0.70710678118654757, -0.70710678118654757,
+  0.0, -1.0,  -1.0,  0.0,
+ +1.0,  0.0,   0.0, -1.0
+};
+
+const double pylith::faults::CohesiveDynDataTri3d::_area[] = {
+  2.0,
+  1.0,
+  1.0,
+};
+
+const int pylith::faults::CohesiveDynDataTri3d::_numConstraintVert = 3;
+const int pylith::faults::CohesiveDynDataTri3d::_constraintVertices[] = {
+  13, 14, 15
+};
+
+const double pylith::faults::CohesiveDynDataTri3d::_forcesInitial[] = {
+  3.15*1.4142135623730951, 1.00*1.41421356237309,
+  2.05, -1.05,
+  1.10,  2.10,
+};
+
+
+// ----------------------------------------------------------------------
+// Stick case
+// ----------------------------------------------------------------------
+// Input
+const double pylith::faults::CohesiveDynDataTri3d::_fieldIncrStick[] = {
+  1.1, 29.1,
+  1.2, 29.2, // 5
+  1.3, 29.3, // 6
+  1.4, 29.4,
+  1.5, 29.5, // 8
+  1.6, 29.6,
+  1.7, 29.7, // 10
+  1.9, 29.9, // 11
+  2.1, 29.1, // 12
+  1.8, -29.8, // 13
+  1.0, -29.0, // 14
+  2.2, -29.2, // 15
+};
+
+// No change in fieldIncr
+// Zero slip
+
+// ----------------------------------------------------------------------
+// Slip case
+// ----------------------------------------------------------------------
+// Input
+const double pylith::faults::CohesiveDynDataTri3d::_fieldIncrSlip[] = {
+  9.1, 10.1,
+  9.2, 10.2, // 5
+  9.3, 10.3, // 6
+  9.4, 10.4,
+  9.5, 10.5, // 8
+  9.6, 10.6,
+  9.7, 10.7, // 10
+  9.9, 10.9, // 11
+  9.1, 10.1, // 12
+  9.8, -10.8, // 13
+  9.0, -10.0, // 14
+  9.2, -10.2, // 15
+};
+
+// Output
+// TODO Update
+const double pylith::faults::CohesiveDynDataTri3d::_fieldIncrSlipE[] = {
+  9.100000000000,  10.100000000000,
+  4.178047263424,  15.221952736576,
+  9.300000000000,  10.050098043990,
+  9.400000000000,  10.400000000000,
+  9.655679817715,  10.500000000000,
+  9.600000000000,  10.600000000000,
+ 14.721952736576,   5.678047263424,
+  9.900000000000,  11.149901956010,
+  8.944320182285,  10.100000000000,
+ -5.600000000000, -10.800000000000,
+ -4.800000000000, -10.000000000000,
+ -6.600000000000, -10.200000000000,
+};
+
+const double pylith::faults::CohesiveDynDataTri3d::_slipSlipE[] = {
+  14.204227339325,   0.0,
+  -0.499803912020,   0.0,
+  -0.311359635429,   0.0,
+};
+
+// ----------------------------------------------------------------------
+// Open case
+// ----------------------------------------------------------------------
+// Input
+const double pylith::faults::CohesiveDynDataTri3d::_fieldIncrOpen[] = {
+  9.1, 10.1,
+  9.2, 10.2, // 5
+  9.3, 10.3, // 6
+  9.4, 10.4,
+  9.5, 10.5, // 8
+  9.6, 10.6,
+  9.7, 10.7, // 10
+  9.9, 10.9, // 11
+  9.1, 10.1, // 12
+  9.8, 10.8, // 13
+  9.0, 10.0, // 14
+  9.2, 10.2, // 15
+};
+
+// Output
+const double pylith::faults::CohesiveDynDataTri3d::_fieldIncrOpenE[] = {
+  9.100000000000,  10.100000000000,
+ 16.634130951967,   0.141847738351,
+  8.488053449168,  16.358051491522,
+  9.400000000000,  10.400000000000,
+  1.376240123890,  19.299429217321,
+  9.600000000000,  10.600000000000,
+  2.265869048033,  20.758152261649,
+ 10.711946550832,   4.841948508478,
+ 17.223759876110,   1.300570782679,
+ -6.800000000000,  -8.800000000000,
+ -6.000000000000,  -8.000000000000,
+ -7.200000000000,  -9.200000000000,
+};
+
+const double pylith::faults::CohesiveDynDataTri3d::_slipOpenE[] = {
+-24.737824157567,  -3.710926524107,
+ 12.116102983044,  -1.623893101663,
+ 16.247519752219,  17.598858434641,
+
+};
+
+// ----------------------------------------------------------------------
+pylith::faults::CohesiveDynDataTri3d::CohesiveDynDataTri3d(void)
+{ // constructor
+  meshFilename = const_cast<char*>(_meshFilename);
+  spaceDim = _spaceDim;
+  cellDim = _cellDim;
+  numBasis = _numBasis;
+  numQuadPts = _numQuadPts;
+  quadPts = const_cast<double*>(_quadPts);
+  quadWts = const_cast<double*>(_quadWts);
+  basis = const_cast<double*>(_basis);
+  basisDeriv = const_cast<double*>(_basisDeriv);
+  verticesRef = const_cast<double*>(_verticesRef);
+  id = _id;
+  label = const_cast<char*>(_label);
+  initialTractFilename = const_cast<char*>(_initialTractFilename);
+
+  fieldT = const_cast<double*>(_fieldT);
+  jacobian = const_cast<double*>(_jacobian);
+  orientation = const_cast<double*>(_orientation);
+  area = const_cast<double*>(_area);
+  forcesInitial = const_cast<double*>(_forcesInitial);
+
+  constraintVertices = const_cast<int*>(_constraintVertices);
+  numConstraintVert = _numConstraintVert;  
+
+  // Stick
+  fieldIncrStick = const_cast<double*>(_fieldIncrStick);
+
+  // Slip
+  fieldIncrSlip = const_cast<double*>(_fieldIncrSlip);
+  fieldIncrSlipE = const_cast<double*>(_fieldIncrSlipE);
+  slipSlipE = const_cast<double*>(_slipSlipE);
+
+  // Open
+  fieldIncrOpen = const_cast<double*>(_fieldIncrOpen);
+  fieldIncrOpenE = const_cast<double*>(_fieldIncrOpenE);
+  slipOpenE = const_cast<double*>(_slipOpenE);
+} // constructor
+
+pylith::faults::CohesiveDynDataTri3d::~CohesiveDynDataTri3d(void)
+{}
+
+
+// End of file

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.hh	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.hh	2010-04-12 20:12:47 UTC (rev 16532)
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesivedynldatatri3d_hh)
+#define pylith_faults_cohesivedynldatatri3d_hh
+
+#include "CohesiveDynData.hh"
+
+namespace pylith {
+  namespace faults {
+     class CohesiveDynDataTri3d;
+  } // pylith
+} // faults
+
+class pylith::faults::CohesiveDynDataTri3d : public CohesiveDynData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public: 
+
+  /// Constructor
+  CohesiveDynDataTri3d(void);
+
+  /// Destructor
+  ~CohesiveDynDataTri3d(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+  static const char* _meshFilename; ///< Filename of input mesh
+
+  static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+  static const int _cellDim; ///< Number of dimensions associated with cell
+
+  static const int _numBasis; ///< Number of vertices in cell
+  static const int _numQuadPts; ///< Number of quadrature points
+  static const double _quadPts[]; ///< Coordinates of quad pts in ref cell
+  static const double _quadWts[]; ///< Weights of quadrature points
+  static const double _basis[]; ///< Basis fns at quadrature points
+  static const double _basisDeriv[]; ///< Derivatives of basis fns at quad pts
+  static const double _verticesRef[]; ///< Coordinates of vertices in ref cell (dual basis)
+
+  static const int _id; ///< Fault material identifier
+  static const char* _label; ///< Label for fault
+  static const char* _initialTractFilename; ///< Name of db for initial tractions.
+
+  static const double _fieldT[]; ///< Solution field at time t.
+  static const double _fieldIncrStick[]; ///< Solution increment at time t for stick case.
+  static const double _fieldIncrSlip[]; ///< Solution increment at time t for slip case.
+  static const double _fieldIncrOpen[]; ///< Solution increment at time t for opening case.
+  static const double _jacobian[]; ///< Jacobian sparse matrix.
+
+  static const double _orientation[]; ///< Expected values for fault orientation.
+  static const double _area[]; ///< Expected values for fault area.
+  static const double _forcesInitial[]; ///< Expected values for initial forces.
+  static const double _fieldIncrSlipE[]; ///< Expected values for solution increment for slip case.
+  static const double _slipSlipE[]; ///< Expected values for slip for slip case.
+  static const double _fieldIncrOpenE[]; ///< Expected values for solution increment for opening case.
+  static const double _slipOpenE[]; ///< Expected values for slip for opening case.
+  static const int _constraintVertices[]; ///< Expected points for constraint vertices
+  static const int _numConstraintVert; ///< Number of constraint vertices
+
+};
+
+#endif // pylith_faults_cohesivedynldatatri3d_hh
+
+
+// End of file

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am	2010-04-12 20:12:47 UTC (rev 16532)
@@ -34,6 +34,7 @@
 	tri3d_sliptime.spatialdb \
 	tri3d_risetime.spatialdb \
 	tri3_initialtract.spatialdb \
+	tri3d_initialtract.spatialdb \
 	quad4.mesh \
 	quad4b.mesh \
 	quad4c.mesh \

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py	2010-04-12 20:12:47 UTC (rev 16532)
@@ -7,7 +7,21 @@
 from numpy import *
 from numpy.linalg import inv
 
+numpy.set_printoptions(precision=12)
+
 # ----------------------------------------------------------------------
+def printdata(data):
+    """
+    Print data as C array.
+    """
+    (nrows, ncols) = data.shape
+    style = " %16.12f,"*ncols
+    for row in xrange(nrows):
+        print (style % tuple(data[row,:]))
+    return
+
+
+# ----------------------------------------------------------------------
 if dim == "2d":
     if cell == "tri3":
         dlagrange1 = numpy.zeros(2)
@@ -23,6 +37,10 @@
         fieldIncr = numpy.array([[9.6, -10.6],
                                  [9.8, -10.8]])
         area = numpy.array([1.0, 1.0])
+        C = numpy.array([[0.0, -1.0, 0.0, 0.0,],
+                         [-1.0, 0.0, 0.0, 0.0,],
+                         [0.0, 0.0, 0.0, -1.0,],
+                         [0.0, 0.0, -1.0, 0.0,],]);
     
         jacobianN = numpy.array(
             [[  1.0,  5.2,  4.2,  5.3,],
@@ -65,6 +83,86 @@
                                     [ 9.8, 10.8,],])
 
 
+    elif cell == "tri3d":
+        dlagrange1 = numpy.zeros(3)
+        Lindex = numpy.array([18, 19, 20, 21, 22, 23])
+        Iindex = numpy.array([2, 3, 4, 5, 8, 9])
+        Jindex = numpy.array([12, 13, 14, 15, 16, 17])
+        n = 24
+        m = 6
+        DOF = 2
+
+        fieldT = numpy.array([[6.8, 8.8],
+                              [6.0, 8.0],
+                              [7.2, 9.2]])
+        fieldIncr = numpy.array([[9.8, -10.8],
+                                 [9.0, -10.0],
+                                 [9.2, -10.2]])
+        area = numpy.array([2.0, 1.0, 1.0])
+        C = numpy.array([[+0.70710678118654757, -0.70710678118654757, 0.0, 0.0, 0.0, 0.0,],
+                         [-0.70710678118654757, -0.70710678118654757, 0.0, 0.0, 0.0, 0.0,],
+                         [0.0, 0.0, 0.0, -1.0, 0.0, 0.0,],
+                         [0.0, 0.0, -1.0, 0.0, 0.0, 0.0,],
+                         [0.0, 0.0, 0.0, 0.0, +1.0, 0.0,],
+                         [0.0, 0.0, 0.0, 0.0, 0.0, -1.0,],])
+    
+        jacobianN = numpy.array(
+            [[6.0, 7.3, 6.9, 7.4, 6.7, 7.6],
+             [3.1, 5.2, 3.2, 5.2, 3.4, 5.3],
+             [3.9, 2.7, 3.8, 2.8, 0.0, 0.0],
+             [4.1, 6.6, 4.2, 6.2, 0.0, 0.0],
+             [7.9, 8.1, 0.0, 0.0, 7.4, 8.5],
+             [6.4, 3.4, 0.0, 0.0, 6.1, 3.8]])
+
+        jacobianP = numpy.array(
+            [[1.6, 4.1, 1.7, 4.2, 1.8, 4.3],
+             [4.6, 4.8, 4.7, 4.4, 4.8, 4.2],
+             [6.9, 5.3, 7.0, 5.9, 0.0, 0.0],
+             [7.2, 6.6, 7.3, 6.5, 0.0, 0.0],
+             [8.4, 7.8, 0.0, 0.0, 8.3, 7.1],
+             [6.3, 8.6, 0.0, 0.0, 4.7, 8.7]])
+
+        disp = numpy.array([[ 6.1, 8.1,],
+                            [ 6.2, 8.2,],
+                            [ 6.3, 8.3,],
+                            [ 6.4, 8.4,],
+                            [ 6.5, 8.5,],
+                            [ 6.6, 8.6,],
+                            [ 6.7, 8.7,],
+                            [ 6.9, 8.9,],
+                            [ 7.1, 9.1,],
+                            [ 6.8, 8.8,],
+                            [ 6.0, 8.0,],
+                            [ 7.2, 9.2,],])
+
+        if testCase == "slip":
+            dispIncr = numpy.array([[ 9.1, 10.1,],
+                                    [ 9.2, 10.2,],
+                                    [ 9.3, 10.3,],
+                                    [ 9.4, 10.4,],
+                                    [ 9.5, 10.5,],
+                                    [ 9.6, 10.6,],
+                                    [ 9.7, 10.7,],
+                                    [ 9.9, 10.9,],
+                                    [ 9.1, 10.1,],
+                                    [ 9.8, -10.8,],
+                                    [ 9.0, -10.0,],
+                                    [ 9.2, -10.2,],])            
+        elif testCase == "open":
+            dispIncr = numpy.array([[ 9.1, 10.1,],
+                                    [ 9.2, 10.2,],
+                                    [ 9.3, 10.3,],
+                                    [ 9.4, 10.4,],
+                                    [ 9.5, 10.5,],
+                                    [ 9.6, 10.6,],
+                                    [ 9.7, 10.7,],
+                                    [ 9.9, 10.9,],
+                                    [ 9.1, 10.1,],
+                                    [ 9.8, 10.8,],
+                                    [ 9.0, 10.0,],
+                                    [ 9.2, 10.2,],])            
+
+
     elif cell == "quad4":
         dlagrange1 = numpy.zeros(2)
         Lindex = numpy.arange(16,20)
@@ -79,6 +177,10 @@
         fieldIncr = numpy.array([[-9.8, -10.8],
                                  [-9.0, -10.0]])
         area = numpy.array([1.0, 1.0])
+        C = numpy.array([[0.0, -1.0, 0.0, 0.0,],
+                         [-1.0, 0.0, 0.0, 0.0,],
+                         [0.0, 0.0, 0.0, -1.0,],
+                         [0.0, 0.0, -1.0, 0.0,],]);
     
         jacobianN = numpy.array(
             [[  1.0,  8.1,  8.2,  8.3,],
@@ -150,13 +252,6 @@
     
     print "dlagrange0",dlagrange0
 
-    D = numpy.array([[ 0, -1,],
-                     [ -1, 0,],])
-    Z = numpy.zeros([2,2])
-    C1 = numpy.hstack((D, Z))
-    C2 = numpy.hstack((Z, D))
-    C = numpy.vstack((C1, C2))
-
     if testCase == "slip": 
         dLagrange = numpy.vstack((dlagrange0, dlagrange1))
         dLagrange = numpy.transpose(dLagrange)
@@ -186,14 +281,16 @@
     dispIncrE = numpy.reshape(dispIncrE, n)
 
     dispIncrE[Lindex] = dispIncrE[Lindex] - dLagrange
-    dispIncrE[Iindex] = dispIncrE[Iindex] - 0.5*slipVertex
-    dispIncrE[Jindex] = dispIncrE[Jindex] + 0.5*slipVertex
+    dispIncrE[Iindex] = dispIncrE[Iindex] - \
+        0.5*numpy.dot(C.transpose(), slipVertex)
+    dispIncrE[Jindex] = dispIncrE[Jindex] + \
+        0.5*numpy.dot(C.transpose(), slipVertex)
 
     dispIncrE = numpy.reshape(dispIncrE, (n/DOF,DOF))
     slipVertex = numpy.reshape(slipVertex, (m/DOF,DOF))
 
-    print "dispIncrE \n", dispIncrE
-    print "slipVertex \n", slipVertex
+    print "dispIncrE\n", printdata(dispIncrE)
+    print "slipVertexE\n", printdata(slipVertex)
 
 
 # ----------------------------------------------------------------------
@@ -463,16 +560,14 @@
     dispIncrE = numpy.reshape(dispIncrE, n)
 
     dispIncrE[Lindex] = dispIncrE[Lindex] - dLagrange
-    dispIncrE[Iindex] = dispIncrE[Iindex] - 0.5*slipVertex
-    dispIncrE[Jindex] = dispIncrE[Jindex] + 0.5*slipVertex
+    dispIncrE[Iindex] = dispIncrE[Iindex] - \
+        0.5*numpy.dot(C.transpose(), slipVertex)
+    dispIncrE[Jindex] = dispIncrE[Jindex] + \
+        0.5*numpy.dot(C.transpose(), slipVertex)
 
     dispIncrE = numpy.reshape(dispIncrE, (n/DOF,DOF))
     slipVertex = numpy.reshape(slipVertex, (m/DOF,DOF))
 
-    if testCase == "slip":
-        slipVertex[:,2] = 0    
+    print "dispIncrE\n", printdata(dispIncrE)
+    print "slipVertexE\n", printdata(slipVertex)
 
-    numpy.set_printoptions(precision=12)
-    print "dispIncrE \n", dispIncrE
-    print "slipVertex \n", slipVertex
-

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_initialtract.spatialdb
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_initialtract.spatialdb	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_initialtract.spatialdb	2010-04-12 20:12:47 UTC (rev 16532)
@@ -0,0 +1,16 @@
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 2
+  value-names =  traction-shear traction-normal
+  value-units =  Pa   Pa
+  num-locs = 3
+  data-dim = 2
+  space-dim = 2
+  cs-data = cartesian {
+    to-meters = 1.0
+    space-dim = 2
+  }
+}
+ 0.0   1.0     1.0  -2.0
+ 0.0  -1.0     1.1  -2.1
+-2.0   1.0     1.2  -2.2

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/test_faults.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/test_faults.cc	2010-04-12 20:12:15 UTC (rev 16531)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/test_faults.cc	2010-04-12 20:12:47 UTC (rev 16532)
@@ -64,6 +64,9 @@
 
     // Finalize PETSc
     err = PetscFinalize(); CHKERRQ(err);
+  } catch (const std::exception& err) {
+    std::cerr << "Error: " << err.what() << std::endl;
+    abort();
   } catch (...) {
     abort();
   } // catch



More information about the CIG-COMMITS mailing list