[cig-commits] r19825 - short/3D/PyLith/trunk/libsrc/pylith/feassemble
brad at geodynamics.org
brad at geodynamics.org
Tue Mar 20 09:05:52 PDT 2012
Author: brad
Date: 2012-03-20 09:05:52 -0700 (Tue, 20 Mar 2012)
New Revision: 19825
Modified:
short/3D/PyLith/trunk/libsrc/pylith/feassemble/CellGeometry.cc
Log:
Merge from stable.
Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/CellGeometry.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/CellGeometry.cc 2012-03-20 15:59:07 UTC (rev 19824)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/CellGeometry.cc 2012-03-20 16:05:52 UTC (rev 19825)
@@ -249,7 +249,15 @@
PylithScalar p2 = upDir[0]*r1 - upDir[1]*r0;
// Make unit vector
mag = sqrt(p0*p0 + p1*p1 + p2*p2);
- assert(mag > 0.0);
+ if (0.0 == mag) {
+ std::ostringstream msg;
+ msg << "Error computing orientation of cell face.\nUp direction ("
+ << upDir[0] << ", " << upDir[1] << ", " << upDir[2] << ") "
+ << " cannot be parallel to the face normal ("
+ << r0 << ", " << r1 << ", " << r2 << ").\n"
+ << "Adjust the up_dir parameter.";
+ throw std::runtime_error(msg.str());
+ } // if
p0 /= mag;
p1 /= mag;
p2 /= mag;
More information about the CIG-COMMITS
mailing list