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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6756 - (hide annotations)
Thu Nov 29 07:23:43 2018 UTC (17 months, 4 weeks ago) by aellery
File MIME type: text/x-python
File size: 1596 byte(s)
Temporarily undoing last commit.
1 sshaw 5288 from __future__ import division, print_function
2 jfenwick 3981 ##############################################################################
3 gross 2574 #
4 jfenwick 6651 # Copyright (c) 2003-2018 by The University of Queensland
5 jfenwick 3981 # http://www.uq.edu.au
6 gross 2574 #
7     # Primary Business: Queensland, Australia
8 jfenwick 6112 # Licensed under the Apache License, version 2.0
9     # http://www.apache.org/licenses/LICENSE-2.0
10 gross 2574 #
11 jfenwick 3981 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 # Development 2012-2013 by School of Earth Sciences
13     # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 jfenwick 3981 #
15     ##############################################################################
16 gross 2574
17 jfenwick 6651 __copyright__="""Copyright (c) 2003-2018 by The University of Queensland
18 jfenwick 3981 http://www.uq.edu.au
19 gross 2574 Primary Business: Queensland, Australia"""
20 jfenwick 6112 __license__="""Licensed under the Apache License, version 2.0
21     http://www.apache.org/licenses/LICENSE-2.0"""
22 gross 2574 __url__="https://launchpad.net/escript-finley"
23    
24     from esys.escript import *
25     from esys.escript.linearPDEs import Poisson
26 sshaw 5288 try:
27     from esys.finley import Rectangle
28     HAVE_FINLEY = True
29     except ImportError:
30     HAVE_FINLEY = False
31 caltinay 3346 from esys.weipa import saveVTK
32 gross 2574
33 sshaw 5288 if not HAVE_FINLEY:
34     print("Finley module not available")
35     else:
36     # generate domain:
37     mydomain = Rectangle(l0=1.,l1=1.,n0=40, n1=20)
38     # define characteristic function of Gamma^D
39     x = mydomain.getX()
40     gammaD = whereZero(x[0])+whereZero(x[1])
41     # define PDE and get its solution u
42     mypde = Poisson(domain=mydomain)
43     mypde.setValue(f=1,q=gammaD)
44     u = mypde.getSolution()
45     # write u to an external file
46     saveVTK("u.vtu",sol=u)
47    

  ViewVC Help
Powered by ViewVC 1.1.26