[cig-commits] [commit] knepley/fix-faults-parallel: Fault: Fixes for new way of handling hybrid edges - Note that allowing negative v_fault causes a crash (cb2b2b6)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Sat Apr 12 21:19:02 PDT 2014


Repository : ssh://geoshell/pylith

On branch  : knepley/fix-faults-parallel
Link       : https://github.com/geodynamics/pylith/compare/4dcce725b0152244ce91b3920a46eb630f8be495...cb2b2b6872804de20695860572c9871e254dfb28

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

commit cb2b2b6872804de20695860572c9871e254dfb28
Author: Matthew G. Knepley <knepley at gmail.com>
Date:   Sat Apr 12 23:18:53 2014 -0500

    Fault: Fixes for new way of handling hybrid edges
    - Note that allowing negative v_fault causes a crash


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

cb2b2b6872804de20695860572c9871e254dfb28
 libsrc/pylith/faults/FaultCohesiveLagrange.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libsrc/pylith/faults/FaultCohesiveLagrange.cc b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
index d12c954..39e7699 100644
--- a/libsrc/pylith/faults/FaultCohesiveLagrange.cc
+++ b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
@@ -1068,6 +1068,7 @@ void pylith::faults::FaultCohesiveLagrange::_initializeCohesiveInfo(const topolo
   const PetscInt eEnd = edgeStratum.end();
   PetscInt eMax;
   err = DMPlexGetHybridBounds(dmMesh, NULL, NULL, &eMax, NULL);PYLITH_CHECK_ERROR(err);
+  if (eMax < 0) eMax = eEnd;
 
   // Get vertices and cells in fault mesh.
   PetscDM faultDMMesh = _faultMesh->dmMesh();assert(faultDMMesh);
@@ -1104,7 +1105,8 @@ void pylith::faults::FaultCohesiveLagrange::_initializeCohesiveInfo(const topolo
     const PetscInt v_positive = cone[1];
 
     PetscInt v_fault;
-    err = PetscFindInt(v_negative, numPoints, points, &v_fault);PYLITH_CHECK_ERROR(err);assert(v_fault >= 0);
+    err = PetscFindInt(v_negative, numPoints, points, &v_fault);PYLITH_CHECK_ERROR(err);
+    /* v_fault can be < 0 if this hybrid edge is in no normal cohesive cell on this process */
     _cohesiveVertices[index].lagrange = e_lagrange;
     _cohesiveVertices[index].positive = v_positive;
     _cohesiveVertices[index].negative = v_negative;



More information about the CIG-COMMITS mailing list