/[escript]/trunk/doc/examples/cookbook/example09b.py
ViewVC logotype

Diff of /trunk/doc/examples/cookbook/example09b.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3098 by ahallam, Mon Aug 9 07:20:58 2010 UTC revision 3099 by ahallam, Sun Aug 22 04:35:15 2010 UTC
# Line 53  mkDir(savepath) Line 53  mkDir(savepath)
53  mx = 200. # model lenght  mx = 200. # model lenght
54  my = 200. # model width  my = 200. # model width
55  mz=100.0  mz=100.0
56  step=10.0 # the element size  step=4.0 # the element size
57  ndx = int(mx/step) # steps in x direction  ndx = int(mx/step) # steps in x direction
58  ndy = int(my/step) # steps in y direction  ndy = int(my/step) # steps in y direction
59  ndz = int(mz/step)  ndz = int(mz/step)
# Line 68  tend=0.1    # end time Line 68  tend=0.1    # end time
68  h=0.00005    # time step  h=0.00005    # time step
69  # data recording times  # data recording times
70  rtime=0.0 # first time to record  rtime=0.0 # first time to record
71  rtime_inc=tend/50.0 # time increment to record  rtime_inc=tend/200.0 # time increment to record
72  #Check to make sure number of time steps is not too large.  #Check to make sure number of time steps is not too large.
73  print "Time step size= ",h, "Expected number of outputs= ",tend/h  print "Time step size= ",h, "Expected number of outputs= ",tend/h
74    
# Line 137  xb=FunctionOnBoundary(domain).getX() Line 137  xb=FunctionOnBoundary(domain).getX()
137  yx=(cos(length(xb-xc)*3.1415/src_length)+1)*whereNegative(length(xb-xc)-src_length)  yx=(cos(length(xb-xc)*3.1415/src_length)+1)*whereNegative(length(xb-xc)-src_length)
138  stop=Scalar(0.0,FunctionOnBoundary(domain))  stop=Scalar(0.0,FunctionOnBoundary(domain))
139  stop.setTaggedValue("stop",1.0)  stop.setTaggedValue("stop",1.0)
140  src_dir=numpy.array([0.,0.,1.0]) # defines direction of point source as down  src_dir=numpy.array([0.,1.,0.0]) # defines direction of point source as down
141    
142  mypde.setValue(y=source[0]*yx*src_dir*stop) #set the source as a function on the boundary  mypde.setValue(y=source[0]*yx*src_dir*stop) #set the source as a function on the boundary
143  # initial value of displacement at point source is constant (U0=0.01)  # initial value of displacement at point source is constant (U0=0.01)

Legend:
Removed from v.3098  
changed lines
  Added in v.3099

  ViewVC Help
Powered by ViewVC 1.1.26