[cig-commits] r7376 - short/3D/PyLith/trunk/pylith/problems

brad at geodynamics.org brad at geodynamics.org
Fri Jun 22 08:32:14 PDT 2007


Author: brad
Date: 2007-06-22 08:32:14 -0700 (Fri, 22 Jun 2007)
New Revision: 7376

Modified:
   short/3D/PyLith/trunk/pylith/problems/Explicit.py
   short/3D/PyLith/trunk/pylith/problems/Formulation.py
   short/3D/PyLith/trunk/pylith/problems/Implicit.py
   short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
Log:
Adjusted poststep() so that it checks to see if the simulation is done before attempting to reform Jacobian (i.e., simulation only has 1 time step).

Modified: short/3D/PyLith/trunk/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Explicit.py	2007-06-22 15:15:03 UTC (rev 7375)
+++ short/3D/PyLith/trunk/pylith/problems/Explicit.py	2007-06-22 15:32:14 UTC (rev 7376)
@@ -138,7 +138,7 @@
     return
 
 
-  def poststep(self, t, dt):
+  def poststep(self, t, dt, totalTime):
     """
     Hook for doing stuff after advancing time step.
     """
@@ -148,7 +148,7 @@
     for integrator in self.integrators:
       integrator.updateState(t, self.fields.getReal("dispT"))
 
-    Formulation.poststep(self, t, dt)
+    Formulation.poststep(self, t, dt, totalTime)
     return
 
 

Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-06-22 15:15:03 UTC (rev 7375)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-06-22 15:32:14 UTC (rev 7376)
@@ -160,7 +160,7 @@
     return
 
 
-  def poststep(self, t, dt):
+  def poststep(self, t, dt, totalTime):
     """
     Hook for doing stuff after advancing time step.
     """

Modified: short/3D/PyLith/trunk/pylith/problems/Implicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Implicit.py	2007-06-22 15:15:03 UTC (rev 7375)
+++ short/3D/PyLith/trunk/pylith/problems/Implicit.py	2007-06-22 15:32:14 UTC (rev 7376)
@@ -161,7 +161,7 @@
     return
 
 
-  def poststep(self, t, dt):
+  def poststep(self, t, dt, totalTime):
     """
     Hook for doing stuff after advancing time step.
     """
@@ -181,7 +181,7 @@
 
     # If finishing first time step, then switch from solving for total
     # displacements to solving for incremental displacements
-    if 0 == self._istep:
+    if 0 == self._istep and (t + dt) < totalTime:
       self._info.log("Switching from total field solution to incremental " \
                      "field solution.")
       for constraint in self.constraints:
@@ -190,7 +190,7 @@
         integrator.useSolnIncr(True)
       self._reformJacobian(t, dt)
 
-    Formulation.poststep(self, t, dt)
+    Formulation.poststep(self, t, dt, totalTime)
     return
 
 

Modified: short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/TimeDependent.py	2007-06-22 15:15:03 UTC (rev 7375)
+++ short/3D/PyLith/trunk/pylith/problems/TimeDependent.py	2007-06-22 15:32:14 UTC (rev 7376)
@@ -132,7 +132,7 @@
       self._step(t, dt)
 
       # Do stuff after advancing time step
-      self._poststep(t, dt)
+      self._poststep(t, dt, self.totalTime)
 
       # Update time step
       t += dt
@@ -194,12 +194,12 @@
     return
 
 
-  def _poststep(self, t, dt):
+  def _poststep(self, t, dt, totalTime):
     """
     Hook for doing stuff after advancing time step.
     """
     self._info.log("Finishing advancing solution to t=%s." % (t+dt))    
-    self.formulation.poststep(t, dt)
+    self.formulation.poststep(t, dt, totalTime)
     return
 
 



More information about the cig-commits mailing list