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

brad at geodynamics.org brad at geodynamics.org
Thu Jun 14 17:27:22 PDT 2007


Author: brad
Date: 2007-06-14 17:27:22 -0700 (Thu, 14 Jun 2007)
New Revision: 7251

Added:
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTri3d.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTri3d.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3d.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3d.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_finalslip.spatialdb
   short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_peakrate.spatialdb
   short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_sliptime.spatialdb
Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am
Log:
Added unit test for multiple cohesive cells in a tri3 mesh. Fixed bug where orientation info was not averaged.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/TODO	2007-06-15 00:27:22 UTC (rev 7251)
@@ -1,9 +1,14 @@
 ======================================================================
+CURRENT ISSUES
+======================================================================
+  tests/1d/line3/dislocation.cfg [CHACO]
+  tests/3d/tet4/shearelasticstrain.cfg [SIEVE INDEXING]
+
+======================================================================
 MAIN PRIORITIES (Brad)
 ======================================================================
 
 Unit tests with multiple cohesive cells.
-  tri3
   quad4
   tet4
   hex8

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2007-06-15 00:27:22 UTC (rev 7251)
@@ -195,7 +195,7 @@
       orientFn(&vertexOrientation, jacobian, jacobianDet, upDir);
       
       // Update orientation
-      _orientation->updatePoint(*v_iter, &vertexOrientation[0]);
+      _orientation->updateAddPoint(*v_iter, &vertexOrientation[0]);
     } // for
   } // for
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/Makefile.am	2007-06-15 00:27:22 UTC (rev 7251)
@@ -28,6 +28,7 @@
 	TestFaultCohesiveKin.cc \
 	TestFaultCohesiveKinLine2.cc \
 	TestFaultCohesiveKinTri3.cc \
+	TestFaultCohesiveKinTri3d.cc \
 	TestFaultCohesiveKinQuad4.cc \
 	TestFaultCohesiveKinTet4.cc \
 	TestFaultCohesiveKinHex8.cc \
@@ -41,6 +42,7 @@
 	TestFaultCohesiveKin.hh \
 	TestFaultCohesiveKinLine2.hh \
 	TestFaultCohesiveKinTri3.hh \
+	TestFaultCohesiveKinTri3d.hh \
 	TestFaultCohesiveKinQuad4.hh \
 	TestFaultCohesiveKinTet4.hh \
 	TestFaultCohesiveKinHex8.hh
@@ -76,6 +78,7 @@
 	data/CohesiveKinData.cc \
 	data/CohesiveKinDataLine2.cc \
 	data/CohesiveKinDataTri3.cc \
+	data/CohesiveKinDataTri3d.cc \
 	data/CohesiveKinDataQuad4.cc \
 	data/CohesiveKinDataTet4.cc \
 	data/CohesiveKinDataHex8.cc
@@ -110,6 +113,7 @@
 	data/CohesiveKinData.hh \
 	data/CohesiveKinDataLine2.hh \
 	data/CohesiveKinDataTri3.hh \
+	data/CohesiveKinDataTri3d.hh \
 	data/CohesiveKinDataQuad4.hh \
 	data/CohesiveKinDataTet4.hh \
 	data/CohesiveKinDataHex8.hh

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2007-06-15 00:27:22 UTC (rev 7251)
@@ -114,7 +114,7 @@
   const int orientationSize = spaceDim*spaceDim;
   for (std::set<Mesh::point_type>::const_iterator v_iter=vertConstraintBegin;
        v_iter != vertConstraintEnd;
-       ++v_iter) {
+       ++v_iter, ++iVertex) {
     const int fiberDim = fault._orientation->getFiberDimension(*v_iter);
     CPPUNIT_ASSERT_EQUAL(orientationSize, fiberDim);
     const real_section_type::value_type* vertexOrient = 
@@ -166,8 +166,6 @@
     dispT->updatePoint(*v_iter, &_data->fieldT[iVertex*spaceDim]);
   } // for
   
-  //dispT->view("DISP T");
-
   // Call integrateResidual()
   const double t = 2.134;
   fault.integrateResidual(residual, t, &fields, mesh);
@@ -275,6 +273,13 @@
   for (int iRow=0; iRow < nrows; ++iRow)
     for (int iCol=0; iCol < ncols; ++iCol) {
       const int index = ncols*iRow+iCol;
+      if (fabs(valsE[index]-vals[index]) > tolerance)
+#if 0 // DEBUGGING
+	std::cout << "ERROR: iRow: " << iRow << ", iCol: " << iCol
+		  << "valE: " << valsE[index]
+		  << ", val: " << vals[index]
+		  << std::endl;
+#endif // DEBUGGING
       if (fabs(valsE[index]) > 1.0)
 	CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[index]/valsE[index], tolerance);
       else

Added: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTri3d.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTri3d.cc	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTri3d.cc	2007-06-15 00:27:22 UTC (rev 7251)
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestFaultCohesiveKinTri3d.hh" // Implementation of class methods
+
+#include "data/CohesiveKinDataTri3d.hh" // USES CohesiveKinDataTri3d
+
+#include "pylith/feassemble/Quadrature1Din2D.hh" // USES Quadrature1Din2D
+#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestFaultCohesiveKinTri3d );
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::faults::TestFaultCohesiveKinTri3d::setUp(void)
+{ // setUp
+  TestFaultCohesiveKin::setUp();
+  _data = new CohesiveKinDataTri3d();
+  _quadrature = new feassemble::Quadrature1Din2D();
+  CPPUNIT_ASSERT(0 != _quadrature);
+  feassemble::GeometryLine2D geometry;
+  _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// End of file 

Added: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTri3d.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTri3d.hh	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKinTri3d.hh	2007-06-15 00:27:22 UTC (rev 7251)
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/faults/TestFaultCohesiveKinTri3d.hh
+ *
+ * @brief C++ TestFaultCohesiveKinTri3d object.
+ *
+ * C++ unit testing for FaultCohesiveKin for mesh with 2-D triangular cells.
+ */
+
+#if !defined(pylith_faults_testfaultcohesivekintri3d_hh)
+#define pylith_faults_testfaultcohesivekintri3d_hh
+
+#include "TestFaultCohesiveKin.hh" // ISA TestFaultCohesiveKin
+
+/// Namespace for pylith package
+namespace pylith {
+  namespace faults {
+    class TestFaultCohesiveKinTri3d;
+  } // bc
+} // pylith
+
+/// C++ unit testing for FaultCohesiveKin for mesh with 2-D triangular cells.
+class pylith::faults::TestFaultCohesiveKinTri3d : public TestFaultCohesiveKin
+{ // class TestFaultCohesiveKinTri3d
+
+  // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+  CPPUNIT_TEST_SUITE( TestFaultCohesiveKinTri3d );
+
+  CPPUNIT_TEST( testInitialize );
+  CPPUNIT_TEST( testIntegrateResidual );
+  CPPUNIT_TEST( testIntegrateJacobian );
+
+  CPPUNIT_TEST_SUITE_END();
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Setup testing data.
+  void setUp(void);
+
+}; // class TestFaultCohesiveKinTri3d
+
+#endif // pylith_faults_testfaultcohesivetri3d_hh
+
+
+// End of file 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTet4.cc	2007-06-15 00:27:22 UTC (rev 7251)
@@ -96,7 +96,7 @@
 const double pylith::faults::CohesiveKinDataTet4::_orientation[] = {
   0.0, +1.0, 0.0,    0.0, 0.0, +1.0,    +1.0, 0.0, 0.0,
   0.0, +1.0, 0.0,    0.0, 0.0, +1.0,    +1.0, 0.0, 0.0,
-  0.0, +1.0, 0.0,    0.0, 0.0, +1.0     +1.0, 0.0, 0.0,
+  0.0, +1.0, 0.0,    0.0, 0.0, +1.0,    +1.0, 0.0, 0.0,
 };
 
 const int pylith::faults::CohesiveKinDataTet4::_constraintVertices[] = {

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3d.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3d.cc	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3d.cc	2007-06-15 00:27:22 UTC (rev 7251)
@@ -0,0 +1,473 @@
+// -*- 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
+ *        / \
+ *       /   \
+ *      /     \
+ *     /       \
+ *   14--------- 10
+ * 15 |        11/|
+ *    8---------5 |
+ *     \       /| |\
+ *      \     / | | \
+ *       \   /  | |  \
+ *        \ /   | |   \
+ *         4    | |    7
+ *          \   | |   /
+ *           \  | |  /
+ *            \ | | /
+ *             \| |/
+ *              6-12
+ *               13
+ */
+
+
+#include "CohesiveKinDataTri3d.hh"
+
+const char* pylith::faults::CohesiveKinDataTri3d::_meshFilename =
+  "data/tri3d.mesh";
+
+const int pylith::faults::CohesiveKinDataTri3d::_spaceDim = 2;
+
+const int pylith::faults::CohesiveKinDataTri3d::_cellDim = 1;
+
+const int pylith::faults::CohesiveKinDataTri3d::_numBasis = 2;
+
+const int pylith::faults::CohesiveKinDataTri3d::_numQuadPts = 1;
+
+const double pylith::faults::CohesiveKinDataTri3d::_quadPts[] = {
+  0.0,
+};
+
+const double pylith::faults::CohesiveKinDataTri3d::_quadWts[] = {
+  2.0,
+};
+
+const double pylith::faults::CohesiveKinDataTri3d::_basis[] = {
+  0.5,
+  0.5
+};
+
+const double pylith::faults::CohesiveKinDataTri3d::_basisDeriv[] = {
+  -0.5,
+   0.5
+};
+
+const double pylith::faults::CohesiveKinDataTri3d::_verticesRef[] = {
+  -1.0, 1.0
+};
+
+const int pylith::faults::CohesiveKinDataTri3d::_id = 10;
+
+const char* pylith::faults::CohesiveKinDataTri3d::_label = "fault";
+
+const char* pylith::faults::CohesiveKinDataTri3d::_finalSlipFilename = 
+  "data/tri3d_finalslip.spatialdb";
+
+const char* pylith::faults::CohesiveKinDataTri3d::_slipTimeFilename = 
+  "data/tri3d_sliptime.spatialdb";
+
+const char* pylith::faults::CohesiveKinDataTri3d::_peakRateFilename = 
+  "data/tri3d_peakrate.spatialdb";
+
+const double pylith::faults::CohesiveKinDataTri3d::_fieldT[] = {
+  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.8, 8.8,
+  6.9, 8.9,
+  6.0, 8.0,
+  7.1, 9.1,
+  7.2, 9.2,
+};
+
+const int pylith::faults::CohesiveKinDataTri3d::_numConstraintVert = 3;
+
+const double pylith::faults::CohesiveKinDataTri3d::_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 int pylith::faults::CohesiveKinDataTri3d::_constraintVertices[] = {
+  11, 13, 15
+};
+
+const double pylith::faults::CohesiveKinDataTri3d::_valsResidual[] = {
+  0.0,  0.0,
+  0.0,  0.0,
+  0.0,  0.0,
+  0.0,  0.0,
+  0.0,  0.0,
+  0.0,  0.0,
+  0.0,  0.0,
+  1.05057813143, 0.0456773100622, // 11
+  0.0,  0.0,
+  0.989535448086, 0.0824612873405, // 13
+  0.0,  0.0,
+  0.90435792846,  0.10852295130, // 15
+};
+
+const double pylith::faults::CohesiveKinDataTri3d::_valsJacobian[] = {
+  0.0, 0.0, // 4x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 4y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 5x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ +0.70710678118654757, -0.70710678118654757, // 11
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 5y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ -0.70710678118654757, -0.70710678118654757, // 11
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 6x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0,-1.0, // 13
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 6y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ -1.0, 0.0, // 13
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 7x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 7y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 8x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ +1.0, 0.0,
+  0.0, 0.0, // 8y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0,-1.0,
+  0.0, 0.0, // 9x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 9y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 10x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ -0.70710678118654757, +0.70710678118654757, // 11
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 10y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ +0.70710678118654757, +0.70710678118654757, // 11
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 11x
+ +0.70710678118654757, -0.70710678118654757, // 5
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ -0.70710678118654757, +0.70710678118654757, // 10
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 11y
+ -0.70710678118654757, -0.70710678118654757, // 5
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ +0.70710678118654757, +0.70710678118654757, // 10
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 12x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0,+1.0, // 13
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 12y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ +1.0, 0.0, // 13
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 13x
+  0.0, 0.0,
+  0.0,-1.0, // 6
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0,+1.0, // 12
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 13y
+  0.0, 0.0,
+ -1.0, 0.0, // 6
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ +1.0, 0.0, // 12
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0, // 14x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ -1.0, 0.0, // 15
+  0.0, 0.0, // 14y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0,+1.0, // 15
+  0.0, 0.0, // 15x
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ +1.0, 0.0, // 8
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+ -1.0, 0.0, // 14
+  0.0, 0.0,
+  0.0, 0.0, // 15y
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0,-1.0, // 8
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0, 0.0,
+  0.0,+1.0, // 14
+  0.0, 0.0,
+};
+
+pylith::faults::CohesiveKinDataTri3d::CohesiveKinDataTri3d(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);
+  finalSlipFilename = const_cast<char*>(_finalSlipFilename);
+  slipTimeFilename = const_cast<char*>(_slipTimeFilename);
+  peakRateFilename = const_cast<char*>(_peakRateFilename);
+  fieldT = const_cast<double*>(_fieldT);
+  orientation = const_cast<double*>(_orientation);
+  constraintVertices = const_cast<int*>(_constraintVertices);
+  valsResidual = const_cast<double*>(_valsResidual);
+  valsJacobian = const_cast<double*>(_valsJacobian);
+  numConstraintVert = _numConstraintVert;  
+} // constructor
+
+pylith::faults::CohesiveKinDataTri3d::~CohesiveKinDataTri3d(void)
+{}
+
+
+// End of file

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3d.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3d.hh	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3d.hh	2007-06-15 00:27:22 UTC (rev 7251)
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesivekindatatri3d_hh)
+#define pylith_faults_cohesivekindatatri3d_hh
+
+#include "CohesiveKinData.hh"
+
+namespace pylith {
+  namespace faults {
+     class CohesiveKinDataTri3d;
+  } // pylith
+} // faults
+
+class pylith::faults::CohesiveKinDataTri3d : public CohesiveKinData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public: 
+
+  /// Constructor
+  CohesiveKinDataTri3d(void);
+
+  /// Destructor
+  ~CohesiveKinDataTri3d(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* _finalSlipFilename; ///< Name of db for final slip
+  static const char* _slipTimeFilename; ///< Name of db for slip time
+  static const char* _peakRateFilename; ///< Name of db for peak rate
+  //@}
+
+  static const double _fieldT[]; ///< Solution field at time t.
+
+  static const double _orientation[]; ///< Expected values for fault orientation.
+  static const int _constraintVertices[]; ///< Expected points for constraint vertices
+  static const double _valsResidual[]; ///< Expected values from residual calculation.
+  static const double _valsJacobian[]; ///< Expected values from Jacobian calculation.
+  static const int _numConstraintVert; ///< Number of constraint vertices
+
+};
+
+#endif // pylith_faults_cohesivekindatatri3d_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	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am	2007-06-15 00:27:22 UTC (rev 7251)
@@ -22,6 +22,9 @@
 	tri3_finalslip.spatialdb \
 	tri3_sliptime.spatialdb \
 	tri3_peakrate.spatialdb \
+	tri3d_finalslip.spatialdb \
+	tri3d_sliptime.spatialdb \
+	tri3d_peakrate.spatialdb \
 	quad4.mesh \
 	quad4b.mesh \
 	quad4c.mesh \

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_finalslip.spatialdb
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_finalslip.spatialdb	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_finalslip.spatialdb	2007-06-15 00:27:22 UTC (rev 7251)
@@ -0,0 +1,16 @@
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 2
+  value-names =  left-lateral-slip fault-opening
+  value-units =  m   m
+  num-locs = 3
+  data-dim = 2
+  space-dim = 2
+  cs-data = cartesian {
+    to-meters = 1.0
+    space-dim = 2
+  }
+}
+ 0.0  +1.0   2.3   0.1
+ 0.0  -1.0   2.4   0.2
+-2.0  +1.0   2.5   0.3

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_peakrate.spatialdb
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_peakrate.spatialdb	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_peakrate.spatialdb	2007-06-15 00:27:22 UTC (rev 7251)
@@ -0,0 +1,16 @@
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 1
+  value-names =  slip-rate
+  value-units =  m/s
+  num-locs = 3
+  data-dim = 2
+  space-dim = 2
+  cs-data = cartesian {
+    to-meters = 1.0
+    space-dim = 2
+  }
+}
+ 0.0  +1.0   1.4
+ 0.0  -1.0   1.5
+-2.0  +1.0   1.6

Added: short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_sliptime.spatialdb
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_sliptime.spatialdb	2007-06-14 22:59:37 UTC (rev 7250)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/tri3d_sliptime.spatialdb	2007-06-15 00:27:22 UTC (rev 7251)
@@ -0,0 +1,16 @@
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 1
+  value-names =  slip-time
+  value-units =  s
+  num-locs = 3
+  data-dim = 2
+  space-dim = 2
+  cs-data = cartesian {
+    to-meters = 1.0
+    space-dim = 2
+  }
+}
+ 0.0  +1.0    1.2
+ 0.0  -1.0    1.3
+-2.0  +1.0    1.4



More information about the cig-commits mailing list