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

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

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

revision 3891 by gross, Thu Feb 25 04:54:30 2010 UTC revision 3892 by jfenwick, Tue Apr 10 08:57:23 2012 UTC
# Line 62  def subsample(u, nx=50, ny=50): Line 62  def subsample(u, nx=50, ny=50):
62      dx = (sup(xx[0])-x0)/nx # x spacing      dx = (sup(xx[0])-x0)/nx # x spacing
63      dy = (sup(xx[1])-y0)/ny # y spacing      dy = (sup(xx[1])-y0)/ny # y spacing
64      grid = [ ]      grid = [ ]
65      for j in xrange(0,ny-1):      for j in range(0,ny-1):
66          for i in xrange(0,nx-1):          for i in range(0,nx-1):
67                 grid.append([x0+dx/2+dx*i,y0+dy/2+dy*j])                 grid.append([x0+dx/2+dx*i,y0+dy/2+dy*j])
68      uLoc = Locator(u.getFunctionSpace(),grid)      uLoc = Locator(u.getFunctionSpace(),grid)
69      subu= uLoc(u) # get data of u at sample points closests to grid points      subu= uLoc(u) # get data of u at sample points closests to grid points

Legend:
Removed from v.3891  
changed lines
  Added in v.3892

  ViewVC Help
Powered by ViewVC 1.1.26