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

brad at geodynamics.org brad at geodynamics.org
Tue Aug 23 13:04:54 PDT 2011


Author: brad
Date: 2011-08-23 13:04:54 -0700 (Tue, 23 Aug 2011)
New Revision: 18847

Modified:
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5.cc
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
Log:
Added more error checking for output. Verify cone sizes are consistent with initial determination of cone size.

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5.cc	2011-08-23 16:27:16 UTC (rev 18846)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5.cc	2011-08-23 20:04:54 UTC (rev 18847)
@@ -185,8 +185,17 @@
 	const typename ALE::ISieveVisitor::NConeRetriever<sieve_type>::oriented_point_type* cone =
 	  ncV.getOrientedPoints();
 	const int coneSize = ncV.getOrientedSize();
-          for (int c=0; c < coneSize; ++c)
-            tmpVertices[k++] = vNumbering->getIndex(cone[c].first);
+	if (coneSize != numCorners) {
+	  std::ostringstream msg;
+	  msg << "Inconsistency in topology found for mesh '"
+	      << sieveMesh->getName() << "' during output.\n"
+	      << "Number of vertices (" << coneSize << ") in cell '"
+	      << *c_iter << "' does not expected number of vertices ("
+	      << numCorners << ").";
+	  throw std::runtime_error(msg.str());
+	} // if
+	for (int c=0; c < coneSize; ++c)
+	  tmpVertices[k++] = vNumbering->getIndex(cone[c].first);
       } // if
 
     PetscVec elemVec;

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2011-08-23 16:27:16 UTC (rev 18846)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2011-08-23 20:04:54 UTC (rev 18847)
@@ -201,8 +201,17 @@
 	const typename ALE::ISieveVisitor::NConeRetriever<sieve_type>::oriented_point_type* cone =
 	  ncV.getOrientedPoints();
 	const int coneSize = ncV.getOrientedSize();
-          for (int c=0; c < coneSize; ++c)
-            tmpVertices[k++] = vNumbering->getIndex(cone[c].first);
+	if (coneSize != numCorners) {
+	  std::ostringstream msg;
+	  msg << "Inconsistency in topology found for mesh '"
+	      << sieveMesh->getName() << "' during output.\n"
+	      << "Number of vertices (" << coneSize << ") in cell '"
+	      << *c_iter << "' does not expected number of vertices ("
+	      << numCorners << ").";
+	  throw std::runtime_error(msg.str());
+	} // if
+	for (int c=0; c < coneSize; ++c)
+	  tmpVertices[k++] = vNumbering->getIndex(cone[c].first);
       } // if
 
     PetscVec elemVec;



More information about the CIG-COMMITS mailing list