[cig-commits] r16468 - in short/3D/PyLith/trunk/unittests/pytests: bc faults faults/data feassemble topology

brad at geodynamics.org brad at geodynamics.org
Tue Mar 30 16:03:30 PDT 2010


Author: brad
Date: 2010-03-30 16:03:29 -0700 (Tue, 30 Mar 2010)
New Revision: 16468

Modified:
   short/3D/PyLith/trunk/unittests/pytests/bc/TestAbsorbingDampers.py
   short/3D/PyLith/trunk/unittests/pytests/bc/TestNeumann.py
   short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveDyn.py
   short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py
   short/3D/PyLith/trunk/unittests/pytests/faults/data/tri3_staticfriction.spatialdb
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicit.py
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicit.py
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicitLgDeform.py
   short/3D/PyLith/trunk/unittests/pytests/topology/TestJacobian.py
Log:
Updated unit tests.

Modified: short/3D/PyLith/trunk/unittests/pytests/bc/TestAbsorbingDampers.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/bc/TestAbsorbingDampers.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/bc/TestAbsorbingDampers.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -124,7 +124,7 @@
     (mesh, bc, fields) = self._initialize()
 
     from pylith.topology.Jacobian import Jacobian
-    jacobian = Jacobian(fields)
+    jacobian = Jacobian(fields.solution())
     jacobian.zero()
     t = 0.24
     bc.integrateJacobian(jacobian, t, fields)
@@ -232,10 +232,10 @@
     from pylith.topology.SolutionFields import SolutionFields
     fields = SolutionFields(mesh)
     fields.add("residual", "residual")
-    fields.add("disp(t+dt)", "displacement")
+    fields.add("dispIncr(t->t+dt)", "displacement")
     fields.add("disp(t)", "displacement")
     fields.add("disp(t-dt)", "displacement")
-    fields.solutionName("disp(t+dt)")
+    fields.solutionName("dispIncr(t->t+dt)")
 
     residual = fields.get("residual")
     residual.newSection(residual.VERTICES_FIELD, cs.spaceDim())

Modified: short/3D/PyLith/trunk/unittests/pytests/bc/TestNeumann.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/bc/TestNeumann.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/bc/TestNeumann.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -123,7 +123,7 @@
     (mesh, bc, fields) = self._initialize()
 
     from pylith.topology.Jacobian import Jacobian
-    jacobian = Jacobian(fields)
+    jacobian = Jacobian(fields.solution())
     jacobian.zero()
     t = 0.24
     bc.integrateJacobian(jacobian, t, fields)

Modified: short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveDyn.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveDyn.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveDyn.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -178,7 +178,7 @@
     (mesh, fault, fields) = self._initialize()
 
     from pylith.topology.Jacobian import Jacobian
-    jacobian = Jacobian(fields)
+    jacobian = Jacobian(fields.solution())
     jacobian.zero()
     t = 1.0
     fault.integrateJacobian(jacobian, t, fields)
@@ -314,6 +314,9 @@
     firstFaultCell      = 2*nvertices
     fault.adjustTopology(mesh, firstFaultVertex, firstLagrangeVertex,
                          firstFaultCell)
+
+    mesh.nondimensionalize(normalizer)
+
     fault.preinitialize(mesh)
     fault.timeStep(dt)
     fault.verifyConfiguration()

Modified: short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -205,7 +205,7 @@
     (mesh, fault, fields) = self._initialize()
 
     from pylith.topology.Jacobian import Jacobian
-    jacobian = Jacobian(fields)
+    jacobian = Jacobian(fields.solution())
     jacobian.zero()
     t = 1.0
     fault.integrateJacobian(jacobian, t, fields)

Modified: short/3D/PyLith/trunk/unittests/pytests/faults/data/tri3_staticfriction.spatialdb
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/faults/data/tri3_staticfriction.spatialdb	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/faults/data/tri3_staticfriction.spatialdb	2010-03-30 23:03:29 UTC (rev 16468)
@@ -1,8 +1,8 @@
 #SPATIAL.ascii 1
 SimpleDB {
-  num-values = 1
-  value-names =  friction-coefficient
-  value-units =  none
+  num-values = 2
+  value-names =  friction-coefficient cohesion
+  value-units =  none Pa
   num-locs = 2
   data-dim = 1
   space-dim = 2
@@ -11,5 +11,5 @@
     space-dim = 2
   }
 }
-0.0   1.0   0.6
-0.0  -1.0   0.4
+0.0   1.0   0.6  0.0
+0.0  -1.0   0.4  0.0

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicit.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicit.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicit.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -163,7 +163,7 @@
     fields = self._initialize(mesh, integrator)
 
     from pylith.topology.Jacobian import Jacobian
-    jacobian = Jacobian(fields)
+    jacobian = Jacobian(fields.solution())
     jacobian.zero()
     t = 7.3
     self.assertEqual(True, integrator.needNewJacobian())
@@ -283,10 +283,10 @@
     from pylith.topology.SolutionFields import SolutionFields
     fields = SolutionFields(mesh)
     fields.add("residual", "residual")
-    fields.add("disp(t+dt)", "displacement")
+    fields.add("dispIncr(t->t+dt)", "displacement")
     fields.add("disp(t)", "displacement")
     fields.add("disp(t-dt)", "displacement")
-    fields.solutionName("disp(t+dt)")
+    fields.solutionName("dispIncr(t->t+dt)")
 
     residual = fields.get("residual")
     residual.newSection(residual.VERTICES_FIELD, mesh.coordsys().spaceDim())

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -163,7 +163,7 @@
     fields = self._initialize(mesh, integrator)
 
     from pylith.topology.Jacobian import Jacobian
-    jacobian = Jacobian(fields)
+    jacobian = Jacobian(fields.solution())
     jacobian.zero()
     t = 7.3
     self.assertEqual(True, integrator.needNewJacobian())

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicit.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicit.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicit.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -159,7 +159,7 @@
     fields = self._initialize(mesh, integrator)
 
     from pylith.topology.Jacobian import Jacobian
-    jacobian = Jacobian(fields)
+    jacobian = Jacobian(fields.solution())
     jacobian.zero()
     t = 7.3
     self.assertEqual(True, integrator.needNewJacobian())

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicitLgDeform.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicitLgDeform.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicitLgDeform.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -159,7 +159,7 @@
     fields = self._initialize(mesh, integrator)
 
     from pylith.topology.Jacobian import Jacobian
-    jacobian = Jacobian(fields)
+    jacobian = Jacobian(fields.solution())
     jacobian.zero()
     t = 7.3
     self.assertEqual(True, integrator.needNewJacobian())

Modified: short/3D/PyLith/trunk/unittests/pytests/topology/TestJacobian.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/TestJacobian.py	2010-03-30 21:42:16 UTC (rev 16467)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/TestJacobian.py	2010-03-30 23:03:29 UTC (rev 16468)
@@ -55,7 +55,7 @@
     solution.zero()
 
     self.fields = fields
-    self.jacobian = Jacobian(self.fields)
+    self.jacobian = Jacobian(solution)
     return
 
 
@@ -64,8 +64,8 @@
     Test constructor.
     """
     # setUp() tests constructor with default type
-    jacobianA = Jacobian(self.fields, "aij")
-    jacobianB = Jacobian(self.fields, "baij")
+    jacobianA = Jacobian(self.fields.solution(), "aij")
+    jacobianB = Jacobian(self.fields.solution(), "baij")
     return
 
 
@@ -130,10 +130,14 @@
     :WARNING: This is not a complete test of write(). We do not
     verify the results.
     """
-    self.jacobian = Jacobian(self.fields, "aij")
+    self.jacobian = Jacobian(self.fields.solution(), "aij")
     self.jacobian.assemble("final_assembly")
-    self.jacobian.write("jacobian.mat")
 
+    from pylith.mpi.Communicator import Communicator
+    comm = Communicator(self.mesh.comm())
+
+    self.jacobian.write("jacobian.mat", comm.handle)
+
     # No testing of result.
     return
 



More information about the CIG-COMMITS mailing list