[cig-commits] r6539 -
short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive
willic3 at geodynamics.org
willic3 at geodynamics.org
Tue Apr 10 14:14:49 PDT 2007
Author: willic3
Date: 2007-04-10 14:14:48 -0700 (Tue, 10 Apr 2007)
New Revision: 6539
Added:
short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/mklinks.py
short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/pylith3d-np2.cfg
short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/pylith3d.cfg
Removed:
short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/runbm.py
Modified:
short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/tutor.py
Log:
Updated tutorial to use *.cfg files and new methods of dealing with
filenames.
Added: short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/mklinks.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/mklinks.py 2007-04-10 20:25:47 UTC (rev 6538)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/mklinks.py 2007-04-10 21:14:48 UTC (rev 6539)
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+root="splitcube"
+
+# ----------------------------------------------------------------------
+def setupInput(nprocs):
+ dupext = [".fuldat", ".prop", ".statevar", ".time"]
+ sinext = [".coord", ".connect", ".bc", ".split"]
+
+ print "Setting up symbolic links with prefix '%s_%d':" % (root, nprocs)
+ import os
+
+ dirFiles = os.listdir(os.getcwd())
+ for ext in sinext:
+ src = "%s%s" % (root, ext)
+ dest = "%s_%s%s" % (root, nprocs, ext)
+ if not dest in dirFiles:
+ print " %s -> %s... created" % (dest, src)
+ os.symlink(src, dest)
+ else:
+ print " %s -> %s... already exists" % (dest, src)
+
+ for ext in dupext:
+ src = "%s%s" % (root, ext)
+ dest = "%s_%s%s" % (root, nprocs, ext)
+ if not dest in dirFiles:
+ print " %s -> %s... created" % (dest, src)
+ os.symlink(src, dest)
+ else:
+ print " %s -> %s... already exists" % (dest, src)
+
+ return
+
+# ----------------------------------------------------------------------
+if __name__ == "__main__":
+
+ nprocs = 1
+ setupInput(nprocs)
+ nprocs = 2
+ setupInput(nprocs)
+
+# End of file
Property changes on: short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/mklinks.py
___________________________________________________________________
Name: svn:executable
+ *
Added: short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/pylith3d-np2.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/pylith3d-np2.cfg 2007-04-10 20:25:47 UTC (rev 6538)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/pylith3d-np2.cfg 2007-04-10 21:14:48 UTC (rev 6539)
@@ -0,0 +1,131 @@
+[pylith3d.launcher]
+# Specify multi-processor run
+command = mpiexec -np 2
+
+[pylith3d]
+# PETSc options
+log_summary = true
+pc_type = bjacobi
+sub_pc_type = ilu
+ksp_monitor = true
+ksp_view = true
+ksp_rtol = 1.0e-9
+# start_in_debugger = true
+# debugger_pause = 100
+
+# Using pythonTimestep allows full vtk output for each time step
+pythonTimestep = true
+
+# PyLith i/o info
+fileRoot = splitcube_2
+asciiOutput = full
+ucdOutput = ascii
+
+# Specific filenames below are to allow single-processor and
+# multi-processor files to exist in the same directory.
+# coordinateInputFile = splitcube_2.coord
+# connectivityInputFile = splitcube_2.connect
+# bcInputFile = splitcube_2.bc
+# splitNodeInputFile = splitcube_2.split
+# outputFileRoot = splitcube_2
+
+# Parameters that were previously specified in a 'keyword=value' file:
+
+# Example of a keyword=value file to be used with TECTON.
+# In this example, the default values are listed, but commented out.
+# To change a default value, uncomment the appropriate entry and
+# edit the value.
+# With the present implementation, there should not be any spaces
+# before the keyword.
+#
+# Non-default parameters to be used for SCEC BM 5.
+#
+# Scaling factors applied to Winkler forces. These factors may be
+# used as a quick and easy way of changing the density or gravitational
+# acceleration when Winkler forces are used to simulate gravity.
+#
+#winklerScaleX = 1.0
+#winklerScaleY = 1.0
+#winklerScaleZ = 1.0
+#
+#
+# Parameters controlling stress integration and numerical computation
+# of the tangent material matrix. These default values should be
+# reasonable for most cases.
+#
+#stressTolerance = 1.0e-12*Pa
+#minimumStrainPerturbation = 1.0e-7
+#initialStrainPerturbation = 1.0e-1
+#
+#
+# Parameters controlling the solution of the linear problem at each
+# iteration. This is now all controlled by PETSc command-line
+# arguments. The only option now specified in this file is whether to
+# use the solution from the previous time step as the starting guess
+# for the current time step.
+#
+#usePreviousDisplacementFlag = 0
+#
+#
+# Quadrature order for the problem. The options are:
+# Full: Quadrature order that should give the exact
+# element matrices when the elements are
+# geometrically undistorted.
+# Reduced: Quadrature order that is one order less than
+# full quadrature. This option should be used
+# with caution.
+# Selective: Uses Hughes' b-bar formulation to perform
+# reduced quadrature on the dilatational parts of
+# the strain-displacement matrix. This can be
+# useful in nearly-incompressible problems.
+#
+#quadratureOrder = Full
+#
+#
+# Gravitational acceleration in each direction.
+#
+#gravityX = 0.0*m/(s*s)
+#gravityY = 0.0*m/(s*s)
+#gravityZ = 0.0*m/(s*s)
+#
+#
+# Factors controlling computation of prestresses. When gravity is being
+# used, an automatic computation option may be used, with the option of
+# using alternative values for Poisson's ratio and Young's modulus.
+# Each prestress component may also be scaled. This option is only
+# useful if the prestresses are read from a file (and not automatically
+# computed).
+#
+#prestressAutoCompute = False
+#prestressAutoChangeElasticProps = False
+#prestressAutoComputePoisson = 0.49
+#prestressAutoComputeYoungs = 1.0e30*Pa
+#
+#prestressScaleXx = 1.0
+#prestressScaleYy = 1.0
+#prestressScaleZz = 1.0
+#prestressScaleXy = 1.0
+#prestressScaleXz = 1.0
+#prestressScaleYz = 1.0
+#
+#
+# Scaling factors applied to differential Winkler forces. Differential
+# Winkler forces are those applied across a slippery node interface, and
+# are generally used to keep the fault locked at certain times. These
+# factors control the magnitudes and provide a simple way of scaling the
+# forces so the fault remains sufficiently 'locked'.
+#
+#winklerSlipScaleX = 1.0
+#winklerSlipScaleY = 1.0
+#winklerSlipScaleZ = 1.0
+#
+#
+# Unit numbers used by f77. These defaults should work for most Unix
+# systems, but may be altered if necessary.
+#
+#f77StandardInput = 5
+#f77StandardOutput = 6
+#f77FileInput = 10
+#f77AsciiOutput = 11
+#f77PlotOutput = 12
+#f77UcdOutput = 13
Added: short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/pylith3d.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/pylith3d.cfg 2007-04-10 20:25:47 UTC (rev 6538)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/pylith3d.cfg 2007-04-10 21:14:48 UTC (rev 6539)
@@ -0,0 +1,127 @@
+[pylith3d]
+# PETSc options
+log_summary = true
+pc_type = bjacobi
+sub_pc_type = ilu
+ksp_monitor = true
+ksp_view = true
+ksp_rtol = 1.0e-9
+# start_in_debugger = true
+# debugger_pause = 100
+
+# Using pythonTimestep allows full vtk output for each time step
+pythonTimestep = true
+
+# PyLith i/o info
+fileRoot = splitcube_1
+asciiOutput = full
+ucdOutput = ascii
+
+# Specific filenames below are to allow single-processor and
+# multi-processor files to exist in the same directory.
+# coordinateInputFile = splitcube_1.coord
+# connectivityInputFile = splitcube_1.connect
+# bcInputFile = splitcube_1.bc
+# splitNodeInputFile = splitcube_1.split
+# outputFileRoot = splitcube_1
+
+# Parameters that were previously specified in a 'keyword=value' file:
+
+# Example of a keyword=value file to be used with TECTON.
+# In this example, the default values are listed, but commented out.
+# To change a default value, uncomment the appropriate entry and
+# edit the value.
+# With the present implementation, there should not be any spaces
+# before the keyword.
+#
+# Non-default parameters to be used for SCEC BM 5.
+#
+# Scaling factors applied to Winkler forces. These factors may be
+# used as a quick and easy way of changing the density or gravitational
+# acceleration when Winkler forces are used to simulate gravity.
+#
+#winklerScaleX = 1.0
+#winklerScaleY = 1.0
+#winklerScaleZ = 1.0
+#
+#
+# Parameters controlling stress integration and numerical computation
+# of the tangent material matrix. These default values should be
+# reasonable for most cases.
+#
+#stressTolerance = 1.0e-12*Pa
+#minimumStrainPerturbation = 1.0e-7
+#initialStrainPerturbation = 1.0e-1
+#
+#
+# Parameters controlling the solution of the linear problem at each
+# iteration. This is now all controlled by PETSc command-line
+# arguments. The only option now specified in this file is whether to
+# use the solution from the previous time step as the starting guess
+# for the current time step.
+#
+#usePreviousDisplacementFlag = 0
+#
+#
+# Quadrature order for the problem. The options are:
+# Full: Quadrature order that should give the exact
+# element matrices when the elements are
+# geometrically undistorted.
+# Reduced: Quadrature order that is one order less than
+# full quadrature. This option should be used
+# with caution.
+# Selective: Uses Hughes' b-bar formulation to perform
+# reduced quadrature on the dilatational parts of
+# the strain-displacement matrix. This can be
+# useful in nearly-incompressible problems.
+#
+#quadratureOrder = Full
+#
+#
+# Gravitational acceleration in each direction.
+#
+#gravityX = 0.0*m/(s*s)
+#gravityY = 0.0*m/(s*s)
+#gravityZ = 0.0*m/(s*s)
+#
+#
+# Factors controlling computation of prestresses. When gravity is being
+# used, an automatic computation option may be used, with the option of
+# using alternative values for Poisson's ratio and Young's modulus.
+# Each prestress component may also be scaled. This option is only
+# useful if the prestresses are read from a file (and not automatically
+# computed).
+#
+#prestressAutoCompute = False
+#prestressAutoChangeElasticProps = False
+#prestressAutoComputePoisson = 0.49
+#prestressAutoComputeYoungs = 1.0e30*Pa
+#
+#prestressScaleXx = 1.0
+#prestressScaleYy = 1.0
+#prestressScaleZz = 1.0
+#prestressScaleXy = 1.0
+#prestressScaleXz = 1.0
+#prestressScaleYz = 1.0
+#
+#
+# Scaling factors applied to differential Winkler forces. Differential
+# Winkler forces are those applied across a slippery node interface, and
+# are generally used to keep the fault locked at certain times. These
+# factors control the magnitudes and provide a simple way of scaling the
+# forces so the fault remains sufficiently 'locked'.
+#
+#winklerSlipScaleX = 1.0
+#winklerSlipScaleY = 1.0
+#winklerSlipScaleZ = 1.0
+#
+#
+# Unit numbers used by f77. These defaults should work for most Unix
+# systems, but may be altered if necessary.
+#
+#f77StandardInput = 5
+#f77StandardOutput = 6
+#f77FileInput = 10
+#f77AsciiOutput = 11
+#f77PlotOutput = 12
+#f77UcdOutput = 13
Deleted: short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/runbm.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/runbm.py 2007-04-10 20:25:47 UTC (rev 6538)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/runbm.py 2007-04-10 21:14:48 UTC (rev 6539)
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-#
-# ======================================================================
-#
-# Brad T. Aagaard
-# U.S. Geological Survey
-#
-# {LicenseText}
-#
-# ======================================================================
-#
-
-root="splitcube"
-
-# ----------------------------------------------------------------------
-def setupInput(nprocs):
- dupext = [".fuldat", ".prop", ".statevar", ".time"]
- sinext = [".coord", ".connect", ".bc", ".split"]
-
- print "Setting up symbolic links with prefix '%s_%d':" % (root, nprocs)
- import os
-
- dirFiles = os.listdir(os.getcwd())
- for ext in sinext:
- src = "%s%s" % (root, ext)
- dest = "%s_%s%s" % (root, nprocs, ext)
- if not dest in dirFiles:
- print " %s -> %s... created" % (dest, src)
- os.symlink(src, dest)
- else:
- print " %s -> %s... already exists" % (dest, src)
-
- for ext in dupext:
- src = "%s%s" % (root, ext)
- for iproc in range(nprocs):
- dest = "%s_%s.%d%s" % (root, nprocs, iproc, ext)
- if not dest in dirFiles:
- print " %s -> %s... created" % (dest, src)
- os.symlink(src, dest)
- else:
- print " %s -> %s... already exists" % (dest, src)
- return
-
-
-# ----------------------------------------------------------------------
-def run(nprocs):
- print "Running PyLith..."
-
- # TODO: Replace the use of launching via 'system' with use
- # of Leif's architecture independent utility.
-
- cmd = "mpirun -np %d `which pylith3dapp.py` " \
- "--typos=relaxed " \
- "--scanner.fileRoot=%s_%d " \
- "--scanner.asciiOutput=full " \
- "--scanner.ucdOutput=ascii " \
- "-log_summary -pc_type bjacobi -sub_pc_type ilu " \
- "-ksp_monitor -ksp_view -ksp_rtol 1e-09" % (nprocs, root, nprocs)
- import os
- print cmd
- os.system(cmd)
- return
-
-
-# ----------------------------------------------------------------------
-if __name__ == "__main__":
- from optparse import OptionParser
-
- parser = OptionParser()
- parser.add_option("-n", "--numprocs", dest="nprocs",
- type="int", metavar="NPROCS",
- help="Set number of processors.")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.error("Incorrent number of arguments.")
-
- nprocs = 1
- if not options.nprocs is None:
- nprocs = options.nprocs
-
- setupInput(nprocs)
- run(nprocs)
-
-
-# End of file
Modified: short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/tutor.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/tutor.py 2007-04-10 20:25:47 UTC (rev 6538)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/splitcube/archive/tutor.py 2007-04-10 21:14:48 UTC (rev 6539)
@@ -52,7 +52,8 @@
fragments = [ [root], [".coord", ".connect", ".split", ".bc",
".fuldat", ".prop", ".statevar", ".time"] ]
files['input'] += assembleStrings(fragments)
- files['input'] += ["runbm.py"]
+ files['input'] += ["pylith3d.cfg"]
+ files['input'] += ["mklinks.py"]
root1 = root + "_1"
fragments = [ [root1], [".coord", ".connect", ".split", ".bc"] ]
@@ -60,8 +61,7 @@
fragments = [ [root1], [".0"],
[".coord", ".connect", ".split", ".bc",
- ".ascii", ".vtk",
- ".fuldat", ".prop", ".statevar", ".time"] ]
+ ".ascii", ".vtk"] ]
files['output'] += assembleStrings(fragments)
fragments = [ [root1], [".0"],
@@ -83,7 +83,8 @@
fragments = [ [root], [".coord", ".connect", ".split", ".bc",
".fuldat", ".prop", ".statevar", ".time"] ]
files['input'] += assembleStrings(fragments)
- files['input'] += ["runbm.py"]
+ files['input'] += ["pylith3d-np2.cfg"]
+ files['input'] += ["mklinks.py"]
root1 = root + "_2"
fragments = [ [root1], [".coord", ".connect", ".split", ".bc"] ]
@@ -91,8 +92,7 @@
fragments = [ [root1], [".0", ".1"],
[".coord", ".connect", ".split", ".bc",
- ".ascii", ".vtk",
- ".fuldat", ".prop", ".statevar", ".time"] ]
+ ".ascii", ".vtk"] ]
files['output'] += assembleStrings(fragments)
fragments = [ [root1], [".0", ".1"],
More information about the cig-commits
mailing list