/[escript]/trunk/doc/examples/pyvisi/wave_with_pyvisi.py
ViewVC logotype

Diff of /trunk/doc/examples/pyvisi/wave_with_pyvisi.py

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

revision 2419 by jfenwick, Mon Mar 30 02:13:58 2009 UTC revision 2420 by gross, Thu May 14 02:28:58 2009 UTC
# Line 26  Author: John Ngui, john.ngui@uq.edu.au Line 26  Author: John Ngui, john.ngui@uq.edu.au
26    
27  # Import the necessary modules.  # Import the necessary modules.
28  from esys.escript import *  from esys.escript import *
 from esys.escript.pdetools import Locator  
29  from esys.escript.linearPDEs import LinearPDE  from esys.escript.linearPDEs import LinearPDE
30  from esys.finley import Brick  from esys.finley import Brick
31  from numarray import identity,zeros,ones  from numarray import identity,zeros,ones
# Line 73  def wavePropagation(domain,h,tend,lam,mu Line 72  def wavePropagation(domain,h,tend,lam,mu
72     u_last=U0*whereNegative(length(x-xc)-src_radius)*dunit     u_last=U0*whereNegative(length(x-xc)-src_radius)*dunit
73     t=0     t=0
74    
    # define the location of the point source  
    L=Locator(domain,numarray.array(xc))  
    # find potential at point source  
    u_pc=L.getValue(u)  
     
    u_pc_x = u_pc[0]  
    u_pc_y = u_pc[1]  
    u_pc_z = u_pc[2]  
   
    # open file to save displacement at point source  
    #u_pc_data=open('./data/U_pc.out','w')  
    #u_pc_data.write("%f %f %f %f\n"%(t,u_pc_x,u_pc_y,u_pc_z))  
   
75     # Create a Scene.     # Create a Scene.
76     s = Scene(renderer = JPG_RENDERER, x_size = X_SIZE, y_size = Y_SIZE)     s = Scene(renderer = JPG_RENDERER, x_size = X_SIZE, y_size = Y_SIZE)
77    
# Line 118  def wavePropagation(domain,h,tend,lam,mu Line 104  def wavePropagation(domain,h,tend,lam,mu
104       u=u_new       u=u_new
105       t+=h       t+=h
106       n+=1       n+=1
      u_pc=L.getValue(u)  
       
      u_pc_x=u_pc[0]  
      u_pc_y=u_pc[1]  
      u_pc_z=u_pc[2]  
         
107       # ... save current acceleration in units of gravity and displacements       # ... save current acceleration in units of gravity and displacements
108       if n==1 or n%10==0:       if n==1 or n%10==0:
109    

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

  ViewVC Help
Powered by ViewVC 1.1.26