[cig-commits] [commit] knepley/upgrade-petsc-interface: Update embedded fault full-scale tests with fault info. (687c383)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Mar 5 17:03:31 PST 2014


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/37e2098396275cfd63fcf1498024739b6fac6398...687c383d3af9cc4c33c72ebdfe5dc3c70ec327a8

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

commit 687c383d3af9cc4c33c72ebdfe5dc3c70ec327a8
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Wed Mar 5 17:03:06 2014 -0800

    Update embedded fault full-scale tests with fault info.


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

687c383d3af9cc4c33c72ebdfe5dc3c70ec327a8
 tests_auto/3d/hex8/TestShearDispNoSlip.py | 75 +++++++++++++++++++++++++++++++
 tests_auto/3d/hex8/sheardispnoslip.cfg    | 24 +++++-----
 tests_auto/3d/tet4/TestShearDispNoSlip.py | 44 ++++++++++++++++++
 3 files changed, 131 insertions(+), 12 deletions(-)

diff --git a/tests_auto/3d/hex8/TestShearDispNoSlip.py b/tests_auto/3d/hex8/TestShearDispNoSlip.py
index 9862950..d36e4c1 100644
--- a/tests_auto/3d/hex8/TestShearDispNoSlip.py
+++ b/tests_auto/3d/hex8/TestShearDispNoSlip.py
@@ -25,6 +25,8 @@ 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):
@@ -61,6 +63,13 @@ class TestShearDispNoSlip(TestHex8):
     Setup for test.
     """
     TestHex8.setUp(self)
+    self.nverticesO = self.mesh['nvertices']
+    self.mesh['nvertices'] += 44
+    self.faultMesh = {'nvertices': 44,
+                      'spaceDim': 3,
+                      'ncells': 30,
+                      'ncorners': 4}
+
     run_pylith()
     self.outputRoot = "sheardispnoslip"
 
@@ -68,6 +77,34 @@ class TestShearDispNoSlip(TestHex8):
     return
 
 
+  def test_fault_info(self):
+    """
+    Check fault information.
+    """
+    if not self.checkResults:
+      return
+
+    filename = "%s-fault_info.h5" % 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 not self.checkResults:
+      return
+
+    filename = "%s-fault.h5" % self.outputRoot
+    fields = ["slip"]
+    check_vertex_fields(self, filename, self.faultMesh, fields)
+
+    return
+
+
   def calcDisplacements(self, vertices):
     """
     Calculate displacement field given coordinates of vertices.
@@ -91,6 +128,44 @@ class TestShearDispNoSlip(TestHex8):
     return stateVar
 
 
+  def calcFaultField(self, name, vertices):
+    """
+    Calculate fault info.
+    """
+
+    normalDir = (-1.0, 0.0, 0.0)
+    finalSlip = 0.0
+    slipTime = 0.0
+
+    nvertices = self.faultMesh['nvertices']
+
+    if name == "normal_dir":
+      field = numpy.zeros( (1, nvertices, 3), 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, 3), 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, 3), dtype=numpy.float64)
+      field[0,:,0] = finalSlip
+
+    elif name == "traction_change":
+      field = numpy.zeros( (1, nvertices, 3), dtype=numpy.float64)
+      field[0,:,0] = 0.0
+      
+    else:
+      raise ValueError("Unknown fault field '%s'." % name)
+
+    return field
+
+
 # ----------------------------------------------------------------------
 if __name__ == '__main__':
   import unittest
diff --git a/tests_auto/3d/hex8/sheardispnoslip.cfg b/tests_auto/3d/hex8/sheardispnoslip.cfg
index 3a3fc89..818a19b 100644
--- a/tests_auto/3d/hex8/sheardispnoslip.cfg
+++ b/tests_auto/3d/hex8/sheardispnoslip.cfg
@@ -7,16 +7,16 @@ command = mpirun -np ${nodes}
 # journal
 # ----------------------------------------------------------------------
 [sheardispnoslip.journal.info]
-timedependent = 1
-implicit = 1
-petsc = 1
-solverlinear = 1
-meshimporter = 1
-meshiocubit = 1
-implicitelasticity = 1
-quadrature3d = 1
-faultcohesivekin = 1
-fiatsimplex = 1
+#timedependent = 1
+#implicit = 1
+#petsc = 1
+#solverlinear = 1
+#meshimporter = 1
+#meshiocubit = 1
+#implicitelasticity = 1
+#quadrature3d = 1
+#faultcohesivekin = 1
+#fiatlagrange = 1
 
 # ----------------------------------------------------------------------
 # mesh_generator
@@ -139,9 +139,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
diff --git a/tests_auto/3d/tet4/TestShearDispNoSlip.py b/tests_auto/3d/tet4/TestShearDispNoSlip.py
index e4ae14d..795312f 100644
--- a/tests_auto/3d/tet4/TestShearDispNoSlip.py
+++ b/tests_auto/3d/tet4/TestShearDispNoSlip.py
@@ -61,6 +61,12 @@ class TestShearDispNoSlip(TestTet4):
     Setup for test.
     """
     TestTet4.setUp(self)
+    self.nverticesO = self.mesh['nvertices']
+    self.mesh['nvertices'] += 51
+    self.faultMesh = {'nvertices': 51,
+                      'spaceDim': 3,
+                      'ncells': 30,
+                      'ncorners': 3}
     run_pylith()
     self.outputRoot = "sheardispnoslip"
 
@@ -91,6 +97,44 @@ class TestShearDispNoSlip(TestTet4):
     return stateVar
 
 
+  def calcFaultField(self, name, vertices):
+    """
+    Calculate fault info.
+    """
+
+    normalDir = (-1.0, 0.0, 0.0)
+    finalSlip = 0.0
+    slipTime = 0.0
+
+    nvertices = self.faultMesh['nvertices']
+
+    if name == "normal_dir":
+      field = numpy.zeros( (1, nvertices, 3), 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, 3), 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, 3), dtype=numpy.float64)
+      field[0,:,0] = finalSlip
+
+    elif name == "traction_change":
+      field = numpy.zeros( (1, nvertices, 3), dtype=numpy.float64)
+      field[0,:,0] = 0.0
+      
+    else:
+      raise ValueError("Unknown fault field '%s'." % name)
+
+    return field
+
+
 # ----------------------------------------------------------------------
 if __name__ == '__main__':
   import unittest



More information about the CIG-COMMITS mailing list