/[escript]/trunk/doc/examples/inversion/synthetic_sonic.py
ViewVC logotype

Diff of /trunk/doc/examples/inversion/synthetic_sonic.py

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

revision 4575 by gross, Mon Dec 2 07:18:02 2013 UTC revision 4576 by sshaw, Mon Dec 9 23:35:30 2013 UTC
# Line 54  width_y=width_x Line 54  width_y=width_x
54  #  #
55  # create array  # create array
56  #  #
57  receiver_line=[2*absorption_zone + i * (rangeRcv/(numRcvPerLine-1)) for i in xrange(numRcvPerLine) ]  receiver_line=[2*absorption_zone + i * (rangeRcv/(numRcvPerLine-1)) for i in range(numRcvPerLine) ]
58  #  #
59  #   set source location with tag "source""  #   set source location with tag "source""
60  #  #
# Line 79  rcvEW_locations=[] Line 79  rcvEW_locations=[]
79  rgEW=[]  rgEW=[]
80  mid_point=receiver_line[len(receiver_line)/2]  mid_point=receiver_line[len(receiver_line)/2]
81    
82  for ix in xrange(len(receiver_line)):  for ix in range(len(receiver_line)):
83          if DIM == 2:          if DIM == 2:
84              rcvEW_locations.append((receiver_line[ix], depth))              rcvEW_locations.append((receiver_line[ix], depth))
85              rgEW.append( ( receiver_line[ix], 0.) )              rgEW.append( ( receiver_line[ix], 0.) )
# Line 91  if DIM == 3: Line 91  if DIM == 3:
91     rcvNS_locations=[]     rcvNS_locations=[]
92     rgNS=[]     rgNS=[]
93    
94     for iy in xrange(len(receiver_line)):     for iy in range(len(receiver_line)):
95         rcvNS_locations.append((mid_point, receiver_line[iy],  depth))         rcvNS_locations.append((mid_point, receiver_line[iy],  depth))
96         rgNS.append( (  mid_point, receiver_line[iy]) )         rgNS.append( (  mid_point, receiver_line[iy]) )
97  #  #
# Line 99  if DIM == 3: Line 99  if DIM == 3:
99  #  #
100  if DIM == 2:  if DIM == 2:
101     domain=Rectangle(ceil(ne_z*width_x/depth),ne_z,l0=width_x,l1=depth,     domain=Rectangle(ceil(ne_z*width_x/depth),ne_z,l0=width_x,l1=depth,
102          diracPoints=src_locations, diracTags=src_tags)          diracPoints=src_locations, diracTags=src_tags)
103  else:  else:
104     domain=Brick(ceil(ne_z*width_x/depth),ceil(ne_z*width_y/depth),ne_z,l0=width_x,l1=width_y,l2=depth,     domain=Brick(ceil(ne_z*width_x/depth),ceil(ne_z*width_y/depth),ne_z,l0=width_x,l1=width_y,l2=depth,
105          diracPoints=src_locations, diracTags=src_tags)          diracPoints=src_locations, diracTags=src_tags)
106  wl=Ricker(frq)  wl=Ricker(frq)
107  m=whereNegative(Function(domain).getX()[DIM-1]-reflector_at)  m=whereNegative(Function(domain).getX()[DIM-1]-reflector_at)
108  v_p=v_p_bottom*m+v_p_top*(1-m)  v_p=v_p_bottom*m+v_p_top*(1-m)
# Line 120  t=0. Line 120  t=0.
120  mkDir('tmp')  mkDir('tmp')
121  n=0  n=0
122  while t < t_end:  while t < t_end:
123      t,p = sw.update(t+sampling_interval)      t,p = sw.update(t+sampling_interval)
124      tracerEW.addRecord(locEW(p))      tracerEW.addRecord(locEW(p))
125      if DIM==3: tracerNS.addRecord(locNS(p))      if DIM==3: tracerNS.addRecord(locNS(p))
126      print t, locEW(p)[:4], wl.getValue(t)      print t, locEW(p)[:4], wl.getValue(t)
127      if n%5 == 0 : saveSilo("tmp/u_%d.silo"%(n/5,), p=p)      if n%5 == 0 : saveSilo("tmp/u_%d.silo"%(n/5,), p=p)
128      n+=1      n+=1
129  tracerEW.write('lineEW.sgy')  tracerEW.write('lineEW.sgy')
130  if DIM == 3: tracerNS.write('lineNS.sgy')  if DIM == 3: tracerNS.write('lineNS.sgy')

Legend:
Removed from v.4575  
changed lines
  Added in v.4576

  ViewVC Help
Powered by ViewVC 1.1.26