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

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

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

revision 2392 by ahallam, Thu Apr 16 01:53:23 2009 UTC revision 2397 by ahallam, Fri Apr 24 04:24:28 2009 UTC
# Line 36  import os #This package is necessary to Line 36  import os #This package is necessary to
36  q=50.e6 #our heat source temperature  q=50.e6 #our heat source temperature
37  Tref=0. #the starting temperature of our iron bar  Tref=0. #the starting temperature of our iron bar
38  rho=2.6e6  rho=2.6e6
39  eta=75.  eta=0#75.
40  kappa=240.  kappa=240.
41  #Script/Iteration Related  #Script/Iteration Related
42  t=0 #our start time, usually zero  t=0 #our start time, usually zero
# Line 51  save_path = "data/onedheatdiff" #the fol Line 51  save_path = "data/onedheatdiff" #the fol
51  #... generate domain ...  #... generate domain ...
52  rod = Rectangle(l0=0.05,l1=.01,n0=500, n1=1)  rod = Rectangle(l0=0.05,l1=.01,n0=500, n1=1)
53  # extract finite points  # extract finite points
54  x=r od.getX()  x=rod.getX()
55  #... open PDE ...  #... open PDE ...
56  mypde=LinearPDE(rod)  mypde=LinearPDE(rod)
57  mypde.setSymmetryOn()  mypde.setSymmetryOn()
# Line 66  T=Tref Line 66  T=Tref
66  while t<=tend:  while t<=tend:
67        i+=1        i+=1
68        t+=h        t+=h
69        mypde.setValue(Y=qH+rhocp/h*T)        mypde.setValue(Y=qH+rho/h*T)
70        T=mypde.getSolution()        T=mypde.getSolution()
71        print T        print T
72        saveVTK(os.path.join(save_path,"data%03d.xml") %i,sol=T)        saveVTK(os.path.join(save_path,"data%03d.xml") %i,sol=T)

Legend:
Removed from v.2392  
changed lines
  Added in v.2397

  ViewVC Help
Powered by ViewVC 1.1.26