/[escript]/trunk/escriptcore/test/python/test_linearPDEs.py
ViewVC logotype

Diff of /trunk/escriptcore/test/python/test_linearPDEs.py

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

revision 2470 by gross, Thu Jun 11 08:32:32 2009 UTC revision 2995 by artak, Tue Mar 23 06:14:26 2010 UTC
# Line 1  Line 1 
1    
2  ########################################################  ########################################################
3  #  #
4  # Copyright (c) 2003-2008 by University of Queensland  # Copyright (c) 2003-2010 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
6  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
7  #  #
# Line 11  Line 11 
11  #  #
12  ########################################################  ########################################################
13    
14  __copyright__="""Copyright (c) 2003-2008 by University of Queensland  __copyright__="""Copyright (c) 2003-2010 by University of Queensland
15  Earth Systems Science Computational Center (ESSCC)  Earth Systems Science Computational Center (ESSCC)
16  http://www.uq.edu.au/esscc  http://www.uq.edu.au/esscc
17  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
# Line 34  The tests must be linked with a Domain c Line 34  The tests must be linked with a Domain c
34     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley))
35     unittest.TextTestRunner(verbosity=2).run(suite)     unittest.TextTestRunner(verbosity=2).run(suite)
36    
37  @var __author__: name of author  :var __author__: name of author
38  @var __copyright__: copyrights  :var __copyright__: copyrights
39  @var __license__: licence agreement  :var __license__: licence agreement
40  @var __url__: url entry point on documentation  :var __url__: url entry point on documentation
41  @var __version__: version  :var __version__: version
42  @var __date__: date of the version  :var __date__: date of the version
43  """  """
44    
45  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
# Line 57  class Test_linearPDEs(unittest.TestCase) Line 57  class Test_linearPDEs(unittest.TestCase)
57      VERBOSE=False      VERBOSE=False
58      def check(self,arg,ref_arg,tol=None):      def check(self,arg,ref_arg,tol=None):
59          """          """
60          checks if arg and ref_arg are nearly identical using the L{Lsup<esys.escript.util.Lsup>}          checks if arg and ref_arg are nearly identical using the `Lsup`
61          """          """
62          if tol==None: tol=self.TOL          if tol==None: tol=self.TOL
63          return Lsup(arg-ref_arg)<=tol*Lsup(ref_arg)          return Lsup(arg-ref_arg)<=tol*Lsup(ref_arg)
# Line 67  class Test_LameEquation(Test_linearPDEs) Line 67  class Test_LameEquation(Test_linearPDEs)
67      def test_config(self):      def test_config(self):
68          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
69          d=self.domain.getDim()          d=self.domain.getDim()
70          self.failUnlessEqual((mypde.getNumEquations(),mypde.getNumSolutions(),mypde.isSymmetric()),(d,d,True),"set up incorrect")          self.failUnlessEqual((mypde.getNumEquations(), mypde.getNumSolutions(), mypde.getSolverOptions().isSymmetric()),(d,d,True),"set up incorrect")
71    
72      def test_setCoefficient_q(self):      def test_setCoefficient_q(self):
73          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
# Line 330  class Test_Helmholtz(Test_linearPDEs): Line 330  class Test_Helmholtz(Test_linearPDEs):
330    
331      def test_config(self):      def test_config(self):
332          mypde=Helmholtz(self.domain,debug=self.DEBUG)          mypde=Helmholtz(self.domain,debug=self.DEBUG)
333          self.failUnlessEqual((mypde.getNumEquations(),mypde.getNumSolutions(),mypde.isSymmetric()),(1,1,True),"set up incorrect")          self.failUnlessEqual((mypde.getNumEquations(), mypde.getNumSolutions(), mypde.getSolverOptions().isSymmetric()),(1,1,True),"set up incorrect")
334      def test_setCoefficient_q(self):      def test_setCoefficient_q(self):
335          mypde=Helmholtz(self.domain,debug=self.DEBUG)          mypde=Helmholtz(self.domain,debug=self.DEBUG)
336          x=self.domain.getX()          x=self.domain.getX()
# Line 526  class Test_Poisson(Test_linearPDEs): Line 526  class Test_Poisson(Test_linearPDEs):
526    
527      def test_config(self):      def test_config(self):
528          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
529          self.failUnlessEqual((mypde.getNumEquations(),mypde.getNumSolutions(),mypde.isSymmetric()),(1,1,True),"set up incorrect")          self.failUnlessEqual((mypde.getNumEquations(), mypde.getNumSolutions(), mypde.getSolverOptions().isSymmetric()),(1,1,True),"set up incorrect")
530      def test_setCoefficient_q(self):      def test_setCoefficient_q(self):
531          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
532          x=self.domain.getX()          x=self.domain.getX()
# Line 642  class Test_LinearPDE_noLumping(Test_line Line 642  class Test_LinearPDE_noLumping(Test_line
642      N=4      N=4
643      def test_SolverOptions(self):      def test_SolverOptions(self):
644          so=SolverOptions()          so=SolverOptions()
645            
646            self.failUnless(so.getSmoother() == 28, "initial Smoother is wrong.")
647            self.failUnlessRaises(ValueError,so.setSmoother,-1)
648            so.setSmoother(so.GAUSS_SEIDEL)
649            self.failUnless(so.getSmoother() == 28, "Gauss-Seidel smoother is not set.")
650            so.setSmoother(so.JACOBI)
651            self.failUnless(so.getSmoother() == 10, "Jacobi smoother is not set.")
652    
653          self.failUnless(so.getLevelMax() == 10, "initial  LevelMax is wrong.")          self.failUnless(so.getLevelMax() == 5, "initial  LevelMax is wrong.")
654          self.failUnlessRaises(ValueError,so.setLevelMax,-1)          self.failUnlessRaises(ValueError,so.setLevelMax,-1)
655          so.setLevelMax(3)          so.setLevelMax(20)
656          self.failUnless(so.getLevelMax() == 3, "LevelMax is wrong.")          self.failUnless(so.getLevelMax() == 20, "LevelMax is wrong.")
657    
658          self.failUnless(so.getCoarseningThreshold() == 0.05, "initial  CoarseningThreshold is wrong.")          self.failUnless(so.getCoarseningThreshold() == 0.25, "initial  CoarseningThreshold is wrong.")
659          self.failUnlessRaises(ValueError,so.setCoarseningThreshold,-1)          self.failUnlessRaises(ValueError,so.setCoarseningThreshold,-1)
660          so.setCoarseningThreshold(0.1)          so.setCoarseningThreshold(0.1)
661          self.failUnless(so.getCoarseningThreshold() == 0.1, "CoarseningThreshold is wrong.")          self.failUnless(so.getCoarseningThreshold() == 0.1, "CoarseningThreshold is wrong.")
662            
663            self.failUnless(so.getMinCoarseMatrixSize() == 500, "initial  Minimum Coarse Matrix Size is wrong.")
664            self.failUnlessRaises(ValueError,so.setMinCoarseMatrixSize,-1)
665            so.setMinCoarseMatrixSize(1000)
666            self.failUnless(so.getMinCoarseMatrixSize() == 1000, "Minimum Coarse Matrix Size is wrong.")
667    
668          self.failUnless(so.getNumSweeps() == 2, "initial  Sweeps is wrong.")          self.failUnless(so.getNumSweeps() == 2, "initial  Sweeps is wrong.")
669          self.failUnlessRaises(ValueError,so.setNumSweeps,-1)          self.failUnlessRaises(ValueError,so.setNumSweeps,-1)
# Line 699  class Test_LinearPDE_noLumping(Test_line Line 711  class Test_LinearPDE_noLumping(Test_line
711          self.failUnless(so.getRelaxationFactor() == 0.1, "Relaxation is wrong.")          self.failUnless(so.getRelaxationFactor() == 0.1, "Relaxation is wrong.")
712    
713    
714          self.failUnless(so.getIterMax() == 10000, "initial IterMax is wrong.")          self.failUnless(so.getIterMax() == 100000, "initial IterMax is wrong.")
715          self.failUnlessRaises(ValueError,so.setIterMax,0)          self.failUnlessRaises(ValueError,so.setIterMax,0)
716          so.setIterMax(11)          so.setIterMax(11)
717          self.failUnless(so.getIterMax() == 11, "IterMax is wrong.")          self.failUnless(so.getIterMax() == 11, "IterMax is wrong.")
# Line 720  class Test_LinearPDE_noLumping(Test_line Line 732  class Test_LinearPDE_noLumping(Test_line
732          self.failUnless(so.getRestart() == 14, "Truncation is wrong.")          self.failUnless(so.getRestart() == 14, "Truncation is wrong.")
733          so.setRestart(None)          so.setRestart(None)
734          self.failUnless(so.getRestart() == None, "Truncation is wrong.")          self.failUnless(so.getRestart() == None, "Truncation is wrong.")
735            
736            self.failUnless(not so.isVerbose(), "initial verbosity flag is wrong.")
737            so.setVerbosityOn()
738            self.failUnless(so.isVerbose(), "verbosity (1) flag is wrong.")
739            so.setVerbosityOff()
740            self.failUnless(not so.isVerbose(), "verbosity (2) flag is wrong.")
741            so.setVerbosity(verbose=True)
742            self.failUnless(so.isVerbose(), "verbosity (3) flag is wrong.")
743            so.setVerbosity(verbose=False)
744            self.failUnless(not so.isVerbose(), "verbosity (4) flag is wrong.")
745    
746          self.failUnless(not so.isSymmetric(), "initial symmetry flag is wrong.")          self.failUnless(not so.isSymmetric(), "initial symmetry flag is wrong.")
747          so.setSymmetryOn()          so.setSymmetryOn()
748          self.failUnless(so.isSymmetric(), "symmetry (1) flag is wrong.")          self.failUnless(so.isSymmetric(), "symmetry (1) flag is wrong.")
# Line 809  class Test_LinearPDE_noLumping(Test_line Line 831  class Test_LinearPDE_noLumping(Test_line
831          self.failUnless(so.getSolverMethod() == 26, "TFQMR is not set.")          self.failUnless(so.getSolverMethod() == 26, "TFQMR is not set.")
832          so.setSolverMethod(so.MINRES)          so.setSolverMethod(so.MINRES)
833          self.failUnless(so.getSolverMethod() == 27, "MINRES is not set.")          self.failUnless(so.getSolverMethod() == 27, "MINRES is not set.")
         so.setSolverMethod(so.GAUSS_SEIDEL)  
         self.failUnless(so.getSolverMethod() == 28, "GAUSS_SEIDEL is not set.")  
834          so.setSolverMethod(so.DEFAULT)          so.setSolverMethod(so.DEFAULT)
835          self.failUnless(so.getSolverMethod() == 0, "DEFAULT is not set.")          self.failUnless(so.getSolverMethod() == 0, "DEFAULT is not set.")
836    
# Line 843  class Test_LinearPDE_noLumping(Test_line Line 863  class Test_LinearPDE_noLumping(Test_line
863          self.failUnless(so.getCoarsening() == 34, "RUGE_STUEBEN_COARSENING is not set.")          self.failUnless(so.getCoarsening() == 34, "RUGE_STUEBEN_COARSENING is not set.")
864          so.setCoarsening(so.AGGREGATION_COARSENING)          so.setCoarsening(so.AGGREGATION_COARSENING)
865          self.failUnless(so.getCoarsening() == 35, "AGREGATION_COARSENING is not set.")          self.failUnless(so.getCoarsening() == 35, "AGREGATION_COARSENING is not set.")
866            so.setCoarsening(so.STANDARD_COARSENING)
867            self.failUnless(so.getCoarsening() == 39, "STANDARD_COARSENING is not set.")
868          so.setCoarsening(so.DEFAULT)          so.setCoarsening(so.DEFAULT)
869          self.failUnless(so.getCoarsening() == 0, "DEFAULT is not set.")          self.failUnless(so.getCoarsening() == 0, "DEFAULT is not set.")
870    
# Line 924  class Test_LinearPDE_noLumping(Test_line Line 946  class Test_LinearPDE_noLumping(Test_line
946                    
947      def test_setCoefficient_WithIllegalFunctionSpace(self):      def test_setCoefficient_WithIllegalFunctionSpace(self):
948          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
949          self.failUnlessRaises(IllegalCoefficientFunctionSpace,mypde.setValue, C=Vector(0.,FunctionOnBoundary(self.domain)))          self.failUnlessRaises(IllegalCoefficientFunctionSpace, mypde.setValue, C=Vector(0.,FunctionOnBoundary(self.domain)))
950    
951      def test_setCoefficient_WithWrongName(self):      def test_setCoefficient_WithWrongName(self):
952          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 945  class Test_LinearPDE_noLumping(Test_line Line 967  class Test_LinearPDE_noLumping(Test_line
967      def test_attemptToChangeOrderAfterDefinedCoefficient(self):      def test_attemptToChangeOrderAfterDefinedCoefficient(self):
968          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
969          mypde.setValue(D=1.)          mypde.setValue(D=1.)
970          self.failUnlessRaises(RuntimeError,mypde.setReducedOrderOn)          self.failUnlessRaises(RuntimeError, mypde.setReducedOrderOn)
971    
972      def test_reducedOnConfig(self):      def test_reducedOnConfig(self):
973          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
974          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
975          self.failUnlessEqual((mypde.getFunctionSpaceForSolution(),mypde.getFunctionSpaceForEquation()),(ReducedSolution(self.domain),ReducedSolution(self.domain)),"reduced function spaces expected.")          self.failUnlessEqual((mypde.getFunctionSpaceForSolution(), mypde.getFunctionSpaceForEquation()),(ReducedSolution(self.domain),ReducedSolution(self.domain)),"reduced function spaces expected.")
976      #      #
977      #  set coefficients for scalars:      #  set coefficients for scalars:
978      #      #
# Line 959  class Test_LinearPDE_noLumping(Test_line Line 981  class Test_LinearPDE_noLumping(Test_line
981          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
982          mypde.setValue(A=numpy.ones((d,d)))          mypde.setValue(A=numpy.ones((d,d)))
983          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
984          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,d),Function(self.domain),1,1))
985      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(self):
986          d=self.domain.getDim()          d=self.domain.getDim()
987          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
988          mypde.setValue(B=numpy.ones((d,)))          mypde.setValue(B=numpy.ones((d,)))
989          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
990          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),Function(self.domain),1,1))
991      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
992          d=self.domain.getDim()          d=self.domain.getDim()
993          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
994          mypde.setValue(C=numpy.ones((d,)))          mypde.setValue(C=numpy.ones((d,)))
995          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
996          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),Function(self.domain),1,1))
997      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
998          d=self.domain.getDim()          d=self.domain.getDim()
999          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1000          mypde.setValue(D=1.)          mypde.setValue(D=1.)
1001          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
1002          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),Function(self.domain),1,1))
1003      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(self):
1004          d=self.domain.getDim()          d=self.domain.getDim()
1005          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1006          mypde.setValue(X=numpy.ones((d,)))          mypde.setValue(X=numpy.ones((d,)))
1007          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
1008          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),Function(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((d,),Function(self.domain),1))
1009      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
1010          d=self.domain.getDim()          d=self.domain.getDim()
1011          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1012          mypde.setValue(Y=1.)          mypde.setValue(Y=1.)
1013          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
1014          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),Function(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),Function(self.domain),1))
1015      def test_setCoefficient_y_Scalar(self):      def test_setCoefficient_y_Scalar(self):
1016          d=self.domain.getDim()          d=self.domain.getDim()
1017          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1018          mypde.setValue(y=1.)          mypde.setValue(y=1.)
1019          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
1020          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))
1021      def test_setCoefficient_d_Scalar(self):      def test_setCoefficient_d_Scalar(self):
1022          d=self.domain.getDim()          d=self.domain.getDim()
1023          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1024          mypde.setValue(d=1.)          mypde.setValue(d=1.)
1025          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1026          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
1027      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(self):
1028          d=self.domain.getDim()          d=self.domain.getDim()
1029          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1030          mypde.setValue(d_contact=1.)          mypde.setValue(d_contact=1.)
1031          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
1032          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))
1033      def test_setCoefficient_y_contact_Scalar(self):      def test_setCoefficient_y_contact_Scalar(self):
1034          d=self.domain.getDim()          d=self.domain.getDim()
1035          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1036          mypde.setValue(y_contact=1.)          mypde.setValue(y_contact=1.)
1037          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
1038          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))
1039      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
1040          d=self.domain.getDim()          d=self.domain.getDim()
1041          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1042          mypde.setValue(A_reduced=numpy.ones((d,d)))          mypde.setValue(A_reduced=numpy.ones((d,d)))
1043          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1044          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))
1045      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(self):
1046          d=self.domain.getDim()          d=self.domain.getDim()
1047          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1048          mypde.setValue(B_reduced=numpy.ones((d,)))          mypde.setValue(B_reduced=numpy.ones((d,)))
1049          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1050          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
1051      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(self):
1052          d=self.domain.getDim()          d=self.domain.getDim()
1053          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1054          mypde.setValue(C_reduced=numpy.ones((d,)))          mypde.setValue(C_reduced=numpy.ones((d,)))
1055          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1056          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
1057      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
1058          d=self.domain.getDim()          d=self.domain.getDim()
1059          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1060          mypde.setValue(D_reduced=1.)          mypde.setValue(D_reduced=1.)
1061          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1062          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
1063      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(self):
1064          d=self.domain.getDim()          d=self.domain.getDim()
1065          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1066          mypde.setValue(X_reduced=numpy.ones((d,)))          mypde.setValue(X_reduced=numpy.ones((d,)))
1067          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1068          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))
1069      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
1070          d=self.domain.getDim()          d=self.domain.getDim()
1071          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1072          mypde.setValue(Y_reduced=1.)          mypde.setValue(Y_reduced=1.)
1073          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1074          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
1075      def test_setCoefficient_y_reduced_Scalar(self):      def test_setCoefficient_y_reduced_Scalar(self):
1076          d=self.domain.getDim()          d=self.domain.getDim()
1077          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1078          mypde.setValue(y_reduced=1.)          mypde.setValue(y_reduced=1.)
1079          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1080          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
1081      def test_setCoefficient_d_reduced_Scalar(self):      def test_setCoefficient_d_reduced_Scalar(self):
1082          d=self.domain.getDim()          d=self.domain.getDim()
1083          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1084          mypde.setValue(d_reduced=1.)          mypde.setValue(d_reduced=1.)
1085          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1086          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
1087      def test_setCoefficient_d_contact_reduced_Scalar(self):      def test_setCoefficient_d_contact_reduced_Scalar(self):
1088          d=self.domain.getDim()          d=self.domain.getDim()
1089          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1090          mypde.setValue(d_contact_reduced=1.)          mypde.setValue(d_contact_reduced=1.)
1091          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1092          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
1093      def test_setCoefficient_y_contact_reduced_Scalar(self):      def test_setCoefficient_y_contact_reduced_Scalar(self):
1094          d=self.domain.getDim()          d=self.domain.getDim()
1095          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1096          mypde.setValue(y_contact_reduced=1.)          mypde.setValue(y_contact_reduced=1.)
1097          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1098          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
1099      def test_setCoefficient_r_Scalar(self):      def test_setCoefficient_r_Scalar(self):
1100          d=self.domain.getDim()          d=self.domain.getDim()
1101          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1102          mypde.setValue(r=1.)          mypde.setValue(r=1.)
1103          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1104          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),Solution(self.domain),1))
1105      def test_setCoefficient_q_Scalar(self):      def test_setCoefficient_q_Scalar(self):
1106          d=self.domain.getDim()          d=self.domain.getDim()
1107          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1108          mypde.setValue(q=1.)          mypde.setValue(q=1.)
1109          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1110          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),Solution(self.domain),1))
1111      def test_setCoefficient_r_Scalar_reducedOn(self):      def test_setCoefficient_r_Scalar_reducedOn(self):
1112          d=self.domain.getDim()          d=self.domain.getDim()
1113          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1114          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1115          mypde.setValue(r=1.)          mypde.setValue(r=1.)
1116          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1117          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
1118      def test_setCoefficient_q_Scalar_reducedOn(self):      def test_setCoefficient_q_Scalar_reducedOn(self):
1119          d=self.domain.getDim()          d=self.domain.getDim()
1120          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1121          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1122          mypde.setValue(q=1.)          mypde.setValue(q=1.)
1123          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1124          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
1125    
1126      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
1127          d=self.domain.getDim()          d=self.domain.getDim()
1128          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1129          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
1130          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1131          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))
1132      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
1133          d=self.domain.getDim()          d=self.domain.getDim()
1134          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1135          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1136          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1137          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
1138      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(self):
1139          d=self.domain.getDim()          d=self.domain.getDim()
1140          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1141          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1142          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1143          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
1144      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
1145          d=self.domain.getDim()          d=self.domain.getDim()
1146          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1147          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))
1148          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1149          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
1150      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
1151          d=self.domain.getDim()          d=self.domain.getDim()
1152          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1153          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1154          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1155          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))
1156      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
1157          d=self.domain.getDim()          d=self.domain.getDim()
1158          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1159          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))
1160          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1161          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
1162      def test_setCoefficient_y_reduced_Scalar_using_y(self):      def test_setCoefficient_y_reduced_Scalar_using_y(self):
1163          d=self.domain.getDim()          d=self.domain.getDim()
1164          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1165          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
1166          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1167          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
1168      def test_setCoefficient_d_reduced_Scalar_using_d(self):      def test_setCoefficient_d_reduced_Scalar_using_d(self):
1169          d=self.domain.getDim()          d=self.domain.getDim()
1170          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1171          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
1172          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1173          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
1174      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):
1175          d=self.domain.getDim()          d=self.domain.getDim()
1176          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1177          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1178          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1179          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
1180      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):
1181          d=self.domain.getDim()          d=self.domain.getDim()
1182          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1183          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1184          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1185          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
1186      #      #
1187      #  set coefficients for systems:      #  set coefficients for systems:
1188      #      #
# Line 1169  class Test_LinearPDE_noLumping(Test_line Line 1191  class Test_LinearPDE_noLumping(Test_line
1191          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1192          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))
1193          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
1194          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N,d),Function(self.domain),self.N,self.N))
1195      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
1196          d=self.domain.getDim()          d=self.domain.getDim()
1197          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1198          mypde.setValue(B=numpy.ones((self.N,d,self.N)))          mypde.setValue(B=numpy.ones((self.N,d,self.N)))
1199          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
1200          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N),Function(self.domain),self.N,self.N))
1201      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
1202          d=self.domain.getDim()          d=self.domain.getDim()
1203          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1204          mypde.setValue(C=numpy.ones((self.N,self.N,d)))          mypde.setValue(C=numpy.ones((self.N,self.N,d)))
1205          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
1206          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),Function(self.domain),self.N,self.N))
1207      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
1208          d=self.domain.getDim()          d=self.domain.getDim()
1209          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1210          mypde.setValue(D=numpy.ones((self.N,self.N)))          mypde.setValue(D=numpy.ones((self.N,self.N)))
1211          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
1212          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),Function(self.domain),self.N,self.N))
1213      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
1214          d=self.domain.getDim()          d=self.domain.getDim()
1215          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1216          mypde.setValue(X=numpy.ones((self.N,d)))          mypde.setValue(X=numpy.ones((self.N,d)))
1217          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
1218          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),Function(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),Function(self.domain),self.N))
1219      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
1220          d=self.domain.getDim()          d=self.domain.getDim()
1221          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1222          mypde.setValue(Y=numpy.ones((self.N,)))          mypde.setValue(Y=numpy.ones((self.N,)))
1223          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
1224          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),Function(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),Function(self.domain),self.N))
1225      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
1226          d=self.domain.getDim()          d=self.domain.getDim()
1227          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1228          mypde.setValue(y=numpy.ones((self.N,)))          mypde.setValue(y=numpy.ones((self.N,)))
1229          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
1230          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),FunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FunctionOnBoundary(self.domain),self.N))
1231      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
1232          d=self.domain.getDim()          d=self.domain.getDim()
1233          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1234          mypde.setValue(d=numpy.ones((self.N,self.N)))          mypde.setValue(d=numpy.ones((self.N,self.N)))
1235          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1236          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))
1237      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
1238          d=self.domain.getDim()          d=self.domain.getDim()
1239          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1240          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
1241          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
1242          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))
1243      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
1244          d=self.domain.getDim()          d=self.domain.getDim()
1245          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1246          mypde.setValue(y_contact=numpy.ones((self.N,)))          mypde.setValue(y_contact=numpy.ones((self.N,)))
1247          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
1248          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),FunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FunctionOnContactZero(self.domain),self.N))
1249      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
1250          d=self.domain.getDim()          d=self.domain.getDim()
1251          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1252          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))
1253          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1254          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))
1255      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
1256          d=self.domain.getDim()          d=self.domain.getDim()
1257          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1258          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))
1259          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1260          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))
1261      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
1262          d=self.domain.getDim()          d=self.domain.getDim()
1263          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1264          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))
1265          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1266          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))
1267      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(self):
1268          d=self.domain.getDim()          d=self.domain.getDim()
1269          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1270          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))
1271          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1272          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
1273      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
1274          d=self.domain.getDim()          d=self.domain.getDim()
1275          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1276          mypde.setValue(X_reduced=numpy.ones((self.N,d)))          mypde.setValue(X_reduced=numpy.ones((self.N,d)))
1277          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1278          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))
1279      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
1280          d=self.domain.getDim()          d=self.domain.getDim()
1281          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1282          mypde.setValue(Y_reduced=numpy.ones((self.N,)))          mypde.setValue(Y_reduced=numpy.ones((self.N,)))
1283          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1284          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))
1285      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
1286          d=self.domain.getDim()          d=self.domain.getDim()
1287          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1288          mypde.setValue(y_reduced=numpy.ones((self.N,)))          mypde.setValue(y_reduced=numpy.ones((self.N,)))
1289          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1290          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))
1291      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
1292          d=self.domain.getDim()          d=self.domain.getDim()
1293          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1294          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))
1295          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1296          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
1297      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
1298          d=self.domain.getDim()          d=self.domain.getDim()
1299          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1300          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
1301          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1302          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
1303      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
1304          d=self.domain.getDim()          d=self.domain.getDim()
1305          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1306          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
1307          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1308          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))
1309      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
1310          d=self.domain.getDim()          d=self.domain.getDim()
1311          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1312          mypde.setValue(r=numpy.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
1313          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1314          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))
1315      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
1316          d=self.domain.getDim()          d=self.domain.getDim()
1317          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1318          mypde.setValue(q=numpy.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
1319          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1320          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))
1321      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
1322          d=self.domain.getDim()          d=self.domain.getDim()
1323          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1324          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1325          mypde.setValue(r=numpy.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
1326          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1327          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))
1328      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
1329          d=self.domain.getDim()          d=self.domain.getDim()
1330          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1331          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1332          mypde.setValue(q=numpy.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
1333          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1334          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))
1335    
1336      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
1337          d=self.domain.getDim()          d=self.domain.getDim()
1338          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1339          mypde.setValue(A=Data(numpy.ones((self.N,d,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((self.N,d,self.N,d)),ReducedFunction(self.domain)))
1340          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1341          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))
1342      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
1343          d=self.domain.getDim()          d=self.domain.getDim()
1344          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1345          mypde.setValue(B=Data(numpy.ones((self.N,d,self.N)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((self.N,d,self.N)),ReducedFunction(self.domain)))
1346          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1347          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))
1348      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
1349          d=self.domain.getDim()          d=self.domain.getDim()
1350          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1351          mypde.setValue(C=Data(numpy.ones((self.N,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((self.N,self.N,d)),ReducedFunction(self.domain)))
1352          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1353          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))
1354      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
1355          d=self.domain.getDim()          d=self.domain.getDim()
1356          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1357          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
1358          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1359          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
1360      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
1361          d=self.domain.getDim()          d=self.domain.getDim()
1362          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1363          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
1364          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1365          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))
1366      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
1367          d=self.domain.getDim()          d=self.domain.getDim()
1368          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1369          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
1370          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1371          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))
1372      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
1373          d=self.domain.getDim()          d=self.domain.getDim()
1374          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1375          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
1376          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1377          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))
1378      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
1379          d=self.domain.getDim()          d=self.domain.getDim()
1380          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1381          mypde.setValue(d=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
1382          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1383          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
1384      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
1385          d=self.domain.getDim()          d=self.domain.getDim()
1386          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1387          mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))
1388          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1389          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
1390      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
1391          d=self.domain.getDim()          d=self.domain.getDim()
1392          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1393          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
1394          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1395          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))
1396      def test_resetCoefficient_HomogeneousConstraint(self):      def test_resetCoefficient_HomogeneousConstraint(self):
1397          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1398          x=self.domain.getX()          x=self.domain.getX()
# Line 1383  class Test_LinearPDE_noLumping(Test_line Line 1405  class Test_LinearPDE_noLumping(Test_line
1405      def test_resetCoefficient_InHomogeneousConstraint(self):      def test_resetCoefficient_InHomogeneousConstraint(self):
1406          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1407          mypde.setSymmetryOn()          mypde.setSymmetryOn()
1408        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1409          x=self.domain.getX()          x=self.domain.getX()
1410          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.,r=1,q=whereZero(x[0]))          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.,r=1,q=whereZero(x[0]))
1411          u1=mypde.getSolution(verbose=self.VERBOSE)          u1=mypde.getSolution()
1412          mypde.setValue(Y=2.,D=2)          mypde.setValue(Y=2.,D=2)
1413          u2=mypde.getSolution(verbose=self.VERBOSE)          u2=mypde.getSolution()
1414          self.failUnless(self.check(u2,u1),'first solution is wrong.')          self.failUnless(self.check(u2,u1),'first solution is wrong.')
1415          u2=mypde.getSolution(verbose=self.VERBOSE)          u2=mypde.getSolution()
1416          self.failUnless(self.check(u2,u1),'first solution is wrong.')          self.failUnless(self.check(u2,u1),'first solution is wrong.')
1417          mypde.setValue(r=2,Y=4.)          mypde.setValue(r=2,Y=4.)
1418          u2=mypde.getSolution(verbose=self.VERBOSE)          u2=mypde.getSolution()
1419          self.failUnless(self.check(u2,2*u1),'second solution is wrong.')          self.failUnless(self.check(u2,2*u1),'second solution is wrong.')
1420    
1421        def test_Status(self):
1422            DIM=self.domain.getDim()
1423            x=self.domain.getX()
1424            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1425            mypde.getSolverOptions().setSymmetryOn()
1426            mypde.getSolverOptions().setTolerance(self.RES_TOL)
1427            mypde.setValue(A=kronecker(self.domain), q=whereZero(x[0])+whereZero(x[0]-1.), Y=2.)
1428            x1=self.domain.getX()
1429            u1_ref=x1[0]*(1.-x1[0])
1430            u1=mypde.getSolution()
1431            error1=Lsup(u1-u1_ref)/Lsup(u1_ref)
1432            self.failUnless(mypde.getDomainStatus() == mypde.getSystemStatus(), "status of first pde does not match domain status.")
1433    
1434            self.domain.setX(x*5)
1435    
1436            self.failUnless(mypde.getDomainStatus() != mypde.getSystemStatus(), "status of first pde matches updated domain status.")
1437            x2=self.domain.getX()
1438            u2_ref=x2[0]*(5.-x2[0])
1439            u2=mypde.getSolution()
1440            error2=Lsup(u2-u2_ref)/Lsup(u2_ref)
1441            self.failUnless(error2 <= max(error1,self.RES_TOL)*10., "solution of second PDE wrong.")
1442            self.failUnless(mypde.getDomainStatus() == mypde.getSystemStatus(), "status of second pde does not match domain status.")
1443    
1444      def test_symmetryCheckTrue_System(self):      def test_symmetryCheckTrue_System(self):
1445          d=self.domain.getDim()          d=self.domain.getDim()
1446          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1529  class Test_LinearPDE_noLumping(Test_line Line 1575  class Test_LinearPDE_noLumping(Test_line
1575      def test_symmetryOnIterative(self):      def test_symmetryOnIterative(self):
1576          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1577          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1578          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1579            u=mypde.getSolution()
1580          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1581      def test_symmetryOnDirect(self):      def test_symmetryOnDirect(self):
1582          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1583          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1584          mypde.setSolverMethod(mypde.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1585          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1586            u=mypde.getSolution()
1587          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1588      def test_PCG_JACOBI(self):      def test_PCG_JACOBI(self):
1589          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1590          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1591          mypde.setSolverMethod(mypde.PCG,mypde.JACOBI)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1592          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1593        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1594            u=mypde.getSolution()
1595          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1596        def test_PCG_AMG(self):
1597            if self.order!=2:
1598                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1599                mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1600                mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1601                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1602                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1603                u=mypde.getSolution()
1604                self.failUnless(self.check(u,1.),'solution is wrong.')
1605      def test_PCG_ILU0(self):      def test_PCG_ILU0(self):
1606          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1607          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1608          mypde.setSolverMethod(mypde.PCG,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1609          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1610        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1611            u=mypde.getSolution()
1612          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1613      def test_PCG_RILU(self):      def test_PCG_RILU(self):
1614          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1615          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1616          mypde.setSolverMethod(mypde.PCG,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1617          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1618        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1619            u=mypde.getSolution()
1620            self.failUnless(self.check(u,1.),'solution is wrong.')
1621        def test_PCG_REC_ILU(self):
1622            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1623            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1624        mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1625        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1626        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1627            u=mypde.getSolution()
1628          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1629      def test_DIRECT(self):      def test_DIRECT(self):
1630          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1631          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1632          mypde.setSolverMethod(mypde.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1633          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1634            u=mypde.getSolution()
1635          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1636      def test_BICGSTAB_JACOBI(self):      def test_BICGSTAB_JACOBI(self):
1637          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1638      mypde.setSolverMethod(mypde.BICGSTAB,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1639        mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1640          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1641          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1642            u=mypde.getSolution()
1643          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1644        def test_BICGSTAB_AMG(self):
1645            if self.order!=2:
1646                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1647                mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1648                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1649                mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1650                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1651                u=mypde.getSolution()
1652                self.failUnless(self.check(u,1.),'solution is wrong.')
1653      def test_BICGSTAB_ILU0(self):      def test_BICGSTAB_ILU0(self):
1654          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1655          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1656      mypde.setSolverMethod(mypde.BICGSTAB,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1657          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1658            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1659            u=mypde.getSolution()
1660          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1661      def test_BICGSTAB_RILU(self):      def test_BICGSTAB_RILU(self):
1662          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1663          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1664      mypde.setSolverMethod(mypde.BICGSTAB,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1665          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1666            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1667            u=mypde.getSolution()
1668            self.failUnless(self.check(u,1.),'solution is wrong.')
1669        def test_BICGSTAB_REC_ILU(self):
1670            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1671            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1672        mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1673        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1674            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1675            u=mypde.getSolution()
1676          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1677      def test_MINRES_JACOBI(self):      def test_MINRES_JACOBI(self):
1678          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1679      mypde.setSolverMethod(mypde.MINRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1680        mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1681          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1682          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1683            u=mypde.getSolution()
1684          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1685        def test_MINRES_AMG(self):
1686            if self.order!=2:
1687                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1688                mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1689                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1690                mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1691                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1692                u=mypde.getSolution()
1693                self.failUnless(self.check(u,1.),'solution is wrong.')
1694      def test_MINRES_ILU0(self):      def test_MINRES_ILU0(self):
1695          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1696          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1697      mypde.setSolverMethod(mypde.MINRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1698          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1699            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1700            u=mypde.getSolution()
1701          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1702      def test_MINRES_RILU(self):      def test_MINRES_RILU(self):
1703          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1704          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1705      mypde.setSolverMethod(mypde.MINRES,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1706          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1707            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1708            u=mypde.getSolution()
1709            self.failUnless(self.check(u,1.),'solution is wrong.')
1710        def test_MINRES_REC_ILU(self):
1711            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1712            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1713        mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1714        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1715            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1716            u=mypde.getSolution()
1717          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1718      def test_TFQMR_JACOBI(self):      def test_TFQMR_JACOBI(self):
1719          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1720      mypde.setSolverMethod(mypde.TFQMR,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1721        mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1722          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1723          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1724            u=mypde.getSolution()
1725          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1726        def test_TFQMR_AMG(self):
1727            if self.order!=2:
1728                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1729                mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1730                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1731                mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1732                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1733                u=mypde.getSolution()
1734                self.failUnless(self.check(u,1.),'solution is wrong.')
1735      def test_TFQMR_ILU0(self):      def test_TFQMR_ILU0(self):
1736          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1737          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1738      mypde.setSolverMethod(mypde.TFQMR,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1739          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1740            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1741            u=mypde.getSolution()
1742          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1743      def test_TFQMR_RILU(self):      def test_TFQMR_RILU(self):
1744          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1745          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1746      mypde.setSolverMethod(mypde.TFQMR,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1747          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1748            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1749            u=mypde.getSolution()
1750            self.failUnless(self.check(u,1.),'solution is wrong.')
1751        def test_TFQMR_REC_ILU(self):
1752            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1753            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1754        mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1755        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1756            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1757            u=mypde.getSolution()
1758          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1759      def test_PRES20_JACOBI(self):      def test_PRES20_JACOBI(self):
1760          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1761          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1762      mypde.setSolverMethod(mypde.PRES20,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1763          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1764            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1765            u=mypde.getSolution()
1766          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1767        def test_PRES20_AMG(self):
1768            if self.order!=2:
1769                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1770                mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1771                mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1772                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1773                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1774                u=mypde.getSolution()
1775                self.failUnless(self.check(u,1.),'solution is wrong.')
1776      def test_PRES20_ILU0(self):      def test_PRES20_ILU0(self):
1777          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1778          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1779      mypde.setSolverMethod(mypde.PRES20,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1780          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1781            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1782            u=mypde.getSolution()
1783          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1784      def test_PRES20_RILU(self):      def test_PRES20_RILU(self):
1785          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1786          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1787      mypde.setSolverMethod(mypde.PRES20,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1788          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1789            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1790            u=mypde.getSolution()
1791            self.failUnless(self.check(u,1.),'solution is wrong.')
1792        def test_PRES20_REC_ILU(self):
1793            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1794            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1795        mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1796        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1797            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1798            u=mypde.getSolution()
1799          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1800      def test_GMRESnoRestart_JACOBI(self):      def test_GMRESnoRestart_JACOBI(self):
1801          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1802          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1803      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1804          u=mypde.getSolution(verbose=self.VERBOSE,truncation=50)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1805        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1806        mypde.getSolverOptions().setTruncation(50)
1807            u=mypde.getSolution()
1808          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1809        def test_GMRESnoRestart_AMG(self):
1810            if self.order!=2:
1811                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1812                mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1813                mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1814                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1815                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1816                mypde.getSolverOptions().setTruncation(50)
1817                u=mypde.getSolution()
1818                self.failUnless(self.check(u,1.),'solution is wrong.')
1819      def test_GMRESnoRestart_ILU0(self):      def test_GMRESnoRestart_ILU0(self):
1820          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1821          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1822      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1823          u=mypde.getSolution(verbose=self.VERBOSE,truncation=50)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1824          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1825        mypde.getSolverOptions().setTruncation(50)                        
1826            u=mypde.getSolution()
1827          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1828      def test_GMRESnoRestart_RILU(self):      def test_GMRESnoRestart_RILU(self):
1829          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1830          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1831      mypde.setSolverMethod(mypde.GMRES,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1832          u=mypde.getSolution(verbose=self.VERBOSE,truncation=50)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1833          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1834        mypde.getSolverOptions().setTruncation(50)
1835            u=mypde.getSolution()
1836            self.failUnless(self.check(u,1.),'solution is wrong.')
1837        def test_GMRESnoRestart_REC_ILU(self):
1838            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1839            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1840        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1841        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1842        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1843        mypde.getSolverOptions().setTruncation(50)
1844            u=mypde.getSolution()
1845          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1846      def test_GMRES_JACOBI(self):      def test_GMRES_JACOBI(self):
1847          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1848          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1849      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1850          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1851            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1852            u=mypde.getSolution()
1853          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1854        def test_GMRES_AMG(self):
1855            if self.order!=2:
1856                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1857                mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1858                mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1859                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1860                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1861                u=mypde.getSolution()
1862                self.failUnless(self.check(u,1.),'solution is wrong.')        
1863      def test_GMRES_ILU0(self):      def test_GMRES_ILU0(self):
1864          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1865          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1866      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1867          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1868            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1869            u=mypde.getSolution()
1870          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1871      def test_GMRES_RILU(self):      def test_GMRES_RILU(self):
1872          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1873          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1874      mypde.setSolverMethod(mypde.GMRES,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1875          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1876            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1877            u=mypde.getSolution()
1878            self.failUnless(self.check(u,1.),'solution is wrong.')
1879        def test_GMRES_REC_ILU(self):
1880            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1881            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1882        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1883        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1884            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1885            u=mypde.getSolution()
1886          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1887      def test_GMRES_truncation_restart_JACOBI(self):      def test_GMRES_truncation_restart_JACOBI(self):
1888          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1889          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1890      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1891          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1892        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1893        mypde.getSolverOptions().setTruncation(10)
1894        mypde.getSolverOptions().setRestart(20)
1895            u=mypde.getSolution()
1896          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1897        def test_GMRES_truncation_restart_AMG(self):
1898            if self.order!=2:
1899                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1900                mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1901                mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1902                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1903                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1904                mypde.getSolverOptions().setTruncation(10)
1905                mypde.getSolverOptions().setRestart(20)
1906                u=mypde.getSolution()
1907                self.failUnless(self.check(u,1.),'solution is wrong.')
1908      def test_GMRES_truncation_restart_ILU0(self):      def test_GMRES_truncation_restart_ILU0(self):
1909          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1910          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1911      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1912          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1913        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1914        mypde.getSolverOptions().setTruncation(10)
1915        mypde.getSolverOptions().setRestart(20)
1916            u=mypde.getSolution()
1917          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1918      def test_GMRES_truncation_restart_RILU(self):      def test_GMRES_truncation_restart_RILU(self):
1919          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1920          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1921      mypde.setSolverMethod(mypde.GMRES,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1922          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1923        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1924        mypde.getSolverOptions().setTruncation(10)
1925        mypde.getSolverOptions().setRestart(20)
1926            u=mypde.getSolution()
1927            self.failUnless(self.check(u,1.),'solution is wrong.')
1928        def test_GMRES_truncation_restart_REC_ILU(self):
1929            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1930            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1931        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1932        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1933        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1934        mypde.getSolverOptions().setTruncation(10)
1935        mypde.getSolverOptions().setRestart(20)
1936            u=mypde.getSolution()
1937          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1938      #      #
1939      #   solver checks (PDE system)      #   solver checks (PDE system)
# Line 1702  class Test_LinearPDE_noLumping(Test_line Line 1948  class Test_LinearPDE_noLumping(Test_line
1948              Y[i]+=i              Y[i]+=i
1949          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1950          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1951          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1952            u=mypde.getSolution()
1953          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1954      def test_symmetryOnDirect_System(self):      def test_symmetryOnDirect_System(self):
1955          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1714  class Test_LinearPDE_noLumping(Test_line Line 1961  class Test_LinearPDE_noLumping(Test_line
1961              Y[i]+=i              Y[i]+=i
1962          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1963          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1964          mypde.setSolverMethod(mypde.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1965          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1966            u=mypde.getSolution()
1967          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1968      def test_PCG_JACOBI_System(self):      def test_PCG_JACOBI_System(self):
1969          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1727  class Test_LinearPDE_noLumping(Test_line Line 1975  class Test_LinearPDE_noLumping(Test_line
1975              Y[i]+=i              Y[i]+=i
1976          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1977          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1978          mypde.setSolverMethod(mypde.PCG,mypde.JACOBI)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1979          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1980            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1981            u=mypde.getSolution()
1982          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1983        def test_PCG_AMG_System(self):
1984            if self.order!=2:
1985                A=Tensor4(0.,Function(self.domain))
1986                D=Tensor(1.,Function(self.domain))
1987                Y=Vector(self.domain.getDim(),Function(self.domain))
1988                for i in range(self.domain.getDim()):
1989                    A[i,:,i,:]=kronecker(self.domain)
1990                    D[i,i]+=i
1991                    Y[i]+=i
1992                mypde=LinearPDE(self.domain,debug=self.DEBUG)
1993                mypde.setValue(A=A,D=D,Y=Y)
1994                mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1995                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1996                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1997                u=mypde.getSolution()
1998                self.failUnless(self.check(u,1.),'solution is wrong.')
1999      def test_PCG_ILU0_System(self):      def test_PCG_ILU0_System(self):
2000          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2001          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 1740  class Test_LinearPDE_noLumping(Test_line Line 2006  class Test_LinearPDE_noLumping(Test_line
2006              Y[i]+=i              Y[i]+=i
2007          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2008          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2009          mypde.setSolverMethod(mypde.PCG,mypde.ILU0)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
2010          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2011            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2012            u=mypde.getSolution()
2013          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2014      def test_DIRECT_System(self):      def test_DIRECT_System(self):
2015          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1753  class Test_LinearPDE_noLumping(Test_line Line 2021  class Test_LinearPDE_noLumping(Test_line
2021              Y[i]+=i              Y[i]+=i
2022          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2023          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2024          mypde.setSolverMethod(mypde.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
2025          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2026            u=mypde.getSolution()
2027          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2028      def test_BICGSTAB_JACOBI_System(self):      def test_BICGSTAB_JACOBI_System(self):
2029          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1766  class Test_LinearPDE_noLumping(Test_line Line 2035  class Test_LinearPDE_noLumping(Test_line
2035              Y[i]+=i              Y[i]+=i
2036          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2037          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2038      mypde.setSolverMethod(mypde.BICGSTAB,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2039          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2040            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2041            u=mypde.getSolution()
2042          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2043        def test_BICGSTAB_AMG_System(self):
2044            if self.order!=2:
2045                A=Tensor4(0.,Function(self.domain))
2046                D=Tensor(1.,Function(self.domain))
2047                Y=Vector(self.domain.getDim(),Function(self.domain))
2048                for i in range(self.domain.getDim()):
2049                    A[i,:,i,:]=kronecker(self.domain)
2050                    D[i,i]+=i
2051                    Y[i]+=i
2052                mypde=LinearPDE(self.domain,debug=self.DEBUG)
2053                mypde.setValue(A=A,D=D,Y=Y)
2054                mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2055                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2056                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2057                u=mypde.getSolution()
2058                self.failUnless(self.check(u,1.),'solution is wrong.')
2059      def test_BICGSTAB_ILU0_System(self):      def test_BICGSTAB_ILU0_System(self):
2060          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2061          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 1779  class Test_LinearPDE_noLumping(Test_line Line 2066  class Test_LinearPDE_noLumping(Test_line
2066              Y[i]+=i              Y[i]+=i
2067          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2068          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2069      mypde.setSolverMethod(mypde.BICGSTAB,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2070          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2071            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2072            u=mypde.getSolution()
2073          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2074      def test_PRES20_JACOBI_System(self):      def test_PRES20_JACOBI_System(self):
2075          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1792  class Test_LinearPDE_noLumping(Test_line Line 2081  class Test_LinearPDE_noLumping(Test_line
2081              Y[i]+=i              Y[i]+=i
2082          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2083          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2084      mypde.setSolverMethod(mypde.PRES20,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2085          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2086            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2087            u=mypde.getSolution()
2088          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2089        def test_PRES20_AMG_System(self):
2090            if self.order!=2:
2091                A=Tensor4(0.,Function(self.domain))
2092                D=Tensor(1.,Function(self.domain))
2093                Y=Vector(self.domain.getDim(),Function(self.domain))
2094                for i in range(self.domain.getDim()):
2095                    A[i,:,i,:]=kronecker(self.domain)
2096                    D[i,i]+=i
2097                    Y[i]+=i
2098                mypde=LinearPDE(self.domain,debug=self.DEBUG)
2099                mypde.setValue(A=A,D=D,Y=Y)
2100                mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2101                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2102                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2103                u=mypde.getSolution()
2104                self.failUnless(self.check(u,1.),'solution is wrong.')
2105      def test_PRES20_ILU0_System(self):      def test_PRES20_ILU0_System(self):
2106          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2107          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 1805  class Test_LinearPDE_noLumping(Test_line Line 2112  class Test_LinearPDE_noLumping(Test_line
2112              Y[i]+=i              Y[i]+=i
2113          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2114          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2115      mypde.setSolverMethod(mypde.PRES20,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2116          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2117            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2118            u=mypde.getSolution()
2119          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2120      def test_GMRESnoRestart_JACOBI_System(self):      def test_GMRESnoRestart_JACOBI_System(self):
2121          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1818  class Test_LinearPDE_noLumping(Test_line Line 2127  class Test_LinearPDE_noLumping(Test_line
2127              Y[i]+=i              Y[i]+=i
2128          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2129          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2130      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2131        mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2132          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2133          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2134            u=mypde.getSolution()
2135          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2136        def test_GMRESnoRestart_AMG_System(self):
2137            if self.order!=2:
2138                A=Tensor4(0.,Function(self.domain))
2139                D=Tensor(1.,Function(self.domain))
2140                Y=Vector(self.domain.getDim(),Function(self.domain))
2141                for i in range(self.domain.getDim()):
2142                    A[i,:,i,:]=kronecker(self.domain)
2143                    D[i,i]+=i
2144                    Y[i]+=i
2145                mypde=LinearPDE(self.domain,debug=self.DEBUG)
2146                mypde.setValue(A=A,D=D,Y=Y)
2147                mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2148                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2149                # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2150                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2151                u=mypde.getSolution()
2152                self.failUnless(self.check(u,1.),'solution is wrong.')
2153      def test_GMRESnoRestart_ILU0_System(self):      def test_GMRESnoRestart_ILU0_System(self):
2154          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2155          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 1832  class Test_LinearPDE_noLumping(Test_line Line 2160  class Test_LinearPDE_noLumping(Test_line
2160              Y[i]+=i              Y[i]+=i
2161          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2162          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2163      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2164        mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2165          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2166          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2167            u=mypde.getSolution()
2168          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2169      def test_GMRES_JACOBI_System(self):      def test_GMRES_JACOBI_System(self):
2170          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1846  class Test_LinearPDE_noLumping(Test_line Line 2176  class Test_LinearPDE_noLumping(Test_line
2176              Y[i]+=i              Y[i]+=i
2177          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2178          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2179      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2180          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2181            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2182            u=mypde.getSolution()
2183          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2184        def test_GMRES_AMG_System(self):
2185            if self.order!=2:
2186                A=Tensor4(0.,Function(self.domain))
2187                D=Tensor(1.,Function(self.domain))
2188                Y=Vector(self.domain.getDim(),Function(self.domain))
2189                for i in range(self.domain.getDim()):
2190                    A[i,:,i,:]=kronecker(self.domain)
2191                    D[i,i]+=i
2192                    Y[i]+=i
2193                mypde=LinearPDE(self.domain,debug=self.DEBUG)
2194                mypde.setValue(A=A,D=D,Y=Y)
2195                mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2196                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2197                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2198                u=mypde.getSolution()
2199                self.failUnless(self.check(u,1.),'solution is wrong.')
2200      def test_GMRES_ILU0_System(self):      def test_GMRES_ILU0_System(self):
2201          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2202          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 1859  class Test_LinearPDE_noLumping(Test_line Line 2207  class Test_LinearPDE_noLumping(Test_line
2207              Y[i]+=i              Y[i]+=i
2208          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2209          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2210      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2211          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2212            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2213            u=mypde.getSolution()
2214          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2215      def test_GMRES_truncation_restart_JACOBI_System(self):      def test_GMRES_truncation_restart_JACOBI_System(self):
2216          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1872  class Test_LinearPDE_noLumping(Test_line Line 2222  class Test_LinearPDE_noLumping(Test_line
2222              Y[i]+=i              Y[i]+=i
2223          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2224          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2225      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2226          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2227            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2228        mypde.getSolverOptions().setTruncation(10)
2229        mypde.getSolverOptions().setRestart(20)
2230            u=mypde.getSolution()
2231          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2232        def test_GMRES_truncation_restart_AMG_System(self):
2233            if self.order!=2:
2234                A=Tensor4(0.,Function(self.domain))
2235                D=Tensor(1.,Function(self.domain))
2236                Y=Vector(self.domain.getDim(),Function(self.domain))
2237                for i in range(self.domain.getDim()):
2238                    A[i,:,i,:]=kronecker(self.domain)
2239                    D[i,i]+=i
2240                    Y[i]+=i
2241                mypde=LinearPDE(self.domain,debug=self.DEBUG)
2242                mypde.setValue(A=A,D=D,Y=Y)
2243                mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2244                mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2245                mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2246                mypde.getSolverOptions().setTruncation(10)
2247                mypde.getSolverOptions().setRestart(20)
2248                u=mypde.getSolution()
2249                self.failUnless(self.check(u,1.),'solution is wrong.')
2250      def test_GMRES_truncation_restart_ILU0_System(self):      def test_GMRES_truncation_restart_ILU0_System(self):
2251          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2252          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 1885  class Test_LinearPDE_noLumping(Test_line Line 2257  class Test_LinearPDE_noLumping(Test_line
2257              Y[i]+=i              Y[i]+=i
2258          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2259          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2260      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2261          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2262            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2263        mypde.getSolverOptions().setTruncation(10)
2264        mypde.getSolverOptions().setRestart(20)
2265            u=mypde.getSolution()
2266          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2267    
2268  class Test_LinearPDE(Test_LinearPDE_noLumping):  class Test_LinearPDE(Test_LinearPDE_noLumping):
# Line 1894  class Test_LinearPDE(Test_LinearPDE_noLu Line 2270  class Test_LinearPDE(Test_LinearPDE_noLu
2270          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2271          try:          try:
2272             success=True             success=True
2273         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2274             mypde.setValue(A=kronecker(self.domain))             mypde.setValue(A=kronecker(self.domain))
2275             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2276               u=mypde.getSolution()    
2277          except ValueError:          except ValueError:
2278             success=False             success=False
2279          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1904  class Test_LinearPDE(Test_LinearPDE_noLu Line 2281  class Test_LinearPDE(Test_LinearPDE_noLu
2281          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2282          try:          try:
2283             success=True             success=True
2284         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2285             mypde.setValue(B=kronecker(self.domain)[0])             mypde.setValue(B=kronecker(self.domain)[0])
2286             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2287               u=mypde.getSolution()
2288          except ValueError:          except ValueError:
2289             success=False             success=False
2290          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1914  class Test_LinearPDE(Test_LinearPDE_noLu Line 2292  class Test_LinearPDE(Test_LinearPDE_noLu
2292          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2293          try:          try:
2294             success=True             success=True
2295         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2296             mypde.setValue(C=kronecker(self.domain)[0])             mypde.setValue(C=kronecker(self.domain)[0])
2297             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2298               u=mypde.getSolution()
2299          except ValueError:          except ValueError:
2300             success=False             success=False
2301          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1925  class Test_LinearPDE(Test_LinearPDE_noLu Line 2304  class Test_LinearPDE(Test_LinearPDE_noLu
2304          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2305          try:          try:
2306             success=True             success=True
2307         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2308             mypde.setValue(A_reduced=kronecker(self.domain))             mypde.setValue(A_reduced=kronecker(self.domain))
2309             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2310               u=mypde.getSolution()
2311          except ValueError:          except ValueError:
2312             success=False             success=False
2313          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1935  class Test_LinearPDE(Test_LinearPDE_noLu Line 2315  class Test_LinearPDE(Test_LinearPDE_noLu
2315          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2316          try:          try:
2317             success=True             success=True
2318         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2319             mypde.setValue(B_reduced=kronecker(self.domain)[0])             mypde.setValue(B_reduced=kronecker(self.domain)[0])
2320             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2321               u=mypde.getSolution()
2322          except ValueError:          except ValueError:
2323             success=False             success=False
2324          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1945  class Test_LinearPDE(Test_LinearPDE_noLu Line 2326  class Test_LinearPDE(Test_LinearPDE_noLu
2326          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2327          try:          try:
2328             success=True             success=True
2329         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2330             mypde.setValue(C_reduced=kronecker(self.domain)[0])             mypde.setValue(C_reduced=kronecker(self.domain)[0])
2331             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2332               u=mypde.getSolution()
2333          except ValueError:          except ValueError:
2334             success=False             success=False
2335          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
2336                    
2337      def test_Lumping(self):      def test_Lumping(self):
2338          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2339      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2340          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2341          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2342            u=mypde.getSolution()
2343          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2344      def test_Constrained_Lumping(self):      def test_Constrained_Lumping(self):
2345          x=self.domain.getX()          x=self.domain.getX()
2346          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2347      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2348          mypde.setValue(D=1.,Y=1.,q=whereZero(x[0]),r=1.)          mypde.setValue(D=1.,Y=1.,q=whereZero(x[0]),r=1.)
2349          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2350            u=mypde.getSolution()
2351          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2352    
2353      def test_Lumping_System(self):      def test_Lumping_System(self):
2354          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2355      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2356          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]))          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]))
2357          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2358            u=mypde.getSolution()
2359          self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')          self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')
2360      def test_Constrained_Lumping_System(self):      def test_Constrained_Lumping_System(self):
2361          x=self.domain.getX()          x=self.domain.getX()
2362          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2363      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2364          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]), \          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]), \
2365                         q=whereZero(x[0])*[0.,1],r=[0.,1.])                         q=whereZero(x[0])*[0.,1],r=[0.,1.])
2366          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2367            u=mypde.getSolution()
2368          self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')          self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')
2369    
2370      def test_Lumping_updateRHS(self):      def test_Lumping_updateRHS(self):
2371          x=self.domain.getX()          x=self.domain.getX()
2372          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2373      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2374          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2375          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2376            u=mypde.getSolution()
2377          self.failUnless(self.check(u,1.),'first solution is wrong.')          self.failUnless(self.check(u,1.),'first solution is wrong.')
2378          mypde.setValue(Y=2.,q=whereZero(x[0]),r=2.)          mypde.setValue(Y=2.,q=whereZero(x[0]),r=2.)
2379          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2380            u=mypde.getSolution()
2381          self.failUnless(self.check(u,2.),'second solution is wrong.')          self.failUnless(self.check(u,2.),'second solution is wrong.')
2382      def test_Lumping_updateOperator(self):      def test_Lumping_updateOperator(self):
2383          x=self.domain.getX()          x=self.domain.getX()
2384          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2385      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2386          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2387          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2388            u=mypde.getSolution()
2389          mypde.setValue(D=2.)          mypde.setValue(D=2.)
2390          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2391            u=mypde.getSolution()
2392          self.failUnless(self.check(u,0.5),'second solution is wrong.')          self.failUnless(self.check(u,0.5),'second solution is wrong.')
2393    
2394    
# Line 2012  class Test_TransportPDE(Test_linearPDEs) Line 2402  class Test_TransportPDE(Test_linearPDEs)
2402          self.failUnless(mypde.useBackwardEuler()==False,'backward Euler should not be used')          self.failUnless(mypde.useBackwardEuler()==False,'backward Euler should not be used')
2403      def test_setCoefficient_WithWrongName(self):      def test_setCoefficient_WithWrongName(self):
2404          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2405          self.failUnlessRaises(IllegalCoefficient,mypde.setValue, ROMA=Vector(0.,FunctionOnBoundary(self.domain)))          self.failUnlessRaises(IllegalCoefficient)
2406        mypde.getSolverOptions().setSolverMethod(SolverOptions.setValue, ROMA=Vector(0.,FunctionOnBoundary(self.domain)))
2407    
2408      def test_setCoefficient_WithIllegalFunctionSpace(self):      def test_setCoefficient_WithIllegalFunctionSpace(self):
2409          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2410          self.failUnlessRaises(IllegalCoefficientFunctionSpace,mypde.setValue,C=Vector(0.,FunctionOnBoundary(self.domain)))          self.failUnlessRaises(IllegalCoefficientFunctionSpace)
2411        mypde.getSolverOptions().setSolverMethod(SolverOptions.setValue,C=Vector(0.,FunctionOnBoundary(self.domain)))
2412                    
2413      def test_resetCoefficient_WithWrongShape(self):      def test_resetCoefficient_WithWrongShape(self):
2414          mypde=TransportPDE(self.domain,numEquations=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=2,debug=self.DEBUG)
# Line 2026  class Test_TransportPDE(Test_linearPDEs) Line 2418  class Test_TransportPDE(Test_linearPDEs)
2418          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)
2419          mypde.setInitialSolution(1.)          mypde.setInitialSolution(1.)
2420    
     def test_setInitialSolution_scalar_negative(self):  
         mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)  
         self.failUnlessRaises(RuntimeError,mypde.setInitialSolution,-1.)  
   
2421      def test_setInitialSolution_scalar_WithWrongShape(self):      def test_setInitialSolution_scalar_WithWrongShape(self):
2422          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)
2423          self.failUnlessRaises(ValueError,mypde.setInitialSolution,[1.,2.])          self.failUnlessRaises(ValueError,mypde.setInitialSolution,[1.,2.])
# Line 2038  class Test_TransportPDE(Test_linearPDEs) Line 2426  class Test_TransportPDE(Test_linearPDEs)
2426          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)
2427          mypde.setInitialSolution([1.,2.])          mypde.setInitialSolution([1.,2.])
2428    
     def test_setInitialSolution_system(self):  
         mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)  
         self.failUnlessRaises(RuntimeError,mypde.setInitialSolution,[-1,2.])  
   
2429      def test_setInitialSolution_system_WithWrongShape(self):      def test_setInitialSolution_system_WithWrongShape(self):
2430          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)
2431          self.failUnlessRaises(ValueError,mypde.setInitialSolution,1.)          self.failUnlessRaises(ValueError, mypde.setInitialSolution,1.)
   
2432    
2433      def test_attemptToChangeOrderAfterDefinedCoefficient(self):      def test_attemptToChangeOrderAfterDefinedCoefficient(self):
2434          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
# Line 2055  class Test_TransportPDE(Test_linearPDEs) Line 2438  class Test_TransportPDE(Test_linearPDEs)
2438      def test_reducedOnConfig(self):      def test_reducedOnConfig(self):
2439          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2440          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2441          self.failUnlessEqual((mypde.getFunctionSpaceForSolution(),mypde.getFunctionSpaceForEquation()),(ReducedSolution(self.domain),ReducedSolution(self.domain)),"reduced function spaces expected.")          self.failUnlessEqual((mypde.getFunctionSpaceForSolution(), mypde.getFunctionSpaceForEquation()),(ReducedSolution(self.domain),ReducedSolution(self.domain)),"reduced function spaces expected.")
2442      #      #
2443      #  set coefficients for scalars:      #  set coefficients for scalars:
2444      #      #
# Line 2064  class Test_TransportPDE(Test_linearPDEs) Line 2447  class Test_TransportPDE(Test_linearPDEs)
2447          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2448          mypde.setValue(M=1.)          mypde.setValue(M=1.)
2449          coeff=mypde.getCoefficient("M")          coeff=mypde.getCoefficient("M")
2450          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),Function(self.domain),1,1))
2451      def test_setCoefficient_A_Scalar(self):      def test_setCoefficient_A_Scalar(self):
2452          d=self.domain.getDim()          d=self.domain.getDim()
2453          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2454          mypde.setValue(A=numpy.ones((d,d)))          mypde.setValue(A=numpy.ones((d,d)))
2455          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
2456          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,d),Function(self.domain),1,1))
2457      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(self):
2458          d=self.domain.getDim()          d=self.domain.getDim()
2459          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2460          mypde.setValue(B=numpy.ones((d,)))          mypde.setValue(B=numpy.ones((d,)))
2461          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
2462          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),Function(self.domain),1,1))
2463      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
2464          d=self.domain.getDim()          d=self.domain.getDim()
2465          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2466          mypde.setValue(C=numpy.ones((d,)))          mypde.setValue(C=numpy.ones((d,)))
2467          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
2468          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),Function(self.domain),1,1))
2469      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
2470          d=self.domain.getDim()          d=self.domain.getDim()
2471          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2472          mypde.setValue(D=1.)          mypde.setValue(D=1.)
2473          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
2474          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),Function(self.domain),1,1))
2475      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(self):
2476          d=self.domain.getDim()          d=self.domain.getDim()
2477          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2478          mypde.setValue(X=numpy.ones((d,)))          mypde.setValue(X=numpy.ones((d,)))
2479          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
2480          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),Function(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((d,),Function(self.domain),1))
2481      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
2482          d=self.domain.getDim()          d=self.domain.getDim()
2483          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2484          mypde.setValue(Y=1.)          mypde.setValue(Y=1.)
2485          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
2486          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),Function(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),Function(self.domain),1))
2487      def test_setCoefficient_y_Scalar(self):      def test_setCoefficient_y_Scalar(self):
2488          d=self.domain.getDim()          d=self.domain.getDim()
2489          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2490          mypde.setValue(y=1.)          mypde.setValue(y=1.)
2491          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
2492          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))
2493      def test_setCoefficient_d_Scalar(self):      def test_setCoefficient_d_Scalar(self):
2494          d=self.domain.getDim()          d=self.domain.getDim()
2495          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2496          mypde.setValue(d=1.)          mypde.setValue(d=1.)
2497          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
2498          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
2499      def test_setCoefficient_m_Scalar(self):      def test_setCoefficient_m_Scalar(self):
2500          d=self.domain.getDim()          d=self.domain.getDim()
2501          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2502          mypde.setValue(m=1.)          mypde.setValue(m=1.)
2503          coeff=mypde.getCoefficient("m")          coeff=mypde.getCoefficient("m")
2504          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
2505      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(self):
2506          d=self.domain.getDim()          d=self.domain.getDim()
2507          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2508          mypde.setValue(d_contact=1.)          mypde.setValue(d_contact=1.)
2509          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
2510          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))
2511      def test_setCoefficient_y_contact_Scalar(self):      def test_setCoefficient_y_contact_Scalar(self):
2512          d=self.domain.getDim()          d=self.domain.getDim()
2513          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2514          mypde.setValue(y_contact=1.)          mypde.setValue(y_contact=1.)
2515          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
2516          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))
2517    
2518      def test_setCoefficient_M_reduced_Scalar(self):      def test_setCoefficient_M_reduced_Scalar(self):
2519          d=self.domain.getDim()          d=self.domain.getDim()
2520          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2521          mypde.setValue(M_reduced=1.)          mypde.setValue(M_reduced=1.)
2522          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2523          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
2524      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
2525          d=self.domain.getDim()          d=self.domain.getDim()
2526          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2527          mypde.setValue(A_reduced=numpy.ones((d,d)))          mypde.setValue(A_reduced=numpy.ones((d,d)))
2528          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2529          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))
2530      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(self):
2531          d=self.domain.getDim()          d=self.domain.getDim()
2532          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2533          mypde.setValue(B_reduced=numpy.ones((d,)))          mypde.setValue(B_reduced=numpy.ones((d,)))
2534          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2535          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
2536      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(self):
2537          d=self.domain.getDim()          d=self.domain.getDim()
2538          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2539          mypde.setValue(C_reduced=numpy.ones((d,)))          mypde.setValue(C_reduced=numpy.ones((d,)))
2540          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2541          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
2542      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
2543          d=self.domain.getDim()          d=self.domain.getDim()
2544          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2545          mypde.setValue(D_reduced=1.)          mypde.setValue(D_reduced=1.)
2546          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2547          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
2548      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(self):
2549          d=self.domain.getDim()          d=self.domain.getDim()
2550          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2551          mypde.setValue(X_reduced=numpy.ones((d,)))          mypde.setValue(X_reduced=numpy.ones((d,)))
2552          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2553          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))
2554      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
2555          d=self.domain.getDim()          d=self.domain.getDim()
2556          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2557          mypde.setValue(Y_reduced=1.)          mypde.setValue(Y_reduced=1.)
2558          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2559          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
2560      def test_setCoefficient_y_reduced_Scalar(self):      def test_setCoefficient_y_reduced_Scalar(self):
2561          d=self.domain.getDim()          d=self.domain.getDim()
2562          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2563          mypde.setValue(y_reduced=1.)          mypde.setValue(y_reduced=1.)
2564          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2565          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
2566      def test_setCoefficient_m_reduced_Scalar(self):      def test_setCoefficient_m_reduced_Scalar(self):
2567          d=self.domain.getDim()          d=self.domain.getDim()
2568          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2569          mypde.setValue(m_reduced=1.)          mypde.setValue(m_reduced=1.)
2570          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2571          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
2572      def test_setCoefficient_d_reduced_Scalar(self):      def test_setCoefficient_d_reduced_Scalar(self):
2573          d=self.domain.getDim()          d=self.domain.getDim()
2574          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2575          mypde.setValue(d_reduced=1.)          mypde.setValue(d_reduced=1.)
2576          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2577          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
2578      def test_setCoefficient_d_contact_reduced_Scalar(self):      def test_setCoefficient_d_contact_reduced_Scalar(self):
2579          d=self.domain.getDim()          d=self.domain.getDim()
2580          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2581          mypde.setValue(d_contact_reduced=1.)          mypde.setValue(d_contact_reduced=1.)
2582          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2583          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
2584      def test_setCoefficient_y_contact_reduced_Scalar(self):      def test_setCoefficient_y_contact_reduced_Scalar(self):
2585          d=self.domain.getDim()          d=self.domain.getDim()
2586          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2587          mypde.setValue(y_contact_reduced=1.)          mypde.setValue(y_contact_reduced=1.)
2588          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2589          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
2590      def test_setCoefficient_r_Scalar(self):      def test_setCoefficient_r_Scalar(self):
2591          d=self.domain.getDim()          d=self.domain.getDim()
2592          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2593          mypde.setValue(r=1.)          mypde.setValue(r=1.)
2594          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2595          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),Solution(self.domain),1))
2596      def test_setCoefficient_q_Scalar(self):      def test_setCoefficient_q_Scalar(self):
2597          d=self.domain.getDim()          d=self.domain.getDim()
2598          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2599          mypde.setValue(q=1.)          mypde.setValue(q=1.)
2600          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2601          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),Solution(self.domain),1))
2602      def test_setCoefficient_r_Scalar_reducedOn(self):      def test_setCoefficient_r_Scalar_reducedOn(self):
2603          d=self.domain.getDim()          d=self.domain.getDim()
2604          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2605          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2606          mypde.setValue(r=1.)          mypde.setValue(r=1.)
2607          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2608          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
2609      def test_setCoefficient_q_Scalar_reducedOn(self):      def test_setCoefficient_q_Scalar_reducedOn(self):
2610          d=self.domain.getDim()          d=self.domain.getDim()
2611          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2612          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2613          mypde.setValue(q=1.)          mypde.setValue(q=1.)
2614          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2615          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
2616    
2617      def test_setCoefficient_M_reduced_Scalar_usingM(self):      def test_setCoefficient_M_reduced_Scalar_usingM(self):
2618          d=self.domain.getDim()          d=self.domain.getDim()
2619          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2620          mypde.setValue(M=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(M=Scalar(1.,ReducedFunction(self.domain)))
2621          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2622          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
2623      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
2624          d=self.domain.getDim()          d=self.domain.getDim()
2625          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2626          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
2627          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2628          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))
2629      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
2630          d=self.domain.getDim()          d=self.domain.getDim()
2631          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2632          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2633          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2634          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
2635      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(self):
2636          d=self.domain.getDim()          d=self.domain.getDim()
2637          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2638          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2639          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2640          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
2641      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
2642          d=self.domain.getDim()          d=self.domain.getDim()
2643          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2644          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))
2645          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2646          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
2647      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
2648          d=self.domain.getDim()          d=self.domain.getDim()
2649          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2650          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2651          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2652          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))
2653      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
2654          d=self.domain.getDim()          d=self.domain.getDim()
2655          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2656          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))
2657          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2658          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
2659      def test_setCoefficient_y_reduced_Scalar_using_y(self):      def test_setCoefficient_y_reduced_Scalar_using_y(self):
2660          d=self.domain.getDim()          d=self.domain.getDim()
2661          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2662          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
2663          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2664          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
2665      def test_setCoefficient_m_reduced_Scalar_using_m(self):      def test_setCoefficient_m_reduced_Scalar_using_m(self):
2666          d=self.domain.getDim()          d=self.domain.getDim()
2667          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2668          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
2669          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2670          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
2671      def test_setCoefficient_d_reduced_Scalar_using_d(self):      def test_setCoefficient_d_reduced_Scalar_using_d(self):
2672          d=self.domain.getDim()          d=self.domain.getDim()
2673          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2674          mypde.setValue(m=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(m=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
2675          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2676          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
2677      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):
2678          d=self.domain.getDim()          d=self.domain.getDim()
2679          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2680          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
2681          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2682          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
2683      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):
2684          d=self.domain.getDim()          d=self.domain.getDim()
2685          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2686          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
2687          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2688          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
2689      #      #
2690      #  set coefficients for systems:      #  set coefficients for systems:
2691      #      #
# Line 2311  class Test_TransportPDE(Test_linearPDEs) Line 2694  class Test_TransportPDE(Test_linearPDEs)
2694          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2695          mypde.setValue(M=numpy.ones((self.N,self.N)))          mypde.setValue(M=numpy.ones((self.N,self.N)))
2696          coeff=mypde.getCoefficient("M")          coeff=mypde.getCoefficient("M")
2697          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),Function(self.domain),self.N,self.N))
2698      def test_setCoefficient_A_System(self):      def test_setCoefficient_A_System(self):
2699          d=self.domain.getDim()          d=self.domain.getDim()
2700          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2701          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))
2702          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
2703          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N,d),Function(self.domain),self.N,self.N))
2704      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
2705          d=self.domain.getDim()          d=self.domain.getDim()
2706          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2707          mypde.setValue(B=numpy.ones((self.N,d,self.N)))          mypde.setValue(B=numpy.ones((self.N,d,self.N)))
2708          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
2709          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N),Function(self.domain),self.N,self.N))
2710      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
2711          d=self.domain.getDim()          d=self.domain.getDim()
2712          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2713          mypde.setValue(C=numpy.ones((self.N,self.N,d)))          mypde.setValue(C=numpy.ones((self.N,self.N,d)))
2714          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
2715          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),Function(self.domain),self.N,self.N))
2716      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
2717          d=self.domain.getDim()          d=self.domain.getDim()
2718          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2719          mypde.setValue(D=numpy.ones((self.N,self.N)))          mypde.setValue(D=numpy.ones((self.N,self.N)))
2720          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
2721          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),Function(self.domain),self.N,self.N))
2722      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
2723          d=self.domain.getDim()          d=self.domain.getDim()
2724          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2725          mypde.setValue(X=numpy.ones((self.N,d)))          mypde.setValue(X=numpy.ones((self.N,d)))
2726          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
2727          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),Function(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),Function(self.domain),self.N))
2728      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
2729          d=self.domain.getDim()          d=self.domain.getDim()
2730          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2731          mypde.setValue(Y=numpy.ones((self.N,)))          mypde.setValue(Y=numpy.ones((self.N,)))
2732          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
2733          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),Function(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),Function(self.domain),self.N))
2734      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
2735          d=self.domain.getDim()          d=self.domain.getDim()
2736          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2737          mypde.setValue(y=numpy.ones((self.N,)))          mypde.setValue(y=numpy.ones((self.N,)))
2738          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
2739          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),FunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FunctionOnBoundary(self.domain),self.N))
2740      def test_setCoefficient_m_System(self):      def test_setCoefficient_m_System(self):
2741          d=self.domain.getDim()          d=self.domain.getDim()
2742          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2743          mypde.setValue(m=numpy.ones((self.N,self.N)))          mypde.setValue(m=numpy.ones((self.N,self.N)))
2744          coeff=mypde.getCoefficient("m")          coeff=mypde.getCoefficient("m")
2745          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))
2746      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
2747          d=self.domain.getDim()          d=self.domain.getDim()
2748          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2749          mypde.setValue(d=numpy.ones((self.N,self.N)))          mypde.setValue(d=numpy.ones((self.N,self.N)))
2750          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
2751          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))
2752      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
2753          d=self.domain.getDim()          d=self.domain.getDim()
2754          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2755          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
2756          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
2757          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))
2758      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
2759          d=self.domain.getDim()          d=self.domain.getDim()
2760          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2761          mypde.setValue(y_contact=numpy.ones((self.N,)))          mypde.setValue(y_contact=numpy.ones((self.N,)))
2762          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
2763          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),FunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FunctionOnContactZero(self.domain),self.N))
2764      def test_setCoefficient_M_System_reduced(self):      def test_setCoefficient_M_System_reduced(self):
2765          d=self.domain.getDim()          d=self.domain.getDim()
2766          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2767          mypde.setValue(M_reduced=numpy.ones((self.N,self.N)))          mypde.setValue(M_reduced=numpy.ones((self.N,self.N)))
2768          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2769          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
2770      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
2771          d=self.domain.getDim()          d=self.domain.getDim()
2772          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2773          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))
2774          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2775          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))
2776      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
2777          d=self.domain.getDim()          d=self.domain.getDim()
2778          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2779          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))
2780          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2781          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))
2782      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
2783          d=self.domain.getDim()          d=self.domain.getDim()
2784          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2785          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))
2786          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2787          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))
2788      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(self):
2789          d=self.domain.getDim()          d=self.domain.getDim()
2790          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2791          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))
2792          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2793          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
2794      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
2795          d=self.domain.getDim()          d=self.domain.getDim()
2796          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2797          mypde.setValue(X_reduced=numpy.ones((self.N,d)))          mypde.setValue(X_reduced=numpy.ones((self.N,d)))
2798          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2799          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))
2800      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
2801          d=self.domain.getDim()          d=self.domain.getDim()
2802          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2803          mypde.setValue(Y_reduced=numpy.ones((self.N,)))          mypde.setValue(Y_reduced=numpy.ones((self.N,)))
2804          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2805          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))
2806      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
2807          d=self.domain.getDim()          d=self.domain.getDim()
2808          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2809          mypde.setValue(y_reduced=numpy.ones((self.N,)))          mypde.setValue(y_reduced=numpy.ones((self.N,)))
2810          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2811          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))
2812      def test_setCoefficient_m_reduced_System(self):      def test_setCoefficient_m_reduced_System(self):
2813          d=self.domain.getDim()          d=self.domain.getDim()
2814          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2815          mypde.setValue(m_reduced=numpy.ones((self.N,self.N)))          mypde.setValue(m_reduced=numpy.ones((self.N,self.N)))
2816          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2817          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
2818      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
2819          d=self.domain.getDim()          d=self.domain.getDim()
2820          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2821          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))
2822          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2823          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
2824      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
2825          d=self.domain.getDim()          d=self.domain.getDim()
2826          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2827          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
2828          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2829          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
2830      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
2831          d=self.domain.getDim()          d=self.domain.getDim()
2832          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2833          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
2834          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2835          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))
2836      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
2837          d=self.domain.getDim()          d=self.domain.getDim()
2838          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2839          mypde.setValue(r=numpy.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
2840          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2841          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))
2842      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
2843          d=self.domain.getDim()          d=self.domain.getDim()
2844          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2845          mypde.setValue(q=numpy.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
2846          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2847          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))
2848      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
2849          d=self.domain.getDim()          d=self.domain.getDim()
2850          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2851          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2852          mypde.setValue(r=numpy.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
2853          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2854          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))
2855      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
2856          d=self.domain.getDim()          d=self.domain.getDim()
2857          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2858          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2859          mypde.setValue(q=numpy.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
2860          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2861          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))
2862    
2863      def test_setCoefficient_M_System_reduced_using_D(self):      def test_setCoefficient_M_System_reduced_using_D(self):
2864          d=self.domain.getDim()          d=self.domain.getDim()
2865          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2866          mypde.setValue(M=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(M=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
2867          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2868          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
2869      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
2870          d=self.domain.getDim()          d=self.domain.getDim()
2871          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2872          mypde.setValue(A=Data(numpy.ones((self.N,d,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((self.N,d,self.N,d)),ReducedFunction(self.domain)))
2873          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2874          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))
2875      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
2876          d=self.domain.getDim()          d=self.domain.getDim()
2877          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2878          mypde.setValue(B=Data(numpy.ones((self.N,d,self.N)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((self.N,d,self.N)),ReducedFunction(self.domain)))
2879          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2880          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))
2881      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
2882          d=self.domain.getDim()          d=self.domain.getDim()
2883          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2884          mypde.setValue(C=Data(numpy.ones((self.N,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((self.N,self.N,d)),ReducedFunction(self.domain)))
2885          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2886          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))
2887      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
2888          d=self.domain.getDim()          d=self.domain.getDim()
2889          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2890          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
2891          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2892          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
2893      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
2894          d=self.domain.getDim()          d=self.domain.getDim()
2895          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2896          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
2897          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2898          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))
2899      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
2900          d=self.domain.getDim()          d=self.domain.getDim()
2901          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2902          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
2903          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2904          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))
2905      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
2906          d=self.domain.getDim()          d=self.domain.getDim()
2907          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2908          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
2909          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2910          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))
2911      def test_setCoefficient_m_reduced_System_using_m(self):      def test_setCoefficient_m_reduced_System_using_m(self):
2912          d=self.domain.getDim()          d=self.domain.getDim()
2913          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2914          mypde.setValue(m=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(m=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
2915          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2916          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
2917      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
2918          d=self.domain.getDim()          d=self.domain.getDim()
2919          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2920          mypde.setValue(d=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
2921          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2922          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
2923      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
2924          d=self.domain.getDim()          d=self.domain.getDim()
2925          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2926          mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))
2927          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2928          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
2929      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
2930          d=self.domain.getDim()          d=self.domain.getDim()
2931          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2932          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
2933          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2934          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))
2935    
2936      def test_symmetryCheckTrue_System(self):      def test_symmetryCheckTrue_System(self):
2937          d=self.domain.getDim()          d=self.domain.getDim()

Legend:
Removed from v.2470  
changed lines
  Added in v.2995

  ViewVC Help
Powered by ViewVC 1.1.26