[cig-commits] r19504 - in short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity: . dynamic

brad at geodynamics.org brad at geodynamics.org
Fri Jan 27 16:23:37 PST 2012


Author: brad
Date: 2012-01-27 16:23:37 -0800 (Fri, 27 Jan 2012)
New Revision: 19504

Added:
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/Makefile.am
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/README
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8.cfg
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8.mesh
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8_pwave.cfg
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8_swave.cfg
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/plot_data.py
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/pwave.cfg
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/pylithapp.cfg
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/runtests.sh
   short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/swave.cfg
Log:
Added dynamic plasticity tests.

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/Makefile.am
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/Makefile.am	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/Makefile.am	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,30 @@
+# -*- Makefile -*-
+#
+# ----------------------------------------------------------------------
+#
+# 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-2011 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+dist_noinst_DATA = \
+	README \
+	runtests.sh \
+	pylithapp.cfg \
+	pwave.cfg \
+	swave.cfg \
+	hex8.mesh \
+	hex8_pwave.cfg \
+	hex8_swave.cfg \
+	plot_data.py
+
+# End of file 

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/README
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/README	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/README	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,6 @@
+Drucker-Prager P wave and S wave tests from SCEC dynamic rupture
+benchmarks TPV13 and TPV19. See http://scecdata.usc.edu/cvws for more
+information.
+
+Execute the bash script runtest.sh to run the tests and then plot the
+results using plot_data.py (requires PyTables and Matplotlib).

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8.cfg	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8.cfg	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,19 @@
+# -*- Python -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# mesh_generator
+# ----------------------------------------------------------------------
+[pylithapp.mesh_generator.reader]
+filename = hex8.mesh
+coordsys.space_dim = 3
+
+# ----------------------------------------------------------------------
+# materials
+# ----------------------------------------------------------------------
+[pylithapp.timedependent.materials.elastic]
+quadrature.cell = pylith.feassemble.FIATLagrange
+quadrature.cell.dimension = 3
+
+
+# End of file

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8.mesh
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8.mesh	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8.mesh	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,45 @@
+mesh = {
+  dimension = 3
+  use-index-zero = true
+  vertices = {
+    dimension = 3
+    count = 8
+    coordinates = {
+             0      0.0  0.0  0.0
+             1      0.0  1.0  0.0
+             2      0.0  0.0  1.0
+             3      0.0  1.0  1.0
+             4      1.0  0.0  0.0
+             5      1.0  1.0  0.0
+             6      1.0  0.0  1.0
+             7      1.0  1.0  1.0
+    }
+  }
+  cells = {
+    count = 1
+    num-corners = 8
+    simplices = {
+             0       0  4  5  1  2  6  7  3
+    }
+    material-ids = {
+             0   1
+    }
+  }
+
+  group = {
+    name = xneg
+    type = vertices
+    count = 4
+    indices = {
+      0  1  2  3
+    }
+  }
+  group = {
+    name = xpos
+    type = vertices
+    count = 4
+    indices = {
+      4  5  6  7
+    }
+  }
+}

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8_pwave.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8_pwave.cfg	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8_pwave.cfg	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,14 @@
+# -*- Python -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+[pylithapp.problem.formulation.output.domain]
+writer.filename = hex8_pwave.h5
+
+[pylithapp.timedependent.materials.elastic.output]
+writer.filename = hex8_pwave-statevars.h5
+
+
+# End of file

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8_swave.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8_swave.cfg	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/hex8_swave.cfg	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,14 @@
+# -*- Python -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+[pylithapp.problem.formulation.output.domain]
+writer.filename = hex8_swave.h5
+
+[pylithapp.timedependent.materials.elastic.output]
+writer.filename = hex8_swave-statevars.h5
+
+
+# End of file

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/plot_data.py
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/plot_data.py	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/plot_data.py	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,133 @@
+#!/usr/bin/env python
+import sys
+
+if len(sys.argv) != 3:
+    raise ValueError("usage: plot_data.py CELL SIM")
+
+cell = sys.argv[1]
+sim = sys.argv[2]
+
+if not sim in ['swave', 'pwave']:
+    raise ValueError("Unknown sim '%s'." % sim)
+
+
+# ======================================================================
+import tables
+import pylab
+import numpy
+
+# ----------------------------------------------------------------------
+def swave_soln():
+
+    dt = 5.0e-6
+    tend = 5.0e-4
+    t = numpy.arange(0.0, tend+0.5*dt, dt)
+
+    mask = t < 1.2956829537e-4
+    sxx = 0*t
+    syy = 0*t
+    szz = 0*t
+    sxy = mask*2.9403000000e+10*t + ~mask*3.8096965888e+6
+    syz = 0*t
+    sxz = 0*t
+
+    return {'t': t,
+            'sxx': sxx,
+            'syy': syy,
+            'szz': szz,
+            'sxy': sxy,
+            'syz': syz,
+            'sxz': sxz}
+
+
+# ----------------------------------------------------------------------
+def pwave_soln():
+    dt = 5.0e-5
+    tend = 5.0e-3
+    t = numpy.arange(0.0, tend+0.5*dt, dt)
+
+    mask = t < 1.7246213245e-3
+    sxx = mask*-8.8216171200e+10*t + ~mask*(-8.5665432299e+10*t-4.3990587021e+6)
+    syy = mask*-2.9410171200e+10*t + ~mask*(-3.0685540651e+10*t+2.1995293511e+6)
+    szz = 1.0*syy
+    sxy = 0*t
+    syz = 0*t
+    sxz = 0*t
+
+    return {'t': t,
+            'sxx': sxx,
+            'syy': syy,
+            'szz': szz,
+            'sxy': sxy,
+            'syz': syz,
+            'sxz': sxz}
+
+
+# ----------------------------------------------------------------------
+# Analytical soln
+if sim == "swave":
+    analytic = swave_soln()
+elif sim == "pwave":
+    analytic = pwave_soln()
+else:
+    raise ValueError("Unknown sim.")
+
+
+# Synthetic
+h5 = tables.openFile("%s_%s-statevars.h5" % (cell, sim), "r")
+time = h5.root.time[:].ravel()
+stress = h5.root.cell_fields.stress[:]
+h5.close()
+
+# Redimensionalize
+timescale = 1.0e-6
+analytic['t'] /= timescale
+time /= timescale
+
+stressscale = 1.0e+6
+analytic['sxx'] /= stressscale
+analytic['syy'] /= stressscale
+analytic['szz'] /= stressscale
+analytic['sxy'] /= stressscale
+analytic['syz'] /= stressscale
+analytic['sxz'] /= stressscale
+stress /= stressscale
+
+# Plot
+fig = pylab.Figure()
+
+if sim == "swave":
+    xlim = (0, 500)
+    ylim = (-1, 10)
+else:
+    xlim = (0, 5000)
+    ylim = (-450, 10)
+
+
+# Axial components
+ax = pylab.subplot(1, 2, 1)
+ax.plot(analytic['t'], analytic['sxx'], 'k-',
+        time, stress[:,0,0:48:6], 'r--',
+        analytic['t'], analytic['syy'], 'k-',
+        time, stress[:,0,1:48:6], 'r--',
+        analytic['t'], analytic['szz'], 'k-',
+        time, stress[:,0,2:48:6], 'r--')
+ax.set_xlim(xlim)
+ax.set_ylim(ylim)
+ax.set_xlabel("Time (usec)")
+ax.set_ylabel("Stress (MPa)")
+
+# Shear components
+ax = pylab.subplot(1, 2, 2)
+ax.plot(analytic['t'], analytic['sxy'], 'k-',
+        time, stress[:,0,3:48:6], 'r--',
+        analytic['t'], analytic['syz'], 'k-',
+        time, stress[:,0,4:48:6], 'r--',
+        analytic['t'], analytic['sxz'], 'k-',
+        time, stress[:,0,5:48:6], 'r--')
+ax.set_xlim(xlim)
+ax.set_ylim(ylim)
+ax.set_xlabel("Time (usec)")
+ax.set_ylabel("Stress (MPa)")
+
+pylab.show()


Property changes on: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/plot_data.py
___________________________________________________________________
Name: svn:executable
   + *

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/pwave.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/pwave.cfg	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/pwave.cfg	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,24 @@
+# -*- Python -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+dimension = 3
+
+[pylithapp.timedependent.formulation.time_step]
+total_time = 5.0e-03*s
+dt = 5.0e-05*s
+
+# ----------------------------------------------------------------------
+# boundary conditions
+# ----------------------------------------------------------------------
+[pylithapp.timedependent.bc.x_pos]
+db_rate = spatialdata.spatialdb.UniformDB
+db_rate.label = Velocity BC on +x
+db_rate.values = [displacement-rate-x, displacement-rate-y, displacement-rate-z, rate-start-time]
+db_rate.data = [-1.0*m/s, 0.0*m/s, 0.0*m/s, 0.0*s]
+
+
+# End of file

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/pylithapp.cfg	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/pylithapp.cfg	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,89 @@
+# -*- Python -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# journal
+# ----------------------------------------------------------------------
+[pylithapp.journal.info]
+timedependent = 1
+explicit = 1
+petsc = 1
+solverlinear = 1
+meshioascii = 1
+homogeneous = 1
+elasticityexplicit = 1
+quadrature3d = 1
+fiatlagrange = 1
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+dimension = 3
+
+formulation = pylith.problems.ExplicitLumped
+formulation.norm_viscosity = 1.0e-30
+normalizer = spatialdata.units.NondimElasticDynamic
+normalizer.shear_wave_speed = 3300*m/s
+normalizer.wave_period = 0.003*s
+normalizer.mass_density = 2716*kg/m**3
+
+# ----------------------------------------------------------------------
+# materials
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+materials = [elastic]
+materials.elastic = pylith.materials.DruckerPrager3D
+
+[pylithapp.timedependent.materials.elastic]
+label = Elastic material
+id = 1
+
+db_properties = spatialdata.spatialdb.UniformDB
+db_properties.label = Elastic properties
+db_properties.values = [density, vs, vp, cohesion, friction-angle, dilatation-angle]
+db_properties.data = [2700*kg/m**3, 3300.0*m/s, 5716.0*m/s, 5.0*MPa, 40.36453657309736*degree, 0.0*degree]
+
+
+# ----------------------------------------------------------------------
+# boundary conditions
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+bc = [x_neg,x_pos]
+
+[pylithapp.timedependent.bc.x_pos]
+bc_dof = [0,1,2]
+label = xpos
+
+db_initial.label = Initial displacement BC +x
+
+[pylithapp.timedependent.bc.x_neg]
+bc_dof = [0,1,2]
+label = xneg
+
+db_initial.label = Initial displacement BC -x
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+[pylithapp.timedependent.formulation]
+output = [domain]
+
+[pylithapp.problem.formulation.output.domain]
+vertex_data_fields=[displacement,velocity]
+writer = pylith.meshio.DataWriterHDF5Mesh
+
+[pylithapp.timedependent.materials.elastic.output]
+cell_info_fields = []
+cell_data_fields = [stress]
+writer = pylith.meshio.DataWriterHDF5Mesh
+
+
+# ----------------------------------------------------------------------
+# PETSc
+# ----------------------------------------------------------------------
+[pylithapp.petsc]
+#log_summary = true
+
+
+# End of file

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/runtests.sh
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/runtests.sh	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/runtests.sh	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+pylith hex8.cfg swave.cfg hex8_swave.cfg
+plot_data.py hex8 swave &
+
+pylith hex8.cfg pwave.cfg hex8_pwave.cfg
+plot_data.py hex8 pwave &
+
+#pylith tet4.cfg swave.cfg tet4_swave.cfg
+#plot_data.py tet4 swave &
+
+#pylith tet4.cfg pwave.cfg tet4_pwave.cfg
+#plot_data.py tet4 pwave &

Added: short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/swave.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/swave.cfg	                        (rev 0)
+++ short/3D/PyLith/branches/v1.6-stable/tests/3d/plasticity/dynamic/swave.cfg	2012-01-28 00:23:37 UTC (rev 19504)
@@ -0,0 +1,24 @@
+# -*- Python -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+dimension = 3
+
+[pylithapp.timedependent.formulation.time_step]
+total_time = 5.0e-04*s
+dt = 5.0e-06*s
+
+# ----------------------------------------------------------------------
+# boundary conditions
+# ----------------------------------------------------------------------
+[pylithapp.timedependent.bc.x_pos]
+db_rate = spatialdata.spatialdb.UniformDB
+db_rate.label = Velocity BC on +x
+db_rate.values = [displacement-rate-x, displacement-rate-y, displacement-rate-z, rate-start-time]
+db_rate.data = [0.0*m/s, 1.0*m/s, 0.0*m/s, 0.0*s]
+
+
+# End of file



More information about the CIG-COMMITS mailing list