# Diff of /trunk/esys2/finley/test/python/PoissonSolverTest.py

revision 151 by jgs, Thu Sep 1 03:31:39 2005 UTC revision 152 by phornby, Fri Oct 21 08:32:21 2005 UTC
# Line 13  def getDomain(dim,ne,height): Line 13  def getDomain(dim,ne,height):
13
14      if dim==2:      if dim==2:
15       ne1=int(ne*height+0.5)       ne1=int(ne*height+0.5)
16       mydomain=finley.Rectangle(n0=ne,n1=ne1,l1=height,order=2)       mydomain=finley.Rectangle(n0=ne,n1=ne1,l1=height,order=1)
17       totne=ne1*ne       totne=ne1*ne
18      else:      else:
19       ne2=int(ne*height+0.5)       ne2=int(ne*height+0.5)
# Line 92  def Solve2(mydomain,height): Line 92  def Solve2(mydomain,height):
92      return error      return error
93
94
95  error=0  def main() :
96  for ne in ne_list:      error=0
97     for dim in [2,3]:      for ne in ne_list:
98     # for dim in [2]:         for dim in [2,3]:
99        for height in height_list:         # for dim in [2]:
100           print "***************************************************************"            for height in height_list:
101           mydomain= getDomain(dim,ne,height)               print "***************************************************************"
102           print "---------------------------------------------------------------"               mydomain= getDomain(dim,ne,height)
103           error=max(error,Solve1(mydomain,height))               print "---------------------------------------------------------------"
104           print "---------------------------------------------------------------"               error=max(error,Solve1(mydomain,height))
105           error=max(error,Solve2(mydomain,height))               print "---------------------------------------------------------------"
106           print "***************************************************************"               error=max(error,Solve2(mydomain,height))
107                 print "***************************************************************"
108  print "***************************************************************"
109  print "maximum error: ",error      print "***************************************************************"
110  print "***************************************************************"      print "maximum error: ",error
111        print "***************************************************************"
112
113
114
115    import profile as Pr, pstats as Ps
116
117
118    if __name__ == "__main__":
119        pr = Pr.Profile()
120        pr.calibrate(10000)
121        Pr.run('main()','eos_stats')
122        stats = Ps.Stats('eos_stats')
123        stats.strip_dirs()
124        stats.sort_stats('time')
125        stats.print_stats()

Legend:
 Removed from v.151 changed lines Added in v.152