[cig-commits] r6031 - in short/3D/PyLith/trunk: . examples/twotri3 pylith pylith/problems

brad at geodynamics.org brad at geodynamics.org
Wed Feb 14 21:28:43 PST 2007


Author: brad
Date: 2007-02-14 21:28:42 -0800 (Wed, 14 Feb 2007)
New Revision: 6031

Modified:
   short/3D/PyLith/trunk/DEPENDENCIES
   short/3D/PyLith/trunk/examples/twotri3/pylithapp.cfg
   short/3D/PyLith/trunk/pylith/PyLithApp.py
   short/3D/PyLith/trunk/pylith/problems/Explicit.py
   short/3D/PyLith/trunk/pylith/problems/Formulation.py
   short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
Log:
Removed dependence on petsc4py per Leif's suggestion. Now we need to create bindings for PetscInitialize/Finialize. Continued work on top-level implementation (Formulation).

Modified: short/3D/PyLith/trunk/DEPENDENCIES
===================================================================
--- short/3D/PyLith/trunk/DEPENDENCIES	2007-02-15 01:12:45 UTC (rev 6030)
+++ short/3D/PyLith/trunk/DEPENDENCIES	2007-02-15 05:28:42 UTC (rev 6031)
@@ -2,7 +2,6 @@
 
 MPI
 PETSc
-petsc2py (http://cheeseshop.python.org/pypi/petsc4py)
 pythia
 spatialdata
   proj
@@ -12,3 +11,7 @@
 
 cppunit
 doxygen
+
+FUTURE DEPENDENCIES??
+
+petsc2py (http://cheeseshop.python.org/pypi/petsc4py)

Modified: short/3D/PyLith/trunk/examples/twotri3/pylithapp.cfg
===================================================================
--- short/3D/PyLith/trunk/examples/twotri3/pylithapp.cfg	2007-02-15 01:12:45 UTC (rev 6030)
+++ short/3D/PyLith/trunk/examples/twotri3/pylithapp.cfg	2007-02-15 05:28:42 UTC (rev 6031)
@@ -4,6 +4,7 @@
 # Journal
 # ----------------------------------------------------------------------
 journal.info.eqdeformation = 1
+journal.info.explicit = 1
 
 # ----------------------------------------------------------------------
 # MPI
@@ -19,4 +20,4 @@
 # Solution
 # ----------------------------------------------------------------------
 eqdeformation.total_time = 1.0*s
-eqdeformation.default_dt = 1.0*s
\ No newline at end of file
+eqdeformation.default_dt = 1.0*s

Modified: short/3D/PyLith/trunk/pylith/PyLithApp.py
===================================================================
--- short/3D/PyLith/trunk/pylith/PyLithApp.py	2007-02-15 01:12:45 UTC (rev 6030)
+++ short/3D/PyLith/trunk/pylith/PyLithApp.py	2007-02-15 05:28:42 UTC (rev 6031)
@@ -63,13 +63,12 @@
     Run the application.
     """
 
-    import petsc4py
-    # :TODO: Add PETSc command line arguments using something like
-    # PetscUtil.py in 0.8. Some update may be necessary to be
-    # compatible with petsc4py. Brad doesn' like mixing different
+    # :TODO: Setup initialize/finalize of PETSc here. Will need to get
+    # PETSc command line arguments using something like PetscUtil.py
+    # in 0.8. If we end up using petsc2py, some modification of
+    # PetscUtil may be necessary. Brad doesn' like mixing different
     # formats of command line arguments and he would like to require
     # Pyre style formats.
-    petsc4py.init()
 
     #mesh = self.mesher.create()
     #self.problem.mesh = mesh.distribute()

Modified: short/3D/PyLith/trunk/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Explicit.py	2007-02-15 01:12:45 UTC (rev 6030)
+++ short/3D/PyLith/trunk/pylith/problems/Explicit.py	2007-02-15 05:28:42 UTC (rev 6031)
@@ -73,22 +73,30 @@
     return
 
 
-  def calcResidual(self):
+  def prestep(self):
     """
-    Compute residual, {b(t)}.
+    Hook for doing stuff before advancing time step.
     """
-    self._info.log("WARNING: Explicit::calcResidual not implemented.")
+    self._info.log("WARNING: Explicit::prestep() not implemented.")
     return
 
 
-  def calcJacobian(self):
+  def step(self, dt):
     """
-    Compute Jacobian, [A(t)].
+    Advance to next time step.
     """
-    self._info.log("WARNING: Explicit::calcJacobian not implemented.")
+    self._info.log("WARNING: Explicit::step() not implemented.")
     return
 
 
+  def poststep(self, t):
+    """
+    Hook for doing stuff after advancing time step.
+    """
+    self._info.log("WARNING: Explicit::poststep() not implemented.")
+    return
+
+
   def __init__(self, name="explicit"):
     """
     Constructor.
@@ -108,4 +116,20 @@
     return
 
 
+  def _calcResidual(self):
+    """
+    Compute residual, {b(t)}.
+    """
+    self._info.log("WARNING: Explicit::calcResidual() not implemented.")
+    return
+
+
+  def _calcJacobian(self):
+    """
+    Compute Jacobian, [A(t)].
+    """
+    self._info.log("WARNING: Explicit::calcJacobian() not implemented.")
+    return
+
+
 # End of file 

Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-02-15 01:12:45 UTC (rev 6030)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py	2007-02-15 05:28:42 UTC (rev 6031)
@@ -58,21 +58,6 @@
     return
 
 
-  def calcResidual(self):
-    """
-    Compute residual, {b(t)}.
-    """
-    raise NotImplementedError("Please implement calcResidual().")
-    return
-
-  def calcJacobian(self):
-    """
-    Compute Jacobian, [A(t)].
-    """
-    raise NotImplementedError("Please implement calcJacobian().")
-    return
-
-
   def __init__(self, name="formulation"):
     """
     Constructor.
@@ -92,4 +77,21 @@
     return
 
 
+  def _calcResidual(self):
+    """
+    Compute residual, {b(t)}.
+    """
+    raise NotImplementedError("Please implement calcResidual().")
+    return
+
+
+  def _calcJacobian(self):
+    """
+    Compute Jacobian, [A(t)].
+    """
+    raise NotImplementedError("Please implement calcJacobian().")
+    return
+
+
+
 # End of file 

Modified: short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/TimeDependent.py	2007-02-15 01:12:45 UTC (rev 6030)
+++ short/3D/PyLith/trunk/pylith/problems/TimeDependent.py	2007-02-15 05:28:42 UTC (rev 6031)
@@ -137,7 +137,7 @@
     """
     Hook for doing stuff before advancing time step.
     """
-    self._info.log("WARNING: TimeDependent::_prestep() not implemented.")
+    self.formulation.prestep()
     return
 
 
@@ -145,7 +145,7 @@
     """
     Advance to next time step.
     """
-    self._info.log("WARNING: TimeDependent::_step() not implemented.")
+    self.formulation.step(dt)
     return
 
 
@@ -153,7 +153,7 @@
     """
     Hook for doing stuff after advancing time step.
     """
-    self._info.log("WARNING: TimeDependent::_poststep() not implemented.")
+    self.formulation.poststep(t)
     return
 
 



More information about the cig-commits mailing list