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

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

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

revision 3891 by ahallam, Tue Nov 23 00:30:20 2010 UTC revision 3892 by jfenwick, Tue Apr 10 08:57:23 2012 UTC
# Line 63  tend=50 * yr # - time to end simulation Line 63  tend=50 * yr # - time to end simulation
63  outputs = 200 # number of time steps required.  outputs = 200 # number of time steps required.
64  h=(tend-t)/outputs #size of time step  h=(tend-t)/outputs #size of time step
65  #user warning statement  #user warning statement
66  print "Expected Number of time outputs is: ", (tend-t)/h  print("Expected Number of time outputs is: ", (tend-t)/h)
67  i=0 #loop counter  i=0 #loop counter
68  #the folder to put our outputs in, leave blank "" for script path  #the folder to put our outputs in, leave blank "" for script path
69  save_path= os.path.join("data","example01")  save_path= os.path.join("data","example01")
# Line 94  while t<tend: Line 94  while t<tend:
94        mypde.setValue(Y=qH+rhocp/h*T)        mypde.setValue(Y=qH+rhocp/h*T)
95        T=mypde.getSolution()        T=mypde.getSolution()
96        totE=integrate(rhocp*T)        totE=integrate(rhocp*T)
97        print "time step %s at t=%e days completed. total energy = %e."%(i,t/day,totE)        print("time step %s at t=%e days completed. total energy = %e."%(i,t/day,totE))
98        t_list.append(t)        t_list.append(t)
99        E_list.append(totE)        E_list.append(totE)
100    

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

  ViewVC Help
Powered by ViewVC 1.1.26