/[escript]/trunk/doc/examples/usersguide/wave.py
ViewVC logotype

Diff of /trunk/doc/examples/usersguide/wave.py

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

revision 2420 by gross, Thu May 14 02:28:58 2009 UTC revision 2474 by gross, Tue Jun 16 06:32:15 2009 UTC
# Line 25  from esys.escript import * Line 25  from esys.escript import *
25  from esys.escript.pdetools import Locator  from esys.escript.pdetools import Locator
26  from esys.escript.linearPDEs import LinearPDE  from esys.escript.linearPDEs import LinearPDE
27  from esys.finley import Brick  from esys.finley import Brick
28  from numarray import identity,zeros,ones  from numpy import identity,zeros,ones
29    
30  if not os.path.isdir("data"):  if not os.path.isdir("data"):
31     print "\nCreating subdirectory 'data'\n"     print "\nCreating subdirectory 'data'\n"
# Line 46  def wavePropagation(domain,h,tend,lam,mu Line 46  def wavePropagation(domain,h,tend,lam,mu
46     x=domain.getX()     x=domain.getX()
47     # ... open new PDE ...     # ... open new PDE ...
48     mypde=LinearPDE(domain)     mypde=LinearPDE(domain)
49     mypde.setSolverMethod(LinearPDE.LUMPING)     mypde.getSolverOptions().setSolverMethod(mypde.getSolverOptions().LUMPING)
50     kronecker=identity(mypde.getDim())     kronecker=identity(mypde.getDim())
51    
52     #  spherical source at middle of bottom face     #  spherical source at middle of bottom face
# Line 57  def wavePropagation(domain,h,tend,lam,mu Line 57  def wavePropagation(domain,h,tend,lam,mu
57     src_radius = 0.1*Lsup(domain.getSize())     src_radius = 0.1*Lsup(domain.getSize())
58     print "src_radius = ",src_radius     print "src_radius = ",src_radius
59    
60     dunit=numarray.array([1.,0.,0.]) # defines direction of point source     dunit=numpy.array([1.,0.,0.]) # defines direction of point source
61    
62     mypde.setValue(D=kronecker*rho)     mypde.setValue(D=kronecker*rho)
63     # ... set initial values ....     # ... set initial values ....
# Line 69  def wavePropagation(domain,h,tend,lam,mu Line 69  def wavePropagation(domain,h,tend,lam,mu
69     t=0     t=0
70    
71     # define the location of the point source     # define the location of the point source
72     L=Locator(domain,numarray.array(xc))     L=Locator(domain,numpy.array(xc))
73     # find potential at point source     # find potential at point source
74     u_pc=L.getValue(u)     u_pc=L.getValue(u)
75     print "u at point charge=",u_pc     print "u at point charge=",u_pc

Legend:
Removed from v.2420  
changed lines
  Added in v.2474

  ViewVC Help
Powered by ViewVC 1.1.26