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

revision 1370 by gross, Wed Jan 2 09:21:43 2008 UTC revision 1371 by gross, Thu Jan 3 06:11:21 2008 UTC
# Line 59  class TransportPDE(object): Line 59  class TransportPDE(object):
59         return self.__transport_problem.solve(self.__source,dt,{})         return self.__transport_problem.solve(self.__source,dt,{})
60  from esys.finley import Rectangle  from esys.finley import Rectangle
61
62  dom=Rectangle(10,10)  dom=Rectangle(20,20)
63  fc=TransportPDE(dom,num_equations=1,theta=0.0,dt_max=0.)  fc=TransportPDE(dom,num_equations=1,theta=0.0,dt_max=0.)
64  fc.setValue(M=Scalar(1.,Function(dom)),C=Scalar(1.,Function(dom))*[-1.,0.])  fc.setValue(M=Scalar(1.,Function(dom)),C=Scalar(1.,Function(dom))*[-1.,0])
65  x=dom.getX()  x=dom.getX()
66  u=whereNonPositive(abs(x[0]-0.3)-0.1)*whereNonPositive(abs(x[1]-0.3)-0.1)  x_0=[0.3,0.3]
67    sigma=0.08
68    u=1.
69    for i in range(dom.getDim()):
70        u=u*exp(-(x[i]-x_0[i])**2/sigma**2)
71    u/=Lsup(u)
72
73    u=whereNonPositive(abs(x[0]-0.3)-0.2)*whereNonPositive(abs(x[1]-0.5)-0.2)
74  c=0  c=0
75  saveVTK("u.%s.xml"%c,u=u)  saveVTK("u.%s.xml"%c,u=u)
76  fc.setInitialSolution(u)  fc.setInitialSolution(u)
77  dt=0.301
78    dt=2.5e-2
79  t=0.  t=0.
80  while t<dt:  while t<15*dt:
81      print "time step t=",t+dt        print "time step t=",t+dt
82      u=fc.solve(dt)        u=fc.solve(dt)
83      print "range u",inf(u),sup(u)      print "range u",inf(u),sup(u)

Legend:
 Removed from v.1370 changed lines Added in v.1371