/[escript]/trunk/doc/examples/usersguide/mount.py
ViewVC logotype

Annotation of /trunk/doc/examples/usersguide/mount.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2484 - (hide annotations)
Mon Jun 22 04:22:19 2009 UTC (9 years, 8 months ago) by gross
File MIME type: text/x-python
File size: 1247 byte(s)
numarray removed from docu; Locator revised.
1 artak 2211 from esys.escript import *
2     from esys.escript.models import Mountains
3     from esys.finley import Brick,Rectangle
4     from math import pi, ceil
5    
6     NE=16
7     DIM=3
8     H=1.
9 artak 2306 L=2*H
10 artak 2211 TOL=1.e-4
11     OMEGA=10
12     EPS=0.01
13     t=0
14     T_END=(2*pi)/OMEGA
15     n=0
16     if DIM==2:
17     mydomain=Rectangle(int(ceil(L*NE/H)),NE,l0=L,l1=H,order=1, useFullElementOrder=True,optimize=True)
18     else:
19     mydomain=Brick(int(ceil(L*NE/H)),int(ceil(L*NE/H)),NE,l0=L,l1=L,l2=H,order=1, useFullElementOrder=True,optimize=True)
20     x=mydomain.getX()
21     v = Vector(0.0, Solution(mydomain))
22     if DIM==2:
23     a0=1
24     n0=1
25     n1=0.5
26     a1=-(a0*n0)/n1
27     v[0]=a0*sin(pi*n0*x[0])* cos(pi*n1*x[1])
28     v[1]=a1*cos(pi*n0*x[0])* sin(pi*n1*x[1])
29     else:
30     a0=1
31     a1=1
32     n0=2
33     n1=2
34     n2=0.5
35     a2=-(a0*n0+a1*n1)/n2
36     v[0]=a0*sin(pi*n0*x[0])* cos(pi*n1*x[1])* cos(pi*n2*x[2])
37     v[1]=a1*cos(pi*n0*x[0])* sin(pi*n1*x[1])* cos(pi*n2*x[2])
38     v[2]=a2*cos(pi*n0*x[0])* cos(pi*n1*x[1])* sin(pi*n2*x[2])
39    
40    
41     H_t=Scalar(0.0, Solution(mydomain))
42     mts=Mountains(mydomain,v,eps=EPS,z=H)
43     dt=0.
44     while t<T_END:
45     print "STEP ", t
46     u=v*cos(OMEGA*t)
47 artak 2306 u,Z=mts.update(u=u,H_t=H_t,verbose=False)
48 artak 2211
49     saveVTK("state.%d.vtu"%n,sol=Z)
50     print "Integral(Z)=",integrate(Z),Lsup(u[DIM-1])
51     n+=1
52     H_t=Z
53     dt=mts.getDt()
54     t+=dt
55    

Properties

Name Value
svn:mergeinfo

  ViewVC Help
Powered by ViewVC 1.1.26