[cig-commits] r14859 - in short/3D/PyLith/branches/pylith-swig/pylith: bc problems

brad at geodynamics.org brad at geodynamics.org
Mon May 4 15:12:55 PDT 2009


Author: brad
Date: 2009-05-04 15:12:55 -0700 (Mon, 04 May 2009)
New Revision: 14859

Modified:
   short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py
   short/3D/PyLith/branches/pylith-swig/pylith/problems/Explicit.py
   short/3D/PyLith/branches/pylith-swig/pylith/problems/Formulation.py
Log:
Fixed some small bugs related to explicit time stepping.

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py	2009-05-04 21:35:00 UTC (rev 14858)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py	2009-05-04 22:12:55 UTC (rev 14859)
@@ -84,7 +84,7 @@
     logEvent = "%sverify" % self._loggingPrefix
     self._logger.eventBegin(logEvent)
 
-    BoundaryCondition.verifyConfiguration(self)
+    BoundaryCondition.verifyConfiguration(self, self.mesh)
     Integrator.verifyConfiguration(self)
     if self.bcQuadrature.cellDim() != self.mesh.dimension()-1:
         raise ValueError, \

Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/Explicit.py	2009-05-04 21:35:00 UTC (rev 14858)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/Explicit.py	2009-05-04 22:12:55 UTC (rev 14859)
@@ -18,6 +18,7 @@
 ## Factory: pde_formulation
 
 from Formulation import Formulation
+from pylith.utils.profiling import resourceUsageString
 
 # Explicit class
 class Explicit(Formulation):
@@ -47,7 +48,7 @@
     Formulation.__init__(self, name)
     self._loggingPrefix = "TSEx "
     self.solnField = {'name': "disp(t)",
-                      'label': "displacements"}
+                      'label': "displacement"}
     return
 
 
@@ -69,17 +70,23 @@
     Formulation.initialize(self, dimension, normalizer)
 
     self._info.log("Creating other fields and matrices.")
-    self.fields.add("disp(t+dt)")
-    self.fields.add("disp(t-dt)")
-    self.fields.add("residual")
-    self.fields.createHistory(["disp(t+dt), disp(t), disp(t-dt)"])    
+    self.fields.add("disp(t+dt)", "displacement")
+    self.fields.add("disp(t-dt)", "displacement")
+    self.fields.add("residual", "residual")
+    self.fields.createHistory(["disp(t+dt)", "disp(t)", "disp(t-dt)"])    
     self.fields.copyLayout("disp(t)")
     self.fields.solveSolnName("disp(t+dt)")
     self._debug.log(resourceUsageString())
 
-    # Create Petsc vectors for fields involved in solve
+    # Create Petsc vectors for fields involved in solve. Since we
+    # shift fields through the time history, all fields need a PETSc
+    # vector.
     dispTpdt = self.fields.get("disp(t+dt)")
     dispTpdt.createVector()
+    dispT = self.fields.get("disp(t)")
+    dispT.createVector()
+    dispTmdt = self.fields.get("disp(t-dt)")
+    dispTmdt.createVector()
     residual = self.fields.get("residual")
     residual.createVector()
 
@@ -152,10 +159,14 @@
     self._logger.eventBegin(logEvent)
     
     self.fields.shiftHistory()
-    if not self.solver.guessZero: # only works for KSP solver
+
+    # :KLUDGE: only works for KSP solver
+    if not self.solver.guessZero:
       dispTpdt = self.fields.get("disp(t+dt)")
       dispT = self.fields.get("disp(t)")
       dispTpdt.copy(dispT)
+    else:
+      dispTpdt.zero()
 
     Formulation.poststep(self, t, dt)
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/problems/Formulation.py	2009-05-04 21:35:00 UTC (rev 14858)
+++ short/3D/PyLith/branches/pylith-swig/pylith/problems/Formulation.py	2009-05-04 22:12:55 UTC (rev 14859)
@@ -220,7 +220,7 @@
     """
     Get start time for simulation.
     """
-    return 0.0*second
+    return 0.0
 
 
   def getTotalTime(self):



More information about the CIG-COMMITS mailing list