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

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

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

revision 2671 by jfenwick, Thu Sep 17 01:49:11 2009 UTC revision 2672 by ahallam, Fri Sep 18 01:46:47 2009 UTC
# Line 63  if getMPISizeWorld() > 1: Line 63  if getMPISizeWorld() > 1:
63  #################################################ESTABLISHING VARIABLES  #################################################ESTABLISHING VARIABLES
64  qin=300.*Milli*W/(m*m) #our heat source temperature is now zero  qin=300.*Milli*W/(m*m) #our heat source temperature is now zero
65  Ti=290.15*K # Kelvin #the starting temperature of our iron bar  Ti=290.15*K # Kelvin #the starting temperature of our iron bar
66    width=5000.0*m
67    depth=-6000.0*m
68    
69  # the folder to gett our outputs from, leave blank "" for script path -  # the folder to gett our outputs from, leave blank "" for script path -
70  # note these depen. are generated from heatrefraction_mesher001.py  # note these depen. are generated from heatrefraction_mesher001.py
# Line 85  bpgry = bpgr[:,1] Line 87  bpgry = bpgr[:,1]
87  # set up kappa (thermal conductivity across domain) using tags  # set up kappa (thermal conductivity across domain) using tags
88  kappa=Scalar(0,Function(mymesh))  kappa=Scalar(0,Function(mymesh))
89  kappa.setTaggedValue("top",2.0)  kappa.setTaggedValue("top",2.0)
90  kappa.setTaggedValue("bottomleft",18.0)  kappa.setTaggedValue("bottomleft",4.0)
91  kappa.setTaggedValue("bottomright",6.0)  kappa.setTaggedValue("bottomright",6.0)
92    
93  #... generate functionspace...  #... generate functionspace...
# Line 133  ziK = pl.matplotlib.mlab.griddata(coordK Line 135  ziK = pl.matplotlib.mlab.griddata(coordK
135  # contour the gridded data, plotting dots at the randomly  # contour the gridded data, plotting dots at the randomly
136  # spaced data points.  # spaced data points.
137    
138  pl.matplotlib.pyplot.autumn()  pl.matplotlib.pyplot.autumn()              
139  CKL = pl.fill(tpgx,tpgy,'brown',bpglx,bpgly,'red',\  CKL = pl.fill(tpgx,tpgy,'brown',label='2 W/m/k',zorder=-1000)
140                bpgrx,bpgry,'orange',zorder=-1000)  CKM = pl.fill(bpglx,bpgly,'red',label='4 W/m/k',zorder=-1000)
141    CKN = pl.fill(bpgrx,bpgry,'orange',label='6 W/m/k',zorder=-1000)              
142                  
143  CS = pl.contour(xi,yi,zi,5,linewidths=0.5,colors='k')  CS = pl.contour(xi,yi,zi,5,linewidths=0.5,colors='k')
144  pl.clabel(CS, inline=1, fontsize=8)  pl.clabel(CS, inline=1, fontsize=8)
145  pl.title("Heat Refraction across an anisotropic structure.")  pl.title("Heat Refraction across an anisotropic structure.")
146  pl.xlabel("Horizontal Displacement (m)")  pl.xlabel("Horizontal Displacement (m)")
147  pl.ylabel("Depth (m)")  pl.ylabel("Depth (m)")
148    pl.legend()
149  if getMPIRankWorld() == 0: #check for MPI processing  if getMPIRankWorld() == 0: #check for MPI processing
150      pl.savefig(os.path.join(saved_path,"heatrefraction002_cont.png"))      pl.savefig(os.path.join(saved_path,"heatrefraction002_cont.png"))
151    

Legend:
Removed from v.2671  
changed lines
  Added in v.2672

  ViewVC Help
Powered by ViewVC 1.1.26