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

Diff of /trunk/doc/examples/usersguide/poisson.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2549 by jfenwick, Mon Jul 20 06:43:47 2009 UTC revision 5288 by sshaw, Tue Dec 2 23:18:40 2014 UTC
# Line 1  Line 1 
1    from __future__ import division, print_function
2  ########################################################  ##############################################################################
3  #  #
4  # Copyright (c) 2003-2009 by University of Queensland  # Copyright (c) 2003-2014 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # http://www.uq.edu.au
 # http://www.uq.edu.au/esscc  
6  #  #
7  # Primary Business: Queensland, Australia  # Primary Business: Queensland, Australia
8  # Licensed under the Open Software License version 3.0  # Licensed under the Open Software License version 3.0
9  # http://www.opensource.org/licenses/osl-3.0.php  # http://www.opensource.org/licenses/osl-3.0.php
10  #  #
11  ########################################################  # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12    # Development 2012-2013 by School of Earth Sciences
13    # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14    #
15    ##############################################################################
16    
17  __copyright__="""Copyright (c) 2003-2009 by University of Queensland  __copyright__="""Copyright (c) 2003-2014 by University of Queensland
18  Earth Systems Science Computational Center (ESSCC)  http://www.uq.edu.au
 http://www.uq.edu.au/esscc  
19  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
20  __license__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
21  http://www.opensource.org/licenses/osl-3.0.php"""  http://www.opensource.org/licenses/osl-3.0.php"""
# Line 21  __url__="https://launchpad.net/escript-f Line 23  __url__="https://launchpad.net/escript-f
23    
24  from esys.escript import *  from esys.escript import *
25  from esys.escript.linearPDEs import Poisson  from esys.escript.linearPDEs import Poisson
26  from esys.finley import Rectangle  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  # generate domain:  # generate domain:
33  mydomain = Rectangle(l0=1.,l1=1.,n0=40, n1=20)  if not HAVE_FINLEY:
34  # define characteristic function of Gamma^D      print("Finley module not available")
35  x = mydomain.getX()  else:
36  gammaD = whereZero(x[0])+whereZero(x[1])      mydomain = Rectangle(l0=1.,l1=1.,n0=40, n1=20)
37  # define PDE and get its solution u      # define characteristic function of Gamma^D
38  mypde = Poisson(domain=mydomain)      x = mydomain.getX()
39  mypde.setValue(f=1,q=gammaD)      gammaD = whereZero(x[0])+whereZero(x[1])
40  u = mypde.getSolution()      # define PDE and get its solution u
41  # write u to an external file      mypde = Poisson(domain=mydomain)
42  saveVTK("u.vtu",sol=u)      mypde.setValue(f=1,q=gammaD)
43        u = mypde.getSolution()
44        # write u to an external file
45        saveVTK("u.vtu",sol=u)
46    

Legend:
Removed from v.2549  
changed lines
  Added in v.5288

  ViewVC Help
Powered by ViewVC 1.1.26