/[ascend]/trunk/test.py
ViewVC logotype

Diff of /trunk/test.py

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

revision 951 by johnpye, Sun Nov 26 05:01:49 2006 UTC revision 952 by johnpye, Tue Nov 28 23:01:50 2006 UTC
# Line 1  Line 1 
1  import unittest  import unittest
2  import ascpy  import ascpy
3  import math  import math
4    import os, subprocess
5    
6    class CUnit(unittest.TestCase):
7        def setUp(self):
8            self.cunitexe = "../base/generic/test/test"
9        
10        def testcunittests(self):
11            res = os.system(self.cunitexe)
12            if res:
13                raise RuntimeError("CUnit tests failed (returned %d -- run %s for details)" % (res,self.cunitexe))
14            else:
15                print "CUnit returned %s" % res
16    
17  class AscendTest(unittest.TestCase):  class AscendTest(unittest.TestCase):
18    
# Line 148  class AscendTest(unittest.TestCase): Line 160  class AscendTest(unittest.TestCase):
160      def testIDAkryx(self):      def testIDAkryx(self):
161          self.L.load('johnpye/idakryx.a4c')          self.L.load('johnpye/idakryx.a4c')
162          M = self.L.findType('idakryx').getSimulation('sim')          M = self.L.findType('idakryx').getSimulation('sim')
163            M.build()
164          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
165          I.setEngine('IDA')          I.setEngine('IDA')
166          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setReporter(ascpy.IntegratorReporterConsole(I))
167            I.setParameter('linsolver','SPGMR')
168            I.setParameter('gsmodified',False)
169            I.setParameter('autodiff',True)
170            I.setParameter('rtol',0)
171            I.setParameter('atol',1e-3);
172            I.setParameter('atolvect',False)
173            I.analyse()
174            I.setLogTimesteps(ascpy.Units("s"), 0.01, 10.24, 10);
175            print M.sim.udot[1][3];
176            I.solve()
177            assert 0
178            
179  # move code above down here if you want to temporarily avoid testing it  # move code above down here if you want to temporarily avoid testing it
180  class NotToBeTested:  class NotToBeTested:

Legend:
Removed from v.951  
changed lines
  Added in v.952

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22