/[escript]/trunk/finley/test/python/run_darcy.py
ViewVC logotype

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

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

revision 4983 by jfenwick, Wed May 14 01:13:23 2014 UTC revision 4984 by sshaw, Mon Jun 2 02:50:34 2014 UTC
# Line 23  http://www.opensource.org/licenses/osl-3 Line 23  http://www.opensource.org/licenses/osl-3
23  __url__="https://launchpad.net/escript-finley"  __url__="https://launchpad.net/escript-finley"
24    
25  import esys.escriptcore.utestselect as unittest  import esys.escriptcore.utestselect as unittest
26    from esys.escriptcore.testing import *
27  import tempfile  import tempfile
28                
29    
# Line 30  import tempfile Line 31  import tempfile
31  VERBOSE=False  and True  VERBOSE=False  and True
32    
33  from esys.escript import *  from esys.escript import *
34  from esys.escript.models import  DarcyFlow  from esys.escript.models import DarcyFlow
35  from esys.finley import Rectangle, Brick  from esys.finley import Rectangle, Brick
36    
37  from math import pi  from math import pi
# Line 43  try: Line 44  try:
44  except KeyError:  except KeyError:
45       FINLEY_WORKDIR='.'       FINLEY_WORKDIR='.'
46    
47  class Test_Darcy(unittest.TestCase):  class Darcy(unittest.TestCase):
48      # this is a simple test for the darcy flux problem      # this is a simple test for the darcy flux problem
49      #      #
50      #      #
# Line 303  class Test_Darcy(unittest.TestCase): Line 304  class Test_Darcy(unittest.TestCase):
304          self.assertTrue(Lsup(v-u_ref)<self.TEST_TOL*Lsup(u_ref), "flux error too big.")          self.assertTrue(Lsup(v-u_ref)<self.TEST_TOL*Lsup(u_ref), "flux error too big.")
305          self.assertTrue(Lsup(p-p_ref)<self.TEST_TOL*Lsup(p_ref), "pressure error too big.")          self.assertTrue(Lsup(p-p_ref)<self.TEST_TOL*Lsup(p_ref), "pressure error too big.")
306    
307  class Test_Darcy2D(Test_Darcy):  class Darcy2D(Darcy):
308      TOL=1e-4      TOL=1e-4
309      WIDTH=1.      WIDTH=1.
310      SOLVER=DarcyFlow.POST      SOLVER=DarcyFlow.POST
# Line 313  class Test_Darcy2D(Test_Darcy): Line 314  class Test_Darcy2D(Test_Darcy):
314          self.rescaleDomain()          self.rescaleDomain()
315      def tearDown(self):      def tearDown(self):
316          del self.dom          del self.dom
317            
318  class Test_Darcy2D_EVAL(Test_Darcy2D):  class Test_Darcy2D_EVAL(Darcy2D):
319      TEST_TOL=0.01      TEST_TOL=0.01
320      SOLVER=DarcyFlow.EVAL      SOLVER=DarcyFlow.EVAL
321    
322  class Test_Darcy2D_POST(Test_Darcy2D):  class Test_Darcy2D_POST(Darcy2D):
323      TEST_TOL=1.e-3      TEST_TOL=1.e-3
324      SOLVER=DarcyFlow.POST      SOLVER=DarcyFlow.POST
325    
326  class Test_Darcy2D_SMOOTH(Test_Darcy2D):  class Test_Darcy2D_SMOOTH(Darcy2D):
327      TEST_TOL=0.01      TEST_TOL=0.01
328      SOLVER=DarcyFlow.SMOOTH      SOLVER=DarcyFlow.SMOOTH
329    
330  class Test_Darcy3D(Test_Darcy):  class Darcy3D(Darcy):
331      WIDTH=1.      WIDTH=1.
332      SOLVER=DarcyFlow.POST      SOLVER=DarcyFlow.POST
333      def setUp(self):      def setUp(self):
# Line 336  class Test_Darcy3D(Test_Darcy): Line 337  class Test_Darcy3D(Test_Darcy):
337      def tearDown(self):      def tearDown(self):
338          del self.dom          del self.dom
339    
340  class Test_Darcy3D_EVAL(Test_Darcy3D):  class Test_Darcy3D_EVAL(Darcy3D):
341      TEST_TOL=0.01      TEST_TOL=0.01
342      SOLVER=DarcyFlow.EVAL      SOLVER=DarcyFlow.EVAL
343    
344  class Test_Darcy3D_POST(Test_Darcy3D):  class Test_Darcy3D_POST(Darcy3D):
345      TEST_TOL=1.e-3      TEST_TOL=1.e-3
346      SOLVER=DarcyFlow.POST      SOLVER=DarcyFlow.POST
347    
348  class Test_Darcy3D_SMOOTH(Test_Darcy3D):  class Test_Darcy3D_SMOOTH(Darcy3D):
349      TEST_TOL=0.01      TEST_TOL=0.01
350      SOLVER=DarcyFlow.SMOOTH      SOLVER=DarcyFlow.SMOOTH
351            
352            
353  if __name__ == '__main__':  if __name__ == '__main__':
354     suite = unittest.TestSuite()      run_tests(__name__, classes=[
355     suite.addTest(unittest.makeSuite(Test_Darcy2D_SMOOTH))              Test_Darcy3D_EVAL, Test_Darcy3D_POST, Test_Darcy3D_SMOOTH,
356     suite.addTest(unittest.makeSuite(Test_Darcy2D_POST))              Test_Darcy2D_EVAL, Test_Darcy2D_POST, Test_Darcy2D_SMOOTH
357     suite.addTest(unittest.makeSuite(Test_Darcy2D_EVAL))          ],exit_on_failure=True)
     
    suite.addTest(unittest.makeSuite(Test_Darcy3D_SMOOTH))  
    suite.addTest(unittest.makeSuite(Test_Darcy3D_POST))  
    suite.addTest(unittest.makeSuite(Test_Darcy3D_EVAL))  
    #suite.addTest(Test_Darcy2D_POST("testConstF_FixedBottom_largeK"))  
    s=unittest.TextTestRunner(verbosity=2).run(suite)  
    if not s.wasSuccessful(): sys.exit(1)  
358    
359    

Legend:
Removed from v.4983  
changed lines
  Added in v.4984

  ViewVC Help
Powered by ViewVC 1.1.26