[cig-commits] r6538 - short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive

willic3 at geodynamics.org willic3 at geodynamics.org
Tue Apr 10 13:25:47 PDT 2007


Author: willic3
Date: 2007-04-10 13:25:47 -0700 (Tue, 10 Apr 2007)
New Revision: 6538

Added:
   short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/mklinks.py
   short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/pylith3d-np2.cfg
   short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/pylith3d.cfg
Removed:
   short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/runbm.py
Modified:
   short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/tutor.py
Log:
Updated tutorial to use *.cfg files and new ways of dealing with
filenames.



Added: short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/mklinks.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/mklinks.py	2007-04-10 18:19:28 UTC (rev 6537)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/mklinks.py	2007-04-10 20:25:47 UTC (rev 6538)
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+root="bmrsnog"
+
+# ----------------------------------------------------------------------
+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/reversenog/archive/mklinks.py
___________________________________________________________________
Name: svn:executable
   + *

Added: short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/pylith3d-np2.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/pylith3d-np2.cfg	2007-04-10 18:19:28 UTC (rev 6537)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/pylith3d-np2.cfg	2007-04-10 20:25:47 UTC (rev 6538)
@@ -0,0 +1,128 @@
+[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
+
+# PyLith i/o info
+fileRoot = bmrsnog_2
+asciiOutput = full
+ucdOutput = ascii
+
+# Specific filenames below are to allow single-processor and
+# multi-processor files to exist in the same directory.
+# coordinateInputFile = bmrsnog_2.coord
+# connectivityInputFile = bmrsnog_2.connect
+# bcInputFile = bmrsnog_2.bc
+# splitNodeInputFile = bmrsnog_2.split
+# outputFileRoot = bmrsnog_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/reversenog/archive/pylith3d.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/pylith3d.cfg	2007-04-10 18:19:28 UTC (rev 6537)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/pylith3d.cfg	2007-04-10 20:25:47 UTC (rev 6538)
@@ -0,0 +1,124 @@
+[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
+
+# PyLith i/o info
+fileRoot = bmrsnog_1
+asciiOutput = full
+ucdOutput = ascii
+
+# Specific filenames below are to allow single-processor and
+# multi-processor files to exist in the same directory.
+# coordinateInputFile = bmrsnog_1.coord
+# connectivityInputFile = bmrsnog_1.connect
+# bcInputFile = bmrsnog_1.bc
+# splitNodeInputFile = bmrsnog_1.split
+# outputFileRoot = bmrsnog_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/reversenog/archive/runbm.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/runbm.py	2007-04-10 18:19:28 UTC (rev 6537)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/runbm.py	2007-04-10 20:25:47 UTC (rev 6538)
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-#
-# ======================================================================
-#
-#                           Brad T. Aagaard
-#                        U.S. Geological Survey
-#
-# {LicenseText}
-#
-# ======================================================================
-#
-
-root="bmrsnog"
-
-# ----------------------------------------------------------------------
-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/reversenog/archive/tutor.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/tutor.py	2007-04-10 18:19:28 UTC (rev 6537)
+++ short/3D/PyLith/branches/pylith-0.8/tutorials/reversenog/archive/tutor.py	2007-04-10 20:25:47 UTC (rev 6538)
@@ -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,8 @@
 
     fragments = [ [root1], [".0"],
                   [".coord", ".connect", ".split", ".bc",
-                   ".ascii", ".vtk",
-                   ".fuldat", ".prop", ".statevar", ".time"] ]
+                   ".ascii", ".vtk"] ]
+                   
     files['output'] += assembleStrings(fragments)
     
     fragments = [ [root1], [".0"],
@@ -83,7 +84,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 +93,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