[cig-commits] [commit] baagaard/dynrup-new-lagrange: Update test data for FaultCohesiveDyn 2-D unit tests. (54b8f6c)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 15:40:42 PST 2014


Repository : https://github.com/geodynamics/pylith

On branch  : baagaard/dynrup-new-lagrange
Link       : https://github.com/geodynamics/pylith/compare/f33c75b19fd60eedb2a3405db76a1fee333bb1d7...5b6d812b1612809fea3bd331c4e5af98c25a536a

>---------------------------------------------------------------

commit 54b8f6c77e6f1f5503118603d247bd174d277be6
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Mon Jun 9 18:03:09 2014 -0700

    Update test data for FaultCohesiveDyn 2-D unit tests.


>---------------------------------------------------------------

54b8f6c77e6f1f5503118603d247bd174d277be6
 .../libtests/faults/data/CohesiveDynDataQuad4.cc   |  78 +++----
 .../libtests/faults/data/CohesiveDynDataTri3.cc    |   8 +-
 .../libtests/faults/data/CohesiveDynDataTri3d.cc   |  86 +++----
 unittests/libtests/faults/data/cohesivedyn.py      | 247 +++++++++++----------
 4 files changed, 214 insertions(+), 205 deletions(-)

diff --git a/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc b/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
index 970cb87..70eccae 100644
--- a/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
+++ b/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
@@ -299,7 +299,7 @@ const int pylith::faults::CohesiveDynDataQuad4::_negativeVertices[] = {
 // Stick case
 // ----------------------------------------------------------------------
 // Input
-const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrStick[] = {
+const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrStick[10*2] = {
   1.1, 2.1,
   1.4, 2.4,
   1.2, 2.2, // 4
@@ -309,28 +309,28 @@ const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrStick[] = {
   1.2, 2.2, // 8
   1.3, 2.3, // 9
  -21.6,  2.6, // 19
- -21.6,  2.5, // 20
+ -21.8,  2.5, // 20
 };
 
 // Output
-const PylithScalar pylith::faults::CohesiveDynDataQuad4::_residualStickE[] = {
-  1.1, 2.1,
-  1.4, 2.4,
-  1.2, 2.2, // 4
-  1.3, 2.3, // 5
-  1.5, 2.5,
-  1.6, 2.6,
-  1.2, 2.2, // 8
-  1.3, 2.3, // 9
- -21.6,  2.6, // 19
- -21.6,  2.5, // 20
+const PylithScalar pylith::faults::CohesiveDynDataQuad4::_residualStickE[10*2] = {
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   5.9200000000e-03,
+   0.0000000000e+00,   6.0600000000e-03,
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+  -0.0000000000e+00,  -5.9200000000e-03,
+  -0.0000000000e+00,  -6.0600000000e-03,
+  -0.0000000000e+00,   4.8800000000e-03,
+  -0.0000000000e+00,   6.1500000000e-03,
 };
 
 // ----------------------------------------------------------------------
 // Slip case
 // ----------------------------------------------------------------------
 // Input
-const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrSlip[] = {
+const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrSlip[10*2] = {
   1.1, 2.1,
   1.2, 2.2,
   1.2, 2.2, // 4
@@ -344,17 +344,17 @@ const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrSlip[] = {
 };
 
 // Output
-const PylithScalar pylith::faults::CohesiveDynDataQuad4::_residualSlipE[] = {
-   1.100000000000,   2.100000000000,
-   1.200000000000,   2.200000000000,
-   1.200000000000,   2.200157498929,
-   1.300000000000,   2.300968885890,
-   1.500000000000,   2.500000000000,
-   1.600000000000,   2.600000000000,
-   1.200000000000,   2.199842501071,
-   1.300000000000,   2.299031114110,
-  -1.600000000000,  -3.480000000000,
-  -1.800000000000,  -3.440000000000,
+const PylithScalar pylith::faults::CohesiveDynDataQuad4::_residualSlipE[10*2] = {
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,  -6.0800000000e-03,
+   0.0000000000e+00,  -5.9400000000e-03,
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+  -0.0000000000e+00,   6.0800000000e-03,
+  -0.0000000000e+00,   5.9400000000e-03,
+  -0.0000000000e+00,   4.8800000000e-03,
+  -0.0000000000e+00,   6.1500000000e-03,
 };
 
 // ----------------------------------------------------------------------
@@ -368,24 +368,24 @@ const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrOpen[] = {
   1.3, 2.3, // 5
   1.5, 2.5,
   1.6, 2.6,
-  1.2, 2.2, // 8
-  1.3, 2.3, // 9
-  +10.6, -12.6, // 10
-  +10.8, -12.8, // 11
+  1.3, 2.7, // 8
+  1.4, 2.6, // 9
+  +10.6, -2.6, // 10
+  +10.8, -2.8, // 11
 };
 
 // Output
 const PylithScalar pylith::faults::CohesiveDynDataQuad4::_residualOpenE[] = {
-   1.100000000000,   2.100000000000,
-   1.200000000000,   2.200000000000,
-   1.199388886535,   2.200357375764,
-   1.299417086548,   2.300039516147,
-   1.500000000000,   2.500000000000,
-   1.600000000000,   2.600000000000,
-   1.200611113465,   2.199642624236,
-   1.300582913452,   2.299960483853,
-   8.600000000000,  -9.600000000000,
-   8.800000000000,  -9.800000000000,
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+  -2.0000000000e-03,  -7.0000000000e-03,
+  -2.0000000000e-03,  -7.0000000000e-03,
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+   2.0000000000e-03,   7.0000000000e-03,
+   2.0000000000e-03,   7.0000000000e-03,
+   2.0000000000e-04,   6.3000000000e-03,
+   2.0000000000e-04,   5.6000000000e-03,
 };
 
 // ----------------------------------------------------------------------
diff --git a/unittests/libtests/faults/data/CohesiveDynDataTri3.cc b/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
index 8ec71ce..eec450b 100644
--- a/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
+++ b/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
@@ -338,11 +338,11 @@ const PylithScalar pylith::faults::CohesiveDynDataTri3::_fieldIncrOpen[] = {
 // Output
 const PylithScalar pylith::faults::CohesiveDynDataTri3::_residualOpenE[] = {
    0.0000000000e+00,   0.0000000000e+00,
-   0.0000000000e+00,  -2.0000000000e-04,
-   0.0000000000e+00,  -2.0000000000e-04,
+  -2.0000000000e-03,   1.0000000000e-03,
+  -2.0000000000e-03,   1.0000000000e-03,
    0.0000000000e+00,   0.0000000000e+00,
-  -0.0000000000e+00,   2.0000000000e-04,
-  -0.0000000000e+00,   2.0000000000e-04,
+   2.0000000000e-03,  -1.0000000000e-03,
+   2.0000000000e-03,  -1.0000000000e-03,
    6.0000000000e-04,  -3.0000000000e-04,
    6.0000000000e-04,  -3.0000000000e-04,
 };
diff --git a/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc b/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
index fdc8f14..d29ff01 100644
--- a/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
+++ b/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
@@ -107,7 +107,7 @@ const char* pylith::faults::CohesiveDynDataTri3d::_label = "fault";
 const char* pylith::faults::CohesiveDynDataTri3d::_initialTractFilename = 
   "data/tri3d_initialtract.spatialdb";
 
-const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldT[] = {
+const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldT[12*2] = {
   6.1, 8.1,
   6.2, 8.2, // 7
   6.3, 8.3, // 8
@@ -451,7 +451,7 @@ const PylithScalar pylith::faults::CohesiveDynDataTri3d::_initialTractions[] = {
 // Stick case
 // ----------------------------------------------------------------------
 // Input
-const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrStick[] = {
+const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrStick[12*2] = {
   1.1, 2.1,
   1.2, 2.2, // 5
   1.3, 2.3, // 6
@@ -467,26 +467,26 @@ const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrStick[] = {
 };
 
 // Output
-const PylithScalar pylith::faults::CohesiveDynDataTri3d::_residualStickE[] = {
-  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.2, 2.2, // 10
-  1.3, 2.3, // 11
-  1.5, 2.5, // 12
- -21.8,-22.8, // 26
- -21.0, 2.0, // 27
-  2.2,-22.2, // 28
+const PylithScalar pylith::faults::CohesiveDynDataTri3d::_residualStickE[12*2] = {
+   0.0000000000e+00,   0.0000000000e+00,
+   2.9920000000e-02,  -2.9920000000e-02,
+   0.0000000000e+00,   8.4000000000e-03,
+   0.0000000000e+00,   0.0000000000e+00,
+   1.0440000000e-02,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+  -2.9920000000e-02,   2.9920000000e-02,
+  -0.0000000000e+00,  -8.4000000000e-03,
+  -1.0440000000e-02,  -0.0000000000e+00,
+  -0.0000000000e+00,  -0.0000000000e+00,
+  -0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,  -0.0000000000e+00,
 };
 
 // ----------------------------------------------------------------------
 // Slip case
 // ----------------------------------------------------------------------
 // Input
-const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrSlip[] = {
+const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrSlip[12*2] = {
   1.1, 2.1,
   1.2, 2.2, // 5
   1.3, 2.3, // 6
@@ -502,26 +502,26 @@ const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrSlip[] = {
 };
 
 // Output
-const PylithScalar pylith::faults::CohesiveDynDataTri3d::_residualSlipE[] = {
-   1.100000000000,   2.100000000000,
-   1.199970441179,   2.200029558821,
-   1.300000000000,   2.299168310929,
-   1.400000000000,   2.400000000000,
-   1.499489949674,   2.500000000000,
-   1.600000000000,   2.600000000000,
-   1.200029558821,   2.199970441179,
-   1.300000000000,   2.300831689071,
-   1.500510050326,   2.500000000000,
-  -1.640000000000,   3.440000000000,
-  -1.000000000000,  -1.600000000000,
-   0.040000000000,  -1.200000000000,
+const PylithScalar pylith::faults::CohesiveDynDataTri3d::_residualSlipE[12*2] = {
+   0.0000000000e+00,   0.0000000000e+00,
+   3.2000000000e-04,  -3.2000000000e-04,
+   0.0000000000e+00,  -2.7000000000e-03,
+   0.0000000000e+00,   0.0000000000e+00,
+  -1.6600000000e-03,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+  -3.2000000000e-04,   3.2000000000e-04,
+  -0.0000000000e+00,   2.7000000000e-03,
+   1.6600000000e-03,  -0.0000000000e+00,
+  -0.0000000000e+00,  -0.0000000000e+00,
+  -0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,  -0.0000000000e+00,
 };
 
 // ----------------------------------------------------------------------
 // Open case
 // ----------------------------------------------------------------------
 // Input
-const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrOpen[] = {
+const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrOpen[12*2] = {
   1.1, 2.1,
   1.2, 2.2, // 5
   1.3, 2.3, // 6
@@ -537,19 +537,19 @@ const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrOpen[] = {
 };
 
 // Output
-const PylithScalar pylith::faults::CohesiveDynDataTri3d::_residualOpenE[] = {
-   1.100000000000,   2.100000000000,
-   1.190062443638,   2.192265294477,
-   1.292981353233,   2.293412522606,
-   1.400000000000,   2.400000000000,
-   1.495037703623,   2.494851226153,
-   1.600000000000,   2.600000000000,
-   1.209937556362,   2.207734705523,
-   1.307018646767,   2.306587477394,
-   1.504962296377,   2.505148773847,
-   3.800000000000,   4.800000000000,
-   3.000000000000,  -4.000000000000,
-  -3.200000000000,   4.200000000000,
+const PylithScalar pylith::faults::CohesiveDynDataTri3d::_residualOpenE[12*2] = {
+   0.0000000000e+00,   0.0000000000e+00,
+  -1.6000000000e-02,  -1.4000000000e-02,
+  -7.0000000000e-03,  -4.1000000000e-03,
+   0.0000000000e+00,   0.0000000000e+00,
+  -4.4000000000e-03,  -6.0000000000e-03,
+   0.0000000000e+00,   0.0000000000e+00,
+   1.6000000000e-02,   1.4000000000e-02,
+   7.0000000000e-03,   4.1000000000e-03,
+   4.4000000000e-03,   6.0000000000e-03,
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
+   0.0000000000e+00,   0.0000000000e+00,
 };
 
 // ----------------------------------------------------------------------
diff --git a/unittests/libtests/faults/data/cohesivedyn.py b/unittests/libtests/faults/data/cohesivedyn.py
index 8fa3892..a245067 100644
--- a/unittests/libtests/faults/data/cohesivedyn.py
+++ b/unittests/libtests/faults/data/cohesivedyn.py
@@ -1,5 +1,5 @@
-cell = "tri3"
-testCase = "slip"
+cell = "tri3d"
+testCase = "open"
 
 import numpy
 
@@ -45,7 +45,7 @@ def faultToGlobal(v, R):
 
 
 # ----------------------------------------------------------------------
-if cell == "tri3" or cell == "tri3d" or cell == "quad4":
+if cell in ["tri3", "tri3d", "quad4"]:
     if cell == "tri3":
         indexL = numpy.arange(6,8)
         indexN = numpy.arange(1,3)
@@ -82,14 +82,14 @@ if cell == "tri3" or cell == "tri3d" or cell == "quad4":
                                       [-21.6, 2.6,],
                                       [-21.8, 2.8,],])            
         elif testCase == "slip":
-            fieldTIncr = numpy.array([[ 9.1, 7.1,],
-                                      [ 9.2, 7.2,],
-                                      [ 9.3, 7.3,],
-                                      [ 9.4, 7.4,],
-                                      [ 9.2, 7.5,],
-                                      [ 9.3, 7.6,],
+            fieldTIncr = numpy.array([[ 1.1, 2.1,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [ 1.4, 2.4,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.3, 2.3,],
                                       [-1.6, 2.6,],
-                                      [-1.8, 2.8,],])            
+                                      [-1.8, 2.5,],])            
         elif testCase == "open":
             fieldTIncr = numpy.array([[ 9.1, 7.1,],
                                       [ 9.2, 7.2,],
@@ -102,28 +102,16 @@ if cell == "tri3" or cell == "tri3d" or cell == "quad4":
 
 
     elif cell == "tri3d":
-        dlagrange1 = numpy.zeros(3)
-        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
+        indexL = numpy.array([9, 10, 11])
+        indexN = numpy.array([1, 2, 4])
+        indexP = numpy.array([6, 7, 8])
+        n = 12
+        m = 3
         DOF = 2
 
-        fieldT = numpy.array([[-3.8,-4.8],
-                              [-3.0, 4.0],
-                              [3.2, -4.2]])
-        fieldIncr = numpy.array([[-1.8,+3.6],
-                                 [-1.0, 1.1],
-                                 [ 1.7,-1.2]])
-
-        L = numpy.array([[2.0, 0.0, 0.0, 0.0, 0.0, 0.0],
-                         [0.0, 2.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, 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]])
-
+        L = numpy.array([[2.0, 0.0, 0.0],
+                         [0.0, 1.0, 0.0],
+                         [0.0, 0.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,],
@@ -131,103 +119,119 @@ if cell == "tri3" or cell == "tri3d" or cell == "quad4":
                          [0.0, 0.0, 0.0, 0.0, -1.0, 0.0,],
                          [0.0, 0.0, 0.0, 0.0, 0.0, +1.0,],])
     
-        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.2, 8.2,],
-                            [ 6.3, 8.3,],
-                            [ 6.5, 8.5,],
-                            [-3.8,-4.8,],
-                            [-3.0, 4.0,],
-                            [ 3.2,-4.2,],])
+        fieldT = 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.2, 8.2,],
+                              [ 6.3, 8.3,],
+                              [ 6.5, 8.5,],
+                              [-3.8,-4.8,],
+                              [-3.0, 4.0,],
+                              [ 3.2,-4.2,],])
 
-        if testCase == "slip":
-            dispIncr = numpy.array([[ 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.2, 2.2,],
-                                    [ 1.3, 2.3,],
-                                    [ 1.5, 2.5,],
-                                    [-1.8,+3.6,],
-                                    [-1.0, 1.1,],
-                                    [ 1.7,-1.2,],])            
+        if testCase == "stick":
+            fieldTIncr = numpy.array([[ 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.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [ 1.5, 2.5,],
+                                      [-21.8,-22.8,],
+                                      [-21.0, 2.0,],
+                                      [ 2.2,-22.2,],])            
+        elif testCase == "slip":
+            fieldTIncr = numpy.array([[ 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.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [ 1.5, 2.5,],
+                                      [-1.8,+3.6,],
+                                      [-1.0, 1.1,],
+                                      [ 1.7,-1.2,],])            
         elif testCase == "open":
-            dispIncr = numpy.array([[ 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.2, 2.2,],
-                                    [ 1.3, 2.3,],
-                                    [ 1.5, 2.5,],
-                                    [+11.8, 11.8,],
-                                    [+10.0, 0.1,],
-                                    [ 1.2, +10.2,],])            
+            fieldTIncr = numpy.array([[ 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.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [ 1.5, 2.5,],
+                                      [+11.8, 11.8,],
+                                      [+10.0, 0.1,],
+                                      [ 1.2, +10.2,],])            
 
 
     elif cell == "quad4":
-        dlagrange1 = numpy.zeros(2)
-        indexL = numpy.arange(16,20)
-        indexN = numpy.arange(4,8)
-        indexP = numpy.arange(12,16)
-        n = 20
-        m = 4
+        indexL = numpy.arange(8,10)
+        indexN = numpy.arange(2,4)
+        indexP = numpy.arange(6,8)
+        n = 10
+        m = 2
         DOF = 2
 
-        fieldT = numpy.array([[-8.6, 9.6],
-                              [-8.8, 9.8]])
-        fieldIncr = numpy.array([[-1.6, 2.6],
-                                 [-1.8, 2.5]])
-        L = numpy.array([[1.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, 1.0,],]);
+        L = numpy.array([1.0, 1.0, 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,],]);
     
 
-        disp = numpy.array([[ 8.1, 9.1,],
-                            [ 8.3, 9.3,],
-                            [ 8.2, 9.2,],
-                            [ 8.3, 9.3,],
-                            [ 8.5, 9.5,],
-                            [ 8.6, 9.6,],
-                            [ 8.2, 9.6,],
-                            [ 8.3, 9.8,],
-                            [-8.6, 9.6,],
-                            [-8.8, 9.8,],])
+        fieldT = numpy.array([[ 8.1, 9.1,],
+                              [ 8.3, 9.3,],
+                              [ 8.2, 9.2,],
+                              [ 8.3, 9.3,],
+                              [ 8.5, 9.5,],
+                              [ 8.6, 9.6,],
+                              [ 8.2, 9.6,],
+                              [ 8.3, 9.8,],
+                              [-8.6, 9.6,],
+                              [-8.8, 9.8,],])
 
-        if testCase == "slip":
-            dispIncr = numpy.array([[ 1.1, 2.1,],
-                                    [ 1.2, 2.2,],
-                                    [ 1.2, 2.2,],
-                                    [ 1.3, 2.3,],
-                                    [ 1.5, 2.5,],
-                                    [ 1.6, 2.6,],
-                                    [ 1.2, 2.2,],
-                                    [ 1.3, 2.3,],
-                                    [-1.6, 2.6,],
-                                    [-1.8, 2.5,],])            
+        if testCase == "stick":
+            fieldTIncr = numpy.array([[ 1.1, 2.1,],
+                                      [ 1.4, 2.4,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [ 1.5, 2.5,],
+                                      [ 1.6, 2.6,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [-21.6, 2.6,],
+                                      [-21.8, 2.5,],])
+        elif testCase == "slip":
+            fieldTIncr = numpy.array([[ 1.1, 2.1,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [ 1.5, 2.5,],
+                                      [ 1.6, 2.6,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [-1.6, 2.6,],
+                                      [-1.8, 2.5,],])
         elif testCase == "open":
-            dispIncr = numpy.array([[ 1.1, 2.1,],
-                                    [ 1.2, 2.2,],
-                                    [ 1.2, 2.2,],
-                                    [ 1.3, 2.3,],
-                                    [ 1.5, 2.5,],
-                                    [ 1.6, 2.6,],
-                                    [ 1.2, 2.2,],
-                                    [ 1.3, 2.3,],
-                                    [+10.6, -12.6,],
-                                    [+10.8, -12.8,],])            
+            fieldTIncr = numpy.array([[ 1.1, 2.1,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.2, 2.2,],
+                                      [ 1.3, 2.3,],
+                                      [ 1.5, 2.5,],
+                                      [ 1.6, 2.6,],
+                                      [ 1.3, 2.7,],
+                                      [ 1.4, 2.6,],
+                                      [+10.6, -2.6,],
+                                      [+10.8, -2.8,],])
 
 
     # ------------------------------------------------------------------
@@ -236,26 +240,31 @@ if cell == "tri3" or cell == "tri3d" or cell == "quad4":
     fieldTpdt = (fieldT + fieldTIncr) / lengthScale
     fieldTpdtFault = globalToFault(fieldTpdt[indexL,:], C)
 
-    tractionShear = abs(fieldTpdtFault[:,0])
+    tractionShear = fieldTpdtFault[:,0]
     tractionNormal = fieldTpdtFault[:,1]
 
+    print "fieldTpdt",fieldTpdt
+
     print "tractionShear",tractionShear
     print "tractionNormal",tractionNormal
 
     tractionRheologyFault = numpy.zeros((m, DOF))
-    tractionRheologyFault[:,0] = -0.6 * tractionNormal;
-    tractionRheologyFault[:,1] = tractionNormal
-    print "tractionRheology",tractionRheologyFault
+    if testCase != "open":
+        tractionRheologyFault[:,0] = -0.6 * tractionNormal * tractionShear/numpy.abs(tractionShear)
+        tractionRheologyFault[:,1] = tractionNormal
+    print "tractionRheologyFault",tractionRheologyFault
 
     tractionRheology = faultToGlobal(tractionRheologyFault, C)
     tractionInternal = fieldTpdt[indexL,:]
     tractionResidual = tractionRheology - tractionInternal
+    print "tractionRheology",tractionRheology
+    print "tractionInternal",tractionInternal
     print "tractionResidual",tractionResidual
 
     residual = numpy.zeros(fieldT.shape)
-    residual[indexN,:] = +tractionResidual
-    residual[indexP,:] = -tractionResidual
-    residual[indexL,:] = tractionInternal * (fieldTpdt[indexP,:] - fieldTpdt[indexN,:]) * lagrangeScale
+    residual[indexN,:] = +numpy.dot(L, tractionResidual)
+    residual[indexP,:] = -numpy.dot(L, tractionResidual)
+    residual[indexL,:] = numpy.dot(L, tractionInternal) * (fieldTpdt[indexP,:] - fieldTpdt[indexN,:]) * lagrangeScale
 
     print "residual \n",printdata(residual)
 



More information about the CIG-COMMITS mailing list