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

brad at geodynamics.org brad at geodynamics.org
Fri Jun 19 12:12:37 PDT 2009


Author: brad
Date: 2009-06-19 12:12:37 -0700 (Fri, 19 Jun 2009)
New Revision: 15355

Modified:
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
Log:
Fixed error trap.

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc	2009-06-19 19:05:03 UTC (rev 15354)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc	2009-06-19 19:12:37 UTC (rev 15355)
@@ -76,10 +76,6 @@
 
   // Get group of vertices associated with fault
   const ALE::Obj<topology::Mesh::SieveMesh>& sieveMesh = mesh->sieveMesh();
-  assert(!sieveMesh.isNull());
-  const ALE::Obj<topology::Mesh::IntSection>& groupField = 
-    sieveMesh->getIntSection(label());
-  assert(!groupField.isNull());
 
   if (_useFaultMesh) {
     const int faultDim = 2;
@@ -95,6 +91,15 @@
     faultSieveMesh->setRealSection("coordinates", 
 				   sieveMesh->getRealSection("coordinates"));
 
+    if (!sieveMesh->hasIntSection(label())) {
+      std::ostringstream msg;
+      msg << "Mesh missing group of vertices '" << label()
+          << " for fault interface condition.";
+      throw std::runtime_error(msg.str());
+    } // if  
+    const ALE::Obj<topology::Mesh::IntSection>& groupField = 
+      sieveMesh->getIntSection(label());
+    assert(!groupField.isNull());
     CohesiveTopology::create(mesh, faultMesh, faultBoundary, groupField, id(),
 			     _useLagrangeConstraints());
   } else {
@@ -104,7 +109,9 @@
           << " for fault interface condition.";
       throw std::runtime_error(msg.str());
     } // if  
-
+    const ALE::Obj<topology::Mesh::IntSection>& groupField = 
+      sieveMesh->getIntSection(label());
+    assert(!groupField.isNull());
     CohesiveTopology::createFault(&faultMesh, faultBoundary, *mesh, groupField, 
 				  flipFault);
 



More information about the CIG-COMMITS mailing list