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

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

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

revision 3070 by gross, Tue Mar 2 07:54:11 2010 UTC revision 3071 by gross, Wed Jul 21 05:37:30 2010 UTC
# Line 1  Line 1 
1    # -*- coding: utf-8 -*-
2    
3  ########################################################  ########################################################
4  #  #
# Line 24  import tempfile Line 25  import tempfile
25                
26    
27    
28  VERBOSE=False  # or True  VERBOSE=False  and True
29    
30  from esys.escript import *  from esys.escript import *
31  from esys.escript.models import StokesProblemCartesian, PowerLaw, IncompressibleIsotropicFlowCartesian, FaultSystem, DarcyFlow  from esys.escript.models import StokesProblemCartesian, PowerLaw, IncompressibleIsotropicFlowCartesian, FaultSystem, DarcyFlow
# Line 510  class Test_Darcy(unittest.TestCase): Line 511  class Test_Darcy(unittest.TestCase):
511          p=p_ref*mp          p=p_ref*mp
512          u=u_ref*mv          u=u_ref*mv
513          df=DarcyFlow(self.dom)          df=DarcyFlow(self.dom)
514            #df.getSolverOptionsPressure().setVerbosityOn()
515          df.setValue(g=f,          df.setValue(g=f,
516                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
517                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
518                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
519          df.setTolerance(rtol=self.TOL)          df.setTolerance(rtol=self.TOL)
520          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
521            
522          self.failUnless(Lsup(v-u_ref)<self.TEST_TOL*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TEST_TOL*Lsup(u_ref), "flux error too big.")
523          self.failUnless(Lsup(p-p_ref)<self.TEST_TOL*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TEST_TOL*Lsup(p_ref), "pressure error too big.")
524    
# Line 567  class Test_Darcy(unittest.TestCase): Line 570  class Test_Darcy(unittest.TestCase):
570                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
571          df.setTolerance(rtol=self.TOL)          df.setTolerance(rtol=self.TOL)
572          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
573    
574            
575          self.failUnless(Lsup(v-u_ref)<self.TEST_TOL*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TEST_TOL*Lsup(u_ref), "flux error too big.")
576          self.failUnless(Lsup(p-p_ref)<self.TEST_TOL*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TEST_TOL*Lsup(p_ref), "pressure error too big.")
577    
# Line 661  class Test_Darcy2D(Test_Darcy): Line 666  class Test_Darcy2D(Test_Darcy):
666      WIDTH=1.      WIDTH=1.
667      def setUp(self):      def setUp(self):
668          NE=40  # wrning smaller NE may case a failure for VarioF tests due to discretization errors.          NE=40  # wrning smaller NE may case a failure for VarioF tests due to discretization errors.
669          self.dom = Rectangle(NE,NE)      self.dom = Rectangle(NE/2,NE)
670          self.rescaleDomain()          self.rescaleDomain()
671      def tearDown(self):      def tearDown(self):
672          del self.dom          del self.dom
# Line 1741  if __name__ == '__main__': Line 1746  if __name__ == '__main__':
1746     suite.addTest(unittest.makeSuite(Test_StokesProblemCartesian2D))     suite.addTest(unittest.makeSuite(Test_StokesProblemCartesian2D))
1747     suite.addTest(unittest.makeSuite(Test_Darcy3D))     suite.addTest(unittest.makeSuite(Test_Darcy3D))
1748     suite.addTest(unittest.makeSuite(Test_Darcy2D))     suite.addTest(unittest.makeSuite(Test_Darcy2D))
1749       # suite.addTest(Test_Darcy2D("testVarioF_FixedBottom_smallK"))
1750     suite.addTest(unittest.makeSuite(Test_StokesProblemCartesian3D))     suite.addTest(unittest.makeSuite(Test_StokesProblemCartesian3D))
1751     ## suite.addTest(Test_StokesProblemCartesian3D("test_PCG_P_large"))     suite.addTest(Test_StokesProblemCartesian3D("test_PCG_P_large"))
1752     suite.addTest(unittest.makeSuite(Test_Mountains3D))     suite.addTest(unittest.makeSuite(Test_Mountains3D))
1753     suite.addTest(unittest.makeSuite(Test_Mountains2D))     suite.addTest(unittest.makeSuite(Test_Mountains2D))
1754     suite.addTest(unittest.makeSuite(Test_Rheologies))     suite.addTest(unittest.makeSuite(Test_Rheologies))

Legend:
Removed from v.3070  
changed lines
  Added in v.3071

  ViewVC Help
Powered by ViewVC 1.1.26