[cig-commits] r6177 - short/3D/PyLith/trunk/unittests/pytests/feassemble

brad at geodynamics.org brad at geodynamics.org
Mon Mar 5 10:55:00 PST 2007


Author: brad
Date: 2007-03-05 10:55:00 -0800 (Mon, 05 Mar 2007)
New Revision: 6177

Added:
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestExplicitElasticity.py
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestIntegrator.py
Log:
Fixed some small bugs related to moving Python Quadrature objects to feassemble/quadrature. Created unit test in TestExplicitElasticity to isolate Integrator.initQuadrature bug.

Added: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestExplicitElasticity.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestExplicitElasticity.py	2007-03-05 18:53:23 UTC (rev 6176)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestExplicitElasticity.py	2007-03-05 18:55:00 UTC (rev 6177)
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/pytests/feassemble/TestExplicitElasticity.py
+
+## @brief Unit testing of Python ExplicitElasticity object.
+
+import unittest
+from pylith.feassemble.ExplicitElasticity import ExplicitElasticity
+
+# ----------------------------------------------------------------------
+class TestExplicitElasticity(unittest.TestCase):
+  """
+  Unit testing of Python ExplicitElasticity object.
+  """
+
+  def test_initQuadrature(self):
+    """
+    Test initQuadrature().
+    """
+    from pylith.feassemble.quadrature.Quadrature2D import Quadrature2D
+    q = Quadrature2D()
+    minJacobian = 4.0e-02;
+    q.minJacobian = minJacobian
+    from pylith.feassemble.FIATSimplex import FIATSimplex
+    q.cell = FIATSimplex()
+    q.cell.shape = "triangle"
+    q.cell.order = 1
+    q.cell.degree = 1
+
+    integrator = ExplicitElasticity()
+    integrator.initQuadrature(q)
+    self.assertEqual(minJacobian, integrator.quadrature.minJacobian)
+    return
+    
+
+# End of file 

Added: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestIntegrator.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestIntegrator.py	2007-03-05 18:53:23 UTC (rev 6176)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestIntegrator.py	2007-03-05 18:55:00 UTC (rev 6177)
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/pytests/feassemble/TestIntegrator.py
+
+## @brief Unit testing of Python Integrator object.
+
+import unittest
+from pylith.feassemble.Integrator import Integrator
+
+# ----------------------------------------------------------------------
+class TestIntegrator(unittest.TestCase):
+  """
+  Unit testing of Python Integrator object.
+  """
+
+  def test_constructors(self):
+    """
+    Test constructor.
+    """
+    i = Integrator()
+    return
+
+
+# End of file 



More information about the cig-commits mailing list