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

brad at geodynamics.org brad at geodynamics.org
Wed Jun 20 16:53:10 PDT 2007


Author: brad
Date: 2007-06-20 16:53:10 -0700 (Wed, 20 Jun 2007)
New Revision: 7332

Modified:
   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:
Cleaned up journal logging and fixed inconsistencies in time of boundary conditions and constraints.

Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-06-20 23:52:16 UTC (rev 7331)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-06-20 23:53:10 UTC (rev 7332)
@@ -155,11 +155,6 @@
     self.fields.allocate("solution")
     for constraint in self.constraints:
       constraint.setConstraints(self.fields.getReal("solution"))
-
-    # BEGIN TEMPORARY
-    import pylith.topology.topology as bindings
-    bindings.sectionView(self.fields.getReal("solution"), "solution")
-    # END TEMPORARY
     return
 
 

Modified: short/3D/PyLith/trunk/pylith/problems/Implicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Implicit.py	2007-06-20 23:52:16 UTC (rev 7331)
+++ short/3D/PyLith/trunk/pylith/problems/Implicit.py	2007-06-20 23:53:10 UTC (rev 7332)
@@ -125,10 +125,9 @@
     """
     Hook for doing stuff before advancing time step.
     """
-    self._info.log("Preparing for advanving time step.")
-
     # Set dispTBctpdt to the BC t time t+dt. Unconstrained DOF are
     # unaffected and will be equal to their values at time t.
+    self._info.log("Setting constraints.")
     dispTBctpdt = self.fields.getReal("dispTBctpdt")
     for constraint in self.constraints:
       constraint.setField(t+dt, dispTBctpdt)
@@ -143,7 +142,7 @@
       petsc.mat_setzero(self.jacobian)
       for integrator in self.integrators:
         integrator.timeStep(dt)
-        integrator.integrateJacobian(self.jacobian, t, self.fields)
+        integrator.integrateJacobian(self.jacobian, t+dt, self.fields)
       petsc.mat_assemble(self.jacobian)
     return
 
@@ -160,7 +159,7 @@
     bindings.zeroRealSection(dispIncr)
     for integrator in self.integrators:
       integrator.timeStep(dt)
-      integrator.integrateResidual(residual, t, self.fields)
+      integrator.integrateResidual(residual, t+dt, self.fields)
 
     import pylith.utils.petsc as petsc
     self._info.log("Solving equations.")
@@ -168,7 +167,7 @@
     return
 
 
-  def poststep(self, t):
+  def poststep(self, t, dt):
     """
     Hook for doing stuff after advancing time step.
     """
@@ -184,7 +183,7 @@
 
     self._info.log("Updating integrators states.")
     for integrator in self.integrators:
-      integrator.updateState(t, disp)
+      integrator.updateState(t+dt, disp)
 
     # If finishing first time step, then switch from solving for total
     # displacements to solving for incremental displacements
@@ -196,7 +195,7 @@
       for integrator in self.integrators:
         integrator.useSolnIncr(True)
 
-    Formulation.poststep(self, t)
+    Formulation.poststep(self, t+dt)
     return
 
 

Modified: short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/TimeDependent.py	2007-06-20 23:52:16 UTC (rev 7331)
+++ short/3D/PyLith/trunk/pylith/problems/TimeDependent.py	2007-06-20 23:53:10 UTC (rev 7332)
@@ -114,7 +114,7 @@
       dt = self.dt
     t = self.formulation.startTime(self.dt)
     while t.value < self.totalTime.value:
-      self._info.log("Main time loop, t=%s" % t)
+      self._info.log("Main time loop, current time is t=%s" % t)
       
       # Checkpoint if necessary
       self.checkpointTimer.update(t)
@@ -132,7 +132,7 @@
       self._step(t, dt)
 
       # Do stuff after advancing time step
-      self._poststep(t+dt)
+      self._poststep(t, dt)
 
       # Update time step
       t += dt
@@ -180,6 +180,7 @@
     """
     Hook for doing stuff before advancing time step.
     """
+    self._info.log("Preparing to advance solution from time t=%s." % t)
     self.formulation.prestep(t, dt)
     return
 
@@ -188,15 +189,17 @@
     """
     Advance to next time step.
     """
+    self._info.log("Advancing solution from t=%s to t=%s." % (t, t+dt))    
     self.formulation.step(t, dt)
     return
 
 
-  def _poststep(self, t):
+  def _poststep(self, t, dt):
     """
     Hook for doing stuff after advancing time step.
     """
-    self.formulation.poststep(t)
+    self._info.log("Finishing advancing solution to t=%s." % (t+dt))    
+    self.formulation.poststep(t, dt)
     return
 
 



More information about the cig-commits mailing list