/[escript]/trunk/doc/cookbook/sandbox.py
ViewVC logotype

Annotation of /trunk/doc/cookbook/sandbox.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2392 - (hide annotations)
Thu Apr 16 01:53:23 2009 UTC (11 years, 9 months ago) by ahallam
File MIME type: text/x-python
File size: 661 byte(s)
Initial Commital of CookBook to SVN
Has 2.5 Weeks work and semi completed first heat diffusion tutorial
1 ahallam 2392 from esys.escript import *
2     from esys.escript.linearPDEs import LinearPDE
3     from esys.finley import Rectangle
4     from esys.pyvisi import Scene, DataCollector, Map, Camera
5     from esys.pyvisi.constant import *
6     import os
7    
8     #... set some parameters ...
9     xc=[0.0,0.0]
10     qc=50.e6
11     Tref=0.
12     rhocp=1
13     eta=10
14     kappa=1
15     tend=5.
16     # ... time, time step size and counter ...
17     t=0
18     h=0.1
19     i=0
20    
21     #... generate domain ...
22     mydomain = Rectangle(l0=5,l1=0.00,n0=500, n1=1)
23     #... open PDE ...
24     mypde=LinearPDE(mydomain)
25     mypde.setSymmetryOn()
26     mypde.setValue(A=kappa*kronecker(mydomain),D=rhocp/h,d=eta,y=eta*Tref)
27     # ... set heat source: ....
28     x=mydomain.getX()
29     print x
30     #qH=qc*whereNegative(length(x-xc)-r)

  ViewVC Help
Powered by ViewVC 1.1.26