/[escript]/trunk/escript/test/python/pdetoolsTest.py
ViewVC logotype

Diff of /trunk/escript/test/python/pdetoolsTest.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 349 by jgs, Wed Nov 9 02:02:19 2005 UTC revision 350 by gross, Tue Dec 13 09:11:52 2005 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  from esys.escript import *  from esys.escript import *
4  from esys.escript.pdetools import Locator,Projector  from esys.escript.pdetools import Locator,Projector,TimeIntegrationManager
5  from esys.finley import Rectangle  from esys.finley import Rectangle
6    
7    def testTimeIntegrationManager():
8       t=0.
9       dt=0.1
10       tm=TimeIntegrationManager(0.,p=1)
11       while t<1.:
12          t+=dt
13          tm.checkin(dt,t)
14       v_guess=tm.extrapolate(dt)
15       e=abs(v_guess-(tm.getTime()+dt))
16       error_max,error_text=e,"testTimeIntegrationManager: scalar"
17    
18       t=0.
19       dt=0.3
20       tm=TimeIntegrationManager(0.,0.,p=1)
21       while t<1.:
22          t+=dt
23          tm.checkin(dt,t,3*t)
24       v_guess=tm.extrapolate(dt)
25       e=max(abs(v_guess[0]-(tm.getTime()+dt)),abs(v_guess[1]-(tm.getTime()+dt)*3.))
26       if e>error_max: error_max,error_text=e,"testTimeIntegrationManager: vector"
27    
28       return error_max,error_text
29  def testLocator(domain):  def testLocator(domain):
30        """runs a few test of the Locator"""        """runs a few test of the Locator"""
31    
# Line 69  print "test Locator: ",txt Line 91  print "test Locator: ",txt
91  txt=testProjector(Rectangle(56,61))  txt=testProjector(Rectangle(56,61))
92  print "test Projector: ",txt  print "test Projector: ",txt
93    
94    print testTimeIntegrationManager()
   

Legend:
Removed from v.349  
changed lines
  Added in v.350

  ViewVC Help
Powered by ViewVC 1.1.26