Diff of /trunk/finley/test/python/FCT_test2.py

revision 1475 by gross, Thu Feb 7 04:24:00 2008 UTC revision 1476 by gross, Mon Apr 7 23:38:50 2008 UTC
# Line 25  from esys.escript.linearPDEs import Line Line 25  from esys.escript.linearPDEs import Line
25  from esys.finley import Rectangle, Brick  from esys.finley import Rectangle, Brick
26  from math import pi, ceil  from math import pi, ceil
27  NE=128  NE=128
28    NE=64
29  DIM=2  DIM=2
30  THETA=0.5  THETA=0.5
31  OMEGA0=1.  OMEGA0=1.
# Line 33  T0=0.5*pi Line 34  T0=0.5*pi
34  T_END=2.5*pi  T_END=2.5*pi
35  dt=1e-3*10  dt=1e-3*10
36  E=1.e-3  E=1.e-3
37  TEST_SUPG=False # or True  TEST_SUPG=False or True
38
39
40  def getCenter(t):  def getCenter(t):
# Line 56  def QUALITY(t,u_h): Line 57  def QUALITY(t,u_h):
57       if DIM == 3: sigma_h2*=sqrt(2./3.)       if DIM == 3: sigma_h2*=sqrt(2./3.)
58       e=sigma_h2/sqrt(4*E*t)-1                   e=sigma_h2/sqrt(4*E*t)-1
59       # return a,b,c,e,1./(4*pi*E*t)**(DIM/2.)       # return a,b,c,e,1./(4*pi*E*t)**(DIM/2.)
60       return b, d       return d,e
61       # return a,b,c,d,e       # return a,b,c,d,e
62
63
# Line 111  while t<T_END: Line 112  while t<T_END:
112              nnn+=1              nnn+=1
113      c+=1      c+=1
114      t+=dt      t+=dt
115      print "QUALITY FCT: time = %s pi"%(t/pi),QUALITY(t,u)      print "QUALITY FCT: time = %s pi"%(t/pi),QUALITY(t,u),
116      if TEST_SUPG:      if TEST_SUPG:
117         print "QUALITY SUPG: ",QUALITY(t,u_supg)         print "QUALITY SUPG: ",QUALITY(t,u_supg)
118         # saveVTK("u.%s.xml"%c,u=u,u_supg=u_supg)         # saveVTK("u.%s.xml"%c,u=u,u_supg=u_supg)

Legend:
 Removed from v.1475 changed lines Added in v.1476