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

surendra at geodynamics.org surendra at geodynamics.org
Thu Mar 18 22:07:35 PDT 2010


Author: surendra
Date: 2010-03-18 22:07:35 -0700 (Thu, 18 Mar 2010)
New Revision: 16433

Modified:
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc
Log:
Added assertions to avoid division by zero in construction of Sensitivity matrix

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc	2010-03-17 23:53:49 UTC (rev 16432)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc	2010-03-19 05:07:35 UTC (rev 16433)
@@ -1649,6 +1649,8 @@
  // Determinant of 2 X 2 block of Jacobian on each side of the fault
  const double Deti = Aixx * Aiyy - Aixy*Aiyx;
  const double Detj = Ajxx * Ajyy - Ajxy*Ajyx;
+ assert(Deti > 0.0);
+ assert(Detj > 0.0);
 
  // Co-factor matrix for i side of fault
  const double Ci11 = Aiyy;
@@ -1802,6 +1804,8 @@
    Aixy * (Aiyz * Aizx - Aiyx * Aizz) + Aixx * (-Aiyz * Aizy + Aiyy * Aizz);
  const double Detj = Ajxz * (-Ajyy * Ajzx + Ajyx * Ajzy) +
    Ajxy * (Ajyz * Ajzx - Ajyx * Ajzz) + Ajxx * (-Ajyz * Ajzy + Ajyy * Ajzz);
+ assert(Deti > 0.0);
+ assert(Detj > 0.0);
 
  // Co-factor matrix for i side of fault
  const double Ci11 = Aiyz * Aizy + Aiyy * Aizz;



More information about the CIG-COMMITS mailing list