[cig-commits] r16965 - short/3D/PyLith/trunk/libsrc/faults

brad at geodynamics.org brad at geodynamics.org
Wed Jun 9 17:23:57 PDT 2010


Author: brad
Date: 2010-06-09 17:23:57 -0700 (Wed, 09 Jun 2010)
New Revision: 16965

Modified:
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveLagrange.cc
Log:
Fixed assignment of dip-dir in 3-D. OLD: Rely on normal direction to pick dip-dir. NOW: Use user-specified up-dir and dip-dir and normal-dir to get positive reverse-slip for dipping faults.

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveLagrange.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveLagrange.cc	2010-06-09 23:09:28 UTC (rev 16964)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveLagrange.cc	2010-06-10 00:23:57 UTC (rev 16965)
@@ -1715,10 +1715,8 @@
       } // for
       PetscLogFlops(3 + count * 2);
     } // if
-  } // if
 
-
-  if (2 == cohesiveDim && vertices->size() > 0) {
+  } else if (2 == cohesiveDim && vertices->size() > 0) {
     // Check orientation of first vertex, if dot product of fault
     // normal with preferred normal is negative, flip up/down dip
     // direction.
@@ -1740,14 +1738,21 @@
       &orientationVertex[0], orientationVertex.size());
 
     assert(3 == spaceDim);
-    double_array normalDirVertex(&orientationVertex[6], 3);
-    const double normalDot = normalDir[0] * normalDirVertex[0] + normalDir[1]
-        * normalDirVertex[1] + normalDir[2] * normalDirVertex[2];
+    const double* dipDirVertex = &orientationVertex[3];
+    const double* normalDirVertex = &orientationVertex[6];
+    const double dipDirDot = 
+      upDir[0]*dipDirVertex[0] + 
+      upDir[1]*dipDirVertex[1] + 
+      upDir[2]*dipDirVertex[2];
+    const double normalDirDot = 
+      upDir[0]*normalDirVertex[0] +
+      upDir[1]*normalDirVertex[1] +
+      upDir[2]*normalDirVertex[2];
 
     const int istrike = 0;
     const int idip = 3;
     const int inormal = 6;
-    if (normalDot < 0.0) {
+    if (dipDirDot * normalDirDot < 0.0) {
       // Flip dip direction
       for (SieveSubMesh::label_sequence::iterator v_iter = verticesBegin; v_iter
           != verticesEnd; ++v_iter) {



More information about the CIG-COMMITS mailing list