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

Contents of /trunk/doc/examples/usersguide/helmholtz.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5707 - (show annotations)
Mon Jun 29 03:59:06 2015 UTC (3 years, 6 months ago) by sshaw
File MIME type: text/x-python
File size: 1838 byte(s)
adding copyright headers to files without copyright info, moved header to top of file in some cases where it wasn't
1 ##############################################################################
2 #
3 # Copyright (c) 2003-2015 by The University of Queensland
4 # http://www.uq.edu.au
5 #
6 # Primary Business: Queensland, Australia
7 # Licensed under the Open Software License version 3.0
8 # http://www.opensource.org/licenses/osl-3.0.php
9 #
10 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 # Development 2012-2013 by School of Earth Sciences
12 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
13 #
14 ##############################################################################
15 from __future__ import division, print_function
16
17 __copyright__="""Copyright (c) 2003-2015 by The University of Queensland
18 http://www.uq.edu.au
19 Primary Business: Queensland, Australia"""
20 __license__="""Licensed under the Open Software License version 3.0
21 http://www.opensource.org/licenses/osl-3.0.php"""
22 __url__="https://launchpad.net/escript-finley"
23
24 from esys.escript import *
25 from esys.escript.linearPDEs import LinearPDE
26 try:
27 from esys.finley import Rectangle
28 HAVE_FINLEY = True
29 except ImportError:
30 HAVE_FINLEY = False
31 from esys.weipa import saveVTK
32
33 if not HAVE_FINLEY:
34 print("Finley module not available")
35 else:
36 #... set some parameters ...
37 kappa=1.
38 omega=0.1
39 eta=10.
40 #... generate domain ...
41 mydomain = Rectangle(l0=5.,l1=1.,n0=50, n1=10)
42 #... open PDE and set coefficients ...
43 mypde=LinearPDE(mydomain)
44 mypde.setSymmetryOn()
45 n=mydomain.getNormal()
46 x=mydomain.getX()
47 mypde.setValue(A=kappa*kronecker(mydomain),D=omega,Y=omega*x[0], \
48 d=eta,y=kappa*n[0]+eta*x[0])
49 #... calculate error of the PDE solution ...
50 u=mypde.getSolution()
51 print("error is ",Lsup(u-x[0]))
52 # output should be similar to "error is 1.e-7"
53 saveVTK("x0.vtu",sol=u)
54

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/4.0fordebian/doc/examples/usersguide/helmholtz.py:5567-5588 /branches/lapack2681/doc/examples/usersguide/helmholtz.py:2682-2741 /branches/pasowrap/doc/examples/usersguide/helmholtz.py:3661-3674 /branches/py3_attempt2/doc/examples/usersguide/helmholtz.py:3871-3891 /branches/restext/doc/examples/usersguide/helmholtz.py:2610-2624 /branches/ripleygmg_from_3668/doc/examples/usersguide/helmholtz.py:3669-3791 /branches/symbolic_from_3470/doc/examples/usersguide/helmholtz.py:3471-3974 /branches/symbolic_from_3470/ripley/test/python/doc/examples/usersguide/helmholtz.py:3517-3974 /release/4.0/doc/examples/usersguide/helmholtz.py:5380-5406 /trunk/doc/examples/usersguide/helmholtz.py:1388-2483 /trunk/ripley/test/python/doc/examples/usersguide/helmholtz.py:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26