[cig-commits] [commit] knepley/fix-faults-parallel: Faults: Removed clamped vertex kludge, since now we fix the fault boundary (8db09a4)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue May 6 09:09:37 PDT 2014


Repository : ssh://geoshell/pylith

On branch  : knepley/fix-faults-parallel
Link       : https://github.com/geodynamics/pylith/compare/91a41ca5f30febe7837268273d5918eb2b6cdfaa...8db09a41c2c343e14056a2efdabe319d8fa7fe5b

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

commit 8db09a41c2c343e14056a2efdabe319d8fa7fe5b
Author: Matthew G. Knepley <knepley at gmail.com>
Date:   Tue May 6 11:09:33 2014 -0500

    Faults: Removed clamped vertex kludge, since now we fix the fault boundary


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

8db09a41c2c343e14056a2efdabe319d8fa7fe5b
 libsrc/pylith/faults/FaultCohesiveLagrange.cc | 63 ++++++++++-----------------
 1 file changed, 24 insertions(+), 39 deletions(-)

diff --git a/libsrc/pylith/faults/FaultCohesiveLagrange.cc b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
index 9ef9787..ddd0fb9 100644
--- a/libsrc/pylith/faults/FaultCohesiveLagrange.cc
+++ b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
@@ -1448,39 +1448,29 @@ pylith::faults::FaultCohesiveLagrange::_calcOrientation(const PylithScalar upDir
       
       // Filter out non-vertices
       PetscInt numVertices = 0;
-      bool hasClampedVertex = false;
       for(PetscInt p = 0; p < closureSize*2; p += 2) {
-	if ((closure[p] >= vStart) && (closure[p] < vEnd)) {
-	  // :KLUDGE: Filter out clamped vertices. Remove this when fault edges are clamped.
-	  if (isClampedVertex(clamped, closure[p])) {
-	    hasClampedVertex = true;
-	  } // if
-
-	  closure[numVertices*2]   = closure[p];
-	  closure[numVertices*2+1] = closure[p+1];
-	  ++numVertices;
-	} // if
+        if ((closure[p] >= vStart) && (closure[p] < vEnd)) {
+          closure[numVertices*2]   = closure[p];
+          closure[numVertices*2+1] = closure[p+1];
+          ++numVertices;
+        } // if
       } // for
-      if (hasClampedVertex) {
-	err = DMPlexRestoreTransitiveClosure(faultDMMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
-	continue;
-      } // if
 
       for(PetscInt v = 0; v < numVertices; ++v) {
-	const PetscInt v_fault = closure[v*2];
+        const PetscInt v_fault = closure[v*2];
 
-	// Compute Jacobian and determinant of Jacobian at vertex
-	cellGeometry.jacobian(&jacobian, &jacobianDet, &coordsCell[0], numBasis, spaceDim, &verticesRef[v*cohesiveDim], cohesiveDim);
+        // Compute Jacobian and determinant of Jacobian at vertex
+        cellGeometry.jacobian(&jacobian, &jacobianDet, &coordsCell[0], numBasis, spaceDim, &verticesRef[v*cohesiveDim], cohesiveDim);
 	
-	// Compute orientation
-	cellGeometry.orientation(&orientationVertex, jacobian, jacobianDet, up);
+        // Compute orientation
+        cellGeometry.orientation(&orientationVertex, jacobian, jacobianDet, up);
 	
-	// Update orientation
-	const PetscInt ooff = orientationVisitor.sectionOffset(v_fault);
+        // Update orientation
+        const PetscInt ooff = orientationVisitor.sectionOffset(v_fault);
 	
-	for(PetscInt d = 0; d < orientationSize; ++d) {
-	  orientationArray[ooff+d] += orientationVertex[d];
-	} // for
+        for(PetscInt d = 0; d < orientationSize; ++d) {
+          orientationArray[ooff+d] += orientationVertex[d];
+        } // for
       } // for
       err = DMPlexRestoreTransitiveClosure(faultDMMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
     } // for
@@ -1505,11 +1495,6 @@ pylith::faults::FaultCohesiveLagrange::_calcOrientation(const PylithScalar upDir
   orientationArray = orientationVisitor.localArray();
   int count = 0;
   for(PetscInt v = vStart; v < vEnd; ++v, ++count) {
-    // :KLUDGE: Filter out clamped vertices. Remove this when fault edges are clamped.
-    if (isClampedVertex(clamped, v)) {
-      continue;
-    } // if
-
     assert(orientationSize == orientationVisitor.sectionDof(v));
     const PetscInt ooff = orientationVisitor.sectionOffset(v);
     for(PetscInt d = 0; d < orientationSize; ++d) {
@@ -1522,15 +1507,15 @@ pylith::faults::FaultCohesiveLagrange::_calcOrientation(const PylithScalar upDir
       } // for
 
       if (mag <= 0.0) {
-	std::ostringstream msg;
-	msg << "Error calculating fault orientation at fault vertex " << v << ".\n" 
-	    << "Zero vector in parallel likely indicates inconsistent fault orientation (creation) across processors.\n"
-	    << "Orientation vector " << iDim << ": (";
-	for (int jDim = 0, index = iDim * spaceDim; jDim < spaceDim; ++jDim) {
-	  msg << " " << orientationVertex[index + jDim];
-	} // for
-	msg << " )" << std::endl;
-	throw std::runtime_error(msg.str());
+        std::ostringstream msg;
+        msg << "Error calculating fault orientation at fault vertex " << v << ".\n" 
+            << "Zero vector in parallel likely indicates inconsistent fault orientation (creation) across processors.\n"
+            << "Orientation vector " << iDim << ": (";
+        for (int jDim = 0, index = iDim * spaceDim; jDim < spaceDim; ++jDim) {
+          msg << " " << orientationVertex[index + jDim];
+        } // for
+        msg << " )" << std::endl;
+        throw std::runtime_error(msg.str());
       } // if
 
       mag = sqrt(mag);



More information about the CIG-COMMITS mailing list