[cig-commits] r16577 - short/3D/PyLith/trunk/unittests/libtests/faults/data

brad at geodynamics.org brad at geodynamics.org
Sat Apr 24 13:33:39 PDT 2010


Author: brad
Date: 2010-04-24 13:33:39 -0700 (Sat, 24 Apr 2010)
New Revision: 16577

Modified:
   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/CohesiveDynDataTri3d.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py
Log:
Updated fault friction unit tests to prevent inter-penetration.

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc	2010-04-22 18:21:20 UTC (rev 16576)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc	2010-04-24 20:33:39 UTC (rev 16577)
@@ -1472,17 +1472,17 @@
    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.500000000000,   7.520764683862,   9.493622329940,
+   5.600000000000,   7.633324383533,   9.609428688349,
+   5.700000000000,   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.300000000000,   8.279235316138,  10.306377670060,
+   6.500000000000,   8.466675616467,  10.490571311651,
+   6.700000000000,   8.657842717320,  10.679191979990,
    6.889443715898,   8.839890640676,  10.859602313470,
   -5.400000000000,  -7.400000000000,  -9.400000000000,
   -5.600000000000,  -7.600000000000,  -9.600000000000,
@@ -1491,9 +1491,9 @@
 };
 
 const double pylith::faults::CohesiveDynDataHex8::_slipOpenE[] = {
-  0.041529367723, -0.012755340119, -0.121928199854,
-  0.066648767067,  0.018857376697, -0.067448606565,
-  0.084314565359,  0.041616040020,  -0.03000275954,
+  0.041529367723, -0.012755340119, 0.0,
+  0.066648767067,  0.018857376697, 0.0,
+  0.084314565359,  0.041616040020,  0.0,
   0.120218718648,  0.080795373061,  0.021112568204,
 };
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc	2010-04-22 18:21:20 UTC (rev 16576)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc	2010-04-24 20:33:39 UTC (rev 16577)
@@ -404,20 +404,20 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataQuad4::_fieldIncrOpenE[] = {
-  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,
+   9.100000000000,  10.100000000000,
+   9.200000000000,  10.200000000000,
+   9.300000000000,  10.685047196672,
+   9.932709332305,  11.176949275526,
+   9.500000000000,  10.500000000000,
+   9.600000000000,  10.600000000000,
+   9.700000000000,  10.314952803328,
+   9.367290667695,  10.123050724474,
+  -8.800000000000,  -9.800000000000,
+  -8.000000000000,  -9.000000000000,
 };
 
 const double pylith::faults::CohesiveDynDataQuad4::_slipOpenE[] = {
-  0.770094393343286,  -0.110815417720561,
+  0.770094393343286,  0.0,
   1.553898551051246,   1.065418664609568,
 };
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc	2010-04-22 18:21:20 UTC (rev 16576)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc	2010-04-24 20:33:39 UTC (rev 16577)
@@ -562,22 +562,22 @@
 
 // Output
 const double pylith::faults::CohesiveDynDataTet4::_fieldIncrOpenE[] = {
-  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,
+   8.100000000000,   9.100000000000,  10.100000000000,
+   8.200000000000,   9.135497272962,  10.179476872604,
+   8.300000000000,   9.499046287062,  10.492579766051,
+   8.626823377123,   9.756303461532,  10.737559383723,
+   8.500000000000,   9.500000000000,  10.500000000000,
+   8.600000000000,   9.664502727038,  10.620523127396,
+   8.800000000000,   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[] = {
-  -0.12900545, -0.04104625, -1.08185163,
-  0.39809257,  0.38515953, -0.01606224,
+  -0.12900545, -0.04104625, 0.0,
+  0.39809257,  0.38515953, 0.0,
   0.71260692,  0.67511877,  0.45364675,
 };
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc	2010-04-22 18:21:20 UTC (rev 16576)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc	2010-04-24 20:33:39 UTC (rev 16577)
@@ -325,17 +325,17 @@
 // Output
 const double pylith::faults::CohesiveDynDataTri3::_fieldIncrOpenE[] = {
  9.100000000000,  10.100000000000,
- 8.816324456708,  10.851688943849,
+ 9.200000000000,  10.851688943849,
 10.191208845155,  11.487449638489,
  9.400000000000,  10.400000000000,
- 9.883675543292,   9.848311056151,
+ 9.500000000000,   9.848311056151,
  8.808791154845,   9.512550361511,
 -8.600000000000,  -9.600000000000,
 -8.800000000000,  -9.800000000000,
 };
 
 const double pylith::faults::CohesiveDynDataTri3::_slipOpenE[] = {
-  1.303377887698464,   -0.767351086584028,
+  1.303377887698464,  0.0,
   2.374899276978848,  1.782417690310881,
 };
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc	2010-04-22 18:21:20 UTC (rev 16576)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc	2010-04-24 20:33:39 UTC (rev 16577)
@@ -524,23 +524,23 @@
 
 // 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,
+   9.100000000000,  10.100000000000,
+  17.946141606808,   1.453858393192,
+   9.300000000000,  16.358051491522,
+   9.400000000000,  10.400000000000,
+   1.376240123890,  19.299429217321,
+   9.600000000000,  10.600000000000,
+   0.953858393192,  19.446141606808,
+   9.900000000000,   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,
+-24.737824157567,  0.0,
+ 12.116102983044,  0.0,
  16.247519752219,  17.598858434641,
 
 };

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py	2010-04-22 18:21:20 UTC (rev 16576)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py	2010-04-24 20:33:39 UTC (rev 16577)
@@ -25,9 +25,9 @@
 if dim == "2d":
     if cell == "tri3":
         dlagrange1 = numpy.zeros(2)
-        Lindex = numpy.arange(12,16)
-        Iindex = numpy.arange(2,6)
-        Jindex = numpy.arange(8,12)
+        indexL = numpy.arange(12,16)
+        indexN = numpy.arange(2,6)
+        indexP = numpy.arange(8,12)
         n = 16
         m = 4
         DOF = 2
@@ -85,9 +85,9 @@
 
     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])
+        indexL = numpy.array([18, 19, 20, 21, 22, 23])
+        indexN = numpy.array([2, 3, 4, 5, 8, 9])
+        indexP = numpy.array([12, 13, 14, 15, 16, 17])
         n = 24
         m = 6
         DOF = 2
@@ -165,9 +165,9 @@
 
     elif cell == "quad4":
         dlagrange1 = numpy.zeros(2)
-        Lindex = numpy.arange(16,20)
-        Iindex = numpy.arange(4,8)
-        Jindex = numpy.arange(12,16)
+        indexL = numpy.arange(16,20)
+        indexN = numpy.arange(4,8)
+        indexP = numpy.arange(12,16)
         n = 20
         m = 4
         DOF = 2
@@ -258,32 +258,34 @@
         dLagrange = numpy.reshape(dLagrange, m)
     elif testCase == "open":
         dLagrange = numpy.reshape(disp+dispIncr, n)
-        dLagrange = dLagrange[Lindex]
+        dLagrange = dLagrange[indexL]
 
     print "dLagrange \n", dLagrange
 
     RHS = numpy.dot(numpy.transpose(C),dLagrange)
-    duI = numpy.dot(inv(jacobianN),RHS)
-    duJ = -numpy.dot(inv(jacobianP),RHS)
+    duN = -numpy.dot(inv(jacobianN),RHS)
+    duP = numpy.dot(inv(jacobianP),RHS)
     
-    dispRel = duI - duJ
+    dispRel = duP - duN
 
     slipVertex = numpy.dot(C,dispRel)
     slipVertex = numpy.reshape(slipVertex, (m/DOF,DOF))
     if testCase == "slip":
-        slipVertex[:,1] = 0    
+        slipVertex[:,1] = 0
+    mask = slipVertex[:,1] < 0.0
+    slipVertex[mask,1] = 0
     slipVertex = numpy.reshape(slipVertex, m)
 
-    print "duI \n", duI
-    print "duJ \n", duJ
+    print "duN \n", duN
+    print "duP \n", duP
 
     dispIncrE = dispIncr
     dispIncrE = numpy.reshape(dispIncrE, n)
 
-    dispIncrE[Lindex] = dispIncrE[Lindex] - dLagrange
-    dispIncrE[Iindex] = dispIncrE[Iindex] - \
+    dispIncrE[indexL] = dispIncrE[indexL] - dLagrange
+    dispIncrE[indexN] = dispIncrE[indexN] - \
         0.5*numpy.dot(C.transpose(), slipVertex)
-    dispIncrE[Jindex] = dispIncrE[Jindex] + \
+    dispIncrE[indexP] = dispIncrE[indexP] + \
         0.5*numpy.dot(C.transpose(), slipVertex)
 
     dispIncrE = numpy.reshape(dispIncrE, (n/DOF,DOF))
@@ -298,9 +300,9 @@
     if cell == "tet4":
 
         dlagrange2 = numpy.zeros(3)
-        Lindex = numpy.arange(24,33)
-        Iindex = numpy.arange(3,12)
-        Jindex = numpy.arange(15,24)
+        indexL = numpy.arange(24,33)
+        indexN = numpy.arange(3,12)
+        indexP = numpy.arange(15,24)
         n = 33
         m = 9
         DOF = 3
@@ -375,9 +377,9 @@
 
     elif cell == "hex8":
         dlagrange2 = numpy.zeros(4)
-        Lindex = numpy.arange(48,60)
-        Iindex = numpy.arange(12,24)
-        Jindex = numpy.arange(36,48)
+        indexL = numpy.arange(48,60)
+        indexN = numpy.arange(12,24)
+        indexP = numpy.arange(36,48)
         n = 60
         m = 12
         DOF = 3
@@ -537,32 +539,34 @@
         dLagrange = numpy.reshape(dLagrange, m)
     elif testCase == "open":
         dLagrange = numpy.reshape(disp+dispIncr, n)
-        dLagrange = dLagrange[Lindex]
+        dLagrange = dLagrange[indexL]
 
     print "dLagrange \n", dLagrange
 
     RHS = numpy.dot(numpy.transpose(C),dLagrange)
-    duI = numpy.dot(inv(jacobianN),RHS)
-    duJ = -numpy.dot(inv(jacobianP),RHS)
+    duN = -numpy.dot(inv(jacobianN),RHS)
+    duP = numpy.dot(inv(jacobianP),RHS)
     
-    dispRel = duI - duJ
+    dispRel = duP - duN
 
     slipVertex = numpy.dot(C,dispRel)
     slipVertex = numpy.reshape(slipVertex, (m/DOF,DOF))
     if testCase == "slip":
         slipVertex[:,2] = 0    
+    mask = slipVertex[:,2] < 0.0
+    slipVertex[mask,2] = 0
     slipVertex = numpy.reshape(slipVertex, m)
 
-    print "duI \n", duI
-    print "duJ \n", duJ
+    print "duN \n", duN
+    print "duP \n", duP
 
     dispIncrE = dispIncr
     dispIncrE = numpy.reshape(dispIncrE, n)
 
-    dispIncrE[Lindex] = dispIncrE[Lindex] - dLagrange
-    dispIncrE[Iindex] = dispIncrE[Iindex] - \
+    dispIncrE[indexL] = dispIncrE[indexL] - dLagrange
+    dispIncrE[indexN] = dispIncrE[indexN] - \
         0.5*numpy.dot(C.transpose(), slipVertex)
-    dispIncrE[Jindex] = dispIncrE[Jindex] + \
+    dispIncrE[indexP] = dispIncrE[indexP] + \
         0.5*numpy.dot(C.transpose(), slipVertex)
 
     dispIncrE = numpy.reshape(dispIncrE, (n/DOF,DOF))



More information about the CIG-COMMITS mailing list