[cig-commits] r16142 - in short/3D/PyLith/trunk: . libsrc/faults libsrc/problems unittests/libtests/faults

brad at geodynamics.org brad at geodynamics.org
Mon Jan 18 09:51:55 PST 2010


Author: brad
Date: 2010-01-18 09:51:54 -0800 (Mon, 18 Jan 2010)
New Revision: 16142

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc
   short/3D/PyLith/trunk/libsrc/problems/SolverNonlinear.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc
Log:
Minor cleanup.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2010-01-18 06:48:20 UTC (rev 16141)
+++ short/3D/PyLith/trunk/TODO	2010-01-18 17:51:54 UTC (rev 16142)
@@ -28,6 +28,7 @@
   + full-scale testing
   + Code cleanup
 
+    Remove constraintCells from unitests/libtests/faults/data?
 ----------------------------------------------------------------------
 FRICTION
 ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc	2010-01-18 06:48:20 UTC (rev 16141)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc	2010-01-18 17:51:54 UTC (rev 16142)
@@ -19,7 +19,7 @@
 #include "pylith/feassemble/Quadrature.hh" // USES Quadrature
 #include "pylith/feassemble/CellGeometry.hh" // USES CellGeometry
 
-#include "pylith/topology/Mesh.hh" // USES MeshslipTpdtVertex
+#include "pylith/topology/Mesh.hh" // USES Mesh
 #include "pylith/topology/SubMesh.hh" // USES SubMesh
 #include "pylith/topology/Field.hh" // USES Field
 #include "pylith/topology/Fields.hh" // USES Fields

Modified: short/3D/PyLith/trunk/libsrc/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/SolverNonlinear.cc	2010-01-18 06:48:20 UTC (rev 16141)
+++ short/3D/PyLith/trunk/libsrc/problems/SolverNonlinear.cc	2010-01-18 17:51:54 UTC (rev 16142)
@@ -22,9 +22,11 @@
 
 #include "pylith/utils/petscerror.h" // USES CHECK_PETSC_ERROR
 
-#include <cmath>
+// KLUDGE, Fixes issue with PetscIsInfOrNanReal and include cmath
+// instead of math.h.
 #define isnan std::isnan // TEMPORARY
 #define isinf std::isinf // TEMPORARY
+
 #include "../src/snes/impls/ls/ls.h"
 
 // ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc	2010-01-18 06:48:20 UTC (rev 16141)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc	2010-01-18 17:51:54 UTC (rev 16142)
@@ -212,8 +212,7 @@
   //residual.view("RESIDUAL"); // DEBUGGING
 
   { // Check solution values
-    // Lagrange multipliers should be adjusted according to friction
-    // (No change to dispIncr field).
+    // No change to Lagrange multipliers for stick case.
     const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
     CPPUNIT_ASSERT(!sieveMesh.isNull());
     const ALE::Obj<SieveMesh::label_sequence>& vertices =
@@ -254,8 +253,7 @@
   } // Check solution values
 
   { // Check slip values
-    // Slip values should be adjusted based on the change in the
-    // Lagrange multipliers (slip should be zero).
+    // Slip should be zero for the stick case.
 
     // Get fault vertex info
     const ALE::Obj<SieveSubMesh>& faultSieveMesh = fault._faultMesh->sieveMesh();
@@ -273,11 +271,7 @@
       fault._fields->get("slip").section();
     CPPUNIT_ASSERT(!slipSection.isNull());
 
-    // Get expected values
-    //    const double* valsE = _data->slipStickE;
-    double_array slipStickE(4);
-    slipStickE = 0.0;
-    const double* valsE = &slipStickE[0];
+    const double valE = 0.0; // slip should be zero
     int iVertex = 0; // variable to use as index into valsE array
     const int fiberDimE = spaceDim; // number of values per point
     const double tolerance = 1.0e-06;
@@ -293,11 +287,7 @@
       // Check values at point
       for (int i = 0; i < fiberDimE; ++i) {
         const int index = iVertex * spaceDim + i;
-        const double valE = valsE[index];
-        if (fabs(valE) > tolerance)
-          CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[i]/valE, tolerance);
-        else
-          CPPUNIT_ASSERT_DOUBLES_EQUAL(valE, vals[i], tolerance);
+	CPPUNIT_ASSERT_DOUBLES_EQUAL(valE, vals[i], tolerance);
       } // for
     } // for
   } // Check slip values
@@ -444,8 +434,8 @@
   //residual.view("RESIDUAL"); // DEBUGGING
 
   { // Check solution values
-    // Lagrange multipliers should be adjusted according to friction
-    // as reflected in the fieldIncrOpenE data member.
+    // Lagrange multipliers should be set to zero as reflected in the
+    // fieldIncrOpenE data member.
     const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
     CPPUNIT_ASSERT(!sieveMesh.isNull());
     const ALE::Obj<SieveMesh::label_sequence>& vertices =



More information about the CIG-COMMITS mailing list