[cig-commits] [commit] master: More work setting up simulation. (b18768a)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Feb 19 17:37:20 PST 2014


Repository : ssh://geoshell/pylith_benchmarks

On branch  : master
Link       : https://github.com/geodynamics/pylith_benchmarks/compare/385c7d351cee0569252f2d7ac9caaacc1d6b3888...b18768a541005fcf437aa50bdb2cd57e8e8adc11

>---------------------------------------------------------------

commit b18768a541005fcf437aa50bdb2cd57e8e8adc11
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Wed Feb 19 17:37:25 2014 -0800

    More work setting up simulation.


>---------------------------------------------------------------

b18768a541005fcf437aa50bdb2cd57e8e8adc11
 dynamic/scecdynrup/tpv28/create_faultsurf.py       | 16 +++++
 dynamic/scecdynrup/tpv28/create_tractions.py       | 76 ++++++++++++++++++++++
 dynamic/scecdynrup/tpv28/cubit_io.py               | 16 +++++
 dynamic/scecdynrup/tpv28/friction.spatialdb        | 22 +++++++
 dynamic/scecdynrup/tpv28/initial_stress.spatialdb  | 15 +++++
 .../{tpv102 => tpv28}/matprops.spatialdb           |  0
 dynamic/scecdynrup/{tpv24 => tpv28}/run_sim.py     | 36 ++++++----
 7 files changed, 169 insertions(+), 12 deletions(-)

diff --git a/dynamic/scecdynrup/tpv28/create_faultsurf.py b/dynamic/scecdynrup/tpv28/create_faultsurf.py
index aa5f65b..05c2f13 100755
--- a/dynamic/scecdynrup/tpv28/create_faultsurf.py
+++ b/dynamic/scecdynrup/tpv28/create_faultsurf.py
@@ -1,4 +1,20 @@
 #!/usr/bin/env python
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010-2014 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+# PREREQUISITES: numpy, netCDF4
 
 # Python script to create Exodus II mapped mesh of fault geometry for
 # import into CUBIT.
diff --git a/dynamic/scecdynrup/tpv28/create_tractions.py b/dynamic/scecdynrup/tpv28/create_tractions.py
new file mode 100755
index 0000000..7d135a0
--- /dev/null
+++ b/dynamic/scecdynrup/tpv28/create_tractions.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010-2014 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+# PREREQUISITES: numpy, spatialdata
+#
+# Create spatial variation of initial fault tractions for TPV28.
+
+filename = "initial_tration.spatialdb"
+
+# ----------------------------------------------------------------------
+import numpy
+from spatialdata.spatialdb.SimpleIOAscii import SimpleIOAscii
+from spatialdata.geocoords.CSCart import CSCart
+
+radiusOuter = 2.0e+3
+radiusInner = 1.4e+3
+dx = 100.0
+
+y = numpy.arange(-radiusOuter, +radiusOuter+0.5*dx, dx)
+numY = y.shape[0]
+
+z = numpy.arange(-7500.0-radiusOuter, -7500+radiusOuter+0.5*dx, dx)
+numZ = z.shape[0]
+
+points = numpy.zeros((numY*numZ, 3), dtype=numpy.float64)
+for iY in xrange(numY):
+    points[:,0] = 0.0
+    points[iY*numZ:(iY+1)*numZ,1] = y[iY]
+    points[iY*numZ:(iY+1)*numZ,2] = z
+
+r = (points[:,1]**2+(points[:,2]+7500.0)**2)**0.5
+maskO = numpy.bitwise_and(r > radiusInner, r <= radiusOuter)
+maskI = r <= radiusInner
+tractionShearLL = maskO*-5.80*(1.0+numpy.cos(numpy.pi*(r-1400.0)/600.0)) + maskI*-11.60
+tractionShearUD = 0*tractionShearLL
+tractionNormal = 0*tractionShearLL
+
+cs = CSCart()
+cs._configure()
+cs.initialize()
+
+dataOut = {'points': points,
+           'coordsys': cs,
+           'data_dim': 1,
+           'values': [{'name': 'traction-shear-leftlateral', 
+                       'units': 'MPa',
+                       'data': tractionShearLL},
+                      {'name': 'traction-shear-updip', 
+                       'units': 'MPa',
+                       'data': tractionShearUD},
+                      {'name': 'traction-normal', 
+                       'units': 'MPa',
+                       'data': tractionNormal},
+                      ],
+           }
+
+writer = SimpleIOAscii()
+writer.inventory.filename = "initial_traction.spatialdb"
+writer._configure()
+writer.write(dataOut)
+
+
+# End of file
diff --git a/dynamic/scecdynrup/tpv28/cubit_io.py b/dynamic/scecdynrup/tpv28/cubit_io.py
index ae8ed45..9742bc4 100644
--- a/dynamic/scecdynrup/tpv28/cubit_io.py
+++ b/dynamic/scecdynrup/tpv28/cubit_io.py
@@ -1,4 +1,20 @@
 #!/usr/bin/env python
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010-2014 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+# PREREQUISITES: numpy, netCDF4
 
 # ----------------------------------------------------------------------
 # write_exodus_file
diff --git a/dynamic/scecdynrup/tpv28/friction.spatialdb b/dynamic/scecdynrup/tpv28/friction.spatialdb
new file mode 100644
index 0000000..34ab833
--- /dev/null
+++ b/dynamic/scecdynrup/tpv28/friction.spatialdb
@@ -0,0 +1,22 @@
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 4
+  value-names = static-coefficient dynamic-coefficient slip-weakening-parameter cohesion
+  value-units =  none none m MPa
+  num-locs = 8  
+  data-dim = 2
+  space-dim = 3
+  cs-data = cartesian {
+    to-meters = 1.0e+3  // x, y, z are in km
+    space-dim = 3
+  }
+}
+0.0  -18.0    -14.999    1000.0   0.373   0.4    0.0
+0.0  -17.999  -14.999    0.677    0.373   0.4    0.0
+0.0  +17.999  -14.999    0.677    0.373   0.4    0.0
+0.0  +18.0    -14.999    1000.0   0.373   0.4    0.0
+
+0.0  -18.0    -15.000    1000.0   0.373   0.4    0.0
+0.0  -17.999  -15.000    1000.0   0.373   0.4    0.0
+0.0  +17.999  -15.000    1000.0   0.373   0.4    0.0
+0.0  +18.0    -15.000    1000.0   0.373   0.4    0.0
diff --git a/dynamic/scecdynrup/tpv28/initial_stress.spatialdb b/dynamic/scecdynrup/tpv28/initial_stress.spatialdb
new file mode 100644
index 0000000..117b14b
--- /dev/null
+++ b/dynamic/scecdynrup/tpv28/initial_stress.spatialdb
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+#SPATIAL.ascii 1
+SimpleDB {
+  num-values = 6
+  value-names =  stress-xx stress-yy stress-zz stress-xy stress-yz stress-xz
+  value-units =  MPa  MPa  MPa  MPa  MPa  MPa
+  num-locs = 1
+  data-dim = 0
+  space-dim = 3
+  cs-data = cartesian {
+    to-meters = 1.0e+3
+    space-dim = 3
+  }
+}
+0.0  0.0  0.0    -60.0  -60.0  0.0    -29.38  0.0  0.0
diff --git a/dynamic/scecdynrup/tpv102/matprops.spatialdb b/dynamic/scecdynrup/tpv28/matprops.spatialdb
similarity index 100%
copy from dynamic/scecdynrup/tpv102/matprops.spatialdb
copy to dynamic/scecdynrup/tpv28/matprops.spatialdb
diff --git a/dynamic/scecdynrup/tpv24/run_sim.py b/dynamic/scecdynrup/tpv28/run_sim.py
similarity index 62%
copy from dynamic/scecdynrup/tpv24/run_sim.py
copy to dynamic/scecdynrup/tpv28/run_sim.py
index 78582d3..e3284fb 100755
--- a/dynamic/scecdynrup/tpv24/run_sim.py
+++ b/dynamic/scecdynrup/tpv28/run_sim.py
@@ -1,4 +1,18 @@
 #!/usr/bin/env python
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010-2014 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
 #
 # Python script to facilitate running benchmarks.
 #
@@ -8,21 +22,19 @@ import os
 import sys
 import subprocess
 
-if len(sys.argv) != 7:
-    raise ValueError("usage: run_sim.py TPV CELL RES PPN NNODES QUEUE")
-tpv = sys.argv[1]
-cell = sys.argv[2]
-res = sys.argv[3]
-ppn = int(sys.argv[4])
-nnodes = int(sys.argv[5])
-queue = sys.argv[6]
-
-if not tpv in ["tpv24", "tpv25"]:
-    raise ValueError("TPV (%s) must be 'tpv24' or 'tpv25'." % pc)
+if len(sys.argv) != 6:
+    raise ValueError("usage: run_sim.py CELL RES PPN NNODES QUEUE")
+cell = sys.argv[1]
+res = sys.argv[2]
+ppn = int(sys.argv[3])
+nnodes = int(sys.argv[4])
+queue = sys.argv[5]
+
+tpv = "tpv28"
 if not cell in ["hex8", "tet4"]:
     raise ValueError("Cell type (%s) must be 'hex8' or 'tet4'." % cell)
 if not res in ["200m", "100m"]:
-    raise ValueError("Resolution (%s) must be '200c' or '100m'." % res)
+    raise ValueError("Resolution (%s) must be '200m' or '100m'." % res)
 
 nprocs = ppn*nnodes
 for d in ["output", "logs"]:



More information about the CIG-COMMITS mailing list