/[escript]/trunk/escript/py_src/test_linearPDEs.py
ViewVC logotype

Diff of /trunk/escript/py_src/test_linearPDEs.py

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

revision 530 by gross, Tue Dec 20 00:37:20 2005 UTC revision 531 by gross, Wed Feb 15 08:11:10 2006 UTC
# Line 531  class Test_LinearPDE(Test_linearPDEs): Line 531  class Test_LinearPDE(Test_linearPDEs):
531         mypde.setSolverMethod(mypde.LUMPING)         mypde.setSolverMethod(mypde.LUMPING)
532             mypde.setValue(A=kronecker(self.domain))             mypde.setValue(A=kronecker(self.domain))
533             u=mypde.getSolution(verbose=self.VERBOSE)             u=mypde.getSolution(verbose=self.VERBOSE)
534          except Warning:          except ValueError:
535             success=False             success=False
536          self.failUnless(not success,'warning should be issued')          self.failUnless(not success,'error should be issued')
537      def test_Lumping_attemptToSetB(self):      def test_Lumping_attemptToSetB(self):
538          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
539          try:          try:
# Line 541  class Test_LinearPDE(Test_linearPDEs): Line 541  class Test_LinearPDE(Test_linearPDEs):
541         mypde.setSolverMethod(mypde.LUMPING)         mypde.setSolverMethod(mypde.LUMPING)
542             mypde.setValue(B=kronecker(self.domain)[0])             mypde.setValue(B=kronecker(self.domain)[0])
543             u=mypde.getSolution(verbose=self.VERBOSE)             u=mypde.getSolution(verbose=self.VERBOSE)
544          except Warning:          except ValueError:
545             success=False             success=False
546          self.failUnless(not success,'warning should be issued')          self.failUnless(not success,'error should be issued')
547      def test_Lumping_attemptToSetC(self):      def test_Lumping_attemptToSetC(self):
548          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
549          try:          try:
# Line 551  class Test_LinearPDE(Test_linearPDEs): Line 551  class Test_LinearPDE(Test_linearPDEs):
551         mypde.setSolverMethod(mypde.LUMPING)         mypde.setSolverMethod(mypde.LUMPING)
552             mypde.setValue(C=kronecker(self.domain)[0])             mypde.setValue(C=kronecker(self.domain)[0])
553             u=mypde.getSolution(verbose=self.VERBOSE)             u=mypde.getSolution(verbose=self.VERBOSE)
554          except Warning:          except ValueError:
555             success=False             success=False
556          self.failUnless(not success,'warning should be issued')          self.failUnless(not success,'error should be issued')
557                    
558      def test_Lumping(self):      def test_Lumping(self):
559          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 568  class Test_LinearPDE(Test_linearPDEs): Line 568  class Test_LinearPDE(Test_linearPDEs):
568          mypde.setValue(D=1.,Y=1.,q=whereZero(x[0]),r=1.)          mypde.setValue(D=1.,Y=1.,q=whereZero(x[0]),r=1.)
569          u=mypde.getSolution(verbose=self.VERBOSE)          u=mypde.getSolution(verbose=self.VERBOSE)
570          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
571    
572        def test_Lumping_System(self):
573            mypde=LinearPDE(self.domain,debug=self.DEBUG)
574        mypde.setSolverMethod(mypde.LUMPING)
575            mypde.setValue(D=numarray.array([[1.,0.],[0.,2.]]),Y=numarray.array([1.,2.]))
576            u=mypde.getSolution(verbose=self.VERBOSE)
577            self.failUnless(self.check(u,numarray.ones((2,))),'solution is wrong.')
578        def test_Constrained_Lumping_System(self):
579            x=self.domain.getX()
580            mypde=LinearPDE(self.domain,debug=self.DEBUG)
581        mypde.setSolverMethod(mypde.LUMPING)
582            mypde.setValue(D=numarray.array([[1.,0.],[0.,2.]]),Y=numarray.array([1.,2.]), \
583                           q=whereZero(x[0])*[0.,1],r=[0.,1.])
584            u=mypde.getSolution(verbose=self.VERBOSE)
585            self.failUnless(self.check(u,numarray.ones((2,))),'solution is wrong.')
586    
587      def test_Lumping_updateRHS(self):      def test_Lumping_updateRHS(self):
588          x=self.domain.getX()          x=self.domain.getX()
589          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)

Legend:
Removed from v.530  
changed lines
  Added in v.531

  ViewVC Help
Powered by ViewVC 1.1.26