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

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

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

revision 5287 by jfenwick, Wed Apr 9 05:41:57 2014 UTC revision 5288 by sshaw, Tue Dec 2 23:18:40 2014 UTC
# Line 1  Line 1 
1  from __future__ import division  from __future__ import division, print_function
2  ##############################################################################  ##############################################################################
3  #  #
4  # Copyright (c) 2003-2014 by University of Queensland  # Copyright (c) 2003-2014 by University of Queensland
# Line 23  __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  from esys.weipa import saveVTK
32  # 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])      # generate domain:
37  # define PDE and get its solution u      mydomain = Rectangle(l0=1.,l1=1.,n0=40, n1=20)
38  mypde = Poisson(domain=mydomain)      # define characteristic function of Gamma^D
39  mypde.setValue(f=1,q=gammaD)      x = mydomain.getX()
40  u = mypde.getSolution()      gammaD = whereZero(x[0])+whereZero(x[1])
41  # write u to an external file      # define PDE and get its solution u
42  saveVTK("u.vtu",sol=u)      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    

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

  ViewVC Help
Powered by ViewVC 1.1.26