[cig-commits] r15690 - short/3D/PyLith/branches/pylith-friction/playpen/friction

brad at geodynamics.org brad at geodynamics.org
Wed Sep 23 21:17:39 PDT 2009


Author: brad
Date: 2009-09-23 21:17:39 -0700 (Wed, 23 Sep 2009)
New Revision: 15690

Modified:
   short/3D/PyLith/branches/pylith-friction/playpen/friction/spring_example.py
Log:
Adjust layout of implementation in example.

Modified: short/3D/PyLith/branches/pylith-friction/playpen/friction/spring_example.py
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/spring_example.py	2009-09-24 02:35:39 UTC (rev 15689)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/spring_example.py	2009-09-24 04:17:39 UTC (rev 15690)
@@ -58,7 +58,6 @@
     """
     Calculate residual
     """
-    calcFriction(disp, incr) # FaultCohesiveDyn::integrateResidual()
     residual = b - numpy.dot(A, disp+incr)
     residual[4] += k[4]*u5 # Dirichlet BC
     return residual
@@ -88,8 +87,9 @@
     iter = 0
     while numpy.sum(numpy.abs(residual)) > 1.0e-8 and iter < 40:
         print "Interation: %d" % iter
-        dincr = numpy.dot(Ai, residual) # Increment to disp increment.
+        dincr = numpy.dot(Ai, residual) # Increment to disp increment. (Newton step)
         incr += dincr
+        calcFriction(disp, incr) # line search (modify search)
         residual = reformResidual(disp, incr)
         print "Disp(t):",disp
         print "Incr(t):",incr



More information about the CIG-COMMITS mailing list