[cig-commits] r18509 - short/3D/PyLith/trunk/tests/2d/frictionslide

brad at geodynamics.org brad at geodynamics.org
Tue May 31 11:22:47 PDT 2011


Author: brad
Date: 2011-05-31 11:22:47 -0700 (Tue, 31 May 2011)
New Revision: 18509

Added:
   short/3D/PyLith/trunk/tests/2d/frictionslide/plot_friction.py
Modified:
   short/3D/PyLith/trunk/tests/2d/frictionslide/pylithapp.cfg
   short/3D/PyLith/trunk/tests/2d/frictionslide/ratestate_stable.cfg
   short/3D/PyLith/trunk/tests/2d/frictionslide/velocitysteps.timedb
Log:
Updated to velocity step test.

Added: short/3D/PyLith/trunk/tests/2d/frictionslide/plot_friction.py
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/plot_friction.py	                        (rev 0)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/plot_friction.py	2011-05-31 18:22:47 UTC (rev 18509)
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+
+sim = "ratestate_stable"
+
+# ======================================================================
+import tables
+import pylab
+import numpy
+from math import exp
+
+# ----------------------------------------------------------------------
+dt = 0.01
+t = numpy.arange(0.0, 12.001, dt)
+mu0 = 0.6
+a = 0.016
+b = 0.012
+L = 2.0e-6
+V0 = 1.0e-6
+
+def integrateStateVar(theta, v, t0):
+    pts = numpy.where(t > t0)[0]
+    for i in pts:
+        theta[i] = theta[i-1]*exp(-v/L*dt) + \
+            dt - 0.5*(v/L)*dt**2 + 1.0/6.0*(v/L)*dt**3;
+    return
+
+
+theta = L/V0*numpy.ones(t.shape)
+
+mask1 = t < 2.0
+V1 = 1.0e-6
+integrateStateVar(theta, V1, 0.0)
+
+mask2 = numpy.bitwise_and(t >= 2.0, t < 4.0)
+V2 = 2.0e-5
+integrateStateVar(theta, V2, 2.0)
+
+mask3 = numpy.bitwise_and(t >= 4.0, t < 8.0)
+V3 = 5.0e-6
+integrateStateVar(theta, V3, 4.0)
+
+mask4 = numpy.bitwise_and(t >= 8.0, t < 12.0)
+V4 = 2.0e-7
+integrateStateVar(theta, V4, 8.0)
+
+slipRateE = mask1*V1 + mask2*V2 + mask3*V3 + mask4*V4
+stateVarE = theta
+
+muE = mu0 + a*numpy.log(slipRateE/V0) + b*numpy.log(V0*stateVarE/L)
+
+# ----------------------------------------------------------------------
+
+h5 = tables.openFile("output/%s-fault.h5" % sim, "r")
+time = h5.root.time[:].ravel()
+slip = h5.root.vertex_fields.slip[:]
+slipRate = h5.root.vertex_fields.slip_rate[:]
+stateVar = h5.root.vertex_fields.state_variable[:]
+traction = h5.root.vertex_fields.traction[:]
+h5.close()
+
+fig = pylab.Figure()
+
+p = 2
+
+ax = pylab.subplot(1, 4, 1)
+ax.plot(time, slip[:,p,0])
+
+ax = pylab.subplot(1, 4, 2)
+ax.plot(t, numpy.log10(numpy.abs(slipRateE)), 'b-',
+        time, numpy.log10(numpy.abs(slipRate[:,p,0])), 'r--')
+ax.set_ylim(-12, 0.0)
+
+ax = pylab.subplot(1, 4, 3)
+ax.plot(t, numpy.log10(stateVarE), 'b-',
+        time, numpy.log10(stateVar[:,p,0]), 'r--')
+ax.set_ylim(-2.0,6.0)
+
+ax = pylab.subplot(1, 4, 4)
+ax.plot(t, muE, 'b-',
+        time, numpy.fabs(traction[:,p,0]/traction[:,p,1]), 'r--')
+
+
+pylab.show()


Property changes on: short/3D/PyLith/trunk/tests/2d/frictionslide/plot_friction.py
___________________________________________________________________
Name: svn:executable
   + *

Modified: short/3D/PyLith/trunk/tests/2d/frictionslide/pylithapp.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/pylithapp.cfg	2011-05-31 15:51:32 UTC (rev 18508)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/pylithapp.cfg	2011-05-31 18:22:47 UTC (rev 18509)
@@ -50,8 +50,8 @@
 solver = pylith.problems.SolverNonlinear
 
 [pylithapp.timedependent.implicit.time_step]
-total_time = 2.0*s
-dt = 0.05*s
+total_time = 12.0*s
+dt = 0.1*s
 
 # ----------------------------------------------------------------------
 # materials
@@ -89,11 +89,21 @@
 bc_dof = [0, 1]
 label = ypos
 
-db_rate = spatialdata.spatialdb.UniformDB
-db_rate.label = Dirichlet rate BC on +y
-db_rate.values = [displacement-rate-x,displacement-rate-y,rate-start-time]
-db_rate.data = [1.0e-6*m/s, 0.0*m/s, 0.0*s]
+db_change = spatialdata.spatialdb.UniformDB
+db_change.label = Spatial variation of displacement on +y
+db_change.values = [displacement-x,displacement-y,change-start-time]
+db_change.data = [1.0*m, 0.0*m, 0.0*s]
 
+th_change = spatialdata.spatialdb.TimeHistory
+th_change.label = Displacement time history on +y
+th_change.filename = velocitysteps.timedb
+
+
+#db_rate = spatialdata.spatialdb.UniformDB
+#db_rate.label = Dirichlet rate BC on +y
+#db_rate.values = [displacement-rate-x,displacement-rate-y,rate-start-time]
+#db_rate.data = [1.0e-6*m/s, 0.0*m/s, 0.0*s]
+
 # ----------------------------------------------------------------------
 # faults
 # ----------------------------------------------------------------------
@@ -144,6 +154,8 @@
 # Friction
 friction_pc_type = asm
 friction_sub_pc_factor_shift_type = nonzero
+friction_ksp_rtol = 1.0e-12
+friction_ksp_atol = 1.0e-15
 friction_ksp_max_it = 25
 friction_ksp_gmres_restart = 30
 #friction_ksp_monitor = true
@@ -157,14 +169,14 @@
 # ----------------------------------------------------------------------
 [pylithapp.problem.formulation.output.output]
 vertex_data_fields = [displacement,velocity]
-writer.time_format = %05.2f
+writer = pylith.meshio.DataWriterHDF5Mesh
 
 [pylithapp.timedependent.interfaces.fault.output]
 vertex_data_fields=[slip,slip_rate,traction,state_variable]
-writer.time_format = %05.2f
+writer = pylith.meshio.DataWriterHDF5SubSubMesh
 
 [pylithapp.timedependent.materials.elastic.output]
 cell_info_fields = []
 #cell_data_fields = []
 #cell_filter = pylith.meshio.CellFilterAvgMesh
-writer.time_format = %05.2f
+writer = pylith.meshio.DataWriterHDF5Mesh

Modified: short/3D/PyLith/trunk/tests/2d/frictionslide/ratestate_stable.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/ratestate_stable.cfg	2011-05-31 15:51:32 UTC (rev 18508)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/ratestate_stable.cfg	2011-05-31 18:22:47 UTC (rev 18509)
@@ -23,23 +23,23 @@
 friction.db_properties = spatialdata.spatialdb.UniformDB
 friction.db_properties.label = Rate State Ageing
 friction.db_properties.values = [reference-friction-coefficient,reference-slip-rate,characteristic-slip-distance,constitutive-parameter-a,constitutive-parameter-b,cohesion]
-friction.db_properties.data = [0.6,1.0e-6*m/s,0.01*m,0.016,0.012,0.0*Pa]
+friction.db_properties.data = [0.6,1.0e-6*m/s,2.0e-6*m,0.016,0.012,0.0*Pa]
 
 # Set spatial database for the initial value of the state variable.
 friction.db_initial_state = spatialdata.spatialdb.UniformDB
 friction.db_initial_state.label = Rate State Ageing State
 friction.db_initial_state.values = [state-variable]
-friction.db_initial_state.data = [1.0e+4*s]
+friction.db_initial_state.data = [2.0e+0*s]
 
 # ----------------------------------------------------------------------
 # output
 # ----------------------------------------------------------------------
 # Set filenames for output.
 [pylithapp.problem.formulation.output.output]
-writer.filename = output/ratestate_stable.vtk
+writer.filename = output/ratestate_stable.h5
 
 [pylithapp.timedependent.interfaces.fault.output]
-writer.filename = output/ratestate_stable-fault.vtk
+writer.filename = output/ratestate_stable-fault.h5
 
 [pylithapp.timedependent.materials.elastic.output]
-writer.filename = output/ratestate_stable-statevars.vtk
+writer.filename = output/ratestate_stable-statevars.h5

Modified: short/3D/PyLith/trunk/tests/2d/frictionslide/velocitysteps.timedb
===================================================================
--- short/3D/PyLith/trunk/tests/2d/frictionslide/velocitysteps.timedb	2011-05-31 15:51:32 UTC (rev 18508)
+++ short/3D/PyLith/trunk/tests/2d/frictionslide/velocitysteps.timedb	2011-05-31 18:22:47 UTC (rev 18509)
@@ -1,10 +1,11 @@
 #TIME HISTORY ascii
 TimeHistory {
-  num-points = 5
+  num-points = 6
   time-units = second
 }
  0.0  0.0
- 2.0  2.0e-06
- 4.0  2.2e-05
- 6.0  2.4e-05
- 8.0  2.4e-05
+ 2.0  2.0e-6
+ 4.0  4.2e-5
+ 8.0  6.2e-05
+12.0  6.28e-05
+99.9  6.28e-05



More information about the CIG-COMMITS mailing list