[cig-commits] r14311 - in short/3D/PyLith/branches/pylith-swig: . libsrc libsrc/bc libsrc/feassemble libsrc/topology modulesrc/topology modulesrc/utils pylith pylith/bc pylith/feassemble unittests/libtests/topology unittests/pytests/bc unittests/pytests/feassemble unittests/pytests/topology

brad at geodynamics.org brad at geodynamics.org
Thu Mar 12 17:47:38 PDT 2009


Author: brad
Date: 2009-03-12 17:47:38 -0700 (Thu, 12 Mar 2009)
New Revision: 14311

Modified:
   short/3D/PyLith/branches/pylith-swig/TODO
   short/3D/PyLith/branches/pylith-swig/libsrc/Makefile.am
   short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.hh
   short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.hh
   short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityExplicit.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityExplicit.hh
   short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.hh
   short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh
   short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.icc
   short/3D/PyLith/branches/pylith-swig/libsrc/topology/Makefile.am
   short/3D/PyLith/branches/pylith-swig/libsrc/topology/topologyfwd.hh
   short/3D/PyLith/branches/pylith-swig/modulesrc/topology/Makefile.am
   short/3D/PyLith/branches/pylith-swig/modulesrc/topology/topology.i
   short/3D/PyLith/branches/pylith-swig/modulesrc/utils/petsc.i
   short/3D/PyLith/branches/pylith-swig/pylith/Makefile.am
   short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py
   short/3D/PyLith/branches/pylith-swig/pylith/bc/BoundaryCondition.py
   short/3D/PyLith/branches/pylith-swig/pylith/feassemble/Integrator.py
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/Makefile.am
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestAbsorbingDampers.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestDirichletBC.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/testbc.py
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/Makefile.am
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/Makefile.am
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py
Log:
Updated to use Jacobian.

Modified: short/3D/PyLith/branches/pylith-swig/TODO
===================================================================
--- short/3D/PyLith/branches/pylith-swig/TODO	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/TODO	2009-03-13 00:47:38 UTC (rev 14311)
@@ -8,6 +8,12 @@
   level using the C++ EventLogger. Add finer grain logging at C++
   level as in ElasticityImplicit.
 
+  Cleanup error checking on PETSc calls. Use PetscError as in
+  Jacobian.
+
+  C++ testing of Jacobian
+  Python testing of Jacobian
+
   TestMesh.test_view()
   TestMesh.test_checkMaterialIds()
   

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/Makefile.am	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/Makefile.am	2009-03-13 00:47:38 UTC (rev 14311)
@@ -77,6 +77,7 @@
 	meshio/PsetFileBinary.cc \
 	problems/Formulation.cc \
 	topology/FieldBase.cc \
+	topology/Jacobian.cc \
 	topology/Mesh.cc \
 	topology/MeshOps.cc \
 	topology/SubMesh.cc \

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.cc	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.cc	2009-03-13 00:47:38 UTC (rev 14311)
@@ -16,6 +16,7 @@
 
 #include "pylith/topology/Field.hh" // HOLDSA Field
 #include "pylith/topology/SolutionFields.hh" // USES SolutionFields
+#include "pylith/topology/Jacobian.hh" // USES Jacobian
 #include "pylith/feassemble/CellGeometry.hh" // USES CellGeometry
 
 #include "spatialdata/spatialdb/SpatialDB.hh" // USES SpatialDB
@@ -352,7 +353,7 @@
 // Integrate contributions to Jacobian matrix (A) associated with
 void
 pylith::bc::AbsorbingDampers::integrateJacobian(
-				      PetscMat* jacobian,
+				      topology::Jacobian* jacobian,
 				      const double t,
 				      topology::SolutionFields* const fields)
 { // integrateJacobian
@@ -396,6 +397,10 @@
 		  (int) pow(sieveMesh->getSieve()->getMaxConeSize(),
 			    sieveMesh->depth())*spaceDim);
 
+  // Get sparse matrix
+  const PetscMat* jacobianMat = jacobian->matrix();
+  assert(0 != jacobianMat);
+
   // Get parameters used in integration.
   const double dt = _dt;
   assert(dt > 0);
@@ -439,7 +444,7 @@
     PetscLogFlops(numQuadPts*(3+numBasis*(1+numBasis*(1+2*spaceDim))));
     
     // Assemble cell contribution into PETSc Matrix
-    err = updateOperator(*jacobian, *submesh->getSieve(), 
+    err = updateOperator(*jacobianMat, *submesh->getSieve(), 
 			 iV, *c_iter, &_cellMatrix[0], ADD_VALUES);
     if (err)
       throw std::runtime_error("Update to PETSc Mat failed.");

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.hh	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/AbsorbingDampers.hh	2009-03-13 00:47:38 UTC (rev 14311)
@@ -96,11 +96,11 @@
   /** Integrate contributions to Jacobian matrix (A) associated with
    * operator.
    *
-   * @param mat Sparse matrix
+   * @param jacobian Jacobian of system.
    * @param t Current time
    * @param fields Solution fields
    */
-  void integrateJacobian(PetscMat* mat,
+  void integrateJacobian(topology::Jacobian* jacobian,
 			 const double t,
 			 topology::SolutionFields* const fields);
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.cc	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.cc	2009-03-13 00:47:38 UTC (rev 14311)
@@ -322,7 +322,7 @@
 // ----------------------------------------------------------------------
 // Integrate contributions to Jacobian matrix (A) associated with
 void
-pylith::bc::Neumann::integrateJacobian(PetscMat* jacobian,
+pylith::bc::Neumann::integrateJacobian(topology::Jacobian* jacobian,
  				       const double t,
  				       topology::SolutionFields* const fields)
 { // integrateJacobian

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.hh	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/Neumann.hh	2009-03-13 00:47:38 UTC (rev 14311)
@@ -69,7 +69,7 @@
    * @param t Current time
    * @param fields Solution fields
    */
-  void integrateJacobian(PetscMat* jacobian,
+  void integrateJacobian(topology::Jacobian* jacobian,
 			 const double t,
 			 topology::SolutionFields* const fields);
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityExplicit.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityExplicit.cc	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityExplicit.cc	2009-03-13 00:47:38 UTC (rev 14311)
@@ -20,6 +20,7 @@
 #include "pylith/materials/ElasticMaterial.hh" // USES ElasticMaterial
 #include "pylith/topology/Field.hh" // USES Field
 #include "pylith/topology/SolutionFields.hh" // USES SolutionFields
+#include "pylith/topology/Jacobian.hh" // USES Jacobian
 
 #include "pylith/utils/array.hh" // USES double_array
 #include "pylith/utils/macrodefs.h" // USES CALL_MEMBER_FN
@@ -263,7 +264,7 @@
 // Compute matrix associated with operator.
 void
 pylith::feassemble::ElasticityExplicit::integrateJacobian(
-					PetscMat* jacobian,
+					topology::Jacobian* jacobian,
 					const double t,
 					topology::SolutionFields* fields)
 { // integrateJacobian
@@ -311,6 +312,10 @@
     fields->get("disp t").section();
   assert(!dispTSection.isNull());
 
+  // Get sparse matrix
+  const PetscMat* jacobianMat = jacobian->matrix();
+  assert(0 != jacobianMat);
+
   // Get parameters used in integration.
   const double dt = _dt;
   const double dt2 = dt*dt;
@@ -373,7 +378,7 @@
     // Assemble cell contribution into PETSc matrix.
     _logger->eventBegin(updateEvent);
     jacobianVisitor.clear();
-    PetscErrorCode err = updateOperator(*jacobian, *sieveMesh->getSieve(),
+    PetscErrorCode err = updateOperator(*jacobianMat, *sieveMesh->getSieve(),
 					jacobianVisitor, *c_iter,
 					&_cellMatrix[0], ADD_VALUES);
     if (err)

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityExplicit.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityExplicit.hh	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityExplicit.hh	2009-03-13 00:47:38 UTC (rev 14311)
@@ -102,7 +102,7 @@
    * @param t Current time
    * @param fields Solution fields
    */
-  void integrateJacobian(PetscMat* jacobian,
+  void integrateJacobian(topology::Jacobian* jacobian,
 			 const double t,
 			 topology::SolutionFields* const fields);
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.cc	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.cc	2009-03-13 00:47:38 UTC (rev 14311)
@@ -20,6 +20,7 @@
 #include "pylith/materials/ElasticMaterial.hh" // USES ElasticMaterial
 #include "pylith/topology/Field.hh" // USES Field
 #include "pylith/topology/SolutionFields.hh" // USES SolutionFields
+#include "pylith/topology/Jacobian.hh" // USES Jacobian
 
 #include "pylith/utils/EventLogger.hh" // USES EventLogger
 #include "pylith/utils/array.hh" // USES double_array
@@ -273,7 +274,7 @@
 // Compute stiffness matrix.
 void
 pylith::feassemble::ElasticityImplicit::integrateJacobian(
-					PetscMat* jacobian,
+					topology::Jacobian* jacobian,
 					const double t,
 					topology::SolutionFields* fields)
 { // integrateJacobian
@@ -352,6 +353,10 @@
 						     numBasis*spaceDim, 
 						     &dispTBctpdtCell[0]);
 
+  // Get sparse matrix
+  const PetscMat* jacobianMat = jacobian->matrix();
+  assert(0 != jacobianMat);
+
   // Get parameters used in integration.
   const double dt = _dt;
   assert(dt > 0);
@@ -442,7 +447,7 @@
     // Assemble cell contribution into PETSc matrix.
     _logger->eventBegin(updateEvent);
     jacobianVisitor.clear();
-    PetscErrorCode err = updateOperator(*jacobian, *sieveMesh->getSieve(),
+    PetscErrorCode err = updateOperator(*jacobianMat, *sieveMesh->getSieve(),
 					jacobianVisitor, *c_iter,
 					&_cellMatrix[0], ADD_VALUES);
     if (err)

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.hh	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/ElasticityImplicit.hh	2009-03-13 00:47:38 UTC (rev 14311)
@@ -110,7 +110,7 @@
    * @param t Current time
    * @param fields Solution fields
    */
-  void integrateJacobian(PetscMat* jacobian,
+  void integrateJacobian(topology::Jacobian* jacobian,
 			 const double t,
 			 topology::SolutionFields* const fields);
   

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh	2009-03-13 00:47:38 UTC (rev 14311)
@@ -128,7 +128,7 @@
    * @param fields Solution fields
    */
   virtual
-  void integrateJacobian(PetscMat* jacobian,
+  void integrateJacobian(topology::Jacobian* jacobian,
 			 const double t,
 			 topology::SolutionFields* const fields);
 
@@ -153,7 +153,7 @@
    * @param fields Solution fields
    */
   virtual
-  void integrateJacobianAssembled(PetscMat* jacobian,
+  void integrateJacobianAssembled(topology::Jacobian* jacobian,
 				  const double t,
 				  topology::SolutionFields* const fields);
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.icc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.icc	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.icc	2009-03-13 00:47:38 UTC (rev 14311)
@@ -61,7 +61,7 @@
 inline
 void
 pylith::feassemble::Integrator<quadrature_type>::integrateJacobian(
-				     PetscMat* mat,
+				     topology::Jacobian* jacobian,
 				     const double t,
 				     topology::SolutionFields* const fields) {
   _needNewJacobian = false;
@@ -86,7 +86,7 @@
 inline
 void
 pylith::feassemble::Integrator<quadrature_type>::integrateJacobianAssembled(
-				      PetscMat* mat,
+				      topology::Jacobian* jacobian,
 				      const double t,
 				      topology::SolutionFields* const fields) {
 } // integrateJacobianAssembled

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/Makefile.am	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/Makefile.am	2009-03-13 00:47:38 UTC (rev 14311)
@@ -21,6 +21,7 @@
 	Field.cc \
 	Fields.hh \
 	Fields.icc \
+	Jacobian.hh \
 	Mesh.hh \
 	Mesh.icc \
 	MeshOps.hh \

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/topologyfwd.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/topologyfwd.hh	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/topologyfwd.hh	2009-03-13 00:47:38 UTC (rev 14311)
@@ -26,6 +26,7 @@
 
     class Mesh;
     class SubMesh;
+    class MeshOps;
 
     class FieldBase;
     template<typename mesh_type> class Field;
@@ -34,7 +35,7 @@
     typedef Fields<Field<SubMesh> > FieldsSubMesh;
     class SolutionFields;
 
-    class MeshOps;
+    class Jacobian;
 
     class Distributor;
 

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/topology/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/topology/Makefile.am	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/topology/Makefile.am	2009-03-13 00:47:38 UTC (rev 14311)
@@ -25,7 +25,8 @@
 	FieldBase.i \
 	Field.i \
 	Fields.i \
-	SolutionFields.i
+	SolutionFields.i \
+	Jacobian.i
 
 swig_generated = \
 	topology_wrap.cxx \

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/topology/topology.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/topology/topology.i	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/topology/topology.i	2009-03-13 00:47:38 UTC (rev 14311)
@@ -22,6 +22,7 @@
 #include "pylith/topology/Field.hh"
 #include "pylith/topology/Fields.hh"
 #include "pylith/topology/SolutionFields.hh"
+#include "pylith/topology/Jacobian.hh"
 %}
 
 %include "exception.i"
@@ -53,6 +54,7 @@
 %include "Field.i"
 %include "Fields.i"
 %include "SolutionFields.i"
+%include "Jacobian.i"
 
 // Template instatiation
 %template(MeshField) pylith::topology::Field<pylith::topology::Mesh>;

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/utils/petsc.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/utils/petsc.i	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/utils/petsc.i	2009-03-13 00:47:38 UTC (rev 14311)
@@ -16,7 +16,6 @@
 // Header files for module C++ code
 %{
 #include <petsc.h>
-#include <petscmat.h>
 %}
 
 %include "exception.i"
@@ -33,7 +32,6 @@
 
 // Interfaces
 %include "petsc_general.i"
-%include "petsc_mat.i"
 
 // End of file
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/Makefile.am	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/pylith/Makefile.am	2009-03-13 00:47:38 UTC (rev 14311)
@@ -95,6 +95,7 @@
 	topology/Field.py \
 	topology/Fields.py \
 	topology/SolutionFields.py \
+	topology/Jacobian.py \
 	topology/MeshGenerator.py \
 	topology/MeshImporter.py \
 	topology/MeshRefiner.py \

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py	2009-03-13 00:47:38 UTC (rev 14311)
@@ -48,8 +48,9 @@
 
     import pyre.inventory
 
-    from pylith.feassemble.quadrature.Quadrature import Quadrature
-    quadrature = pyre.inventory.facility("quadrature", factory=Quadrature)
+    from pylith.feassemble.Quadrature import SubMeshQuadrature
+    quadrature = pyre.inventory.facility("quadrature",
+                                         factory=SubMeshQuadrature)
     quadrature.meta['tip'] = "Quadrature object for numerical integration."
 
 
@@ -61,7 +62,6 @@
     """
     BoundaryCondition.__init__(self, name)
     Integrator.__init__(self)
-    ModuleAbssorbingDampers.__init__(self)
     self._loggingPrefix = "AbBC "
     return
 
@@ -123,6 +123,15 @@
     return
 
 
+  def _createModuleObj(self):
+    """
+    Create handle to corresponding C++ object.
+    """
+    if None == self.this:
+      ModuleAbsorbingDampers.__init__(self)
+    return
+  
+
 # FACTORIES ////////////////////////////////////////////////////////////
 
 def boundary_condition():

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/BoundaryCondition.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/BoundaryCondition.py	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/BoundaryCondition.py	2009-03-13 00:47:38 UTC (rev 14311)
@@ -94,6 +94,7 @@
     """
     Component.__init__(self, name, facility="boundary_condition")
     self.this = None
+    self._createModuleObj()
     return
 
 
@@ -101,7 +102,6 @@
     """
     Setup boundary condition.
     """
-    self._createModuleObj()
     self.label(self.inventory.label)
     self.db(self.inventory.db)
     self.mesh = mesh
@@ -127,11 +127,4 @@
     return
 
 
-  def _createModuleObj(self):
-    """
-    Create handle to corresponding C++ object.
-    """
-    raise NotImplementedError("BoundaryCondition is an abstract base class.")  
-  
-
 # End of file 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/feassemble/Integrator.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/feassemble/Integrator.py	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/pylith/feassemble/Integrator.py	2009-03-13 00:47:38 UTC (rev 14311)
@@ -66,6 +66,7 @@
     """
     Do pre-initialization setup.
     """
+    self._setupLogging()
     return
 
 
@@ -115,7 +116,7 @@
 
     from pylith.utils.EventLogger import EventLogger
     logger = EventLogger()
-    logger.setClassName("FE Integrator")
+    logger.className("FE Integrator")
     logger.initialize()
 
     events = ["preinit",

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/Makefile.am	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/Makefile.am	2009-03-13 00:47:38 UTC (rev 14311)
@@ -29,6 +29,7 @@
 	TestFieldsMesh.cc \
 	TestFieldsSubMesh.cc \
 	TestSolutionFields.cc \
+	TestJacobian.cc \
 	test_topology.cc
 
 
@@ -40,7 +41,8 @@
 	TestFieldSubMesh.hh \
 	TestFieldsMesh.hh \
 	TestFieldsSubMesh.hh \
-	TestSolutionFields.hh
+	TestSolutionFields.hh \
+	TestJacobian.hh
 
 
 # Source files associated with testing data
@@ -62,8 +64,11 @@
   testtopology_LDADD += -lnetcdf_c++ -lnetcdf
 endif
 
-noinst_tmp =
+noinst_tmp = \
+	jacobian.mat \
+	jacobian.mat.info
 
 CLEANFILES = $(noinst_tmp)
 
+
 # End of file 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestAbsorbingDampers.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestAbsorbingDampers.py	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestAbsorbingDampers.py	2009-03-13 00:47:38 UTC (rev 14311)
@@ -35,7 +35,7 @@
 
   def test_implementsIntegrator(self):
     """
-    Test to make sure AbsorbingDampers satisfies constraint requirements.
+    Test to make sure AbsorbingDampers satisfies integrator requirements.
     """
     bc = AbsorbingDampers()
     from pylith.feassemble.Integrator import implementsIntegrator
@@ -53,8 +53,7 @@
 
     (mesh, bc, fields) = self._initialize()
 
-    # We should really add something here to check to make sure things
-    # actually initialized correctly    
+    # No testing of result.
     return
 
 
@@ -110,8 +109,7 @@
     t = 0.02
     bc.integrateResidual(residual, t, fields)
 
-    # We should really add something here to check to make sure things
-    # actually initialized correctly    
+    # No testing of result.
     return
 
 
@@ -132,8 +130,7 @@
     bc.integrateJacobian(jacobian, t, fields)
     self.assertEqual(False, bc.needNewJacobian())
 
-    # We should really add something here to check to make sure things
-    # actually initialized correctly    
+    # No testing of result.
     return
 
 
@@ -151,8 +148,7 @@
     totalTime = 5
     bc.poststep(t, dt, totalTime, fields)
 
-    # We should really add something here to check to make sure things
-    # actually initialized correctly    
+    # No testing of result.
     return
   
 
@@ -166,8 +162,7 @@
     (mesh, bc, fields) = self._initialize()
     bc.finalize()
 
-    # We should really add something here to check to make sure things
-    # actually initialized correctly.
+    # No testing of result.
     return
 
 
@@ -191,8 +186,8 @@
     cell.inventory.degree = 1
     cell.inventory.order = 1
     cell._configure()
-    from pylith.feassemble.quadrature.Quadrature import Quadrature
-    quadrature = Quadrature()
+    from pylith.feassemble.Quadrature import SubMeshQuadrature
+    quadrature = SubMeshQuadrature()
     quadrature.inventory.cell = cell
     quadrature._configure()
 
@@ -228,11 +223,11 @@
     from pylith.topology.SolutionFields import SolutionFields
     fields = SolutionFields(mesh)
     fields.add("residual")
-    fields.add("solution")
+    fields.add("disp t+dt")
     fields.add("disp t")
     fields.add("disp t-dt")
-    fields.solutionName("solution")
-    fields.createHistory(["solution", "disp t", "disp t-dt"])
+    fields.solutionName("disp t+dt")
+    fields.createHistory(["disp t+dt", "disp t", "disp t-dt"])
 
     residual = fields.get("residual")
     residual.newSection(residual.VERTICES_FIELD, cs.spaceDim())

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestDirichletBC.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestDirichletBC.py	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestDirichletBC.py	2009-03-13 00:47:38 UTC (rev 14311)
@@ -33,6 +33,16 @@
     return
 
 
+  def test_implementsConstraint(self):
+    """
+    Test to make sure DirichletBC satisfies constraint requirements.
+    """
+    bc = DirichletBC()
+    from pylith.feassemble.Constraint import implementsConstraint
+    self.failUnless(implementsConstraint(bc))
+    return
+    
+
   def test_initialize(self):
     """
     Test initialize().

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/testbc.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/testbc.py	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/testbc.py	2009-03-13 00:47:38 UTC (rev 14311)
@@ -62,8 +62,8 @@
     #from TestDirichletBoundary import TestDirichletBoundary
     #suite.addTest(unittest.makeSuite(TestDirichletBoundary))
 
-    #from TestAbsorbingDampers import TestAbsorbingDampers
-    #suite.addTest(unittest.makeSuite(TestAbsorbingDampers))
+    from TestAbsorbingDampers import TestAbsorbingDampers
+    suite.addTest(unittest.makeSuite(TestAbsorbingDampers))
 
     #from TestNeumann import TestNeumann
     #suite.addTest(unittest.makeSuite(TestNeumann))

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/Makefile.am	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/feassemble/Makefile.am	2009-03-13 00:47:38 UTC (rev 14311)
@@ -25,7 +25,6 @@
 	TestFIATSimplex.py \
 	TestCellGeometry.py \
 	TestMeshQuadrature.py \
-	TestIntegrator.py \
 	TestElasticityExplicit.py \
 	TestElasticityImplicit.py
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/Makefile.am	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/Makefile.am	2009-03-13 00:47:38 UTC (rev 14311)
@@ -35,4 +35,11 @@
 	TestMeshImporter.py
 
 
+noinst_tmp = \
+	jacobian.mat \
+	jacobian.mat.info
+
+CLEANFILES = $(noinst_tmp)
+
+
 # End of file 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py	2009-03-12 23:10:01 UTC (rev 14310)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/testdriver.py	2009-03-13 00:47:38 UTC (rev 14311)
@@ -72,6 +72,9 @@
     from TestSolutionFields import TestSolutionFields
     suite.addTest(unittest.makeSuite(TestSolutionFields))
 
+    from TestJacobian import TestJacobian
+    suite.addTest(unittest.makeSuite(TestJacobian))
+
     from TestMeshGenerator import TestMeshGenerator
     suite.addTest(unittest.makeSuite(TestMeshGenerator))
 



More information about the CIG-COMMITS mailing list