/[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 3675 - (hide annotations)
Thu Nov 17 00:53:38 2011 UTC (7 years, 3 months ago) by jfenwick
File MIME type: text/x-python
File size: 2040 byte(s)
pasowrap joins the trunk.

1 gross 2563 ########################################################
2     #
3 jfenwick 2881 # Copyright (c) 2003-2010 by University of Queensland
4 gross 2563 # Earth Systems Science Computational Center (ESSCC)
5     # http://www.uq.edu.au/esscc
6     #
7     # Primary Business: Queensland, Australia
8     # Licensed under the Open Software License version 3.0
9     # http://www.opensource.org/licenses/osl-3.0.php
10     #
11     ########################################################
12    
13 jfenwick 2881 __copyright__="""Copyright (c) 2003-2010 by University of Queensland
14 gross 2563 Earth Systems Science Computational Center (ESSCC)
15     http://www.uq.edu.au/esscc
16     Primary Business: Queensland, Australia"""
17     __license__="""Licensed under the Open Software License version 3.0
18     http://www.opensource.org/licenses/osl-3.0.php"""
19     __url__="https://launchpad.net/escript-finley"
20 artak 2211 from esys.escript import *
21     from esys.escript.models import Mountains
22     from esys.finley import Brick,Rectangle
23 caltinay 3346 from esys.weipa import saveVTK
24 artak 2211 from math import pi, ceil
25    
26     NE=16
27     DIM=3
28     H=1.
29 artak 2306 L=2*H
30 artak 2211 OMEGA=10
31     EPS=0.01
32     t=0
33 gross 2502 T_END=0.05 # set T_END=(2*pi)/OMEGA to run a full simulation
34 artak 2211 n=0
35     if DIM==2:
36     mydomain=Rectangle(int(ceil(L*NE/H)),NE,l0=L,l1=H,order=1, useFullElementOrder=True,optimize=True)
37     else:
38     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)
39 gross 2563
40 artak 2211 x=mydomain.getX()
41     v = Vector(0.0, Solution(mydomain))
42     if DIM==2:
43     a0=1
44     n0=1
45     n1=0.5
46     a1=-(a0*n0)/n1
47     v[0]=a0*sin(pi*n0*x[0])* cos(pi*n1*x[1])
48     v[1]=a1*cos(pi*n0*x[0])* sin(pi*n1*x[1])
49     else:
50     a0=1
51     a1=1
52     n0=2
53     n1=2
54     n2=0.5
55     a2=-(a0*n0+a1*n1)/n2
56     v[0]=a0*sin(pi*n0*x[0])* cos(pi*n1*x[1])* cos(pi*n2*x[2])
57     v[1]=a1*cos(pi*n0*x[0])* sin(pi*n1*x[1])* cos(pi*n2*x[2])
58     v[2]=a2*cos(pi*n0*x[0])* cos(pi*n1*x[1])* sin(pi*n2*x[2])
59    
60    
61 gross 2563 mts=Mountains(mydomain,eps=EPS)
62 artak 2211 while t<T_END:
63     print "STEP ", t
64 gross 2563 mts.setVelocity(v*cos(OMEGA*t))
65     Z=mts.update()
66 artak 2211
67 gross 2563 saveVTK("state.%d.vtu"%n,sol=Z, v=mts.getVelocity())
68     print "Integral(Z)=",integrate(Z),Lsup(mts.getVelocity()[DIM-1])
69 artak 2211 n+=1
70 gross 2563 t+=mts.getSafeTimeStepSize()
71 artak 2211

Properties

Name Value
svn:mergeinfo /branches/lapack2681/doc/examples/usersguide/mount.py:2682-2741 /branches/pasowrap/doc/examples/usersguide/mount.py:3661-3674 /branches/restext/doc/examples/usersguide/mount.py:2610-2624

  ViewVC Help
Powered by ViewVC 1.1.26