[cig-commits] r18999 - in short/3D/PyLith/branches/v1.6-revisedfault: libsrc/pylith/faults unittests/libtests/faults unittests/libtests/faults/data

brad at geodynamics.org brad at geodynamics.org
Fri Sep 30 16:53:33 PDT 2011


Author: brad
Date: 2011-09-30 16:53:32 -0700 (Fri, 30 Sep 2011)
New Revision: 18999

Modified:
   short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc
   short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveLagrange.cc
   short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/TestFaultCohesiveDyn.cc
   short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
   short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
   short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTet4.cc
   short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
   short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
   short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/cohesivedyn.py
Log:
Fixed some orientation bugs in spontaneous rupture implementation. Started updating test data.

Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc	2011-09-30 23:53:32 UTC (rev 18999)
@@ -348,7 +348,8 @@
       double slipNormal = 0.0;
       const int indexN = spaceDim - 1;
       for (int jDim=0; jDim < spaceDim; ++jDim) {
-	slipNormal += orientationCell[iO + jDim*spaceDim]*dispRelCell[iB+jDim];
+	slipNormal += 
+	  orientationCell[iO + indexN*spaceDim+jDim]*dispRelCell[iB+jDim];
       } // for
 
       if (slipNormal > _zeroTolerance) {
@@ -453,11 +454,11 @@
     tractionTpdtVertex = 0.0;
     for (int iDim=0; iDim < spaceDim; ++iDim) {
       for (int jDim=0; jDim < spaceDim; ++jDim) {
-	slipVertex[iDim] += orientationVertex[jDim*spaceDim+iDim] *
+	slipVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
 	  dispRelVertex[jDim];
-	slipRateVertex[iDim] += orientationVertex[jDim*spaceDim+iDim] *
+	slipRateVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
 	  velRelVertex[jDim];
-	tractionTpdtVertex[iDim] += orientationVertex[jDim*spaceDim+iDim] *
+	tractionTpdtVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
 	  (lagrangeTVertex[jDim]+lagrangeTIncrVertex[jDim]);
       } // for
     } // for
@@ -619,15 +620,29 @@
     tractionTpdtVertex = 0.0;
     for (int iDim=0; iDim < spaceDim; ++iDim) {
       for (int jDim=0; jDim < spaceDim; ++jDim) {
-	slipVertex[jDim] += orientationVertex[jDim*spaceDim+iDim] *
+	slipVertex[jDim] += orientationVertex[iDim*spaceDim+jDim] *
 	  dispRelVertex[jDim];
-	slipRateVertex[jDim] += orientationVertex[jDim*spaceDim+iDim] *
+	slipRateVertex[jDim] += orientationVertex[iDim*spaceDim+jDim] *
 	  velRelVertex[jDim];
-	tractionTpdtVertex[iDim] += orientationVertex[jDim*spaceDim+iDim] *
+	tractionTpdtVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
 	  (lagrangeTVertex[jDim] + lagrangeTIncrVertex[jDim]);
       } // for
     } // for
 
+#if 1 // debugging
+    std::cout << "slipVertex: ";
+    for (int iDim=0; iDim < spaceDim; ++iDim)
+      std::cout << "  " << slipVertex[iDim];
+    std::cout << ",  slipRateVertex: ";
+    for (int iDim=0; iDim < spaceDim; ++iDim)
+      std::cout << "  " << slipRateVertex[iDim];
+    std::cout << ",  tractionVertex: ";
+    for (int iDim=0; iDim < spaceDim; ++iDim)
+      std::cout << "  " << tractionTpdtVertex[iDim];
+    std::cout << std::endl;
+#endif
+     
+
     // Get friction properties and state variables.
     _friction->retrievePropsStateVars(v_fault);
 
@@ -644,7 +659,7 @@
     for (int iDim=0; iDim < spaceDim; ++iDim) {
       for (int jDim=0; jDim < spaceDim; ++jDim) {
 	dLagrangeTpdtVertexGlobal[iDim] += 
-	  orientationVertex[iDim*spaceDim+jDim] * dLagrangeTpdtVertex[jDim];
+	  orientationVertex[jDim*spaceDim+iDim] * dLagrangeTpdtVertex[jDim];
       } // for
     } // for
 
@@ -721,9 +736,9 @@
     slipVertex = 0.0;
     for (int iDim=0; iDim < spaceDim; ++iDim) {
       for (int jDim=0; jDim < spaceDim; ++jDim) {
-	slipVertex[iDim] += orientationVertex[jDim*spaceDim+iDim] *
+	slipVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
 	  dispRelVertex[jDim];
-	dSlipVertex[iDim] += orientationVertex[jDim*spaceDim+iDim] * 
+	dSlipVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] * 
 	  2.0*sensDispRelVertex[jDim];
       } // for
     } // for
@@ -732,9 +747,9 @@
     double tractionNormal = 0.0;
     const int indexN = spaceDim - 1;
     for (int jDim=0; jDim < spaceDim; ++jDim) {
-      tractionNormal += orientationVertex[jDim*spaceDim+indexN] *
-	(lagrangeTVertex[indexN] + lagrangeTIncrVertex[indexN] + 
-	 dLagrangeTpdtVertex[indexN]);
+      tractionNormal += orientationVertex[indexN*spaceDim+jDim] *
+	(lagrangeTVertex[jDim] + lagrangeTIncrVertex[jDim] + 
+	 dLagrangeTpdtVertex[jDim]);
     } // for
 
     // Do not allow fault interpenetration and set fault opening to
@@ -748,7 +763,7 @@
     dDispRelVertex = 0.0;
     for (int iDim=0; iDim < spaceDim; ++iDim) {
       for (int jDim=0; jDim < spaceDim; ++jDim) {
-	dDispRelVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
+	dDispRelVertex[iDim] += orientationVertex[jDim*spaceDim+iDim] *
 	  dSlipVertex[jDim];
       } // for
     } // for
@@ -1485,7 +1500,7 @@
     tractionsVertex = 0.0;
     for (int iDim=0; iDim < spaceDim; ++iDim) {
       for (int jDim=0; jDim < spaceDim; ++jDim) {
-	tractionsVertex[iDim] += orientationVertex[jDim*spaceDim+iDim] *
+	tractionsVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
 	  dispTVertex[jDim];
       } // for
     } // for
@@ -1764,6 +1779,8 @@
 
   const int spaceDim = _quadrature->spaceDim();
 
+  // :TODO: FIX THIS
+
   // Compute residual -C^T dLagrange
   double_array residualVertex(spaceDim);
   topology::Field<topology::SubMesh>& residual =

Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveLagrange.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveLagrange.cc	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveLagrange.cc	2011-09-30 23:53:32 UTC (rev 18999)
@@ -1787,6 +1787,7 @@
       orientationSection->restrictPoint(v_fault);
     assert(orientationVertex);
 
+    // Rotate from global coordinate system to fault (orientation)
     tractionsVertex = 0.0;
     for (int iDim=0; iDim < spaceDim; ++iDim)
       for (int jDim=0; jDim < spaceDim; ++jDim)
@@ -1839,6 +1840,7 @@
     const double* orientationVertex = orientationSection->restrictPoint(v_fault);
     assert(orientationVertex);
 
+    // Rotate from fault to global coordinate system (transpose orientation)
     fieldVertexGlobal = 0.0;
     for (int iDim=0; iDim < spaceDim; ++iDim)
       for (int jDim=0; jDim < spaceDim; ++jDim)
@@ -1891,6 +1893,7 @@
     const double* orientationVertex = orientationSection->restrictPoint(v_fault);
     assert(orientationVertex);
 
+    // Rotate from global coordinate system to fault (orientation)
     fieldVertexFault = 0.0;
     for (int iDim=0; iDim < spaceDim; ++iDim)
       for (int jDim=0; jDim < spaceDim; ++jDim)

Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/TestFaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/TestFaultCohesiveDyn.cc	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/TestFaultCohesiveDyn.cc	2011-09-30 23:53:32 UTC (rev 18999)
@@ -218,7 +218,7 @@
       fields.get("dispIncr(t->t+dt)").section();
     CPPUNIT_ASSERT(!dispIncrSection.isNull());
 
-    //dispIncrSection->view("DISP INCREMENT"); // DEBUGGING
+    dispIncrSection->view("DISP INCREMENT"); // DEBUGGING
 
     // Get expected values
     const double* valsE = _data->fieldIncrStick; // No change in dispIncr
@@ -260,7 +260,7 @@
 
     // Get section containing slip
     const ALE::Obj<RealSection>& slipSection =
-      fault._fields->get("slip").section();
+      fault.vertexField("slip").section();
     CPPUNIT_ASSERT(!slipSection.isNull());
 
     const double valE = 0.0; // slip should be zero
@@ -372,7 +372,7 @@
 
     // Get section containing slip
     const ALE::Obj<RealSection>& slipSection =
-      fault._fields->get("slip").section();
+      fault.vertexField("slip").section();
     CPPUNIT_ASSERT(!slipSection.isNull());
 
     // Get expected values
@@ -494,7 +494,7 @@
 
     // Get section containing slip
     const ALE::Obj<RealSection>& slipSection =
-      fault._fields->get("slip").section();
+      fault.vertexField("slip").section();
     CPPUNIT_ASSERT(!slipSection.isNull());
 
     // Get expected values
@@ -636,7 +636,7 @@
       double tractionE = 0.0;
       for (int jDim=0; jDim < spaceDim; ++jDim) {
 	tractionE += 
-	  orientationVertex[jDim*spaceDim+iDim]*tractionsVertexGlobalE[jDim];
+	  orientationVertex[iDim*spaceDim+jDim]*tractionsVertexGlobalE[jDim];
       } // for
       if (tractionE != 0.0)
         CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, tractionsVertex[iDim]/tractionE,

Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataHex8.cc	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataHex8.cc	2011-09-30 23:53:32 UTC (rev 18999)
@@ -1362,26 +1362,26 @@
 // ----------------------------------------------------------------------
 // Input
 const double pylith::faults::CohesiveDynDataHex8::_fieldIncrStick[] = {
-  0.1, 2.1, 28.1,
-  0.2, 2.2, 28.2,
-  0.3, 2.3, 28.3,
-  0.4, 2.4, 28.4,
-  0.5, 2.5, 28.5, // 6
-  0.6, 2.6, 28.6, // 7
-  0.7, 2.7, 28.7, // 8
-  0.8, 2.8, 28.8, // 9
-  0.9, 2.9, 28.9,
-  0.0, 2.0, 28.0,
-  1.1, 3.1, 29.1,
-  1.2, 3.2, 29.2,
-  1.3, 3.3, 29.3, // 14
-  1.5, 3.5, 29.5, // 15
-  1.7, 3.7, 29.7, // 16
-  1.9, 3.9, 29.9, // 17
-  1.4, 3.4, -89.4, // 18
-  1.6, 3.6, -89.6, // 19
-  1.8, 3.8, -89.8, // 20
-  1.0, 3.0, -89.0, // 21
+  0.1, 2.1, 1.1,
+  0.2, 2.2, 1.2,
+  0.3, 2.3, 1.3,
+  0.4, 2.4, 1.4,
+  0.5, 2.5, 1.5, // 6
+  0.6, 2.6, 1.6, // 7
+  0.7, 2.7, 1.7, // 8
+  0.8, 2.8, 1.8, // 9
+  0.9, 2.9, 1.9,
+  0.0, 2.0, 1.0,
+  1.1, 3.1, 2.1,
+  1.2, 3.2, 2.2,
+  1.3, 3.3, 2.3, // 14
+  1.5, 3.5, 2.5, // 15
+  1.7, 3.7, 2.7, // 16
+  1.9, 3.9, 2.9, // 17
+  41.4, 3.4, 2.4, // 18
+  41.6, 3.6, 2.6, // 19
+  41.8, 3.8, 2.8, // 20
+  41.0, 3.0, 2.0, // 21
 };
 
 // No change in fieldIncr

Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc	2011-09-30 23:53:32 UTC (rev 18999)
@@ -338,16 +338,16 @@
 // ----------------------------------------------------------------------
 // Input
 const double pylith::faults::CohesiveDynDataQuad4::_fieldIncrStick[] = {
-  1.1, 29.1,
-  1.2, 29.2,
-  1.3, 29.3, // 4
-  1.4, 29.4, // 5
-  1.5, 29.5,
-  1.6, 29.6,
-  1.7, 29.7, // 8
-  1.9, 29.9, // 9
-  1.8, -29.8, // 10
-  1.0, -29.0, // 11
+  1.1, 2.1,
+  1.2, 2.2,
+  1.3, 2.3, // 4
+  1.4, 2.4, // 5
+  1.5, 2.5,
+  1.6, 2.6,
+  1.7, 2.7, // 8
+  1.9, 2.9, // 9
+  21.8, 2.8, // 10
+  21.0, 2.0, // 11
 };
 
 // No change in fieldIncr

Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTet4.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTet4.cc	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTet4.cc	2011-09-30 23:53:32 UTC (rev 18999)
@@ -493,17 +493,17 @@
 // ----------------------------------------------------------------------
 // Input
 const double pylith::faults::CohesiveDynDataTet4::_fieldIncrStick[] = {
-  1.1, 2.1, 35.1,
-  1.2, 2.2, 35.2, // 3
-  1.3, 2.3, 35.3, // 4
-  1.4, 2.4, 35.4, // 5
-  1.5, 2.5, 35.5,
-  1.6, 2.6, 35.6, // 7
-  1.8, 2.8, 35.8, // 8
-  1.0, 2.0, 35.0, // 9
-  1.7, 2.7, -35.7, // 10
-  1.9, 2.9, -35.9, // 11
-  1.1, 2.1, -35.1, // 12
+  1.1, 2.1, 3.1,
+  1.2, 2.2, 3.2, // 3
+  1.3, 2.3, 3.3, // 4
+  1.4, 2.4, 3.4, // 5
+  1.5, 2.5, 3.5,
+  1.6, 2.6, 3.6, // 7
+  1.8, 2.8, 3.8, // 8
+  1.0, 2.0, 3.0, // 9
+  41.7, 2.7, 3.7, // 10
+  41.9, 2.9, 3.9, // 11
+  41.1, 2.1, 3.1, // 12
 };
 
 // No change in fieldIncr

Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTri3.cc	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTri3.cc	2011-09-30 23:53:32 UTC (rev 18999)
@@ -268,14 +268,14 @@
 // ----------------------------------------------------------------------
 // Input
 const double pylith::faults::CohesiveDynDataTri3::_fieldIncrStick[] = {
-  1.1, 29.1,
-  1.2, 29.2, // 3
-  1.3, 29.3, // 4
-  1.4, 29.4,
-  1.5, 29.5, // 6
-  1.7, 29.7, // 7
-  1.6, -29.6, // 8
-  1.8, -29.8, // 9
+  1.1, 2.1,
+  1.2, 2.2, // 3
+  1.3, 2.3, // 4
+  1.4, 2.4,
+  1.5, 2.5, // 6
+  1.7, 2.7, // 7
+  21.6, 2.6, // 8
+  21.8, 2.8, // 9
 };
 
 // No change in fieldIncr

Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc	2011-09-30 23:53:32 UTC (rev 18999)
@@ -450,18 +450,18 @@
 // ----------------------------------------------------------------------
 // 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
+  1.1, 2.1,
+  1.2, 2.2, // 5
+  1.3, 2.3, // 6
+  1.4, 2.4,
+  1.5, 2.5, // 8
+  1.6, 2.6,
+  1.7, 2.7, // 10
+  1.9, 2.9, // 11
+  2.1, 2.1, // 12
+  21.8, 22.8, // 13
+  21.0, 2.0, // 14
+  2.2, 22.2, // 15
 };
 
 // No change in fieldIncr

Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/cohesivedyn.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/cohesivedyn.py	2011-09-30 23:02:10 UTC (rev 18998)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/faults/data/cohesivedyn.py	2011-09-30 23:53:32 UTC (rev 18999)
@@ -1,5 +1,5 @@
-cell = "hex8"
-dim = "3d"
+cell = "tri3"
+dim = "2d"
 testCase = "slip"
 
 import numpy



More information about the CIG-COMMITS mailing list