[cig-commits] r15851 - short/3D/PyLith/branches/pylith-friction/playpen/friction
brad at geodynamics.org
brad at geodynamics.org
Tue Oct 20 10:17:35 PDT 2009
Author: brad
Date: 2009-10-20 10:17:34 -0700 (Tue, 20 Oct 2009)
New Revision: 15851
Modified:
short/3D/PyLith/branches/pylith-friction/playpen/friction/spring_example.py
Log:
Fixed estimate of slip.
Modified: short/3D/PyLith/branches/pylith-friction/playpen/friction/spring_example.py
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/spring_example.py 2009-10-20 02:18:56 UTC (rev 15850)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/spring_example.py 2009-10-20 17:17:34 UTC (rev 15851)
@@ -29,7 +29,7 @@
import numpy
# Spring stiffness [k0, k1, ..., kN]
-k = (6.0, 2.0, 1.0, 1.0, 4.0)
+k = (4.0, 2.0, 1.0, 1.0, 6.0)
# Prescribed displacement, u5
u5 = 2.5
@@ -72,11 +72,9 @@
lm = dispTpdt[5] # Lagrange multiplier
if lm > fy or (lm < fy and b[5] > 0.0):
incr[5] = fy - disp[5] # Adjust Lagrange multiplier in solution
- #slipIncr = 2*(lm-fy)
- slipIncr = (k[2] + k[3])*(lm-fy) - (k[2]*b[2] - k[3]*b[3])
+ slipIncr = -(1.0/k[2] + 1.0/k[3])*(fy-lm)
b[5] += slipIncr # Update slip estimate
- #incr[2] -= 0.5*slipIncr
- #incr[3] += 0.5*slipIncr
+ print "slipIncr:",slipIncr
# ----------------------------------------------------------------------
@@ -106,3 +104,9 @@
solve(incr, A, residual, disp)
disp += incr
print "Solution:",disp
+
+# Analytic solution to sensitivity of slip to Lagrange multipliers
+#Asub = A[0:5,0:5]
+#Asubi = numpy.linalg.inv(Asub)
+#C = numpy.array([[0, 0, -1.0, 1.0, 0.0]], dtype=numpy.float64)
+#print numpy.dot(numpy.dot(C, -Asubi), C.transpose())
More information about the CIG-COMMITS
mailing list