[cig-commits] r14014 - short/2.5D/benchmarks/savageprescott/utils
willic3 at geodynamics.org
willic3 at geodynamics.org
Tue Feb 3 16:31:25 PST 2009
Author: willic3
Date: 2009-02-03 16:31:25 -0800 (Tue, 03 Feb 2009)
New Revision: 14014
Modified:
short/2.5D/benchmarks/savageprescott/utils/savpres_ss.cfg
short/2.5D/benchmarks/savageprescott/utils/savpres_ss.py
Log:
Added options to control timestamp information in output files.
Modified: short/2.5D/benchmarks/savageprescott/utils/savpres_ss.cfg
===================================================================
--- short/2.5D/benchmarks/savageprescott/utils/savpres_ss.cfg 2009-02-04 00:06:19 UTC (rev 14013)
+++ short/2.5D/benchmarks/savageprescott/utils/savpres_ss.cfg 2009-02-04 00:31:25 UTC (rev 14014)
@@ -2,12 +2,12 @@
[savpres_ss]
# Top-level info
-elas_thick = 27.0*km
-lock_depth = 13.5*km
+elas_thick = 40.0*km
+lock_depth = 20.0*km
recurrence_time = 200.0*year
viscosity = 4.73364e+19*Pa*s
shear_modulus = 30.0*GPa
-plate_velocity = -2.0*cm/year
+plate_velocity = 2.0*cm/year
number_cycles = 10
number_steps = 20
number_terms = 50
@@ -16,4 +16,6 @@
x_epsilon = 0.01*m
vtk_basename = savageprescott.vtk
csv_filename = savageprescott.csv
-title = Test model with D/H = 0.5 and tau0 = 0.5.
+time_units = 1.0*year
+time_stamp_width = 4
+title = Test model with D = 20 km, H = 40 km, and tau0 = 0.5.
Modified: short/2.5D/benchmarks/savageprescott/utils/savpres_ss.py
===================================================================
--- short/2.5D/benchmarks/savageprescott/utils/savpres_ss.py 2009-02-04 00:06:19 UTC (rev 14013)
+++ short/2.5D/benchmarks/savageprescott/utils/savpres_ss.py 2009-02-04 00:31:25 UTC (rev 14014)
@@ -51,6 +51,8 @@
## @li \b x_epsilon Offset for computation point closest to the fault.
## @li \b vtk_basename Base name for VTK output files.
## @li \b csv_filename Filename for CSV output.
+ ## @li \b time_units Time units to use for output filenames.
+ ## @li \b time_stamp_width Width of time stamp in output filenames.
## @li \b title Title to appear at the top of VTK files.
import pyre.inventory
@@ -107,6 +109,12 @@
CSVFileName = pyre.inventory.str("csv_filename", default="savpres_ss.csv")
CSVFileName.meta['tip'] = "Filename for CSV output."
+ timeUnits = pyre.inventory.dimensional("time_units", default=1.0*year)
+ timeUnits.meta['tip'] = "Time units to use for output filenames."
+
+ timeStampWidth = pyre.inventory.int("time_stamp_width", default=4)
+ timeStampWidth.meta['tip'] = "Number digits in output filename time stamp."
+
title = pyre.inventory.str("title",
default="Savage & Prescott strike-slip solution")
title.meta['tip'] = "Title to appear at the top of VTK files."
@@ -149,6 +157,8 @@
self.xEpsilon = self.inventory.xEpsilon.value
self.VTKBaseName = self.inventory.VTKBaseName
self.CSVFileName = self.inventory.CSVFileName
+ self.timeUnits = self.inventory.timeUnits.value
+ self.timeStampWidth = self.inventory.timeStampWidth
self.title = self.inventory.title
self.deltaT = self.recurrenceTime/self.numberSteps
@@ -307,7 +317,9 @@
time = 0.0
for step in range(self.numberSteps + 1):
- VTKFile = fileBaseCycle + str(time) + ".vtk"
+ timeStampInt = int(time/self.timeUnits)
+ timeStampString = repr(timeStampInt).rjust(self.timeStampWidth, '0')
+ VTKFile = fileBaseCycle + timeStampString + ".vtk"
f = open(VTKFile, 'w')
self._writeVTK(f, cycle, step)
f.close()
@@ -355,7 +367,9 @@
time = 0.0
for step in range(self.numberSteps + 1):
- head += "," + cycleHead + str(time)
+ timeStampInt = int(time/self.timeUnits)
+ timeStampString = repr(timeStampInt).rjust(self.timeStampWidth, '0')
+ head += "," + cycleHead + timeStampString
time += self.deltaT
f.write('%s\n' % head)
More information about the CIG-COMMITS
mailing list