/[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 2251 by gross, Fri Feb 6 06:50:39 2009 UTC revision 2264 by gross, Wed Feb 11 06:48:28 2009 UTC
# Line 464  class Test_Darcy(unittest.TestCase): Line 464  class Test_Darcy(unittest.TestCase):
464                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
465                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
466                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
467          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
468          v,p=df.solve(u_ref,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
469            v,p=df.solve(u_ref,p, max_iter=100, verbose=VERBOSE)
470          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
471          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
   
472      def testConstF_FixedBottom_mediumK(self):      def testConstF_FixedBottom_mediumK(self):
473          k=1.          k=1.
474          mp=self.getScalarMask(include_bottom=True)          mp=self.getScalarMask(include_bottom=True)
# Line 481  class Test_Darcy(unittest.TestCase): Line 481  class Test_Darcy(unittest.TestCase):
481                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
482                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
483                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
484          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
485          v,p=df.solve(u,p,max_iter=100, verbose=VERBOSE ,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
486            v,p=df.solve(u,p,max_iter=100, verbose=VERBOSE )
487          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
488          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
489    
# Line 498  class Test_Darcy(unittest.TestCase): Line 499  class Test_Darcy(unittest.TestCase):
499                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
500                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
501                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
502          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
503          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
504            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
505          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
506          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
507    
# Line 515  class Test_Darcy(unittest.TestCase): Line 517  class Test_Darcy(unittest.TestCase):
517                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
518                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
519                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
520          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
521          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
522            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
523          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
524          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
525    
# Line 532  class Test_Darcy(unittest.TestCase): Line 535  class Test_Darcy(unittest.TestCase):
535                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
536                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
537                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
538          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
539          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
540            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
541          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
542          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
543    
# Line 549  class Test_Darcy(unittest.TestCase): Line 553  class Test_Darcy(unittest.TestCase):
553                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
554                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
555                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
556          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
557          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
558            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
559          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
560          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
561    
# Line 566  class Test_Darcy(unittest.TestCase): Line 571  class Test_Darcy(unittest.TestCase):
571                      location_of_fixed_pressure=mp,                      location_of_fixed_pressure=mp,
572                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
573                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
574          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
575          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
576            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
577          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
578          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
579    
# Line 583  class Test_Darcy(unittest.TestCase): Line 589  class Test_Darcy(unittest.TestCase):
589                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
590                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
591                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
592          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
593          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
594            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
595          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
596          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
597    
# Line 600  class Test_Darcy(unittest.TestCase): Line 607  class Test_Darcy(unittest.TestCase):
607                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
608                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
609                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
610          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
611          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
612            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
613          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
614          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
615    
# Line 617  class Test_Darcy(unittest.TestCase): Line 625  class Test_Darcy(unittest.TestCase):
625                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
626                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
627                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
628          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
629          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
630            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
631          self.failUnless(Lsup(v-u_ref)<self.TOL*25.*Lsup(u_ref), "flux error too big.")  # 25 because of disc. error.          self.failUnless(Lsup(v-u_ref)<self.TOL*25.*Lsup(u_ref), "flux error too big.")  # 25 because of disc. error.
632          self.failUnless(Lsup(p-p_ref)<self.TOL*25.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*25.*Lsup(p_ref), "pressure error too big.")
633    
# Line 634  class Test_Darcy(unittest.TestCase): Line 643  class Test_Darcy(unittest.TestCase):
643                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
644                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
645                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
646          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
647          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
648            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
649          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
650          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
651    
# Line 651  class Test_Darcy(unittest.TestCase): Line 661  class Test_Darcy(unittest.TestCase):
661                        location_of_fixed_pressure=mp,                        location_of_fixed_pressure=mp,
662                        location_of_fixed_flux=mv,                        location_of_fixed_flux=mv,
663                        permeability=Scalar(k,Function(self.dom)))                        permeability=Scalar(k,Function(self.dom)))
664          df.setTolerance(rtol=self.TOL,p_ref=p_ref,v_ref=u_ref)          df.setTolerance(rtol=self.TOL)
665          v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE,sub_rtol=self.TOL/200)          df.setSubProblemTolerance()
666            v,p=df.solve(u,p, max_iter=100, verbose=VERBOSE)
667          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")          self.failUnless(Lsup(v-u_ref)<self.TOL*10.*Lsup(u_ref), "flux error too big.")
668          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")          self.failUnless(Lsup(p-p_ref)<self.TOL*10.*Lsup(p_ref), "pressure error too big.")
669    

Legend:
Removed from v.2251  
changed lines
  Added in v.2264

  ViewVC Help
Powered by ViewVC 1.1.26