/[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 2849 by gross, Thu Jan 14 05:51:28 2010 UTC revision 2850 by gross, Fri Jan 15 07:14:25 2010 UTC
# Line 24  import tempfile Line 24  import tempfile
24                
25    
26    
27  VERBOSE=False or True  VERBOSE=False # or True
28    
29  from esys.escript import *  from esys.escript import *
30  from esys.escript.models import StokesProblemCartesian, PowerLaw, IncompressibleIsotropicFlowCartesian, FaultSystem, DarcyFlow  from esys.escript.models import StokesProblemCartesian, PowerLaw, IncompressibleIsotropicFlowCartesian, FaultSystem, DarcyFlow
# Line 914  class Test_Rheologies(unittest.TestCase) Line 914  class Test_Rheologies(unittest.TestCase)
914           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i],dt=dt),taus[i])           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i],dt=dt),taus[i])
915    
916  class Test_IncompressibleIsotropicFlowCartesian(unittest.TestCase):  class Test_IncompressibleIsotropicFlowCartesian(unittest.TestCase):
917     TOL=1.e-6     TOL=1.e-5
918     VERBOSE=False or True     VERBOSE=False # or True
919     A=1.     A=1.
920     P_max=100     P_max=100
921     NE=2*getMPISizeWorld()     NE=2*getMPISizeWorld()
# Line 967  class Test_IncompressibleIsotropicFlowCa Line 967  class Test_IncompressibleIsotropicFlowCa
967        mod.setElasticShearModulus(self.mu)        mod.setElasticShearModulus(self.mu)
968        mod.setPowerLaws([self.eta_0, self.eta_1, self.eta_2], [ 1., self.tau_1, self.tau_2],  [1.,self.N_1,self.N_2])        mod.setPowerLaws([self.eta_0, self.eta_1, self.eta_2], [ 1., self.tau_1, self.tau_2],  [1.,self.N_1,self.N_2])
969        mod.setTolerance(self.TOL)        mod.setTolerance(self.TOL)
970        mod.setEtaTolerance(self.TOL*1.e-3)        mod.setEtaTolerance(self.TOL*0.1)
971    
972        BF=Vector(self.P_max,Function(self.dom))        BF=Vector(self.P_max,Function(self.dom))
973        for d in range(self.dom.getDim()):        for d in range(self.dom.getDim()):
# Line 1006  class Test_IncompressibleIsotropicFlowCa Line 1006  class Test_IncompressibleIsotropicFlowCa
1006           error_v=Lsup(mod.getVelocity()-v_ref)/Lsup(v_ref)           error_v=Lsup(mod.getVelocity()-v_ref)/Lsup(v_ref)
1007           error_t=abs(mod.getTime()-t_ref)/abs(t_ref)           error_t=abs(mod.getTime()-t_ref)/abs(t_ref)
1008           if self.VERBOSE: print "time step ",N_t,"time = ",mod.getTime(),"errors s,p,v = ",error_s, error_p, error_v           if self.VERBOSE: print "time step ",N_t,"time = ",mod.getTime(),"errors s,p,v = ",error_s, error_p, error_v
1009           self.failUnless( error_p <= 80*self.TOL, "time step %s: pressure error %s too high."%(N_t,error_p) )           self.failUnless( error_p <= 10*self.TOL, "time step %s: pressure error %s too high."%(N_t,error_p) )
1010           self.failUnless( error_v <= 80*self.TOL, "time step %s: velocity error %s too high."%(N_t,error_v) )           self.failUnless( error_v <= 10*self.TOL, "time step %s: velocity error %s too high."%(N_t,error_v) )
1011           self.failUnless( error_t <= 80*self.TOL, "time step %s: time marker error %s too high."%(N_t,error_t) )           self.failUnless( error_t <= 10*self.TOL, "time step %s: time marker error %s too high."%(N_t,error_t) )
1012           self.failUnless( error_s <= 99*self.TOL, "time step %s: stress error %s too high."%(N_t,error_s) )           self.failUnless( error_s <= 10*self.TOL, "time step %s: stress error %s too high."%(N_t,error_s) )
1013     def tearDown(self):     def tearDown(self):
1014          del self.dom          del self.dom
1015    
# Line 1744  if __name__ == '__main__': Line 1744  if __name__ == '__main__':
1744     suite.addTest(unittest.makeSuite(Test_Mountains3D))     suite.addTest(unittest.makeSuite(Test_Mountains3D))
1745     suite.addTest(unittest.makeSuite(Test_Mountains2D))     suite.addTest(unittest.makeSuite(Test_Mountains2D))
1746     suite.addTest(unittest.makeSuite(Test_Rheologies))     suite.addTest(unittest.makeSuite(Test_Rheologies))
1747     # suite.addTest(Test_IncompressibleIsotropicFlowCartesian("test_D2_Fixed_Mu"))     # suite.addTest(Test_IncompressibleIsotropicFlowCartesian("test_D2_Fixed_MuNone"))
1748     # suite.addTest(unittest.makeSuite(Test_IncompressibleIsotropicFlowCartesian))     suite.addTest(unittest.makeSuite(Test_IncompressibleIsotropicFlowCartesian))
1749     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
1750     if not s.wasSuccessful(): sys.exit(1)     if not s.wasSuccessful(): sys.exit(1)
1751    

Legend:
Removed from v.2849  
changed lines
  Added in v.2850

  ViewVC Help
Powered by ViewVC 1.1.26