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

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
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