[cig-commits] r17147 - in short/3D/PyLith/branches/v1.5-stable/tests_auto/2d: . quad9 tri6
brad at geodynamics.org
brad at geodynamics.org
Mon Aug 30 08:49:48 PDT 2010
Author: brad
Date: 2010-08-30 08:49:48 -0700 (Mon, 30 Aug 2010)
New Revision: 17147
Added:
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/quad9/TestDislocation.py
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/Makefile.am
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/README
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/TestAxialDisp.py
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axial_disp.spatialdb
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp.cfg
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp_gendb.py
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp_soln.py
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/geometry.jou
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/matprops.spatialdb
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/mesh.exo
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/mesh.jou
short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/testpylith.py
Log:
Added more quadratic cell tests.
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/quad9/TestDislocation.py
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/quad9/TestDislocation.py (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/quad9/TestDislocation.py 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,167 @@
+#!/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 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file tests/2d/quad4/TestDislocation.py
+##
+## @brief Test suite for testing pylith with fault slip.
+
+import numpy
+from TestQuad4 import TestQuad4
+from dislocation_soln import AnalyticalSoln
+from pylith.utils.VTKDataReader import has_vtk
+from pylith.utils.VTKDataReader import VTKDataReader
+from pylith.tests.Fault import check_vertex_fields
+
+# Local version of PyLithApp
+from pylith.apps.PyLithApp import PyLithApp
+class AxialApp(PyLithApp):
+ def __init__(self):
+ PyLithApp.__init__(self, name="dislocation")
+ return
+
+
+# Helper function to run PyLith
+def run_pylith():
+ """
+ Run pylith.
+ """
+ if not "done" in dir(run_pylith):
+ # Run PyLith
+ app = AxialApp()
+ app.run()
+ run_pylith.done = True
+ return
+
+
+class TestDislocation(TestQuad4):
+ """
+ Test suite for testing pylith with 2-D axial extension.
+ """
+
+ def setUp(self):
+ """
+ Setup for test.
+ """
+ TestQuad4.setUp(self)
+ self.mesh['nvertices'] = 81+9
+ self.nverticesO = 81
+ self.faultMesh = {'nvertices': 9,
+ 'spaceDim': 3,
+ 'ncells': 8,
+ 'ncorners': 2}
+
+ run_pylith()
+ self.outputRoot = "dislocation"
+ if has_vtk():
+ self.reader = VTKDataReader()
+ self.soln = AnalyticalSoln()
+ else:
+ self.reader = None
+
+ return
+
+
+ def test_fault_info(self):
+ """
+ Check fault information.
+ """
+ if self.reader is None:
+ return
+
+ filename = "%s-fault_info.vtk" % self.outputRoot
+ fields = ["normal_dir", "final_slip", "slip_time"]
+ check_vertex_fields(self, filename, self.faultMesh, fields)
+
+ return
+
+
+ def test_fault_data(self):
+ """
+ Check fault information.
+ """
+ if self.reader is None:
+ return
+
+ filename = "%s-fault_t0000000.vtk" % self.outputRoot
+ fields = ["slip", "traction_change"]
+ check_vertex_fields(self, filename, self.faultMesh, fields)
+
+ return
+
+
+ def calcDisplacements(self, vertices):
+ """
+ Calculate displacement field given coordinates of vertices.
+ """
+ return self.soln.displacement(vertices, self.nverticesO)
+
+
+ def calcStateVar(self, name, vertices, cells):
+ """
+ Calculate state variable.
+ """
+ ncells = self.mesh['ncells']
+ pts = numpy.zeros( (ncells, 3), dtype=numpy.float64)
+ if name == "total_strain":
+ stateVar = self.soln.strain(pts)
+ elif name == "stress":
+ stateVar = self.soln.stress(pts)
+ else:
+ raise ValueError("Unknown state variable '%s'." % name)
+
+ return stateVar
+
+
+ def calcFaultField(self, name, vertices):
+ """
+ Calculate fault info.
+ """
+
+ normalDir = (-1.0, 0.0)
+ finalSlip = -2.0
+ slipTime = 0.0
+
+ nvertices = self.faultMesh['nvertices']
+
+ if name == "normal_dir":
+ field = numpy.zeros( (nvertices, 3), dtype=numpy.float64)
+ field[:,0] = normalDir[0]
+ field[:,1] = normalDir[1]
+
+ elif name == "final_slip":
+ field = numpy.zeros( (nvertices, 3), dtype=numpy.float64)
+ field[:,0] = finalSlip
+
+ elif name == "slip_time":
+ field = slipTime*numpy.zeros( (nvertices, 1), dtype=numpy.float64)
+
+ elif name == "slip":
+ field = numpy.zeros( (nvertices, 3), dtype=numpy.float64)
+ field[:,0] = finalSlip
+
+ elif name == "traction_change":
+ field = numpy.zeros( (nvertices, 3), dtype=numpy.float64)
+ field[:,0] = 0.0
+
+ else:
+ raise ValueError("Unknown fault field '%s'." % name)
+
+ return field
+
+
+# End of file
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/Makefile.am
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/Makefile.am (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/Makefile.am 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,78 @@
+# -*- 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 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+TESTS = testpylith.py
+
+check_SCRIPTS = testpylith.py
+
+dist_noinst_PYTHON = \
+ TestTri3.py \
+ TestAxialDisp.py \
+ axialdisp_soln.py \
+ axialdisp_gendb.py \
+ TestShearDisp.py \
+ sheardisp_soln.py \
+ sheardisp_gendb.py \
+ testpylith.py
+
+# TestDislocation.py \
+# dislocation_soln.py
+
+dist_noinst_DATA = \
+ geometry.jou \
+ mesh.jou \
+ mesh.exo \
+ matprops.spatialdb \
+ axialdisp.cfg \
+ sheardisp.cfg
+
+# dislocation.cfg
+
+noinst_TMP = \
+ axial_disp.spatialdb \
+ axialdisp_t0000000.vtk \
+ axialdisp-elastic_info.vtk \
+ axialdisp-elastic_t0000000.vtk \
+ shear_disp.spatialdb \
+ sheardisp_t0000000.vtk \
+ sheardisp-elastic_info.vtk \
+ sheardisp-elastic_t0000000.vtk \
+ dislocation_t0000000.vtk \
+ dislocation-elastic_info.vtk \
+ dislocation-elastic_t0000000.vtk \
+ dislocation-fault_info.vtk \
+ dislocation-fault_t0000000.vtk
+
+
+TESTS_ENVIRONMENT = $(PYTHON)
+
+
+# 'export' the input files by performing a mock install
+export_datadir = $(top_builddir)/tests_auto/2d/tri3
+export-data: $(dist_noinst_PYTHON) $(dist_noinst_DATA)
+ for f in $(dist_noinst_PYTHON) $(dist_noinst_DATA); do $(install_sh_DATA) $(srcdir)/$$f $(export_datadir); done
+
+clean-data:
+ if [ "X$(top_srcdir)" != "X$(top_builddir)" ]; then for f in $(dist_noinst_PYTHON) $(dist_noinst_DATA) $(noinst_TMP); do $(RM) $(RM_FLAGS) $(export_datadir)/$$f; done; fi
+
+
+BUILT_SOURCES = export-data
+clean-local: clean-data
+CLEANFILES = *.pyc
+
+# End of file
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/README
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/README (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/README 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,117 @@
+======================================================================
+DOMAIN
+======================================================================
+
+-400 <= x <= +400
+-400 <= y <= +400
+
+Mesh is tri3 cells with nominal 100m discretization size.
+
+======================================================================
+AXIAL COMPRESSION
+======================================================================
+
+2-D axial compression test with linear triangular cells.
+
+ Uy=-1.0 m
+ ----------
+ | |
+Ux=0.0 m | |
+ | |
+ | |
+ ----------
+ Uy=+1.0 m
+
+Dirichlet boundary conditions
+ Ux(0,y) = 0.0
+ Uy(x,-400) = +1.0 m
+ Uy(x,+400) = -1.0 m
+
+Analytical solution
+ Ux(x,y) = 0
+ Uy(x,y) = -0.004 * y
+
+
+======================================================================
+SHEAR
+======================================================================
+
+2-D shear test with linear triangular cells.
+
+
+ ----------
+ | |
+Uy=-1.0 m | | Uy=+1.0m
+ | |
+ | |
+ ----------
+
+
+Dirichlet boundary conditions
+ Ux( 0,y) = 0.0
+ Uy( 0,y) = -1.0 m
+ Ux(+400,y) = 0.0
+ Uy(+400,y) = +1.0 m
+
+Analytical solution
+ Ux(x,y) = 0
+ Uy(x,y) = -0.004 * x
+
+
+======================================================================
+DISLOCATION
+======================================================================
+
+2-D dislocation test with linear triangular cells.
+
+
+ ----------
+ | | |
+Uy=-0.5 m | | | Uy=+0.5m
+ | | |
+ | | |
+ ----------
+
+
+Dirichlet boundary conditions
+ Ux( 0,y) = 0.0
+ Uy( 0,y) = -0.5 m
+ Ux(+400,y) = 0.0
+ Uy(+400,y) = +0.5 m
+
+Analytical solution
+ Ux(x<0,y) = -0.5 m
+ Ux(x>0,y) = +0.5 m
+ Uy = 0.0
+
+======================================================================
+DISLOCATION2
+======================================================================
+
+2-D dislocation test with linear triangular cells with 2 faults. One
+is right-lateral and one is left-lateral to cause the middle section
+to move 1.0 m to the right.
+
+
+ Ux=0
+ ----------
+ | |
+ |--------|
+ | Ux=1.0m|
+ |--------|
+ | |
+ ----------
+ Ux=0
+
+
+Dirichlet boundary conditions
+ Ux(x,+400) = 0.0
+ Uy(x,+400) = 0.0
+ Ux(x,-400) = 0.0
+ Uy(x,-400) = 0.0
+
+Analytical solution
+ Ux(x,-100<y<+100) = +1.0 m
+ Ux(x,-100>y) = 0.0
+ Ux(x,+100<y) = 0.0
+ Uy = 0.0
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/TestAxialDisp.py
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/TestAxialDisp.py (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/TestAxialDisp.py 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,98 @@
+#!/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 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file tests/2d/tri3/TestAxialDisp.py
+##
+## @brief Test suite for testing pylith with 2-D axial extension.
+
+import numpy
+from TestTri3 import TestTri3
+from axialdisp_soln import AnalyticalSoln
+from pylith.utils.VTKDataReader import has_vtk
+from pylith.utils.VTKDataReader import VTKDataReader
+
+# Local version of PyLithApp
+from pylith.apps.PyLithApp import PyLithApp
+class AxialApp(PyLithApp):
+ def __init__(self):
+ PyLithApp.__init__(self, name="axialdisp")
+ return
+
+
+# Helper function to run PyLith
+def run_pylith():
+ """
+ Run pylith.
+ """
+ if not "done" in dir(run_pylith):
+ # Generate spatial databases
+ from axialdisp_gendb import GenerateDB
+ db = GenerateDB()
+ db.run()
+
+ # Run PyLith
+ app = AxialApp()
+ app.run()
+ run_pylith.done = True
+ return
+
+
+class TestAxialDisp(TestTri3):
+ """
+ Test suite for testing pylith with 2-D axial extension.
+ """
+
+ def setUp(self):
+ """
+ Setup for test.
+ """
+ TestTri3.setUp(self)
+ run_pylith()
+ self.outputRoot = "axialdisp"
+ if has_vtk():
+ self.reader = VTKDataReader()
+ self.soln = AnalyticalSoln()
+ else:
+ self.reader = None
+ return
+
+
+ def calcDisplacements(self, vertices):
+ """
+ Calculate displacement field given coordinates of vertices.
+ """
+ return self.soln.displacement(vertices)
+
+
+ def calcStateVar(self, name, vertices, cells):
+ """
+ Calculate state variable.
+ """
+ ncells = self.mesh['ncells']
+ pts = numpy.zeros( (ncells, 3), dtype=numpy.float64)
+ if name == "total_strain":
+ stateVar = self.soln.strain(pts)
+ elif name == "stress":
+ stateVar = self.soln.stress(pts)
+ else:
+ raise ValueError("Unknown state variable '%s'." % name)
+
+ return stateVar
+
+
+# End of file
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axial_disp.spatialdb
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axial_disp.spatialdb (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axial_disp.spatialdb 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,302 @@
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 2
+ value-names = displacement-x displacement-y
+ value-units = m m
+ num-locs = 289
+ data-dim = 2
+ space-dim = 2
+ cs-data = cartesian {
+ to-meters = 1
+ space-dim = 2
+}
+}
+ -4.000000e+03 -4.000000e+03 -7.037037e-01 1.851852e-01
+ -3.500000e+03 -4.000000e+03 -6.157407e-01 1.851852e-01
+ -3.000000e+03 -4.000000e+03 -5.277778e-01 1.851852e-01
+ -2.500000e+03 -4.000000e+03 -4.398148e-01 1.851852e-01
+ -2.000000e+03 -4.000000e+03 -3.518519e-01 1.851852e-01
+ -1.500000e+03 -4.000000e+03 -2.638889e-01 1.851852e-01
+ -1.000000e+03 -4.000000e+03 -1.759259e-01 1.851852e-01
+ -5.000000e+02 -4.000000e+03 -8.796296e-02 1.851852e-01
+ 0.000000e+00 -4.000000e+03 0.000000e+00 1.851852e-01
+ 5.000000e+02 -4.000000e+03 8.796296e-02 1.851852e-01
+ 1.000000e+03 -4.000000e+03 1.759259e-01 1.851852e-01
+ 1.500000e+03 -4.000000e+03 2.638889e-01 1.851852e-01
+ 2.000000e+03 -4.000000e+03 3.518519e-01 1.851852e-01
+ 2.500000e+03 -4.000000e+03 4.398148e-01 1.851852e-01
+ 3.000000e+03 -4.000000e+03 5.277778e-01 1.851852e-01
+ 3.500000e+03 -4.000000e+03 6.157407e-01 1.851852e-01
+ 4.000000e+03 -4.000000e+03 7.037037e-01 1.851852e-01
+ -4.000000e+03 -3.500000e+03 -7.037037e-01 1.620370e-01
+ -3.500000e+03 -3.500000e+03 -6.157407e-01 1.620370e-01
+ -3.000000e+03 -3.500000e+03 -5.277778e-01 1.620370e-01
+ -2.500000e+03 -3.500000e+03 -4.398148e-01 1.620370e-01
+ -2.000000e+03 -3.500000e+03 -3.518519e-01 1.620370e-01
+ -1.500000e+03 -3.500000e+03 -2.638889e-01 1.620370e-01
+ -1.000000e+03 -3.500000e+03 -1.759259e-01 1.620370e-01
+ -5.000000e+02 -3.500000e+03 -8.796296e-02 1.620370e-01
+ 0.000000e+00 -3.500000e+03 0.000000e+00 1.620370e-01
+ 5.000000e+02 -3.500000e+03 8.796296e-02 1.620370e-01
+ 1.000000e+03 -3.500000e+03 1.759259e-01 1.620370e-01
+ 1.500000e+03 -3.500000e+03 2.638889e-01 1.620370e-01
+ 2.000000e+03 -3.500000e+03 3.518519e-01 1.620370e-01
+ 2.500000e+03 -3.500000e+03 4.398148e-01 1.620370e-01
+ 3.000000e+03 -3.500000e+03 5.277778e-01 1.620370e-01
+ 3.500000e+03 -3.500000e+03 6.157407e-01 1.620370e-01
+ 4.000000e+03 -3.500000e+03 7.037037e-01 1.620370e-01
+ -4.000000e+03 -3.000000e+03 -7.037037e-01 1.388889e-01
+ -3.500000e+03 -3.000000e+03 -6.157407e-01 1.388889e-01
+ -3.000000e+03 -3.000000e+03 -5.277778e-01 1.388889e-01
+ -2.500000e+03 -3.000000e+03 -4.398148e-01 1.388889e-01
+ -2.000000e+03 -3.000000e+03 -3.518519e-01 1.388889e-01
+ -1.500000e+03 -3.000000e+03 -2.638889e-01 1.388889e-01
+ -1.000000e+03 -3.000000e+03 -1.759259e-01 1.388889e-01
+ -5.000000e+02 -3.000000e+03 -8.796296e-02 1.388889e-01
+ 0.000000e+00 -3.000000e+03 0.000000e+00 1.388889e-01
+ 5.000000e+02 -3.000000e+03 8.796296e-02 1.388889e-01
+ 1.000000e+03 -3.000000e+03 1.759259e-01 1.388889e-01
+ 1.500000e+03 -3.000000e+03 2.638889e-01 1.388889e-01
+ 2.000000e+03 -3.000000e+03 3.518519e-01 1.388889e-01
+ 2.500000e+03 -3.000000e+03 4.398148e-01 1.388889e-01
+ 3.000000e+03 -3.000000e+03 5.277778e-01 1.388889e-01
+ 3.500000e+03 -3.000000e+03 6.157407e-01 1.388889e-01
+ 4.000000e+03 -3.000000e+03 7.037037e-01 1.388889e-01
+ -4.000000e+03 -2.500000e+03 -7.037037e-01 1.157407e-01
+ -3.500000e+03 -2.500000e+03 -6.157407e-01 1.157407e-01
+ -3.000000e+03 -2.500000e+03 -5.277778e-01 1.157407e-01
+ -2.500000e+03 -2.500000e+03 -4.398148e-01 1.157407e-01
+ -2.000000e+03 -2.500000e+03 -3.518519e-01 1.157407e-01
+ -1.500000e+03 -2.500000e+03 -2.638889e-01 1.157407e-01
+ -1.000000e+03 -2.500000e+03 -1.759259e-01 1.157407e-01
+ -5.000000e+02 -2.500000e+03 -8.796296e-02 1.157407e-01
+ 0.000000e+00 -2.500000e+03 0.000000e+00 1.157407e-01
+ 5.000000e+02 -2.500000e+03 8.796296e-02 1.157407e-01
+ 1.000000e+03 -2.500000e+03 1.759259e-01 1.157407e-01
+ 1.500000e+03 -2.500000e+03 2.638889e-01 1.157407e-01
+ 2.000000e+03 -2.500000e+03 3.518519e-01 1.157407e-01
+ 2.500000e+03 -2.500000e+03 4.398148e-01 1.157407e-01
+ 3.000000e+03 -2.500000e+03 5.277778e-01 1.157407e-01
+ 3.500000e+03 -2.500000e+03 6.157407e-01 1.157407e-01
+ 4.000000e+03 -2.500000e+03 7.037037e-01 1.157407e-01
+ -4.000000e+03 -2.000000e+03 -7.037037e-01 9.259259e-02
+ -3.500000e+03 -2.000000e+03 -6.157407e-01 9.259259e-02
+ -3.000000e+03 -2.000000e+03 -5.277778e-01 9.259259e-02
+ -2.500000e+03 -2.000000e+03 -4.398148e-01 9.259259e-02
+ -2.000000e+03 -2.000000e+03 -3.518519e-01 9.259259e-02
+ -1.500000e+03 -2.000000e+03 -2.638889e-01 9.259259e-02
+ -1.000000e+03 -2.000000e+03 -1.759259e-01 9.259259e-02
+ -5.000000e+02 -2.000000e+03 -8.796296e-02 9.259259e-02
+ 0.000000e+00 -2.000000e+03 0.000000e+00 9.259259e-02
+ 5.000000e+02 -2.000000e+03 8.796296e-02 9.259259e-02
+ 1.000000e+03 -2.000000e+03 1.759259e-01 9.259259e-02
+ 1.500000e+03 -2.000000e+03 2.638889e-01 9.259259e-02
+ 2.000000e+03 -2.000000e+03 3.518519e-01 9.259259e-02
+ 2.500000e+03 -2.000000e+03 4.398148e-01 9.259259e-02
+ 3.000000e+03 -2.000000e+03 5.277778e-01 9.259259e-02
+ 3.500000e+03 -2.000000e+03 6.157407e-01 9.259259e-02
+ 4.000000e+03 -2.000000e+03 7.037037e-01 9.259259e-02
+ -4.000000e+03 -1.500000e+03 -7.037037e-01 6.944444e-02
+ -3.500000e+03 -1.500000e+03 -6.157407e-01 6.944444e-02
+ -3.000000e+03 -1.500000e+03 -5.277778e-01 6.944444e-02
+ -2.500000e+03 -1.500000e+03 -4.398148e-01 6.944444e-02
+ -2.000000e+03 -1.500000e+03 -3.518519e-01 6.944444e-02
+ -1.500000e+03 -1.500000e+03 -2.638889e-01 6.944444e-02
+ -1.000000e+03 -1.500000e+03 -1.759259e-01 6.944444e-02
+ -5.000000e+02 -1.500000e+03 -8.796296e-02 6.944444e-02
+ 0.000000e+00 -1.500000e+03 0.000000e+00 6.944444e-02
+ 5.000000e+02 -1.500000e+03 8.796296e-02 6.944444e-02
+ 1.000000e+03 -1.500000e+03 1.759259e-01 6.944444e-02
+ 1.500000e+03 -1.500000e+03 2.638889e-01 6.944444e-02
+ 2.000000e+03 -1.500000e+03 3.518519e-01 6.944444e-02
+ 2.500000e+03 -1.500000e+03 4.398148e-01 6.944444e-02
+ 3.000000e+03 -1.500000e+03 5.277778e-01 6.944444e-02
+ 3.500000e+03 -1.500000e+03 6.157407e-01 6.944444e-02
+ 4.000000e+03 -1.500000e+03 7.037037e-01 6.944444e-02
+ -4.000000e+03 -1.000000e+03 -7.037037e-01 4.629630e-02
+ -3.500000e+03 -1.000000e+03 -6.157407e-01 4.629630e-02
+ -3.000000e+03 -1.000000e+03 -5.277778e-01 4.629630e-02
+ -2.500000e+03 -1.000000e+03 -4.398148e-01 4.629630e-02
+ -2.000000e+03 -1.000000e+03 -3.518519e-01 4.629630e-02
+ -1.500000e+03 -1.000000e+03 -2.638889e-01 4.629630e-02
+ -1.000000e+03 -1.000000e+03 -1.759259e-01 4.629630e-02
+ -5.000000e+02 -1.000000e+03 -8.796296e-02 4.629630e-02
+ 0.000000e+00 -1.000000e+03 0.000000e+00 4.629630e-02
+ 5.000000e+02 -1.000000e+03 8.796296e-02 4.629630e-02
+ 1.000000e+03 -1.000000e+03 1.759259e-01 4.629630e-02
+ 1.500000e+03 -1.000000e+03 2.638889e-01 4.629630e-02
+ 2.000000e+03 -1.000000e+03 3.518519e-01 4.629630e-02
+ 2.500000e+03 -1.000000e+03 4.398148e-01 4.629630e-02
+ 3.000000e+03 -1.000000e+03 5.277778e-01 4.629630e-02
+ 3.500000e+03 -1.000000e+03 6.157407e-01 4.629630e-02
+ 4.000000e+03 -1.000000e+03 7.037037e-01 4.629630e-02
+ -4.000000e+03 -5.000000e+02 -7.037037e-01 2.314815e-02
+ -3.500000e+03 -5.000000e+02 -6.157407e-01 2.314815e-02
+ -3.000000e+03 -5.000000e+02 -5.277778e-01 2.314815e-02
+ -2.500000e+03 -5.000000e+02 -4.398148e-01 2.314815e-02
+ -2.000000e+03 -5.000000e+02 -3.518519e-01 2.314815e-02
+ -1.500000e+03 -5.000000e+02 -2.638889e-01 2.314815e-02
+ -1.000000e+03 -5.000000e+02 -1.759259e-01 2.314815e-02
+ -5.000000e+02 -5.000000e+02 -8.796296e-02 2.314815e-02
+ 0.000000e+00 -5.000000e+02 0.000000e+00 2.314815e-02
+ 5.000000e+02 -5.000000e+02 8.796296e-02 2.314815e-02
+ 1.000000e+03 -5.000000e+02 1.759259e-01 2.314815e-02
+ 1.500000e+03 -5.000000e+02 2.638889e-01 2.314815e-02
+ 2.000000e+03 -5.000000e+02 3.518519e-01 2.314815e-02
+ 2.500000e+03 -5.000000e+02 4.398148e-01 2.314815e-02
+ 3.000000e+03 -5.000000e+02 5.277778e-01 2.314815e-02
+ 3.500000e+03 -5.000000e+02 6.157407e-01 2.314815e-02
+ 4.000000e+03 -5.000000e+02 7.037037e-01 2.314815e-02
+ -4.000000e+03 0.000000e+00 -7.037037e-01 -0.000000e+00
+ -3.500000e+03 0.000000e+00 -6.157407e-01 -0.000000e+00
+ -3.000000e+03 0.000000e+00 -5.277778e-01 -0.000000e+00
+ -2.500000e+03 0.000000e+00 -4.398148e-01 -0.000000e+00
+ -2.000000e+03 0.000000e+00 -3.518519e-01 -0.000000e+00
+ -1.500000e+03 0.000000e+00 -2.638889e-01 -0.000000e+00
+ -1.000000e+03 0.000000e+00 -1.759259e-01 -0.000000e+00
+ -5.000000e+02 0.000000e+00 -8.796296e-02 -0.000000e+00
+ 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
+ 5.000000e+02 0.000000e+00 8.796296e-02 0.000000e+00
+ 1.000000e+03 0.000000e+00 1.759259e-01 0.000000e+00
+ 1.500000e+03 0.000000e+00 2.638889e-01 0.000000e+00
+ 2.000000e+03 0.000000e+00 3.518519e-01 0.000000e+00
+ 2.500000e+03 0.000000e+00 4.398148e-01 0.000000e+00
+ 3.000000e+03 0.000000e+00 5.277778e-01 0.000000e+00
+ 3.500000e+03 0.000000e+00 6.157407e-01 0.000000e+00
+ 4.000000e+03 0.000000e+00 7.037037e-01 0.000000e+00
+ -4.000000e+03 5.000000e+02 -7.037037e-01 -2.314815e-02
+ -3.500000e+03 5.000000e+02 -6.157407e-01 -2.314815e-02
+ -3.000000e+03 5.000000e+02 -5.277778e-01 -2.314815e-02
+ -2.500000e+03 5.000000e+02 -4.398148e-01 -2.314815e-02
+ -2.000000e+03 5.000000e+02 -3.518519e-01 -2.314815e-02
+ -1.500000e+03 5.000000e+02 -2.638889e-01 -2.314815e-02
+ -1.000000e+03 5.000000e+02 -1.759259e-01 -2.314815e-02
+ -5.000000e+02 5.000000e+02 -8.796296e-02 -2.314815e-02
+ 0.000000e+00 5.000000e+02 0.000000e+00 -2.314815e-02
+ 5.000000e+02 5.000000e+02 8.796296e-02 -2.314815e-02
+ 1.000000e+03 5.000000e+02 1.759259e-01 -2.314815e-02
+ 1.500000e+03 5.000000e+02 2.638889e-01 -2.314815e-02
+ 2.000000e+03 5.000000e+02 3.518519e-01 -2.314815e-02
+ 2.500000e+03 5.000000e+02 4.398148e-01 -2.314815e-02
+ 3.000000e+03 5.000000e+02 5.277778e-01 -2.314815e-02
+ 3.500000e+03 5.000000e+02 6.157407e-01 -2.314815e-02
+ 4.000000e+03 5.000000e+02 7.037037e-01 -2.314815e-02
+ -4.000000e+03 1.000000e+03 -7.037037e-01 -4.629630e-02
+ -3.500000e+03 1.000000e+03 -6.157407e-01 -4.629630e-02
+ -3.000000e+03 1.000000e+03 -5.277778e-01 -4.629630e-02
+ -2.500000e+03 1.000000e+03 -4.398148e-01 -4.629630e-02
+ -2.000000e+03 1.000000e+03 -3.518519e-01 -4.629630e-02
+ -1.500000e+03 1.000000e+03 -2.638889e-01 -4.629630e-02
+ -1.000000e+03 1.000000e+03 -1.759259e-01 -4.629630e-02
+ -5.000000e+02 1.000000e+03 -8.796296e-02 -4.629630e-02
+ 0.000000e+00 1.000000e+03 0.000000e+00 -4.629630e-02
+ 5.000000e+02 1.000000e+03 8.796296e-02 -4.629630e-02
+ 1.000000e+03 1.000000e+03 1.759259e-01 -4.629630e-02
+ 1.500000e+03 1.000000e+03 2.638889e-01 -4.629630e-02
+ 2.000000e+03 1.000000e+03 3.518519e-01 -4.629630e-02
+ 2.500000e+03 1.000000e+03 4.398148e-01 -4.629630e-02
+ 3.000000e+03 1.000000e+03 5.277778e-01 -4.629630e-02
+ 3.500000e+03 1.000000e+03 6.157407e-01 -4.629630e-02
+ 4.000000e+03 1.000000e+03 7.037037e-01 -4.629630e-02
+ -4.000000e+03 1.500000e+03 -7.037037e-01 -6.944444e-02
+ -3.500000e+03 1.500000e+03 -6.157407e-01 -6.944444e-02
+ -3.000000e+03 1.500000e+03 -5.277778e-01 -6.944444e-02
+ -2.500000e+03 1.500000e+03 -4.398148e-01 -6.944444e-02
+ -2.000000e+03 1.500000e+03 -3.518519e-01 -6.944444e-02
+ -1.500000e+03 1.500000e+03 -2.638889e-01 -6.944444e-02
+ -1.000000e+03 1.500000e+03 -1.759259e-01 -6.944444e-02
+ -5.000000e+02 1.500000e+03 -8.796296e-02 -6.944444e-02
+ 0.000000e+00 1.500000e+03 0.000000e+00 -6.944444e-02
+ 5.000000e+02 1.500000e+03 8.796296e-02 -6.944444e-02
+ 1.000000e+03 1.500000e+03 1.759259e-01 -6.944444e-02
+ 1.500000e+03 1.500000e+03 2.638889e-01 -6.944444e-02
+ 2.000000e+03 1.500000e+03 3.518519e-01 -6.944444e-02
+ 2.500000e+03 1.500000e+03 4.398148e-01 -6.944444e-02
+ 3.000000e+03 1.500000e+03 5.277778e-01 -6.944444e-02
+ 3.500000e+03 1.500000e+03 6.157407e-01 -6.944444e-02
+ 4.000000e+03 1.500000e+03 7.037037e-01 -6.944444e-02
+ -4.000000e+03 2.000000e+03 -7.037037e-01 -9.259259e-02
+ -3.500000e+03 2.000000e+03 -6.157407e-01 -9.259259e-02
+ -3.000000e+03 2.000000e+03 -5.277778e-01 -9.259259e-02
+ -2.500000e+03 2.000000e+03 -4.398148e-01 -9.259259e-02
+ -2.000000e+03 2.000000e+03 -3.518519e-01 -9.259259e-02
+ -1.500000e+03 2.000000e+03 -2.638889e-01 -9.259259e-02
+ -1.000000e+03 2.000000e+03 -1.759259e-01 -9.259259e-02
+ -5.000000e+02 2.000000e+03 -8.796296e-02 -9.259259e-02
+ 0.000000e+00 2.000000e+03 0.000000e+00 -9.259259e-02
+ 5.000000e+02 2.000000e+03 8.796296e-02 -9.259259e-02
+ 1.000000e+03 2.000000e+03 1.759259e-01 -9.259259e-02
+ 1.500000e+03 2.000000e+03 2.638889e-01 -9.259259e-02
+ 2.000000e+03 2.000000e+03 3.518519e-01 -9.259259e-02
+ 2.500000e+03 2.000000e+03 4.398148e-01 -9.259259e-02
+ 3.000000e+03 2.000000e+03 5.277778e-01 -9.259259e-02
+ 3.500000e+03 2.000000e+03 6.157407e-01 -9.259259e-02
+ 4.000000e+03 2.000000e+03 7.037037e-01 -9.259259e-02
+ -4.000000e+03 2.500000e+03 -7.037037e-01 -1.157407e-01
+ -3.500000e+03 2.500000e+03 -6.157407e-01 -1.157407e-01
+ -3.000000e+03 2.500000e+03 -5.277778e-01 -1.157407e-01
+ -2.500000e+03 2.500000e+03 -4.398148e-01 -1.157407e-01
+ -2.000000e+03 2.500000e+03 -3.518519e-01 -1.157407e-01
+ -1.500000e+03 2.500000e+03 -2.638889e-01 -1.157407e-01
+ -1.000000e+03 2.500000e+03 -1.759259e-01 -1.157407e-01
+ -5.000000e+02 2.500000e+03 -8.796296e-02 -1.157407e-01
+ 0.000000e+00 2.500000e+03 0.000000e+00 -1.157407e-01
+ 5.000000e+02 2.500000e+03 8.796296e-02 -1.157407e-01
+ 1.000000e+03 2.500000e+03 1.759259e-01 -1.157407e-01
+ 1.500000e+03 2.500000e+03 2.638889e-01 -1.157407e-01
+ 2.000000e+03 2.500000e+03 3.518519e-01 -1.157407e-01
+ 2.500000e+03 2.500000e+03 4.398148e-01 -1.157407e-01
+ 3.000000e+03 2.500000e+03 5.277778e-01 -1.157407e-01
+ 3.500000e+03 2.500000e+03 6.157407e-01 -1.157407e-01
+ 4.000000e+03 2.500000e+03 7.037037e-01 -1.157407e-01
+ -4.000000e+03 3.000000e+03 -7.037037e-01 -1.388889e-01
+ -3.500000e+03 3.000000e+03 -6.157407e-01 -1.388889e-01
+ -3.000000e+03 3.000000e+03 -5.277778e-01 -1.388889e-01
+ -2.500000e+03 3.000000e+03 -4.398148e-01 -1.388889e-01
+ -2.000000e+03 3.000000e+03 -3.518519e-01 -1.388889e-01
+ -1.500000e+03 3.000000e+03 -2.638889e-01 -1.388889e-01
+ -1.000000e+03 3.000000e+03 -1.759259e-01 -1.388889e-01
+ -5.000000e+02 3.000000e+03 -8.796296e-02 -1.388889e-01
+ 0.000000e+00 3.000000e+03 0.000000e+00 -1.388889e-01
+ 5.000000e+02 3.000000e+03 8.796296e-02 -1.388889e-01
+ 1.000000e+03 3.000000e+03 1.759259e-01 -1.388889e-01
+ 1.500000e+03 3.000000e+03 2.638889e-01 -1.388889e-01
+ 2.000000e+03 3.000000e+03 3.518519e-01 -1.388889e-01
+ 2.500000e+03 3.000000e+03 4.398148e-01 -1.388889e-01
+ 3.000000e+03 3.000000e+03 5.277778e-01 -1.388889e-01
+ 3.500000e+03 3.000000e+03 6.157407e-01 -1.388889e-01
+ 4.000000e+03 3.000000e+03 7.037037e-01 -1.388889e-01
+ -4.000000e+03 3.500000e+03 -7.037037e-01 -1.620370e-01
+ -3.500000e+03 3.500000e+03 -6.157407e-01 -1.620370e-01
+ -3.000000e+03 3.500000e+03 -5.277778e-01 -1.620370e-01
+ -2.500000e+03 3.500000e+03 -4.398148e-01 -1.620370e-01
+ -2.000000e+03 3.500000e+03 -3.518519e-01 -1.620370e-01
+ -1.500000e+03 3.500000e+03 -2.638889e-01 -1.620370e-01
+ -1.000000e+03 3.500000e+03 -1.759259e-01 -1.620370e-01
+ -5.000000e+02 3.500000e+03 -8.796296e-02 -1.620370e-01
+ 0.000000e+00 3.500000e+03 0.000000e+00 -1.620370e-01
+ 5.000000e+02 3.500000e+03 8.796296e-02 -1.620370e-01
+ 1.000000e+03 3.500000e+03 1.759259e-01 -1.620370e-01
+ 1.500000e+03 3.500000e+03 2.638889e-01 -1.620370e-01
+ 2.000000e+03 3.500000e+03 3.518519e-01 -1.620370e-01
+ 2.500000e+03 3.500000e+03 4.398148e-01 -1.620370e-01
+ 3.000000e+03 3.500000e+03 5.277778e-01 -1.620370e-01
+ 3.500000e+03 3.500000e+03 6.157407e-01 -1.620370e-01
+ 4.000000e+03 3.500000e+03 7.037037e-01 -1.620370e-01
+ -4.000000e+03 4.000000e+03 -7.037037e-01 -1.851852e-01
+ -3.500000e+03 4.000000e+03 -6.157407e-01 -1.851852e-01
+ -3.000000e+03 4.000000e+03 -5.277778e-01 -1.851852e-01
+ -2.500000e+03 4.000000e+03 -4.398148e-01 -1.851852e-01
+ -2.000000e+03 4.000000e+03 -3.518519e-01 -1.851852e-01
+ -1.500000e+03 4.000000e+03 -2.638889e-01 -1.851852e-01
+ -1.000000e+03 4.000000e+03 -1.759259e-01 -1.851852e-01
+ -5.000000e+02 4.000000e+03 -8.796296e-02 -1.851852e-01
+ 0.000000e+00 4.000000e+03 0.000000e+00 -1.851852e-01
+ 5.000000e+02 4.000000e+03 8.796296e-02 -1.851852e-01
+ 1.000000e+03 4.000000e+03 1.759259e-01 -1.851852e-01
+ 1.500000e+03 4.000000e+03 2.638889e-01 -1.851852e-01
+ 2.000000e+03 4.000000e+03 3.518519e-01 -1.851852e-01
+ 2.500000e+03 4.000000e+03 4.398148e-01 -1.851852e-01
+ 3.000000e+03 4.000000e+03 5.277778e-01 -1.851852e-01
+ 3.500000e+03 4.000000e+03 6.157407e-01 -1.851852e-01
+ 4.000000e+03 4.000000e+03 7.037037e-01 -1.851852e-01
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp.cfg
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp.cfg (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp.cfg 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,113 @@
+# -*- Python -*-
+[pylithapp]
+
+[pylithapp.launcher] # WARNING: THIS IS NOT PORTABLE
+command = mpirun -np ${nodes}
+
+# ----------------------------------------------------------------------
+# journal
+# ----------------------------------------------------------------------
+[pylithapp.journal.info]
+#timedependent = 1
+#implicit = 1
+#petsc = 1
+#solverlinear = 1
+#meshiocubit = 1
+#implicitelasticity = 1
+#quadrature2d = 1
+#fiatsimplex = 1
+
+# ----------------------------------------------------------------------
+# mesh_generator
+# ----------------------------------------------------------------------
+[pylithapp.mesh_generator]
+#debug = 1
+reader = pylith.meshio.MeshIOCubit
+
+[pylithapp.mesh_generator.reader]
+filename = mesh.exo
+use_nodeset_names = True
+coordsys.space_dim = 2
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+dimension = 2
+bc = [x_neg,x_pos,y_neg]
+
+[pylithapp.timedependent.formulation.time_step]
+total_time = 0.0*s
+
+# ----------------------------------------------------------------------
+# materials
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+materials = [elastic]
+materials.elastic = pylith.materials.ElasticPlaneStress
+
+[pylithapp.timedependent.materials.elastic]
+label = Elastic material
+id = 1
+db_properties.iohandler.filename = matprops.spatialdb
+quadrature.cell = pylith.feassemble.FIATSimplex
+quadrature.cell.shape = triangle
+quadrature.cell.degree = 2
+
+# ----------------------------------------------------------------------
+# boundary conditions
+# ----------------------------------------------------------------------
+[pylithapp.timedependent.bc.x_pos]
+bc_dof = [0]
+label = edge_xpos
+db_initial = spatialdata.spatialdb.SimpleDB
+db_initial.label = Dirichlet BC +x edge
+db_initial.iohandler.filename = axial_disp.spatialdb
+db_initial.query_type = linear
+
+[pylithapp.timedependent.bc.x_neg]
+bc_dof = [0]
+label = edge_xneg
+db_initial = spatialdata.spatialdb.SimpleDB
+db_initial.label = Dirichlet BC -x edge
+db_initial.iohandler.filename = axial_disp.spatialdb
+db_initial.query_type = linear
+
+[pylithapp.timedependent.bc.y_neg]
+bc_dof = [1]
+label = edge_yneg
+db_initial = spatialdata.spatialdb.SimpleDB
+db_initial.label = Dirichlet BC -y edge
+db_initial.iohandler.filename = axial_disp.spatialdb
+db_initial.query_type = linear
+
+# ----------------------------------------------------------------------
+# PETSc
+# ----------------------------------------------------------------------
+[pylithapp.petsc]
+pc_type = asm
+
+# Change the preconditioner settings.
+sub_pc_factor_shift_type = none
+
+ksp_rtol = 1.0e-8
+ksp_max_it = 100
+ksp_gmres_restart = 50
+
+ksp_monitor = true
+ksp_view = true
+ksp_converged_reason = true
+
+#log_summary = true
+# start_in_debugger = true
+
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+[pylithapp.problem.formulation.output.output.writer]
+filename = axialdisp.vtk
+
+[pylithapp.timedependent.materials.elastic.output]
+cell_filter = pylith.meshio.CellFilterAvgMesh
+writer.filename = axialdisp-elastic.vtk
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp_gendb.py
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp_gendb.py (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp_gendb.py 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,85 @@
+#!/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 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file tests/2d/tri3/axialdisp_gendb.py
+##
+## @brief Python script to generate spatial database with displacement
+## boundary conditions for the axial displacement test.
+
+import numpy
+
+class GenerateDB(object):
+ """
+ Python object to generate spatial database with displacement
+ boundary conditions for the axial displacement test.
+ """
+
+ def __init__(self):
+ """
+ Constructor.
+ """
+ return
+
+
+ def run(self):
+ """
+ Generate the database.
+ """
+ # Domain
+ x = numpy.arange(-4000.0, 4000.1, 500.0)
+ y = numpy.arange(-4000.0, 4000.1, 500.0)
+ npts = x.shape[0]
+
+ xx = x * numpy.ones( (npts, 1), dtype=numpy.float64)
+ yy = y * numpy.ones( (npts, 1), dtype=numpy.float64)
+ xy = numpy.zeros( (npts**2, 2), dtype=numpy.float64)
+ xy[:,0] = numpy.ravel(xx)
+ xy[:,1] = numpy.ravel(numpy.transpose(yy))
+
+ from axialdisp_soln import AnalyticalSoln
+ soln = AnalyticalSoln()
+ disp = soln.displacement(xy)
+
+ from spatialdata.geocoords.CSCart import CSCart
+ cs = CSCart()
+ cs.inventory.spaceDim = 2
+ cs._configure()
+ data = {'points': xy,
+ 'coordsys': cs,
+ 'data_dim': 2,
+ 'values': [{'name': "displacement-x",
+ 'units': "m",
+ 'data': numpy.ravel(disp[:,0])},
+ {'name': "displacement-y",
+ 'units': "m",
+ 'data': numpy.ravel(disp[:,1])}]}
+
+ from spatialdata.spatialdb.SimpleIOAscii import SimpleIOAscii
+ io = SimpleIOAscii()
+ io.inventory.filename = "axial_disp.spatialdb"
+ io._configure()
+ io.write(data)
+ return
+
+# ======================================================================
+if __name__ == "__main__":
+ app = GenerateDB()
+ app.run()
+
+
+# End of file
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp_soln.py
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp_soln.py (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/axialdisp_soln.py 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,94 @@
+#!/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 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file tests/2d/tri3/axialdisp_soln.py
+##
+## @brief Analytical solution to axial displacement problem.
+
+import numpy
+
+# Physical properties
+p_density = 2500.0
+p_vs = 3000.0
+p_vp = 5291.502622129181
+
+p_mu = p_density*p_vs**2
+p_lambda = p_density*p_vp**2 - 2*p_mu
+
+# Uniform stress field (plane stress)
+sxx = 1.0e+7
+sxy = 0.0
+syy = 0.0
+szz = 0.0
+
+# Uniform strain field
+exx = 1.0/(2*p_mu) * (sxx - p_lambda/(3*p_lambda+2*p_mu) * (sxx+syy+szz))
+eyy = 1.0/(2*p_mu) * (syy - p_lambda/(3*p_lambda+2*p_mu) * (sxx+syy+szz))
+ezz = 1.0/(2*p_mu) * (szz - p_lambda/(3*p_lambda+2*p_mu) * (sxx+syy+szz))
+
+exy = 1.0/(2*p_mu) * (sxy)
+
+#print exx,eyy,exy,ezz
+#print -exx*p_lambda/(p_lambda+2*p_mu)
+
+# ----------------------------------------------------------------------
+class AnalyticalSoln(object):
+ """
+ Analytical solution to axial/shear displacement problem.
+ """
+
+ def __init__(self):
+ return
+
+
+ def displacement(self, locs):
+ """
+ Compute displacement field at locations.
+ """
+ (npts, dim) = locs.shape
+ disp = numpy.zeros( (npts, 3), dtype=numpy.float64)
+ disp[:,0] = exx*locs[:,0] + exy*locs[:,1]
+ disp[:,1] = eyy*locs[:,1] + exy*locs[:,0]
+ return disp
+
+
+ def strain(self, locs):
+ """
+ Compute strain field at locations.
+ """
+ (npts, dim) = locs.shape
+ strain = numpy.zeros( (npts, 3), dtype=numpy.float64)
+ strain[:,0] = exx
+ strain[:,1] = eyy
+ strain[:,2] = exy
+ return strain
+
+
+ def stress(self, locs):
+ """
+ Compute stress field at locations.
+ """
+ (npts, dim) = locs.shape
+ stress = numpy.zeros( (npts, 3), dtype=numpy.float64)
+ stress[:,0] = sxx
+ stress[:,1] = syy
+ stress[:,2] = sxy
+ return stress
+
+
+# End of file
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/geometry.jou
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/geometry.jou (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/geometry.jou 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,31 @@
+# ----------------------------------------------------------------------
+# Create surface using vertices
+# ----------------------------------------------------------------------
+
+# Block is 8000m x 8000m
+# -4000 m <= x <= 4000 m
+# -4000 m <= y <= 4000 m
+reset
+create vertex -4000.0 -4000.0 0.0
+create vertex -4000.0 +4000.0 0.0
+create vertex +4000.0 +4000.0 0.0
+create vertex +4000.0 -4000.0 0.0
+create surface vertex 1 2 3 4
+delete vertex all
+
+# ----------------------------------------------------------------------
+# Create interface surfaces
+# ----------------------------------------------------------------------
+
+# Fault at x=0
+create vertex 0.0 -4000.0 0.0
+create vertex 0.0 +4000.0 0.0
+split surface 1 across location vertex 5 location vertex 6
+
+# Fault at x=-2000.0
+create vertex -2000.0 +4000.0 0.0
+create vertex -2000.0 -4000.0 0.0
+split surface 2 across location vertex 9 location vertex 10
+
+delete vertex all
+
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/matprops.spatialdb
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/matprops.spatialdb (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/matprops.spatialdb 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,14 @@
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 3
+ value-names = density vs vp
+ value-units = kg/m**3 m/s m/s
+ num-locs = 1
+ data-dim = 0
+ space-dim = 2
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 2
+ }
+}
+0.0 0.0 2500.0 3000.0 5291.502622129181
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/mesh.exo
===================================================================
(Binary files differ)
Property changes on: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/mesh.exo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/mesh.jou
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/mesh.jou (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/mesh.jou 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,71 @@
+# ----------------------------------------------------------------------
+# Generate geometry
+# ----------------------------------------------------------------------
+playback 'geometry.jou'
+
+# ----------------------------------------------------------------------
+# Set discretization size
+# ----------------------------------------------------------------------
+surface all size 1000
+
+# ----------------------------------------------------------------------
+# Generate the mesh
+# ----------------------------------------------------------------------
+surface all scheme trimesh
+mesh surface all
+
+# ----------------------------------------------------------------------
+# Create blocks for materials
+# ----------------------------------------------------------------------
+block 1 surface 3 4 5
+block 1 name "elastic"
+block 1 element type tri6
+
+# ----------------------------------------------------------------------
+# Create nodeset for faults
+# ----------------------------------------------------------------------
+group "fault_x" add node in curve 5
+nodeset 10 group fault_x
+nodeset 10 name "fault_x"
+
+group "fault_x2" add node in curve 10
+nodeset 11 group fault_x2
+nodeset 11 name "fault_x2"
+
+# ----------------------------------------------------------------------
+# Create nodeset for +x edge
+# ----------------------------------------------------------------------
+group "edge_xpos" add node in curve 3
+nodeset 20 group edge_xpos
+nodeset 20 name "edge_xpos"
+
+# ----------------------------------------------------------------------
+# Create nodeset for -x edge
+# ----------------------------------------------------------------------
+group "edge_xneg" add node in curve 1
+nodeset 21 group edge_xneg
+nodeset 21 name "edge_xneg"
+
+# ----------------------------------------------------------------------
+# Create nodeset for +y edge
+# ----------------------------------------------------------------------
+group "edge_ypos" add node in curve 8
+group "edge_ypos" add node in curve 11
+group "edge_ypos" add node in curve 14
+nodeset 22 group edge_ypos
+nodeset 22 name "edge_ypos"
+
+# ----------------------------------------------------------------------
+# Create nodeset for -y edge
+# ----------------------------------------------------------------------
+group "edge_yneg" add node in curve 9
+group "edge_yneg" add node in curve 12
+group "edge_yneg" add node in curve 13
+nodeset 23 group edge_yneg
+nodeset 23 name "edge_yneg"
+
+# ----------------------------------------------------------------------
+# Export exodus file
+# ----------------------------------------------------------------------
+export mesh "mesh.exo" dimension 2 overwrite
+
Added: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/testpylith.py
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/testpylith.py (rev 0)
+++ short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/testpylith.py 2010-08-30 15:49:48 UTC (rev 17147)
@@ -0,0 +1,57 @@
+#!/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 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ======================================================================
+#
+
+__requires__ = "PyLith"
+
+import unittest
+
+def suite():
+ """
+ Create test suite.
+ """
+ suite = unittest.TestSuite()
+
+ from TestAxialDisp import TestAxialDisp
+ suite.addTest(unittest.makeSuite(TestAxialDisp))
+
+ from TestShearDisp import TestShearDisp
+ suite.addTest(unittest.makeSuite(TestShearDisp))
+
+ #from TestDislocation import TestDislocation
+ #suite.addTest(unittest.makeSuite(TestDislocation))
+
+ #from TestDislocation2 import TestDislocation2
+ #suite.addTest(unittest.makeSuite(TestDislocation2))
+
+ return suite
+
+
+def main():
+ """
+ Run test suite.
+ """
+ unittest.TextTestRunner(verbosity=2).run(suite())
+ return
+
+
+# ----------------------------------------------------------------------
+if __name__ == '__main__':
+ main()
+
+
+# End of file
Property changes on: short/3D/PyLith/branches/v1.5-stable/tests_auto/2d/tri6/testpylith.py
___________________________________________________________________
Name: svn:executable
+ *
More information about the CIG-COMMITS
mailing list