[cig-commits] [commit] baagaard/fix-cubit-cellsize, baagaard/fix-fullscale-3d-tests, baagaard/fix-packaging, knepley/fix-parallel-mult-faults, knepley/upgrade-petsc-interface, master, next: More work on hex8 full-scale tests. Two fault analytical soln not yet correct. (c55f238)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Apr 9 03:02:48 PDT 2014


Repository : ssh://geoshell/pylith

On branches: baagaard/fix-cubit-cellsize,baagaard/fix-fullscale-3d-tests,baagaard/fix-packaging,knepley/fix-parallel-mult-faults,knepley/upgrade-petsc-interface,master,next
Link       : https://github.com/geodynamics/pylith/compare/a213c3005450d915f40c7137ff7d8dbbb439d334...1b3d6d3bc246edc4235d0051142d675d91e9be41

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

commit c55f238bb80c197e0216732910b531602b2eb7ac
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Wed Mar 12 17:17:12 2014 -0700

    More work on hex8 full-scale tests. Two fault analytical soln not yet correct.


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

c55f238bb80c197e0216732910b531602b2eb7ac
 tests_auto/2d/quad4/Makefile.am                    |  2 +-
 tests_auto/2d/tri3/sliptwofaults_soln.py           |  2 +-
 tests_auto/3d/hex8/Makefile.am                     | 11 ++-
 tests_auto/3d/hex8/TestShearDispNoSlip.py          |  6 +-
 tests_auto/3d/hex8/TestShearDispNoSlipRefine.py    |  6 +-
 tests_auto/3d/tet4/Makefile.am                     |  8 ++-
 .../{2d/tri3 => 3d/tet4}/TestSlipOneFault.py       | 30 ++++----
 .../{2d/tri3 => 3d/tet4}/TestSlipTwoFaults.py      | 47 +++++++------
 tests_auto/{2d/tri3 => 3d/tet4}/sliponefault.cfg   | 53 +++++++++------
 .../{2d/tri3 => 3d/tet4}/sliponefault_soln.py      | 33 +++++----
 tests_auto/{2d/tri3 => 3d/tet4}/sliptwofaults.cfg  | 79 +++++++++++++---------
 .../tet4/sliptwofaults_soln.py}                    | 33 +++++----
 tests_auto/3d/tet4/testpylith.py                   |  6 ++
 13 files changed, 199 insertions(+), 117 deletions(-)

diff --git a/tests_auto/2d/quad4/Makefile.am b/tests_auto/2d/quad4/Makefile.am
index 10a5ded..5c626bf 100644
--- a/tests_auto/2d/quad4/Makefile.am
+++ b/tests_auto/2d/quad4/Makefile.am
@@ -94,7 +94,7 @@ BUILT_SOURCES = export-data
 clean-local: clean-local-tmp clean-data
 .PHONY: clean-local-tmp
 clean-local-tmp:
-	-rm *.h5 *.xmf *.pyc *.spatialdb
+	-rm *.h5 *.xmf *.pyc
 
 
 # End of file 
diff --git a/tests_auto/2d/tri3/sliptwofaults_soln.py b/tests_auto/2d/tri3/sliptwofaults_soln.py
index f6bc6ec..0e4531b 100644
--- a/tests_auto/2d/tri3/sliptwofaults_soln.py
+++ b/tests_auto/2d/tri3/sliptwofaults_soln.py
@@ -16,7 +16,7 @@
 # ----------------------------------------------------------------------
 #
 
-## @file tests/2d/quad4/sliponefault_soln.py
+## @file tests/2d/tri3/sliponefault_soln.py
 ##
 ## @brief Analytical solution to sliponefault (rigid motion).
 
diff --git a/tests_auto/3d/hex8/Makefile.am b/tests_auto/3d/hex8/Makefile.am
index cdf1a20..170e094 100644
--- a/tests_auto/3d/hex8/Makefile.am
+++ b/tests_auto/3d/hex8/Makefile.am
@@ -27,6 +27,7 @@ dist_noinst_PYTHON = \
 	axialdisp_soln.py \
 	TestShearDisp.py \
 	TestShearDispNoSlip.py \
+	TestShearDispNoSlipRefine.py \
 	sheardisp_gendb.py \
 	sheardisp_soln.py \
 	testpylith.py
@@ -39,7 +40,13 @@ dist_noinst_DATA = \
 	matprops.spatialdb \
 	axialdisp.cfg \
 	sheardisp.cfg \
-	sheardispnoslip.cfg
+	sheardispnoslip.cfg \
+	sheardispnosliprefine.cfg
+
+noinst_TMP = \
+	shear_dispx.spatialdb \
+	shear_dispy.spatialdb \
+	shear_dispz.spatialdb
 
 TESTS_ENVIRONMENT = $(PYTHON)
 
@@ -58,7 +65,7 @@ BUILT_SOURCES = export-data
 clean-local: clean-local-tmp clean-data
 .PHONY: clean-local-tmp
 clean-local-tmp:
-	-rm *.h5 *.xmf *.pyc *.spatialdb
+	-rm *.h5 *.xmf *.pyc
 
 
 # End of file 
diff --git a/tests_auto/3d/hex8/TestShearDispNoSlip.py b/tests_auto/3d/hex8/TestShearDispNoSlip.py
index d36e4c1..9159974 100644
--- a/tests_auto/3d/hex8/TestShearDispNoSlip.py
+++ b/tests_auto/3d/hex8/TestShearDispNoSlip.py
@@ -25,8 +25,6 @@ import numpy
 from TestHex8 import TestHex8
 from sheardisp_soln import AnalyticalSoln
 
-from pylith.tests.Fault import check_vertex_fields
-
 # Local version of PyLithApp
 from pylith.apps.PyLithApp import PyLithApp
 class ShearApp(PyLithApp):
@@ -86,6 +84,8 @@ class TestShearDispNoSlip(TestHex8):
 
     filename = "%s-fault_info.h5" % self.outputRoot
     fields = ["normal_dir", "final_slip", "slip_time"]
+
+    from pylith.tests.Fault import check_vertex_fields
     check_vertex_fields(self, filename, self.faultMesh, fields)
 
     return
@@ -100,6 +100,8 @@ class TestShearDispNoSlip(TestHex8):
 
     filename = "%s-fault.h5" % self.outputRoot
     fields = ["slip"]
+
+    from pylith.tests.Fault import check_vertex_fields
     check_vertex_fields(self, filename, self.faultMesh, fields)
 
     return
diff --git a/tests_auto/3d/hex8/TestShearDispNoSlipRefine.py b/tests_auto/3d/hex8/TestShearDispNoSlipRefine.py
index c291965..90e3115 100644
--- a/tests_auto/3d/hex8/TestShearDispNoSlipRefine.py
+++ b/tests_auto/3d/hex8/TestShearDispNoSlipRefine.py
@@ -25,8 +25,6 @@ import numpy
 from TestHex8 import TestHex8
 from sheardisp_soln import AnalyticalSoln
 
-from pylith.tests.Fault import check_vertex_fields
-
 # Local version of PyLithApp
 from pylith.apps.PyLithApp import PyLithApp
 class ShearApp(PyLithApp):
@@ -92,6 +90,8 @@ class TestShearDispNoSlipRefine(TestHex8):
 
     filename = "%s-fault_info.h5" % self.outputRoot
     fields = ["normal_dir", "final_slip", "slip_time"]
+
+    from pylith.tests.Fault import check_vertex_fields
     check_vertex_fields(self, filename, self.faultMesh, fields)
 
     return
@@ -106,6 +106,8 @@ class TestShearDispNoSlipRefine(TestHex8):
 
     filename = "%s-fault.h5" % self.outputRoot
     fields = ["slip"]
+
+    from pylith.tests.Fault import check_vertex_fields
     check_vertex_fields(self, filename, self.faultMesh, fields)
 
     return
diff --git a/tests_auto/3d/tet4/Makefile.am b/tests_auto/3d/tet4/Makefile.am
index c66a935..b53e660 100644
--- a/tests_auto/3d/tet4/Makefile.am
+++ b/tests_auto/3d/tet4/Makefile.am
@@ -30,6 +30,10 @@ dist_noinst_PYTHON = \
 	TestShearDispNoSlipRefine.py \
 	sheardisp_gendb.py \
 	sheardisp_soln.py \
+	TestSlipOneFault.py \
+	sliponefault_soln.py \
+	TestSlipTwoFaults.py \
+	sliptwofaults.py \
 	testpylith.py
 
 
@@ -41,7 +45,9 @@ dist_noinst_DATA = \
 	axialdisp.cfg \
 	sheardisp.cfg \
 	sheardispnoslip.cfg \
-	sheardispnosliprefine.cfg
+	sheardispnosliprefine.cfg \
+	sliponefault.cfg \
+	sliptwofaults.cfg
 
 noinst_TMP = \
 	axial_dispx.spatialdb \
diff --git a/tests_auto/2d/tri3/TestSlipOneFault.py b/tests_auto/3d/tet4/TestSlipOneFault.py
similarity index 84%
copy from tests_auto/2d/tri3/TestSlipOneFault.py
copy to tests_auto/3d/tet4/TestSlipOneFault.py
index 8f4cac8..04e8bcd 100644
--- a/tests_auto/2d/tri3/TestSlipOneFault.py
+++ b/tests_auto/3d/tet4/TestSlipOneFault.py
@@ -16,12 +16,12 @@
 # ----------------------------------------------------------------------
 #
 
-## @file tests/2d/tri3/TestSlipOneFault.py
+## @file tests/3d/tet4/TestSlipOneFault.py
 ##
 ## @brief Test suite for testing pylith with shear slip.
 
 import numpy
-from TestTri3 import TestTri3
+from TestTet4 import TestTet4
 from sliponefault_soln import AnalyticalSoln
 
 # Local version of PyLithApp
@@ -44,7 +44,7 @@ def run_pylith():
   return
 
 
-class TestSlipOneFault(TestTri3):
+class TestSlipOneFault(TestTet4):
   """
   Test suite for testing pylith with shear sliponefault for 2-D box.
   """
@@ -53,13 +53,13 @@ class TestSlipOneFault(TestTri3):
     """
     Setup for test.
     """
-    TestTri3.setUp(self)
+    TestTet4.setUp(self)
     self.nverticesO = self.mesh['nvertices']
-    self.mesh['nvertices'] += 9
-    self.faultMesh = {'nvertices': 9,
-                      'spaceDim': 2,
-                      'ncells': 8,
-                      'ncorners': 2}
+    self.mesh['nvertices'] += 50
+    self.faultMesh = {'nvertices': 50,
+                      'spaceDim': 3,
+                      'ncells': 72,
+                      'ncorners': 3}
     run_pylith()
     self.outputRoot = "sliponefault"
 
@@ -126,31 +126,33 @@ class TestSlipOneFault(TestTri3):
     """
     Calculate fault info.
     """
+    dim = 3
 
-    normalDir = (-1.0, 0.0)
+    normalDir = (+1.0, 0.0, 0.0)
     finalSlip = -2.0
     slipTime = 0.0
 
     nvertices = self.faultMesh['nvertices']
 
     if name == "normal_dir":
-      field = numpy.zeros( (1, nvertices, 2), dtype=numpy.float64)
+      field = numpy.zeros( (1, nvertices, dim), dtype=numpy.float64)
       field[0,:,0] = normalDir[0]
       field[0,:,1] = normalDir[1]
+      field[0,:,2] = normalDir[2]
 
     elif name == "final_slip":
-      field = numpy.zeros( (1, nvertices, 2), dtype=numpy.float64)
+      field = numpy.zeros( (1, nvertices, dim), dtype=numpy.float64)
       field[0,:,0] = finalSlip
       
     elif name == "slip_time":
       field = slipTime*numpy.zeros( (1, nvertices, 1), dtype=numpy.float64)
       
     elif name == "slip":
-      field = numpy.zeros( (1, nvertices, 2), dtype=numpy.float64)
+      field = numpy.zeros( (1, nvertices, dim), dtype=numpy.float64)
       field[0,:,0] = finalSlip
 
     elif name == "traction_change":
-      field = numpy.zeros( (1, nvertices, 2), dtype=numpy.float64)
+      field = numpy.zeros( (1, nvertices, dim), dtype=numpy.float64)
       field[0,:,0] = 0.0
       
     else:
diff --git a/tests_auto/2d/tri3/TestSlipTwoFaults.py b/tests_auto/3d/tet4/TestSlipTwoFaults.py
similarity index 75%
copy from tests_auto/2d/tri3/TestSlipTwoFaults.py
copy to tests_auto/3d/tet4/TestSlipTwoFaults.py
index 7d66b3a..4e8952d 100644
--- a/tests_auto/2d/tri3/TestSlipTwoFaults.py
+++ b/tests_auto/3d/tet4/TestSlipTwoFaults.py
@@ -16,12 +16,12 @@
 # ----------------------------------------------------------------------
 #
 
-## @file tests/2d/tri3/TestSlipTwoFaults.py
+## @file tests/3d/tet4/TestSlipTwoFaults.py
 ##
 ## @brief Test suite for testing pylith with shear slip.
 
 import numpy
-from TestTri3 import TestTri3
+from TestTet4 import TestTet4
 from sliptwofaults_soln import AnalyticalSoln
 
 # Local version of PyLithApp
@@ -44,7 +44,7 @@ def run_pylith():
   return
 
 
-class TestSlipTwoFaults(TestTri3):
+class TestSlipTwoFaults(TestTet4):
   """
   Test suite for testing pylith with shear slip on two faults.
   """
@@ -53,13 +53,17 @@ class TestSlipTwoFaults(TestTri3):
     """
     Setup for test.
     """
-    TestTri3.setUp(self)
+    TestTet4.setUp(self)
     self.nverticesO = self.mesh['nvertices']
-    self.mesh['nvertices'] += 2*9
-    self.faultMesh = {'nvertices': 9,
-                      'spaceDim': 2,
-                      'ncells': 8,
-                      'ncorners': 2}
+    self.mesh['nvertices'] += 50+49
+    self.faultMesh1 = {'nvertices': 50,
+                       'spaceDim': 3,
+                       'ncells': 72,
+                       'ncorners': 3}
+    self.faultMesh2 = {'nvertices': 49,
+                       'spaceDim': 3,
+                       'ncells': 72,
+                       'ncorners': 3}
     run_pylith()
     self.outputRoot = "sliptwofaults"
 
@@ -79,11 +83,11 @@ class TestSlipTwoFaults(TestTri3):
 
     self.fault = 1
     filename = "%s-fault1_info.h5" % self.outputRoot
-    check_vertex_fields(self, filename, self.faultMesh, fields)
+    check_vertex_fields(self, filename, self.faultMesh1, fields)
 
     self.fault = 2
     filename = "%s-fault2_info.h5" % self.outputRoot
-    check_vertex_fields(self, filename, self.faultMesh, fields)
+    check_vertex_fields(self, filename, self.faultMesh2, fields)
 
     return
 
@@ -100,11 +104,11 @@ class TestSlipTwoFaults(TestTri3):
 
     filename = "%s-fault1.h5" % self.outputRoot
     self.fault = 1
-    check_vertex_fields(self, filename, self.faultMesh, fields)
+    check_vertex_fields(self, filename, self.faultMesh1, fields)
 
     filename = "%s-fault2.h5" % self.outputRoot
     self.fault = 2
-    check_vertex_fields(self, filename, self.faultMesh, fields)
+    check_vertex_fields(self, filename, self.faultMesh2, fields)
 
     return
 
@@ -137,22 +141,27 @@ class TestSlipTwoFaults(TestTri3):
     Calculate fault info.
     """
 
-    normalDir = (-1.0, 0.0)
+    normalDir = (+1.0, 0.0, 0.0)
     finalSlip = -2.0
     slipTime = 0.0
+    dim = 3
 
-    nvertices = self.faultMesh['nvertices']
+    if self.fault == 1:
+      nvertices = self.faultMesh1['nvertices']
+    else:
+      nvertices = self.faultMesh2['nvertices']
 
     if name == "normal_dir":
-      field = numpy.zeros( (1, nvertices, 2), dtype=numpy.float64)
+      field = numpy.zeros( (1, nvertices, dim), dtype=numpy.float64)
       field[0,:,0] = normalDir[0]
       field[0,:,1] = normalDir[1]
+      field[0,:,2] = normalDir[2]
 
       if self.fault == 2:
         field *= -1
 
     elif name == "final_slip":
-      field = numpy.zeros( (1, nvertices, 2), dtype=numpy.float64)
+      field = numpy.zeros( (1, nvertices, dim), dtype=numpy.float64)
       field[0,:,0] = finalSlip
 
       if self.fault == 2:
@@ -162,14 +171,14 @@ class TestSlipTwoFaults(TestTri3):
       field = slipTime*numpy.zeros( (1, nvertices, 1), dtype=numpy.float64)
       
     elif name == "slip":
-      field = numpy.zeros( (1, nvertices, 2), dtype=numpy.float64)
+      field = numpy.zeros( (1, nvertices, dim), dtype=numpy.float64)
       field[0,:,0] = finalSlip
 
       if self.fault == 2:
         field *= -1
 
     elif name == "traction_change":
-      field = numpy.zeros( (1, nvertices, 2), dtype=numpy.float64)
+      field = numpy.zeros( (1, nvertices, dim), dtype=numpy.float64)
       field[0,:,0] = 0.0
       
     else:
diff --git a/tests_auto/2d/tri3/sliponefault.cfg b/tests_auto/3d/tet4/sliponefault.cfg
similarity index 74%
copy from tests_auto/2d/tri3/sliponefault.cfg
copy to tests_auto/3d/tet4/sliponefault.cfg
index 10976cb..0f58bd6 100644
--- a/tests_auto/2d/tri3/sliponefault.cfg
+++ b/tests_auto/3d/tet4/sliponefault.cfg
@@ -11,7 +11,7 @@
 #meshimporter = 1
 #meshiocubit = 1
 #implicitelasticity = 1
-#quadrature2d = 1
+#quadrature3d = 1
 #fiatsimplex = 1
 
 # ----------------------------------------------------------------------
@@ -23,13 +23,13 @@ reorder_mesh = True
 
 [sliponefault.mesh_generator.reader]
 filename = mesh.exo
-coordsys.space_dim = 2
+coordsys.space_dim = 3
 
 # ----------------------------------------------------------------------
 # problem
 # ----------------------------------------------------------------------
 [sliponefault.timedependent]
-dimension = 2
+dimension = 3
 
 [sliponefault.timedependent.formulation.time_step]
 total_time = 0.0*s
@@ -38,15 +38,25 @@ total_time = 0.0*s
 # materials
 # ----------------------------------------------------------------------
 [sliponefault.timedependent]
-materials = [elastic]
-materials.elastic = pylith.materials.ElasticPlaneStrain
+materials = [elastic,viscoelastic]
+materials.elastic = pylith.materials.ElasticIsotropic3D
+materials.viscoelastic = pylith.materials.ElasticIsotropic3D
 
 [sliponefault.timedependent.materials.elastic]
 label = Elastic material
 id = 1
 db_properties.label = Elastic properties
 db_properties.iohandler.filename = matprops.spatialdb
-quadrature.cell.dimension = 2
+quadrature.cell = pylith.feassemble.FIATSimplex
+quadrature.cell.dimension = 3
+
+[sliponefault.timedependent.materials.viscoelastic]
+label = Elastic material
+id = 2
+db_properties.label = Elastic properties
+db_properties.iohandler.filename = matprops.spatialdb
+quadrature.cell = pylith.feassemble.FIATSimplex
+quadrature.cell.dimension = 3
 
 # ----------------------------------------------------------------------
 # boundary conditions
@@ -55,20 +65,20 @@ quadrature.cell.dimension = 2
 bc = [x_neg,x_pos]
 
 [sliponefault.timedependent.bc.x_pos]
-bc_dof = [0, 1]
-label = edge_xpos
+bc_dof = [0, 1, 2]
+label = face_xpos
 db_initial = spatialdata.spatialdb.UniformDB
 db_initial.label = Dirichlet BC +x edge
-db_initial.values = [displacement-x, displacement-y]
-db_initial.data = [0.0*m,-1.0*m]
+db_initial.values = [displacement-x, displacement-y, displacement-z]
+db_initial.data = [0.0*m,-1.0*m,0.0*m]
 
 [sliponefault.timedependent.bc.x_neg]
-bc_dof = [0, 1]
-label = edge_xneg
+bc_dof = [0, 1, 2]
+label = face_xneg
 db_initial = spatialdata.spatialdb.UniformDB
 db_initial.label = Dirichlet BC -x edge
-db_initial.values = [displacement-x, displacement-y]
-db_initial.data = [0.0*m,+1.0*m]
+db_initial.values = [displacement-x, displacement-y, displacement-z]
+db_initial.data = [0.0*m,+1.0*m,0.0*m]
 
 # ----------------------------------------------------------------------
 # faults
@@ -77,15 +87,15 @@ db_initial.data = [0.0*m,+1.0*m]
 interfaces = [fault]
 
 [sliponefault.timedependent.interfaces.fault]
-id = 2
-label = fault_x
-quadrature.cell.dimension = 1
+id = 100
+label = fault_x_thru
+quadrature.cell.dimension = 2
 
 [sliponefault.timedependent.interfaces.fault.eq_srcs.rupture.slip_function]
 slip = spatialdata.spatialdb.UniformDB
 slip.label = Final slip
-slip.values = [left-lateral-slip,fault-opening]
-slip.data = [-2.0*m,0.0*m]
+slip.values = [left-lateral-slip,reverse-slip,fault-opening]
+slip.data = [-2.0*m,0.0*m,0.0*m]
 
 slip_time = spatialdata.spatialdb.UniformDB
 slip_time.label = Slip start time
@@ -125,6 +135,11 @@ cell_filter = pylith.meshio.CellFilterAvg
 writer = pylith.meshio.DataWriterHDF5
 writer.filename = sliponefault-elastic.h5
 
+[sliponefault.timedependent.materials.viscoelastic.output]
+cell_filter = pylith.meshio.CellFilterAvg
+writer = pylith.meshio.DataWriterHDF5
+writer.filename = sliponefault-viscoelastic.h5
+
 [sliponefault.timedependent.interfaces.fault.output]
 writer = pylith.meshio.DataWriterHDF5
 writer.filename = sliponefault-fault.h5
diff --git a/tests_auto/2d/tri3/sliponefault_soln.py b/tests_auto/3d/tet4/sliponefault_soln.py
similarity index 76%
copy from tests_auto/2d/tri3/sliponefault_soln.py
copy to tests_auto/3d/tet4/sliponefault_soln.py
index b04299a..3974cff 100644
--- a/tests_auto/2d/tri3/sliponefault_soln.py
+++ b/tests_auto/3d/tet4/sliponefault_soln.py
@@ -32,9 +32,11 @@ p_lambda = p_density*p_vp**2 - 2*p_mu
 
 # Uniform stress field (plane strain)
 sxx = 0.0
-sxy = 0.0
 syy = 0.0
-szz = p_lambda/(2*p_lambda+2*p_mu)*(sxx+syy)
+szz = 0.0
+sxy = 0.0
+syz = 0.0
+sxz = 0.0
 
 # Uniform strain field
 exx = 1.0/(2*p_mu) * (sxx - p_lambda/(3*p_lambda+2*p_mu) * (sxx+syy+szz))
@@ -42,14 +44,15 @@ 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)
+eyz = 1.0/(2*p_mu) * (syz)
+exz = 1.0/(2*p_mu) * (sxz)
 
-#print exx,eyy,exy,ezz
-#print -exx*p_lambda/(p_lambda+2*p_mu)
+#print exx,eyy,ezz,exy,eyz,exz
 
 # ----------------------------------------------------------------------
 class AnalyticalSoln(object):
   """
-  Analytical solution to axial/shear displacement problem.
+  Analytical solution to fault slip problem.
   """
 
   def __init__(self):
@@ -62,9 +65,9 @@ class AnalyticalSoln(object):
     """
     (nlocs, dim) = locs.shape
 
-    disp = numpy.zeros( (1, nlocs, 2), dtype=numpy.float64)
-    maskP = locs[:,0] >= 0.0
-    maskP[nlocsO:nlocs] = False
+    disp = numpy.zeros( (1, nlocs, 3), dtype=numpy.float64)
+    maskP = locs[:,0] > 0.0
+    maskP[nlocsO:nlocs] = True
     maskN = numpy.bitwise_and(locs[:,0] <= 0.0, ~maskP)
     disp[0,:,1] = maskN*(+1.0) + maskP*(-1.0)
     return disp
@@ -75,10 +78,13 @@ class AnalyticalSoln(object):
     Compute strain field at locations.
     """
     (nlocs, dim) = locs.shape
-    strain = numpy.zeros( (1, nlocs, 3), dtype=numpy.float64)
+    strain = numpy.zeros( (1, nlocs, 6), dtype=numpy.float64)
     strain[0,:,0] = exx
     strain[0,:,1] = eyy
-    strain[0,:,2] = exy
+    strain[0,:,2] = ezz
+    strain[0,:,3] = exy
+    strain[0,:,4] = eyz
+    strain[0,:,5] = exz
     return strain
   
 
@@ -87,10 +93,13 @@ class AnalyticalSoln(object):
     Compute stress field at locations.
     """
     (nlocs, dim) = locs.shape
-    stress = numpy.zeros( (1, nlocs, 3), dtype=numpy.float64)
+    stress = numpy.zeros( (1, nlocs, 6), dtype=numpy.float64)
     stress[0,:,0] = sxx
     stress[0,:,1] = syy
-    stress[0,:,2] = sxy
+    stress[0,:,2] = szz
+    stress[0,:,3] = sxy
+    stress[0,:,4] = syz
+    stress[0,:,5] = sxz
     return stress
 
 
diff --git a/tests_auto/2d/tri3/sliptwofaults.cfg b/tests_auto/3d/tet4/sliptwofaults.cfg
similarity index 71%
copy from tests_auto/2d/tri3/sliptwofaults.cfg
copy to tests_auto/3d/tet4/sliptwofaults.cfg
index c4508c1..59d9ae8 100644
--- a/tests_auto/2d/tri3/sliptwofaults.cfg
+++ b/tests_auto/3d/tet4/sliptwofaults.cfg
@@ -4,15 +4,15 @@
 # journal
 # ----------------------------------------------------------------------
 [sliptwofaults.journal.info]
-#timedependent = 1
-#implicit = 1
-#petsc = 1
-#solverlinear = 1
-#meshimporter = 1
-#meshiocubit = 1
-#implicitelasticity = 1
-#quadrature2d = 1
-#fiatsimplex = 1
+timedependent = 1
+implicit = 1
+petsc = 1
+solverlinear = 1
+meshimporter = 1
+meshiocubit = 1
+implicitelasticity = 1
+quadrature2d = 1
+fiatsimplex = 1
 
 # ----------------------------------------------------------------------
 # mesh_generator
@@ -23,13 +23,13 @@ reorder_mesh = True
 
 [sliptwofaults.mesh_generator.reader]
 filename = mesh.exo
-coordsys.space_dim = 2
+coordsys.space_dim = 3
 
 # ----------------------------------------------------------------------
 # problem
 # ----------------------------------------------------------------------
 [sliptwofaults.timedependent]
-dimension = 2
+dimension = 3
 
 [sliptwofaults.timedependent.formulation.time_step]
 total_time = 0.0*s
@@ -38,15 +38,25 @@ total_time = 0.0*s
 # materials
 # ----------------------------------------------------------------------
 [sliptwofaults.timedependent]
-materials = [elastic]
-materials.elastic = pylith.materials.ElasticPlaneStrain
+materials = [elastic,viscoelastic]
+materials.elastic = pylith.materials.ElasticIsotropic3D
+materials.viscoelastic = pylith.materials.ElasticIsotropic3D
 
 [sliptwofaults.timedependent.materials.elastic]
 label = Elastic material
 id = 1
 db_properties.label = Elastic properties
 db_properties.iohandler.filename = matprops.spatialdb
-quadrature.cell.dimension = 2
+quadrature.cell = pylith.feassemble.FIATSimplex
+quadrature.cell.dimension = 3
+
+[sliptwofaults.timedependent.materials.viscoelastic]
+label = Elastic material
+id = 2
+db_properties.label = Elastic properties
+db_properties.iohandler.filename = matprops.spatialdb
+quadrature.cell = pylith.feassemble.FIATSimplex
+quadrature.cell.dimension = 3
 
 # ----------------------------------------------------------------------
 # boundary conditions
@@ -55,20 +65,20 @@ quadrature.cell.dimension = 2
 bc = [x_neg,x_pos]
 
 [sliptwofaults.timedependent.bc.x_pos]
-bc_dof = [0, 1]
-label = edge_xpos
+bc_dof = [0, 1, 2]
+label = face_xpos
 db_initial = spatialdata.spatialdb.UniformDB
 db_initial.label = Dirichlet BC +x edge
-db_initial.values = [displacement-x, displacement-y]
-db_initial.data = [0.0*m,-1.0*m]
+db_initial.values = [displacement-x, displacement-y, displacement-z]
+db_initial.data = [0.0*m,+1.0*m,0.0*m]
 
 [sliptwofaults.timedependent.bc.x_neg]
-bc_dof = [0, 1]
-label = edge_xneg
+bc_dof = [0, 1, 2]
+label = face_xneg
 db_initial = spatialdata.spatialdb.UniformDB
 db_initial.label = Dirichlet BC -x edge
-db_initial.values = [displacement-x, displacement-y]
-db_initial.data = [0.0*m,-1.0*m]
+db_initial.values = [displacement-x, displacement-y, displacement-z]
+db_initial.data = [0.0*m,+1.0*m,0.0*m]
 
 # ----------------------------------------------------------------------
 # faults
@@ -78,14 +88,14 @@ interfaces = [fault1,fault2]
 
 [sliptwofaults.timedependent.interfaces.fault1]
 id = 10
-label = fault_x
-quadrature.cell.dimension = 1
+label = fault_x_thru
+quadrature.cell.dimension = 2
 
 [sliptwofaults.timedependent.interfaces.fault1.eq_srcs.rupture.slip_function]
 slip = spatialdata.spatialdb.UniformDB
 slip.label = Final slip
-slip.values = [left-lateral-slip,fault-opening]
-slip.data = [-2.0*m,0.0*m]
+slip.values = [left-lateral-slip,reverse-slip,fault-opening]
+slip.data = [-2.0*m,0.0*m,0.0*m]
 
 slip_time = spatialdata.spatialdb.UniformDB
 slip_time.label = Slip start time
@@ -94,14 +104,14 @@ slip_time.data = [0.0*s]
 
 [sliptwofaults.timedependent.interfaces.fault2]
 id = 20
-label = fault_x2
-quadrature.cell.dimension = 1
+label = fault_x2_thru
+quadrature.cell.dimension = 2
 
 [sliptwofaults.timedependent.interfaces.fault2.eq_srcs.rupture.slip_function]
 slip = spatialdata.spatialdb.UniformDB
 slip.label = Final slip
-slip.values = [left-lateral-slip,fault-opening]
-slip.data = [+2.0*m,0.0*m]
+slip.values = [left-lateral-slip,reverse-slip,fault-opening]
+slip.data = [+2.0*m,0.0*m,0.0*m]
 
 slip_time = spatialdata.spatialdb.UniformDB
 slip_time.label = Slip start time
@@ -121,9 +131,9 @@ ksp_rtol = 1.0e-8
 ksp_max_it = 100
 ksp_gmres_restart = 50
 
-#ksp_monitor = true
+ksp_monitor = true
 #ksp_view = true
-#ksp_converged_reason = true
+ksp_converged_reason = true
 
 #log_summary = true
 # start_in_debugger = true
@@ -141,6 +151,11 @@ cell_filter = pylith.meshio.CellFilterAvg
 writer = pylith.meshio.DataWriterHDF5
 writer.filename = sliptwofaults-elastic.h5
 
+[sliptwofaults.timedependent.materials.viscoelastic.output]
+cell_filter = pylith.meshio.CellFilterAvg
+writer = pylith.meshio.DataWriterHDF5
+writer.filename = sliptwofaults-viscoelastic.h5
+
 [sliptwofaults.timedependent.interfaces.fault1.output]
 writer = pylith.meshio.DataWriterHDF5
 writer.filename = sliptwofaults-fault1.h5
diff --git a/tests_auto/2d/tri3/sliponefault_soln.py b/tests_auto/3d/tet4/sliptwofaults_soln.py
similarity index 74%
copy from tests_auto/2d/tri3/sliponefault_soln.py
copy to tests_auto/3d/tet4/sliptwofaults_soln.py
index b04299a..be99ec7 100644
--- a/tests_auto/2d/tri3/sliponefault_soln.py
+++ b/tests_auto/3d/tet4/sliptwofaults_soln.py
@@ -16,7 +16,7 @@
 # ----------------------------------------------------------------------
 #
 
-## @file tests/2d/quad4/sliponefault_soln.py
+## @file tests/3d/tet4/sliponefault_soln.py
 ##
 ## @brief Analytical solution to sliponefault (rigid motion).
 
@@ -32,9 +32,11 @@ p_lambda = p_density*p_vp**2 - 2*p_mu
 
 # Uniform stress field (plane strain)
 sxx = 0.0
-sxy = 0.0
 syy = 0.0
-szz = p_lambda/(2*p_lambda+2*p_mu)*(sxx+syy)
+szz = 0.0
+sxy = 0.0
+syz = 0.0
+sxz = 0.0
 
 # Uniform strain field
 exx = 1.0/(2*p_mu) * (sxx - p_lambda/(3*p_lambda+2*p_mu) * (sxx+syy+szz))
@@ -42,9 +44,10 @@ 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)
+eyz = 1.0/(2*p_mu) * (syz)
+exz = 1.0/(2*p_mu) * (sxz)
 
-#print exx,eyy,exy,ezz
-#print -exx*p_lambda/(p_lambda+2*p_mu)
+#print exx,eyy,ezz,exy,eyz,exz
 
 # ----------------------------------------------------------------------
 class AnalyticalSoln(object):
@@ -62,11 +65,11 @@ class AnalyticalSoln(object):
     """
     (nlocs, dim) = locs.shape
 
-    disp = numpy.zeros( (1, nlocs, 2), dtype=numpy.float64)
-    maskP = locs[:,0] >= 0.0
+    disp = numpy.zeros( (1, nlocs, 3), dtype=numpy.float64)
+    maskP = numpy.bitwise_or(locs[:,0] <= 0.0, locs[:,0] >= -20.0e+3)
     maskP[nlocsO:nlocs] = False
     maskN = numpy.bitwise_and(locs[:,0] <= 0.0, ~maskP)
-    disp[0,:,1] = maskN*(+1.0) + maskP*(-1.0)
+    disp[0,:,1] = maskN*(-1.0) + maskP*(+1.0)
     return disp
 
 
@@ -75,10 +78,13 @@ class AnalyticalSoln(object):
     Compute strain field at locations.
     """
     (nlocs, dim) = locs.shape
-    strain = numpy.zeros( (1, nlocs, 3), dtype=numpy.float64)
+    strain = numpy.zeros( (1, nlocs, 6), dtype=numpy.float64)
     strain[0,:,0] = exx
     strain[0,:,1] = eyy
-    strain[0,:,2] = exy
+    strain[0,:,2] = ezz
+    strain[0,:,3] = exy
+    strain[0,:,4] = eyz
+    strain[0,:,5] = exz
     return strain
   
 
@@ -87,10 +93,13 @@ class AnalyticalSoln(object):
     Compute stress field at locations.
     """
     (nlocs, dim) = locs.shape
-    stress = numpy.zeros( (1, nlocs, 3), dtype=numpy.float64)
+    stress = numpy.zeros( (1, nlocs, 6), dtype=numpy.float64)
     stress[0,:,0] = sxx
     stress[0,:,1] = syy
-    stress[0,:,2] = sxy
+    stress[0,:,2] = szz
+    stress[0,:,3] = sxy
+    stress[0,:,4] = syz
+    stress[0,:,5] = sxz
     return stress
 
 
diff --git a/tests_auto/3d/tet4/testpylith.py b/tests_auto/3d/tet4/testpylith.py
index bee9a45..044a949 100644
--- a/tests_auto/3d/tet4/testpylith.py
+++ b/tests_auto/3d/tet4/testpylith.py
@@ -38,6 +38,12 @@ def suite():
   #from TestShearDispNoSlipRefine import TestShearDispNoSlipRefine
   #suite.addTest(unittest.makeSuite(TestShearDispNoSlipRefine))
 
+  from TestSlipOneFault import TestSlipOneFault
+  suite.addTest(unittest.makeSuite(TestSlipOneFault))
+
+  from TestSlipTwoFaults import TestSlipTwoFaults
+  suite.addTest(unittest.makeSuite(TestSlipTwoFaults))
+
   return suite
 
 



More information about the CIG-COMMITS mailing list