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

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

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

revision 3891 by caltinay, Fri Nov 12 01:19:02 2010 UTC revision 3892 by jfenwick, Tue Apr 10 08:57:23 2012 UTC
# Line 61  tend=0.5    #end time Line 61  tend=0.5    #end time
61  #calculating )the timestep  #calculating )the timestep
62  h=(1./5.)*sqrt(rho/(lam+2*mu))*(mx/ndx)  h=(1./5.)*sqrt(rho/(lam+2*mu))*(mx/ndx)
63  #Check to make sure number of time steps is not too large.  #Check to make sure number of time steps is not too large.
64  print "Time step size= ",h, "Expected number of outputs= ",tend/h  print("Time step size= ",h, "Expected number of outputs= ",tend/h)
65    
66  #uncomment the following lines to give the user a chance to stop  #uncomment the following lines to give the user a chance to stop
67  #proceeder = raw_input("Is this ok?(y/n)")  #proceeder = raw_input("Is this ok?(y/n)")
# Line 168  abc=abcleft*abcright*abcbottom*abctop Line 168  abc=abcleft*abcright*abcbottom*abctop
168    
169  # ... open new PDE ...  # ... open new PDE ...
170  mypde=LinearPDE(domain)  mypde=LinearPDE(domain)
171  print mypde.isUsingLumping()  print(mypde.isUsingLumping())
172  print mypde.getSolverOptions()  print(mypde.getSolverOptions())
173  #mypde.getSolverOptions().setSolverMethod(mypde.getSolverOptions().LUMPING)  #mypde.getSolverOptions().setSolverMethod(mypde.getSolverOptions().LUMPING)
174  mypde.setSymmetryOn()  mypde.setSymmetryOn()
175  kmat = kronecker(domain)  kmat = kronecker(domain)
# Line 178  mypde.setValue(D=kmat*rho) Line 178  mypde.setValue(D=kmat*rho)
178  # define small radius around point xc  # define small radius around point xc
179  # Lsup(x) returns the maximum value of the argument x  # Lsup(x) returns the maximum value of the argument x
180  src_radius = 50#2*Lsup(domain.getSize())  src_radius = 50#2*Lsup(domain.getSize())
181  print "src_radius = ",src_radius  print("src_radius = ",src_radius)
182    
183  dunit=numpy.array([0.,1.]) # defines direction of point source  dunit=numpy.array([0.,1.]) # defines direction of point source
184  #~ dunit=(x-xc)  #~ dunit=(x-xc)
# Line 194  u=U0*(cos(length(x-xc)*3.1415/src_radius Line 194  u=U0*(cos(length(x-xc)*3.1415/src_radius
194    
195  maxi=0.02  maxi=0.02
196    
197  print u  print(u)
198  u_m1=u  u_m1=u
199  t=0  t=0
200    
# Line 230  while t<tend: Line 230  while t<tend:
230      #stress =      #stress =
231      t+=h      t+=h
232      n+=1      n+=1
233      print n,"-th time step t ",t      print(n,"-th time step t ",t)
234      #~ u_pot = cbphones(domain,u,[[300.,200.],[500.,200.],[750.,200.]],2)      #~ u_pot = cbphones(domain,u,[[300.,200.],[500.,200.],[750.,200.]],2)
235      #~      #~
236      #~ #     print "u at point charge=",u_pc      #~ #     print "u at point charge=",u_pc

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

  ViewVC Help
Powered by ViewVC 1.1.26