[cig-commits] r18846 - short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology

brad at geodynamics.org brad at geodynamics.org
Tue Aug 23 09:27:16 PDT 2011


Author: brad
Date: 2011-08-23 09:27:16 -0700 (Tue, 23 Aug 2011)
New Revision: 18846

Modified:
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology/SubMesh.cc
Log:
Added error checking to make sure submesh has cells (check max cone size).

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology/SubMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology/SubMesh.cc	2011-08-23 16:26:40 UTC (rev 18845)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology/SubMesh.cc	2011-08-23 16:27:16 UTC (rev 18846)
@@ -139,6 +139,14 @@
   // Set name
   std::string meshLabel = "subdomain_" + std::string(label);
   _mesh->setName(meshLabel);
+
+  if (sieve->getMaxConeSize() <= 0) {
+    std::ostringstream msg;
+    msg << "Error while creating submesh. Submesh '" 
+	<< label << "' does not contain any cells.\n"
+	<< "Submeshes must be one dimension lower than the domain mesh.";
+    throw std::runtime_error(msg.str());
+  } // if
 } // createSubMesh
 
 // ----------------------------------------------------------------------



More information about the CIG-COMMITS mailing list