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

brad at geodynamics.org brad at geodynamics.org
Thu Feb 14 11:30:37 PST 2008


Author: brad
Date: 2008-02-14 11:30:37 -0800 (Thu, 14 Feb 2008)
New Revision: 9343

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/TestFaultCohesiveKin.py
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicit.py
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicit.py
   short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py
Log:
Updated Python unit tests to reflect changes in integrator interface.

Modified: short/3D/PyLith/trunk/unittests/pytests/bc/TestAbsorbingDampers.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/bc/TestAbsorbingDampers.py	2008-02-14 19:30:13 UTC (rev 9342)
+++ short/3D/PyLith/trunk/unittests/pytests/bc/TestAbsorbingDampers.py	2008-02-14 19:30:37 UTC (rev 9343)
@@ -143,17 +143,19 @@
     return
 
 
-  def test_updateState(self):
+  def test_poststep(self):
     """
-    Test updateState().
+    Test poststep().
 
-    WARNING: This is not a rigorous test of updateState() because we
+    WARNING: This is not a rigorous test of poststep() because we
     neither set the input fields or verify the results.
     """
     (mesh, bc, fields) = self._initialize()
 
     t = 0.50*second
-    bc.updateState(t, fields)
+    dt = 0.1*second
+    totalTime = 5*second
+    bc.poststep(t, dt, totalTime, fields)
 
     # We should really add something here to check to make sure things
     # actually initialized correctly    

Modified: short/3D/PyLith/trunk/unittests/pytests/bc/TestNeumann.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/bc/TestNeumann.py	2008-02-14 19:30:13 UTC (rev 9342)
+++ short/3D/PyLith/trunk/unittests/pytests/bc/TestNeumann.py	2008-02-14 19:30:37 UTC (rev 9343)
@@ -139,17 +139,19 @@
     return
 
 
-  def test_updateState(self):
+  def test_poststep(self):
     """
-    Test updateState().
+    Test poststep().
 
-    WARNING: This is not a rigorous test of updateState() because we
+    WARNING: This is not a rigorous test of poststep() because we
     neither set the input fields or verify the results.
     """
     (mesh, bc, fields) = self._initialize()
 
     t = 0.50*second
-    bc.updateState(t, fields)
+    dt = 0.1*second
+    totalTime = 5*second
+    bc.poststep(t, dt, totalTime, fields)
 
     # We should really add something here to check to make sure things
     # actually initialized correctly    

Modified: short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py	2008-02-14 19:30:13 UTC (rev 9342)
+++ short/3D/PyLith/trunk/unittests/pytests/faults/TestFaultCohesiveKin.py	2008-02-14 19:30:37 UTC (rev 9343)
@@ -53,7 +53,7 @@
     """
     Test adjustTopology().
 
-    WARNING: This is not a rigorous test of updateState() because we
+    WARNING: This is not a rigorous test of adjustTopology() because we
     neither set the input fields or verify the results.
     """
     cs = CSCart()
@@ -81,7 +81,7 @@
     """
     Test initialize().
 
-    WARNING: This is not a rigorous test of updateState() because we
+    WARNING: This is not a rigorous test of initialize() because we
     neither set the input fields or verify the results.
     """
     (mesh, fault, fields) = self._initialize()
@@ -175,17 +175,19 @@
     return
 
   
-  def test_updateState(self):
+  def test_poststep(self):
     """
-    Test updateState().
+    Test poststep().
 
-    WARNING: This is not a rigorous test of updateState() because we
+    WARNING: This is not a rigorous test of poststep() because we
     neither set the input fields or verify the results.
     """
     (mesh, fault, fields) = self._initialize()
 
-    t = 1.0*second
-    fault.updateState(t, fields)
+    t = 0.50*second
+    dt = 0.1*second
+    totalTime = 5*second
+    #fault.poststep(t, dt, totalTime, fields)
 
     # We should really add something here to check to make sure things
     # actually initialized correctly    

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicit.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicit.py	2008-02-14 19:30:13 UTC (rev 9342)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityExplicit.py	2008-02-14 19:30:37 UTC (rev 9343)
@@ -75,6 +75,10 @@
     material.label = "elastic plane strain"
     material.db = db
     material.quadrature = quadrature
+    from pylith.meshio.OutputMatElastic import OutputMatElastic
+    material.output = OutputMatElastic()
+    material.output._configure()
+    material.output.writer._configure()
 
     integrator = ElasticityExplicit()
     integrator.preinitialize(mesh, material)
@@ -168,17 +172,19 @@
     return
 
   
-  def test_updateState(self):
+  def test_poststep(self):
     """
-    Test updateState().
+    Test poststep().
 
-    WARNING: This is not a rigorous test of updateState() because we
+    WARNING: This is not a rigorous test of poststep() because we
     neither set the input fields or verify the results.
     """
     (mesh, integrator, fields) = self._initialize()
 
     t = 3.45*second
-    integrator.updateState(t, fields)
+    dt = 0.02*second
+    totalTime = 5.0*second
+    #integrator.poststep(t, dt, totalTime, fields)
 
     # We should really add something here to check to make sure things
     # actually initialized correctly    
@@ -243,6 +249,10 @@
     material.label = "elastic plane strain"
     material.db = db
     material.quadrature = quadrature
+    from pylith.meshio.OutputMatElastic import OutputMatElastic
+    material.output = OutputMatElastic()
+    material.output._configure()
+    material.output.writer._configure()
 
     # Setup integrator
     integrator = ElasticityExplicit()
@@ -259,6 +269,7 @@
     fields.addReal("dispT")
     fields.addReal("dispTmdt")
     fields.createHistory(["solution", "dispT", "dispTmdt"])
+    fields.solutionField("solution")
     fields.setFiberDimension("residual", cs.spaceDim)
     fields.allocate("residual")
     fields.copyLayout("residual")

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicit.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicit.py	2008-02-14 19:30:13 UTC (rev 9342)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestElasticityImplicit.py	2008-02-14 19:30:37 UTC (rev 9343)
@@ -75,6 +75,10 @@
     material.label = "elastic plane strain"
     material.db = db
     material.quadrature = quadrature
+    from pylith.meshio.OutputMatElastic import OutputMatElastic
+    material.output = OutputMatElastic()
+    material.output._configure()
+    material.output.writer._configure()
 
     integrator = ElasticityImplicit()
     integrator.preinitialize(mesh, material)
@@ -163,17 +167,19 @@
     return
 
   
-  def test_updateState(self):
+  def test_poststep(self):
     """
-    Test updateState().
+    Test poststep().
 
-    WARNING: This is not a rigorous test of updateState() because we
+    WARNING: This is not a rigorous test of poststep() because we
     neither set the input fields or verify the results.
     """
     (mesh, integrator, fields) = self._initialize()
 
     t = 0.27*year
-    integrator.updateState(t, fields)
+    dt = 0.01*year
+    totalTime = 10*year
+    #integrator.poststep(t, dt, totalTime, fields)
 
     # We should really add something here to check to make sure things
     # actually initialized correctly    
@@ -238,6 +244,10 @@
     material.label = "elastic plane strain"
     material.db = db
     material.quadrature = quadrature
+    from pylith.meshio.OutputMatElastic import OutputMatElastic
+    material.output = OutputMatElastic()
+    material.output._configure()
+    material.output.writer._configure()
 
     # Setup integrator
     integrator = ElasticityImplicit()
@@ -251,6 +261,7 @@
     fields = FieldsManager(mesh)
     fields.addReal("residual")
     fields.addReal("dispTBctpdt")
+    fields.solutionField("dispTBctpdt")
     fields.setFiberDimension("residual", cs.spaceDim)
     fields.allocate("residual")
     fields.copyLayout("residual")

Modified: short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py	2008-02-14 19:30:13 UTC (rev 9342)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/TestMeshGenSimple.py	2008-02-14 19:30:37 UTC (rev 9343)
@@ -50,12 +50,11 @@
     io.coordsys = CSCart()
     mesh.coordsys = CSCart()
     self.mesh = mesh
-    
+
     from pyre.units.time import s
-    t = 0.0*s
     io.preinitialize(self)
     io.initialize()
-    io.writeData(t)
+    io.writeInfo()
 
     from pylith.topology.Distributor import Distributor
     distributor = Distributor()
@@ -63,7 +62,7 @@
     newMesh = distributor.distribute(mesh)
     self.mesh = newMesh
     io.writer.filename = 'newMesh.vtk'
-    io.writeData(t)
+    io.writeInfo()
     return
 
 



More information about the cig-commits mailing list