/[escript]/branches/diaplayground/poisson.py
ViewVC logotype

Annotation of /branches/diaplayground/poisson.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4944 - (hide annotations)
Thu May 15 07:00:46 2014 UTC (5 years ago) by caltinay
File MIME type: text/x-python
File size: 779 byte(s)
blocksize >1 lookin' good...

1 caltinay 4944 from esys.escript import *
2     from esys.escript.linearPDEs import Poisson,SolverOptions
3     from esys.ripley import Rectangle
4     from time import time
5    
6     mydomain = Rectangle(l0=1.,l1=1.,n0=9, n1=9)
7     x = mydomain.getX()
8     gammaD = whereZero(x[0])+whereZero(x[1])
9     mypde = Poisson(domain=mydomain)
10     #mypde.getSolverOptions().setPackage(SolverOptions.CUSP)
11     mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
12     mypde.getSolverOptions().setPreconditioner(SolverOptions.NO_PRECONDITIONER)
13     mypde.getSolverOptions().setVerbosityOn()
14     #mypde.setDebugOn()
15     mypde.setValue(f_reduced=1,q=gammaD)
16     #rhs=mypde.getRightHandSide()
17     #saveDataCSV('/tmp/rhs.csv',rhs=rhs)
18     #mypde.getSystem()[0].saveMM('/tmp/poisson.mtx')
19     #print rhs
20    
21     t0=time()
22     x = mypde.getSolution()
23     t1=time()
24     print "Time: ", t1-t0
25     print x
26    

  ViewVC Help
Powered by ViewVC 1.1.26