[cig-commits] [commit] baagaard/fix-faults-intersect: Added 3-D fault intersection full-scale test. (87cc035)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Jun 4 12:49:28 PDT 2014


Repository : https://github.com/geodynamics/pylith

On branch  : baagaard/fix-faults-intersect
Link       : https://github.com/geodynamics/pylith/compare/85fe9961fb58cc7323dc26e78085e3f9b7748433...d42a67a6ec678bc8486e0f74f439efbe2f82a25d

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

commit 87cc03562712ded81323f29eaeda0dbf2f52721f
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Wed Jun 4 09:22:27 2014 -0700

    Added 3-D fault intersection full-scale test.


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

87cc03562712ded81323f29eaeda0dbf2f52721f
 tests_auto/3d/tet4/Makefile.am                     |  4 +-
 .../{2d/tri3 => 3d/tet4}/TestFaultsIntersect.py    | 51 ++++++++++----------
 .../{2d/tri3 => 3d/tet4}/faultsintersect.cfg       | 55 ++++++++++++++--------
 3 files changed, 65 insertions(+), 45 deletions(-)

diff --git a/tests_auto/3d/tet4/Makefile.am b/tests_auto/3d/tet4/Makefile.am
index 54b2bb5..b59df47 100644
--- a/tests_auto/3d/tet4/Makefile.am
+++ b/tests_auto/3d/tet4/Makefile.am
@@ -34,6 +34,7 @@ dist_noinst_PYTHON = \
 	sliponefault_soln.py \
 	TestSlipTwoFaults.py \
 	sliptwofaults_soln.py \
+	TestFaultsIntersect.py \
 	testpylith.py
 
 
@@ -47,7 +48,8 @@ dist_noinst_DATA = \
 	sheardispnoslip.cfg \
 	sheardispnosliprefine.cfg \
 	sliponefault.cfg \
-	sliptwofaults.cfg
+	sliptwofaults.cfg \
+	faultsintersect.cfg
 
 noinst_TMP = \
 	axial_dispx.spatialdb \
diff --git a/tests_auto/2d/tri3/TestFaultsIntersect.py b/tests_auto/3d/tet4/TestFaultsIntersect.py
similarity index 78%
copy from tests_auto/2d/tri3/TestFaultsIntersect.py
copy to tests_auto/3d/tet4/TestFaultsIntersect.py
index 4619b12..6e83cbb 100644
--- a/tests_auto/2d/tri3/TestFaultsIntersect.py
+++ b/tests_auto/3d/tet4/TestFaultsIntersect.py
@@ -16,12 +16,12 @@
 # ----------------------------------------------------------------------
 #
 
-## @file tests/2d/tri3/TestFaultsIntersect.py
+## @file tests/3d/tet4/TestFaultsIntersect.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
@@ -37,38 +37,38 @@ def run_pylith():
   """
   Run pylith.
   """
-  if not "done" in dir(run_pylith):
+  if not "dtwo" in dir(run_pylith):
     app = FaultsIntersectApp()
-    run_pylith.done = True # Put before run() so only called once
+    run_pylith.dtwo = True # Put before run() so only called once
     app.run()
   return
 
 
-class TestFaultsIntersect(TestTri3):
+class TestFaultsIntersect(TestTet4):
   """
-  Test suite for testing pylith with shear faultsintersect for 2-D box.
+  Test suite for testing pylith with shear slip on two faults.
   """
 
   def setUp(self):
     """
     Setup for test.
     """
-    TestTri3.setUp(self)
+    TestTet4.setUp(self)
     self.nverticesO = self.mesh['nvertices']
 
     # Fault x
-    self.mesh['nvertices'] += 9
-    self.faultMeshX = {'nvertices': 9,
-                      'spaceDim': 2,
-                      'ncells': 8,
-                      'ncorners': 2}
-    # Fault y
-    self.mesh['nvertices'] += 1
-    self.faultMeshY = {'nvertices': 3,
-                      'spaceDim': 2,
-                      'ncells': 2,
-                      'ncorners': 2}
+    self.mesh['nvertices'] += 50
+    self.faultMeshX = {'nvertices': 50,
+                       'spaceDim': 3,
+                       'ncells': 72,
+                       'ncorners': 3}
 
+    # Fault y
+    self.mesh['nvertices'] += 2
+    self.faultMeshY = {'nvertices': 9,
+                       'spaceDim': 3,
+                       'ncells': 8,
+                       'ncorners': 3}
     run_pylith()
     self.outputRoot = "faultsintersect"
 
@@ -147,35 +147,38 @@ class TestFaultsIntersect(TestTri3):
     """
 
     if self.fault == "x":
-      normalDir = (-1.0, 0.0)
+      normalDir = (+1.0, 0.0, 0.0)
       finalSlip = -2.0
       faultMesh = self.faultMeshX
     elif self.fault == "y":
-      normalDir = (+1.0, 0.0)
+      normalDir = (0.0,+1.0, 0.0)
       finalSlip = 0.0
       faultMesh = self.faultMeshY
+
     slipTime = 0.0
+    dim = 3
 
     nvertices = 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/faultsintersect.cfg b/tests_auto/3d/tet4/faultsintersect.cfg
similarity index 75%
copy from tests_auto/2d/tri3/faultsintersect.cfg
copy to tests_auto/3d/tet4/faultsintersect.cfg
index ed0eef6..a8c1a0d 100644
--- a/tests_auto/2d/tri3/faultsintersect.cfg
+++ b/tests_auto/3d/tet4/faultsintersect.cfg
@@ -24,13 +24,13 @@ reorder_mesh = True
 
 [faultsintersect.mesh_generator.reader]
 filename = mesh.exo
-coordsys.space_dim = 2
+coordsys.space_dim = 3
 
 # ----------------------------------------------------------------------
 # problem
 # ----------------------------------------------------------------------
 [faultsintersect.timedependent]
-dimension = 2
+dimension = 3
 
 [faultsintersect.timedependent.formulation.time_step]
 total_time = 0.0*s
@@ -39,15 +39,25 @@ total_time = 0.0*s
 # materials
 # ----------------------------------------------------------------------
 [faultsintersect.timedependent]
-materials = [elastic]
-materials.elastic = pylith.materials.ElasticPlaneStrain
+materials = [elastic,viscoelastic]
+materials.elastic = pylith.materials.ElasticIsotropic3D
+materials.viscoelastic = pylith.materials.ElasticIsotropic3D
 
 [faultsintersect.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
+
+[faultsintersect.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
@@ -56,20 +66,20 @@ quadrature.cell.dimension = 2
 bc = [x_neg,x_pos]
 
 [faultsintersect.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]
 
 [faultsintersect.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
@@ -79,14 +89,14 @@ interfaces = [faultx,faulty]
 
 [faultsintersect.timedependent.interfaces.faultx]
 id = 10
-label = fault_x
-quadrature.cell.dimension = 1
+label = fault_x_thru
+quadrature.cell.dimension = 2
 
 [faultsintersect.timedependent.interfaces.faultx.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
@@ -97,13 +107,13 @@ slip_time.data = [0.0*s]
 id = 20
 label = fault_y
 edge = fault_y_edge
-quadrature.cell.dimension = 1
+quadrature.cell.dimension = 2
 
 [faultsintersect.timedependent.interfaces.faulty.eq_srcs.rupture.slip_function]
 slip = spatialdata.spatialdb.UniformDB
 slip.label = Final slip
-slip.values = [left-lateral-slip,fault-opening]
-slip.data = [0.0*m,0.0*m]
+slip.values = [left-lateral-slip,reverse-slip,fault-opening]
+slip.data = [0.0*m,0.0*m,0.0*m]
 
 slip_time = spatialdata.spatialdb.UniformDB
 slip_time.label = Slip start time
@@ -143,6 +153,11 @@ cell_filter = pylith.meshio.CellFilterAvg
 writer = pylith.meshio.DataWriterHDF5
 writer.filename = faultsintersect-elastic.h5
 
+[faultsintersect.timedependent.materials.viscoelastic.output]
+cell_filter = pylith.meshio.CellFilterAvg
+writer = pylith.meshio.DataWriterHDF5
+writer.filename = faultsintersect-viscoelastic.h5
+
 [faultsintersect.timedependent.interfaces.faultx.output]
 writer = pylith.meshio.DataWriterHDF5
 writer.filename = faultsintersect-faultx.h5



More information about the CIG-COMMITS mailing list