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

brad at geodynamics.org brad at geodynamics.org
Sat Jun 9 20:14:33 PDT 2007


Author: brad
Date: 2007-06-09 20:14:33 -0700 (Sat, 09 Jun 2007)
New Revision: 7123

Modified:
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3.cc
Log:
Fixed some more bugs in C++ implementation of cohesive cells implementation of kinematic earthquake rupture. Finished tri3 unit tests. Line2 and tri3 unit tests now all pass.

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2007-06-09 23:32:51 UTC (rev 7122)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2007-06-10 03:14:33 UTC (rev 7123)
@@ -330,21 +330,21 @@
     for (int iConstraint=0; iConstraint < numConstraintVert; ++iConstraint) {
       // Blocks in cell matrix associated with normal cohesive
       // vertices i and j and constraint vertex k
-      const int iBasis = 3*iConstraint;
-      const int jBasis = 3*iConstraint + 1;
-      const int kBasis = 3*iConstraint + 2;
+      const int indexI = iConstraint;
+      const int indexJ = iConstraint +   numConstraintVert;
+      const int indexK = iConstraint + 2*numConstraintVert;
 
-      // Get orientations at constraint vertex
+      // Get orientation at constraint vertex
       const real_section_type::value_type* constraintOrient = 
 	&cellOrientation[iConstraint*orientationSize];
 
       // Entries associated with constraint forces applied at node i
       for (int iDim=0; iDim < spaceDim; ++iDim)
 	for (int kDim=0; kDim < spaceDim; ++kDim) {
-	  const int row = iBasis*spaceDim+iDim;
-	  const int col = kBasis*spaceDim+kDim;
+	  const int row = indexI*spaceDim+iDim;
+	  const int col = indexK*spaceDim+kDim;
 	  cellMatrix[row*numCorners*spaceDim+col] =
-	    -constraintOrient[iDim*spaceDim+kDim];
+	    -constraintOrient[kDim*spaceDim+iDim];
 	  cellMatrix[col*numCorners*spaceDim+row] =
 	    cellMatrix[row*numCorners*spaceDim+col]; // symmetric
 	} // for
@@ -352,10 +352,10 @@
       // Entries associated with constraint forces applied at node j
       for (int jDim=0; jDim < spaceDim; ++jDim)
 	for (int kDim=0; kDim < spaceDim; ++kDim) {
-	  const int row = jBasis*spaceDim+jDim;
-	  const int col = kBasis*spaceDim+kDim;
+	  const int row = indexJ*spaceDim+jDim;
+	  const int col = indexK*spaceDim+kDim;
 	  cellMatrix[row*numCorners*spaceDim+col] =
-	    constraintOrient[jDim*spaceDim+kDim];
+	    constraintOrient[kDim*spaceDim+jDim];
 	  cellMatrix[col*numCorners*spaceDim+row] =
 	    cellMatrix[row*numCorners*spaceDim+col]; // symmetric
 	} // for

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2007-06-09 23:32:51 UTC (rev 7122)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2007-06-10 03:14:33 UTC (rev 7123)
@@ -256,7 +256,7 @@
   err = MatAssemblyEnd(jacobian, MAT_FINAL_ASSEMBLY);
   CPPUNIT_ASSERT(0 == err);
 
-  MatView(jacobian, PETSC_VIEWER_STDOUT_WORLD);
+  //MatView(jacobian, PETSC_VIEWER_STDOUT_WORLD);
 
   const double* valsE = _data->valsJacobian;
   const int nrowsE = dispT->sizeWithBC();

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3.cc	2007-06-09 23:32:51 UTC (rev 7122)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveKinDataTri3.cc	2007-06-10 03:14:33 UTC (rev 7123)
@@ -142,9 +142,9 @@
   0.0,  0.0,
   0.0,  0.0,
   0.0,  0.0,
+  1.05057813143, 0.0456773100622, // 7
   0.0,  0.0,
-  0.0,  0.0,
-  0.0,  0.0,
+  0.989535448086, 0.0824612873405, // 9
 };
 
 const double pylith::faults::CohesiveKinDataTri3::_valsJacobian[] = {
@@ -156,14 +156,6 @@
   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, // 2y
   0.0, 0.0,
   0.0, 0.0,
@@ -172,46 +164,22 @@
   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, // 3x
   0.0, 0.0,
   0.0, 0.0,
   0.0, 0.0,
   0.0, 0.0,
+  0.0,-1.0, // 7
   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, // 3y
   0.0, 0.0,
   0.0, 0.0,
   0.0, 0.0,
   0.0, 0.0,
+ +1.0, 0.0, //  7
   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, // 4x
   0.0, 0.0,
   0.0, 0.0,
@@ -219,15 +187,7 @@
   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,
+  0.0,-1.0, //  9
   0.0, 0.0, // 4y
   0.0, 0.0,
   0.0, 0.0,
@@ -235,15 +195,7 @@
   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,
+ +1.0, 0.0, //  9
   0.0, 0.0, // 5x
   0.0, 0.0,
   0.0, 0.0,
@@ -252,14 +204,6 @@
   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, // 5y
   0.0, 0.0,
   0.0, 0.0,
@@ -268,78 +212,38 @@
   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, // 6x
   0.0, 0.0,
   0.0, 0.0,
   0.0, 0.0,
   0.0, 0.0,
+  0.0,+1.0, //  7
   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, // 6y
   0.0, 0.0,
   0.0, 0.0,
   0.0, 0.0,
   0.0, 0.0,
+ -1.0, 0.0, //  7
   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, // 7x
+  0.0,+1.0, //  3
   0.0, 0.0,
   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, 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
+ -1.0, 0.0, //  3
   0.0, 0.0,
   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,
-  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,
@@ -347,15 +251,7 @@
   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,
+  0.0,+1.0, //  9
   0.0, 0.0, // 8y
   0.0, 0.0,
   0.0, 0.0,
@@ -363,47 +259,23 @@
   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,
+ -1.0, 0.0, //  9
   0.0, 0.0, // 9x
   0.0, 0.0,
+  0.0,+1.0, //  4
   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, 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,
+ -1.0, 0.0, //  4
   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,
-  0.0, 0.0,
-  0.0, 0.0,
-  0.0, 0.0,
-  0.0, 0.0,
-  0.0, 0.0,
-  0.0, 0.0,
 };
 
 pylith::faults::CohesiveKinDataTri3::CohesiveKinDataTri3(void)



More information about the cig-commits mailing list