[cig-commits] [commit] knepley/upgrade-petsc-interface: Debugging: Allow Brad to check example (f40b3d3)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Mar 3 11:51:37 PST 2014


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/40ec07ced2073ebe68dd6602550e9b505fe2fbf2...f40b3d3d5c1975b354d5915ccda6358ce5cd0dcd

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

commit f40b3d3d5c1975b354d5915ccda6358ce5cd0dcd
Author: Matthew G. Knepley <knepley at gmail.com>
Date:   Mon Mar 3 13:51:40 2014 -0600

    Debugging: Allow Brad to check example


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

f40b3d3d5c1975b354d5915ccda6358ce5cd0dcd
 libsrc/pylith/faults/FaultCohesiveLagrange.cc | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libsrc/pylith/faults/FaultCohesiveLagrange.cc b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
index 8dcd264..bca5694 100644
--- a/libsrc/pylith/faults/FaultCohesiveLagrange.cc
+++ b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
@@ -1375,6 +1375,13 @@ pylith::faults::FaultCohesiveLagrange::_calcOrientation(const PylithScalar upDir
 
     PetscErrorCode err = DMPlexGetTransitiveClosure(faultDMMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
 
+#define CHECKING_ORIENTATION
+#ifdef CHECKING_ORIENTATION
+    PetscInt *cl = new PetscInt[closureSize*2];
+    for(PetscInt p = 0; p < closureSize*2; ++p) {cl[p] = closure[p];}
+    err = DMPlexRestoreTransitiveClosure(faultDMMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+    closure = cl;
+#endif
     // Filter out non-vertices
     for(PetscInt p = 0; p < closureSize*2; p += 2) {
       if ((closure[p] >= vStart) && (closure[p] < vEnd)) {
@@ -1384,6 +1391,7 @@ pylith::faults::FaultCohesiveLagrange::_calcOrientation(const PylithScalar upDir
       } // if
     } // for
     closureSize = q;
+
     for(PetscInt v = 0; v < closureSize; ++v) {
       // Compute Jacobian and determinant of Jacobian at vertex
       cellGeometry.jacobian(&jacobian, &jacobianDet, &coordsCell[0], numBasis, spaceDim, &verticesRef[v*cohesiveDim], cohesiveDim);
@@ -1398,7 +1406,11 @@ pylith::faults::FaultCohesiveLagrange::_calcOrientation(const PylithScalar upDir
         orientationArray[ooff+d] += orientationVertex[d];
       } // for
     } // for
+#ifdef CHECKING_ORIENTATION
+    delete [] closure;
+#else
     err = DMPlexRestoreTransitiveClosure(faultDMMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+#endif
   } // for
   orientationVisitor.clear();
 



More information about the CIG-COMMITS mailing list