[cig-commits] [commit] baagaard/fix-friction-initial-state: Added test case for embedded fault and initial state for friction. (3dcf71c)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Jul 15 09:33:54 PDT 2014
Repository : https://github.com/geodynamics/pylith
On branch : baagaard/fix-friction-initial-state
Link : https://github.com/geodynamics/pylith/compare/0000000000000000000000000000000000000000...954bfb2930acc92ce208aae0a6f34cc810569795
>---------------------------------------------------------------
commit 3dcf71c27ef765651251ef858baef53cc77d21bd
Author: Brad Aagaard <baagaard at usgs.gov>
Date: Tue Jul 15 09:30:37 2014 -0700
Added test case for embedded fault and initial state for friction.
Expose bug related to initial state for friction.
>---------------------------------------------------------------
3dcf71c27ef765651251ef858baef53cc77d21bd
...estShearDispNoSlip.py => TestFrictionNoSlip.py} | 37 ++---
...heardispnosliprefine.cfg => frictionnoslip.cfg} | 151 +++++++++++++--------
2 files changed, 119 insertions(+), 69 deletions(-)
diff --git a/tests_auto/3d/hex8/TestShearDispNoSlip.py b/tests_auto/3d/hex8/TestFrictionNoSlip.py
similarity index 83%
copy from tests_auto/3d/hex8/TestShearDispNoSlip.py
copy to tests_auto/3d/hex8/TestFrictionNoSlip.py
index 1ee8ca0..d93b9e9 100644
--- a/tests_auto/3d/hex8/TestShearDispNoSlip.py
+++ b/tests_auto/3d/hex8/TestFrictionNoSlip.py
@@ -16,7 +16,7 @@
# ----------------------------------------------------------------------
#
-## @file tests/3d/hex8/TestShearDispNoSlip.py
+## @file tests/3d/hex8/TestFrictionNoSlip.py
##
## @brief Test suite for testing pylith with 3-D shear motion with no
## fault slip.
@@ -29,7 +29,7 @@ from sheardisp_soln import AnalyticalSoln
from pylith.apps.PyLithApp import PyLithApp
class ShearApp(PyLithApp):
def __init__(self):
- PyLithApp.__init__(self, name="sheardispnoslip")
+ PyLithApp.__init__(self, name="frictionnoslip")
return
@@ -51,7 +51,7 @@ def run_pylith():
return
-class TestShearDispNoSlip(TestHex8):
+class TestFrictionNoSlip(TestHex8):
"""
Test suite for testing pylith with 2-D shear extension.
"""
@@ -69,7 +69,7 @@ class TestShearDispNoSlip(TestHex8):
'ncorners': 4}
run_pylith()
- self.outputRoot = "sheardispnoslip"
+ self.outputRoot = "frictionnoslip"
self.soln = AnalyticalSoln()
return
@@ -83,7 +83,7 @@ class TestShearDispNoSlip(TestHex8):
return
filename = "%s-fault_info.h5" % self.outputRoot
- fields = ["normal_dir", "final_slip", "slip_time"]
+ fields = ["normal_dir","strike_dir","static_coefficient", "traction_initial"]
from pylith.tests.Fault import check_vertex_fields
check_vertex_fields(self, filename, self.faultMesh, fields)
@@ -136,8 +136,10 @@ class TestShearDispNoSlip(TestHex8):
"""
normalDir = (-1.0, 0.0, 0.0)
- finalSlip = 0.0
- slipTime = 0.0
+ strikeDir = (0.0, -1.0, 0.0)
+
+ staticCoef = 0.6
+ initialTraction = (0.0,0.0,-100.0e+6)
nvertices = self.faultMesh['nvertices']
@@ -148,20 +150,23 @@ class TestShearDispNoSlip(TestHex8):
field[0,:,1] = normalDir[1]
field[0,:,2] = normalDir[2]
- elif name == "final_slip":
+ elif name == "strike_dir":
field = numpy.zeros( (1, nvertices, 3), dtype=numpy.float64)
- field[0,:,0] = finalSlip
+ field[0,:,0] = strikeDir[0]
+ field[0,:,1] = strikeDir[1]
+ field[0,:,2] = strikeDir[2]
- elif name == "slip_time":
- field = slipTime*numpy.zeros( (1, nvertices, 1), dtype=numpy.float64)
+ elif name == "static_coefficient":
+ field = staticCoef*numpy.ones( (1, nvertices, 1), dtype=numpy.float64)
- elif name == "slip":
+ elif name == "traction_initial":
field = numpy.zeros( (1, nvertices, 3), dtype=numpy.float64)
- field[0,:,0] = finalSlip
+ field[0,:,0] = initialTraction[0]
+ field[0,:,1] = initialTraction[1]
+ field[0,:,2] = initialTraction[2]
- elif name == "traction_change":
+ elif name == "slip":
field = numpy.zeros( (1, nvertices, 3), dtype=numpy.float64)
- field[0,:,0] = 0.0
else:
raise ValueError("Unknown fault field '%s'." % name)
@@ -179,7 +184,7 @@ class TestShearDispNoSlip(TestHex8):
# ----------------------------------------------------------------------
if __name__ == '__main__':
import unittest
- from TestShearDispNoSlip import TestShearDispNoSlip as Tester
+ from TestFrictionNoSlip import TestFrictionNoSlip as Tester
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(Tester))
diff --git a/tests_auto/3d/hex8/sheardispnosliprefine.cfg b/tests_auto/3d/hex8/frictionnoslip.cfg
similarity index 51%
copy from tests_auto/3d/hex8/sheardispnosliprefine.cfg
copy to tests_auto/3d/hex8/frictionnoslip.cfg
index b844299..c48ce83 100644
--- a/tests_auto/3d/hex8/sheardispnosliprefine.cfg
+++ b/tests_auto/3d/hex8/frictionnoslip.cfg
@@ -1,58 +1,57 @@
-[sheardispnosliprefine]
-nodes = 4
+[frictionnoslip]
+nodes = 1
-[sheardispnosliprefine.launcher] # WARNING: THIS IS NOT PORTABLE
+[frictionnoslip.launcher] # WARNING: THIS IS NOT PORTABLE
command = mpirun -np ${nodes}
# ----------------------------------------------------------------------
# journal
# ----------------------------------------------------------------------
-[sheardispnosliprefine.journal.info]
-#sheardispnoslip = 1
-#timedependent = 1
-#implicit = 1
-#petsc = 1
-#solverlinear = 1
-#meshimporter = 1
-#meshiocubit = 1
+[frictionnoslip.journal.info]
+frictionnoslip = 1
+timedependent = 1
+implicit = 1
+petsc = 1
+solvernonlinear = 1
+meshimporter = 1
+meshiocubit = 1
#implicitelasticity = 1
#quadrature3d = 1
-#faultcohesivekin = 1
+#faultcohesivedyn = 1
#fiatlagrange = 1
# ----------------------------------------------------------------------
# mesh_generator
# ----------------------------------------------------------------------
-[sheardispnosliprefine.mesh_generator]
+[frictionnoslip.mesh_generator]
reader = pylith.meshio.MeshIOCubit
reorder_mesh = True
-refiner = pylith.topology.RefineUniform
-[sheardispnosliprefine.mesh_generator.reader]
+[frictionnoslip.mesh_generator.reader]
filename = mesh.exo
coordsys.space_dim = 3
# ----------------------------------------------------------------------
# problem
# ----------------------------------------------------------------------
-[sheardispnosliprefine.timedependent]
+[frictionnoslip.timedependent]
dimension = 3
-bc = [x_neg,x_pos,y_neg,y_pos,z_neg]
-
normalizer.length_scale = 5.0*km
-[sheardispnosliprefine.timedependent.formulation.time_step]
-total_time = 0.0*s
+[frictionnoslip.timedependent.formulation]
+solver = pylith.problems.SolverNonlinear
+time_step.total_time = 0.0*s
+time_step.dt = 1.0*year
# ----------------------------------------------------------------------
# materials
# ----------------------------------------------------------------------
-[sheardispnosliprefine.timedependent]
+[frictionnoslip.timedependent]
materials = [elastic,viscoelastic]
materials.elastic = pylith.materials.ElasticIsotropic3D
materials.viscoelastic = pylith.materials.ElasticIsotropic3D
-[sheardispnosliprefine.timedependent.materials.elastic]
+[frictionnoslip.timedependent.materials.elastic]
label = Elastic material
id = 1
db_properties.label = Elastic properties
@@ -60,7 +59,7 @@ db_properties.iohandler.filename = matprops.spatialdb
quadrature.cell = pylith.feassemble.FIATLagrange
quadrature.cell.dimension = 3
-[sheardispnosliprefine.timedependent.materials.viscoelastic]
+[frictionnoslip.timedependent.materials.viscoelastic]
label = Elastic material
id = 2
db_properties.label = Elastic properties
@@ -71,35 +70,38 @@ quadrature.cell.dimension = 3
# ----------------------------------------------------------------------
# boundary conditions
# ----------------------------------------------------------------------
-[sheardispnosliprefine.timedependent.bc.x_pos]
+[frictionnoslip.timedependent]
+bc = [x_neg,x_pos,y_neg,y_pos,z_neg]
+
+[frictionnoslip.timedependent.bc.x_pos]
bc_dof = [1]
label = face_xpos
db_initial = spatialdata.spatialdb.SimpleDB
db_initial.label = Dirichlet BC +x edge
db_initial.iohandler.filename = shear_dispy.spatialdb
-[sheardispnosliprefine.timedependent.bc.x_neg]
+[frictionnoslip.timedependent.bc.x_neg]
bc_dof = [1]
label = face_xneg
db_initial = spatialdata.spatialdb.SimpleDB
db_initial.label = Dirichlet BC -x edge
db_initial.iohandler.filename = shear_dispy.spatialdb
-[sheardispnosliprefine.timedependent.bc.y_pos]
+[frictionnoslip.timedependent.bc.y_pos]
bc_dof = [0]
label = face_ypos
db_initial = spatialdata.spatialdb.SimpleDB
db_initial.label = Dirichlet BC +y edge
db_initial.iohandler.filename = shear_dispx.spatialdb
-[sheardispnosliprefine.timedependent.bc.y_neg]
+[frictionnoslip.timedependent.bc.y_neg]
bc_dof = [0]
label = face_yneg
db_initial = spatialdata.spatialdb.SimpleDB
db_initial.label = Dirichlet BC -y edge
db_initial.iohandler.filename = shear_dispx.spatialdb
-[sheardispnosliprefine.timedependent.bc.z_neg]
+[frictionnoslip.timedependent.bc.z_neg]
bc_dof = [2]
label = face_zneg
db_initial = spatialdata.spatialdb.SimpleDB
@@ -109,65 +111,108 @@ db_initial.iohandler.filename = shear_dispz.spatialdb
# ----------------------------------------------------------------------
# faults
# ----------------------------------------------------------------------
-[sheardispnosliprefine.timedependent]
+[frictionnoslip.timedependent]
interfaces = [fault]
+interfaces.fault = pylith.faults.FaultCohesiveDyn
-[sheardispnosliprefine.timedependent.interfaces.fault]
+[frictionnoslip.timedependent.interfaces.fault]
id = 100
label = fault_x_trim
+#up_dir = [1,0,1]
edge = fault_x_trim_edge
quadrature.cell = pylith.feassemble.FIATLagrange
quadrature.cell.dimension = 2
-[sheardispnosliprefine.timedependent.interfaces.fault.eq_srcs.rupture.slip_function]
-slip = spatialdata.spatialdb.UniformDB
-slip.label = Final slip
-slip.values = [left-lateral-slip,reverse-slip,fault-opening]
-slip.data = [0.0*m,0.0*m,0.0*m]
+zero_tolerance = 1.0e-10
+
+friction = pylith.friction.SlipWeakening
+friction.label = Slip-weakening friction
+friction.db_properties = spatialdata.spatialdb.UniformDB
+friction.db_properties.label = Slip-weakening friction parameters
+friction.db_properties.values = [static-coefficient,dynamic-coefficient,slip-weakening-parameter,cohesion]
+friction.db_properties.data = [0.6,0.4,1.0*m,0.0*Pa]
+
+friction.db_initial_state = spatialdata.spatialdb.UniformDB
+friction.db_initial_state.label = Slip Weakening
+friction.db_initial_state.values = [cumulative-slip, previous-slip]
+friction.db_initial_state.data = [0*m, 0*m]
+
+traction_perturbation = pylith.faults.TractPerturbation
+
+[frictionnoslip.timedependent.interfaces.fault.traction_perturbation]
+db_initial = spatialdata.spatialdb.UniformDB
+db_initial.label = Initial fault tractions
+db_initial.values = [traction-shear-leftlateral,traction-shear-updip,traction-normal]
+db_initial.data = [0.0*Pa, 0.0*Pa, -100.0*MPa]
-slip_time = spatialdata.spatialdb.UniformDB
-slip_time.label = Slip start time
-slip_time.values = [slip-time]
-slip_time.data = [0.0*s]
# ----------------------------------------------------------------------
# PETSc
# ----------------------------------------------------------------------
-[sheardispnosliprefine.petsc]
-pc_type = asm
+[frictionnoslip.problem.formulation]
+#split_fields = True
+#matrix_type = aij
+#use_custom_constraint_pc = True
-# Change the preconditioner settings.
-sub_pc_factor_shift_type = none
+[frictionnoslip.petsc]
+#fs_pc_type = fieldsplit
+#fs_pc_use_amat =
+#fs_pc_fieldsplit_type = multiplicative
+#fs_fieldsplit_displacement_pc_type = ml
+#fs_fieldsplit_lagrange_multiplier_pc_type = jacobi
+#fs_fieldsplit_displacement_ksp_type = preonly
+#fs_fieldsplit_lagrange_multiplier_ksp_type = preonly
-ksp_rtol = 1.0e-8
+pc_type = asm
+sub_pc_factor_shift_type = nonzero
+
+ksp_rtol = 1.0e-20
+ksp_atol = 1.0e-13
ksp_max_it = 100
ksp_gmres_restart = 50
+snes_rtol = 1.0e-20
+snes_atol = 1.0e-9
+
#ksp_monitor = true
#ksp_view = true
+#snes_monitor = true
+#snes_view = true
+
#ksp_converged_reason = true
+#snes_converged_reason = true
+
+friction_pc_type = asm
+friction_sub_pc_factor_shift_type = nonzero
+friction_ksp_max_it = 25
+friction_ksp_gmres_restart = 30
+
+#friction_ksp_monitor = true
+#friction_ksp_view = true
+#friction_ksp_converged_reason = true
+
#log_summary = true
# start_in_debugger = true
-
# ----------------------------------------------------------------------
# output
# ----------------------------------------------------------------------
-[sheardispnosliprefine.problem.formulation.output.output]
+[frictionnoslip.problem.formulation.output.output]
writer = pylith.meshio.DataWriterHDF5
-writer.filename = sheardispnosliprefine.h5
+writer.filename = frictionnoslip.h5
-[sheardispnosliprefine.timedependent.interfaces.fault.output]
+[frictionnoslip.timedependent.interfaces.fault.output]
writer = pylith.meshio.DataWriterHDF5
-writer.filename = sheardispnosliprefine-fault.h5
+writer.filename = frictionnoslip-fault.h5
+vertex_info_fields = [strike_dir,normal_dir,traction_initial_value,static_coefficient,cohesion]
-[sheardispnosliprefine.timedependent.materials.elastic.output]
+[frictionnoslip.timedependent.materials.elastic.output]
cell_filter = pylith.meshio.CellFilterAvg
writer = pylith.meshio.DataWriterHDF5
-writer.filename = sheardispnosliprefine-elastic.h5
+writer.filename = frictionnoslip-elastic.h5
-[sheardispnosliprefine.timedependent.materials.viscoelastic.output]
+[frictionnoslip.timedependent.materials.viscoelastic.output]
cell_filter = pylith.meshio.CellFilterAvg
writer = pylith.meshio.DataWriterHDF5
-writer.filename = sheardispnosliprefine-viscoelastic.h5
+writer.filename = frictionnoslip-viscoelastic.h5
More information about the CIG-COMMITS
mailing list