/[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 3551 by jfenwick, Fri Aug 19 03:53:41 2011 UTC revision 3772 by jfenwick, Wed Jan 18 04:19:33 2012 UTC
# Line 550  class Test_Rheologies(unittest.TestCase) Line 550  class Test_Rheologies(unittest.TestCase)
550           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
551           pl.setPowerLaw(eta_N=2.)           pl.setPowerLaw(eta_N=2.)
552           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
553           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
554                    
555       def test_PowerLaw_QuadLarge(self):       def test_PowerLaw_QuadLarge(self):
556           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 559  class Test_Rheologies(unittest.TestCase) Line 559  class Test_Rheologies(unittest.TestCase)
559           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
560           pl.setPowerLaws(eta_N=[2.,0.01],tau_t=[1, 25.], power=[1,2])           pl.setPowerLaws(eta_N=[2.,0.01],tau_t=[1, 25.], power=[1,2])
561           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
562           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
563    
564       def test_PowerLaw_QuadSmall(self):       def test_PowerLaw_QuadSmall(self):
565           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 568  class Test_Rheologies(unittest.TestCase) Line 568  class Test_Rheologies(unittest.TestCase)
568           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
569           pl.setPowerLaws(eta_N=[2.,10.],tau_t=[1, 25.], power=[1,2])           pl.setPowerLaws(eta_N=[2.,10.],tau_t=[1, 25.], power=[1,2])
570           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
571           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
572    
573       def test_PowerLaw_CubeLarge(self):       def test_PowerLaw_CubeLarge(self):
574           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 577  class Test_Rheologies(unittest.TestCase) Line 577  class Test_Rheologies(unittest.TestCase)
577           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
578           pl.setPowerLaws(eta_N=[2.,1./16.],tau_t=[1, 64.], power=[1,3])           pl.setPowerLaws(eta_N=[2.,1./16.],tau_t=[1, 64.], power=[1,3])
579           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
580           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
581    
582       def test_PowerLaw_CubeSmall(self):       def test_PowerLaw_CubeSmall(self):
583           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 586  class Test_Rheologies(unittest.TestCase) Line 586  class Test_Rheologies(unittest.TestCase)
586           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
587           pl.setPowerLaws(eta_N=[2.,25./4.],tau_t=[1, 64.], power=[1,3])           pl.setPowerLaws(eta_N=[2.,25./4.],tau_t=[1, 64.], power=[1,3])
588           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
589           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
590    
591       def test_PowerLaw_QuadLarge_CubeLarge(self):       def test_PowerLaw_QuadLarge_CubeLarge(self):
592           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 596  class Test_Rheologies(unittest.TestCase) Line 596  class Test_Rheologies(unittest.TestCase)
596           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
597           pl.setPowerLaws(eta_N=[2.,0.01,1./16.],tau_t=[1, 25.,64.], power=[1,2,3])           pl.setPowerLaws(eta_N=[2.,0.01,1./16.],tau_t=[1, 25.,64.], power=[1,2,3])
598           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
599           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
600    
601       def test_PowerLaw_QuadLarge_CubeSmall(self):       def test_PowerLaw_QuadLarge_CubeSmall(self):
602           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 606  class Test_Rheologies(unittest.TestCase) Line 606  class Test_Rheologies(unittest.TestCase)
606           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
607           pl.setPowerLaws(eta_N=[2.,0.01,25./4.],tau_t=[1, 25.,64.], power=[1,2,3])           pl.setPowerLaws(eta_N=[2.,0.01,25./4.],tau_t=[1, 25.,64.], power=[1,2,3])
608           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
609           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
610    
611       def test_PowerLaw_QuadSmall_CubeLarge(self):       def test_PowerLaw_QuadSmall_CubeLarge(self):
612           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 615  class Test_Rheologies(unittest.TestCase) Line 615  class Test_Rheologies(unittest.TestCase)
615           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
616           pl.setPowerLaws(eta_N=[2.,10.,1./16.],tau_t=[1, 25.,64.], power=[1,2,3])           pl.setPowerLaws(eta_N=[2.,10.,1./16.],tau_t=[1, 25.,64.], power=[1,2,3])
617           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
618           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
619    
620       def test_PowerLaw_QuadSmall_CubeSmall(self):       def test_PowerLaw_QuadSmall_CubeSmall(self):
621           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 624  class Test_Rheologies(unittest.TestCase) Line 624  class Test_Rheologies(unittest.TestCase)
624           pl.setDruckerPragerLaw(tau_Y=100.)           pl.setDruckerPragerLaw(tau_Y=100.)
625           pl.setPowerLaws(eta_N=[2.,10.,25./4.],tau_t=[1, 25.,64.], power=[1,2,3])           pl.setPowerLaws(eta_N=[2.,10.,25./4.],tau_t=[1, 25.,64.], power=[1,2,3])
626           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
627           for i in xrange(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])           for i in range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i]),taus[i])
628    
629       def test_PowerLaw_withShear(self):       def test_PowerLaw_withShear(self):
630           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]           taus=[0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
# Line 636  class Test_Rheologies(unittest.TestCase) Line 636  class Test_Rheologies(unittest.TestCase)
636           dt=1./3.           dt=1./3.
637           pl.setEtaTolerance(self.TOL)           pl.setEtaTolerance(self.TOL)
638           self.assertRaises(ValueError, pl.getEtaEff,gamma_dot_s[0])           self.assertRaises(ValueError, pl.getEtaEff,gamma_dot_s[0])
639           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 range(len(taus)): self.checkResult(i,gamma_dot_s[i], pl.getEtaEff(gamma_dot_s[i],dt=dt),taus[i])
640    
641  class Test_IncompressibleIsotropicFlowCartesian(unittest.TestCase):  class Test_IncompressibleIsotropicFlowCartesian(unittest.TestCase):
642     TOL=1.e-5     TOL=1.e-5
# Line 680  class Test_IncompressibleIsotropicFlowCa Line 680  class Test_IncompressibleIsotropicFlowCa
680        x=self.dom.getX()        x=self.dom.getX()
681        B=self.tau_Y/sqrt((self.dom.getDim()-1)*self.dom.getDim()*0.5)        B=self.tau_Y/sqrt((self.dom.getDim()-1)*self.dom.getDim()*0.5)
682        dt=B/int(self.N_dt/2)        dt=B/int(self.N_dt/2)
683        if self.VERBOSE: print "dt =",dt        if self.VERBOSE: print("dt =",dt)
684        if self.latestart:        if self.latestart:
685            t=dt            t=dt
686        else:        else:
# Line 730  class Test_IncompressibleIsotropicFlowCa Line 730  class Test_IncompressibleIsotropicFlowCa
730           error_s=Lsup(mod.getDeviatoricStress()-s_ref)/Lsup(s_ref)           error_s=Lsup(mod.getDeviatoricStress()-s_ref)/Lsup(s_ref)
731           error_v=Lsup(mod.getVelocity()-v_ref)/Lsup(v_ref)           error_v=Lsup(mod.getVelocity()-v_ref)/Lsup(v_ref)
732           error_t=abs(mod.getTime()-t_ref)/abs(t_ref)           error_t=abs(mod.getTime()-t_ref)/abs(t_ref)
733           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)
734           self.assertTrue( error_p <= 10*self.TOL, "time step %s: pressure error %s too high."%(N_t,error_p) )           self.assertTrue( error_p <= 10*self.TOL, "time step %s: pressure error %s too high."%(N_t,error_p) )
735           self.assertTrue( error_v <= 10*self.TOL, "time step %s: velocity error %s too high."%(N_t,error_v) )           self.assertTrue( error_v <= 10*self.TOL, "time step %s: velocity error %s too high."%(N_t,error_v) )
736           self.assertTrue( error_t <= 10*self.TOL, "time step %s: time marker error %s too high."%(N_t,error_t) )           self.assertTrue( error_t <= 10*self.TOL, "time step %s: time marker error %s too high."%(N_t,error_t) )

Legend:
Removed from v.3551  
changed lines
  Added in v.3772

  ViewVC Help
Powered by ViewVC 1.1.26