[cig-commits] r20506 - short/3D/PyLith/branches/v1.7-stable/pylith/apps

brad at geodynamics.org brad at geodynamics.org
Sun Jul 8 22:03:02 PDT 2012


Author: brad
Date: 2012-07-08 22:03:01 -0700 (Sun, 08 Jul 2012)
New Revision: 20506

Modified:
   short/3D/PyLith/branches/v1.7-stable/pylith/apps/PyLithApp.py
Log:
Added initialize_only property to PyLithApp.

Modified: short/3D/PyLith/branches/v1.7-stable/pylith/apps/PyLithApp.py
===================================================================
--- short/3D/PyLith/branches/v1.7-stable/pylith/apps/PyLithApp.py	2012-07-09 05:02:28 UTC (rev 20505)
+++ short/3D/PyLith/branches/v1.7-stable/pylith/apps/PyLithApp.py	2012-07-09 05:03:01 UTC (rev 20506)
@@ -39,7 +39,7 @@
     ## Python object for managing PyLithApp facilities and properties.
     ##
     ## \b Properties
-    ## @li None
+    ## @li \b initialize_only Stop simulation after initializing problem.
     ##
     ## \b Facilities
     ## @li \b mesher Generates or imports the computational mesh.
@@ -48,6 +48,9 @@
 
     import pyre.inventory
 
+    initializeOnly = pyre.inventory.bool("initialize_only", default=False)
+    initializeOnly.meta['tip'] = "Stop simulation after initializing problem."
+
     from pylith.topology.MeshImporter import MeshImporter
     mesher = pyre.inventory.facility("mesh_generator", family="mesh_generator",
                                      factory=MeshImporter)
@@ -115,6 +118,10 @@
 
     self._eventLogger.stagePop()
 
+    # If initializing only, stop before running problem
+    if self.initializeOnly:
+      return
+
     # Run problem
     self.problem.run(self)
     self._debug.log(resourceUsageString())
@@ -141,6 +148,7 @@
     Setup members using inventory.
     """
     PetscApplication._configure(self)
+    self.initializeOnly = self.inventory.initializeOnly
     self.mesher = self.inventory.mesher
     self.problem = self.inventory.problem
     self.perfLogger = self.inventory.perfLogger



More information about the CIG-COMMITS mailing list