Diff of /trunk/finley/test/python/slip_stress.py

revision 883 by gross, Mon Oct 30 06:12:54 2006 UTC revision 884 by gross, Mon Oct 30 06:37:30 2006 UTC
# Line 3  Line 3
3  """  """
4  calculation of the stress distribution around a fault from the slip on the fault  calculation of the stress distribution around a fault from the slip on the fault
5
6    e.g. use slip_stress_mesh.py to generate mesh
7
8  @var __author__: name of author  @var __author__: name of author
# Line 11  calculation of the stress distribution a Line 13  calculation of the stress distribution a
13  @var __date__: date of the version  @var __date__: date of the version
14  """  """
15
16  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, Louise Kettle"
18                      http://www.access.edu.au                      http://www.access.edu.au
# Line 24  __date__="\$Date\$" Line 26  __date__="\$Date\$"
26  from esys.escript import *  from esys.escript import *
28  from esys.escript.linearPDEs import LinearPDE  from esys.escript.linearPDEs import LinearPDE
29  from esys.finley import Rectangle  from esys.finley import ReadMesh
30
31
32  rho=1.  rho=0.
33  lam_lmbd=1.  lam_lmbd=1.
34  lam_mu=1.  lam_mu=1.
35  g=9.81  g=9.81
57
58        def inner(self,p0,p1):        def inner(self,p0,p1):
59           return integrate(p0*p1,FunctionOnContactZero(self.__pde_p.getDomain()))           return integrate(p0*p1,FunctionOnContactZero(self.domain))
60
61        def solve_f(self,u,p,tol=1.e-8):        def solve_f(self,u,p,tol=1.e-8):
62           self.__pde_u.setTolerance(tol)           self.__pde_u.setTolerance(tol)
63           self.__pde_u.setValue(y_contact=p)           self.__pde_u.setValue(y_contact=-p)
64           return  self.__pde_u.getSolution()           return  self.__pde_u.getSolution()
65
66        def solve_g(self,u,tol=1.e-8):        def solve_g(self,u,tol=1.e-8):
67           dp=self.slip-jump(u)           dp=-(self.slip-jump(u))
68           return  dp           return  dp
69
70
71  s=numarray.array([0.,1.,1.])  s=numarray.array([0.,1.,1.])
dom=Rectangle(NE,NE,order=2)
73  prop=SlippingFault(dom)  prop=SlippingFault(dom)
74  d=dom.getDim()  d=dom.getDim()
75  x=dom.getX()[d-1]  x=dom.getX()[d-1]