# Diff of /branches/symbolic_from_3470/dudley/test/python/slip_stress.py

revision 3788 by caltinay, Tue Mar 15 04:23:54 2011 UTC revision 3789 by caltinay, Tue Jan 31 04:55:05 2012 UTC
# Line 67  g=9.81 Line 67  g=9.81
67  fstart =  [lockToGrid(50000.0,width,ne_w), lockToGrid(40000.0,width,ne_w), lockToGrid(8000.,height,ne)]  fstart =  [lockToGrid(50000.0,width,ne_w), lockToGrid(40000.0,width,ne_w), lockToGrid(8000.,height,ne)]
68  fend =  [lockToGrid(50000.0,width,ne_w), lockToGrid(60000.0,width,ne_w), lockToGrid(20000.,height,ne)]  fend =  [lockToGrid(50000.0,width,ne_w), lockToGrid(60000.0,width,ne_w), lockToGrid(20000.,height,ne)]
69
70  print "=== generate mesh over %s x %s x %s ==="%(width,width,height)  print("=== generate mesh over %s x %s x %s ==="%(width,width,height))
71  dom=Brick(l0=width, l1=width, l2=height, n0=ne_w, n1=ne_w, n2=ne)  dom=Brick(l0=width, l1=width, l2=height, n0=ne_w, n1=ne_w, n2=ne)
72  print "  total number of elements = ",ne*ne_w*ne_w  print("  total number of elements = ",ne*ne_w*ne_w)
73
74  print "=== prepare PDE coefficients ==="  print("=== prepare PDE coefficients ===")
75  # fixed displacements:  # fixed displacements:
76  d=dom.getDim()  d=dom.getDim()
77  x=dom.getX()  x=dom.getX()
# Line 101  for i in range(d): Line 101  for i in range(d):
101        A[i,i,j,j] += lmbd        A[i,i,j,j] += lmbd
103
104  print "=== solve pde === "  print("=== solve pde === ")
105  u=pde.getSolution(verbose=True)  u=pde.getSolution(verbose=True)
106
107  print "=== calculate stress ==="  print("=== calculate stress ===")
109  sigma=mu*symmetric(g_s)+lmbd*trace(g_s)*kronecker(d)  sigma=mu*symmetric(g_s)+lmbd*trace(g_s)*kronecker(d)
110
111  print "=== start rendering ==="  print("=== start rendering ===")
112  # Create a Scene.  # Create a Scene.
113  s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size=XSIZE, y_size=YSIZE )  s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size=XSIZE, y_size=YSIZE )
114  dc1 = DataCollector(source = Source.ESCRIPT)  dc1 = DataCollector(source = Source.ESCRIPT)