[cig-commits] r20030 - in short/3D/PyLith/branches/v1.7-trunk/pylith: . problems

brad at geodynamics.org brad at geodynamics.org
Thu May 3 11:43:09 PDT 2012


Author: brad
Date: 2012-05-03 11:43:09 -0700 (Thu, 03 May 2012)
New Revision: 20030

Modified:
   short/3D/PyLith/branches/v1.7-trunk/pylith/Makefile.am
   short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py
Log:
Fixed some small bugs in GreensFns.

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/Makefile.am	2012-05-03 18:42:25 UTC (rev 20029)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/Makefile.am	2012-05-03 18:43:09 UTC (rev 20030)
@@ -147,6 +147,7 @@
 	problems/SolverNonlinear.py \
 	problems/SolverLumped.py \
 	problems/TimeDependent.py \
+	problems/GreensFns.py \
 	problems/TimeStep.py \
 	problems/TimeStepAdapt.py \
 	problems/TimeStepUniform.py \

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py	2012-05-03 18:42:25 UTC (rev 20029)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py	2012-05-03 18:43:09 UTC (rev 20030)
@@ -117,7 +117,7 @@
     if not "numImpulses" in dir(self.source) or not "numComponents" in dir(self.source):
       raise ValueError("Incompatible source for green's function impulses "
                        "with id '%d' and label '%s'." % \
-                         (self.source.id(), self.source.label())
+                         (self.source.id(), self.source.label()))
     return
   
 
@@ -149,11 +149,14 @@
 
     nimpulses = self.source.numImpulses()*self.source.numComponents()
     ipulse = 0;
+    dt = 1.0
     while ipulse < nimpulses:
       self._eventLogger.stagePush("Prestep")
       if 0 == comm.rank:
         self._info.log("Main loop, impulse %d of %d." % (ipulse+1, nimpulses))
       
+      t = float(ipulse)
+
       # Checkpoint if necessary
       self.checkpointTimer.update(t)
 
@@ -177,8 +180,8 @@
       self.formulation.poststep(t, dt)
       self._eventLogger.stagePop()
 
-      # Update time
-      t += dt
+      # Update time/impulse
+      ipulse += 1
     return
 
 



More information about the CIG-COMMITS mailing list