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

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

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

revision 2454 by jfenwick, Mon Mar 30 02:13:58 2009 UTC revision 2455 by jfenwick, Wed Jun 3 03:29:07 2009 UTC
# Line 47  __author__="Lutz Gross, l.gross@uq.edu.a Line 47  __author__="Lutz Gross, l.gross@uq.edu.a
47  from esys.escript.util import Lsup,kronecker,interpolate,whereZero, outer, swap_axes  from esys.escript.util import Lsup,kronecker,interpolate,whereZero, outer, swap_axes
48  from esys.escript import Function,FunctionOnBoundary,FunctionOnContactZero,Solution,ReducedSolution,Vector,ContinuousFunction,Scalar, ReducedFunction,ReducedFunctionOnBoundary,ReducedFunctionOnContactZero,Data, Tensor4, Tensor  from esys.escript import Function,FunctionOnBoundary,FunctionOnContactZero,Solution,ReducedSolution,Vector,ContinuousFunction,Scalar, ReducedFunction,ReducedFunctionOnBoundary,ReducedFunctionOnContactZero,Data, Tensor4, Tensor
49  from esys.escript.linearPDEs import LinearPDE,IllegalCoefficientValue,Poisson, IllegalCoefficientFunctionSpace, TransportPDE, IllegalCoefficient, Helmholtz, LameEquation  from esys.escript.linearPDEs import LinearPDE,IllegalCoefficientValue,Poisson, IllegalCoefficientFunctionSpace, TransportPDE, IllegalCoefficient, Helmholtz, LameEquation
50  import numarray  import numpy
51  import unittest  import unittest
52    
53  class Test_linearPDEs(unittest.TestCase):  class Test_linearPDEs(unittest.TestCase):
# Line 675  class Test_LinearPDE_noLumping(Test_line Line 675  class Test_LinearPDE_noLumping(Test_line
675      def test_setCoefficient_A_Scalar(self):      def test_setCoefficient_A_Scalar(self):
676          d=self.domain.getDim()          d=self.domain.getDim()
677          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
678          mypde.setValue(A=numarray.ones((d,d)))          mypde.setValue(A=numpy.ones((d,d)))
679          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
680          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))
681      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(self):
682          d=self.domain.getDim()          d=self.domain.getDim()
683          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
684          mypde.setValue(B=numarray.ones((d,)))          mypde.setValue(B=numpy.ones((d,)))
685          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
686          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))
687      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
688          d=self.domain.getDim()          d=self.domain.getDim()
689          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
690          mypde.setValue(C=numarray.ones((d,)))          mypde.setValue(C=numpy.ones((d,)))
691          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
692          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))
693      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
# Line 699  class Test_LinearPDE_noLumping(Test_line Line 699  class Test_LinearPDE_noLumping(Test_line
699      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(self):
700          d=self.domain.getDim()          d=self.domain.getDim()
701          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
702          mypde.setValue(X=numarray.ones((d,)))          mypde.setValue(X=numpy.ones((d,)))
703          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
704          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))
705      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
# Line 735  class Test_LinearPDE_noLumping(Test_line Line 735  class Test_LinearPDE_noLumping(Test_line
735      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
736          d=self.domain.getDim()          d=self.domain.getDim()
737          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
738          mypde.setValue(A_reduced=numarray.ones((d,d)))          mypde.setValue(A_reduced=numpy.ones((d,d)))
739          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
740          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))
741      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(self):
742          d=self.domain.getDim()          d=self.domain.getDim()
743          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
744          mypde.setValue(B_reduced=numarray.ones((d,)))          mypde.setValue(B_reduced=numpy.ones((d,)))
745          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
746          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))
747      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(self):
748          d=self.domain.getDim()          d=self.domain.getDim()
749          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
750          mypde.setValue(C_reduced=numarray.ones((d,)))          mypde.setValue(C_reduced=numpy.ones((d,)))
751          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
752          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))
753      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
# Line 759  class Test_LinearPDE_noLumping(Test_line Line 759  class Test_LinearPDE_noLumping(Test_line
759      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(self):
760          d=self.domain.getDim()          d=self.domain.getDim()
761          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
762          mypde.setValue(X_reduced=numarray.ones((d,)))          mypde.setValue(X_reduced=numpy.ones((d,)))
763          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
764          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))
765      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
# Line 822  class Test_LinearPDE_noLumping(Test_line Line 822  class Test_LinearPDE_noLumping(Test_line
822      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
823          d=self.domain.getDim()          d=self.domain.getDim()
824          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
825          mypde.setValue(A=Data(numarray.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
826          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
827          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))
828      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
829          d=self.domain.getDim()          d=self.domain.getDim()
830          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
831          mypde.setValue(B=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
832          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
833          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))
834      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(self):
835          d=self.domain.getDim()          d=self.domain.getDim()
836          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
837          mypde.setValue(C=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
838          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
839          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))
840      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
# Line 846  class Test_LinearPDE_noLumping(Test_line Line 846  class Test_LinearPDE_noLumping(Test_line
846      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
847          d=self.domain.getDim()          d=self.domain.getDim()
848          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
849          mypde.setValue(X_reduced=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
850          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
851          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))
852      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
# Line 885  class Test_LinearPDE_noLumping(Test_line Line 885  class Test_LinearPDE_noLumping(Test_line
885      def test_setCoefficient_A_System(self):      def test_setCoefficient_A_System(self):
886          d=self.domain.getDim()          d=self.domain.getDim()
887          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
888          mypde.setValue(A=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))
889          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
890          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))
891      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
892          d=self.domain.getDim()          d=self.domain.getDim()
893          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
894          mypde.setValue(B=numarray.ones((self.N,d,self.N)))          mypde.setValue(B=numpy.ones((self.N,d,self.N)))
895          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
896          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))
897      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
898          d=self.domain.getDim()          d=self.domain.getDim()
899          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
900          mypde.setValue(C=numarray.ones((self.N,self.N,d)))          mypde.setValue(C=numpy.ones((self.N,self.N,d)))
901          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
902          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))
903      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
904          d=self.domain.getDim()          d=self.domain.getDim()
905          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
906          mypde.setValue(D=numarray.ones((self.N,self.N)))          mypde.setValue(D=numpy.ones((self.N,self.N)))
907          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
908          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))
909      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
910          d=self.domain.getDim()          d=self.domain.getDim()
911          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
912          mypde.setValue(X=numarray.ones((self.N,d)))          mypde.setValue(X=numpy.ones((self.N,d)))
913          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
914          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))
915      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
916          d=self.domain.getDim()          d=self.domain.getDim()
917          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
918          mypde.setValue(Y=numarray.ones((self.N,)))          mypde.setValue(Y=numpy.ones((self.N,)))
919          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
920          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))
921      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
922          d=self.domain.getDim()          d=self.domain.getDim()
923          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
924          mypde.setValue(y=numarray.ones((self.N,)))          mypde.setValue(y=numpy.ones((self.N,)))
925          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
926          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))
927      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
928          d=self.domain.getDim()          d=self.domain.getDim()
929          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
930          mypde.setValue(d=numarray.ones((self.N,self.N)))          mypde.setValue(d=numpy.ones((self.N,self.N)))
931          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
932          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))
933      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
934          d=self.domain.getDim()          d=self.domain.getDim()
935          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
936          mypde.setValue(d_contact=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
937          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
938          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))
939      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
940          d=self.domain.getDim()          d=self.domain.getDim()
941          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
942          mypde.setValue(y_contact=numarray.ones((self.N,)))          mypde.setValue(y_contact=numpy.ones((self.N,)))
943          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
944          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))
945      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
946          d=self.domain.getDim()          d=self.domain.getDim()
947          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
948          mypde.setValue(A_reduced=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))
949          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
950          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))
951      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
952          d=self.domain.getDim()          d=self.domain.getDim()
953          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
954          mypde.setValue(B_reduced=numarray.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))
955          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
956          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))
957      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
958          d=self.domain.getDim()          d=self.domain.getDim()
959          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
960          mypde.setValue(C_reduced=numarray.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))
961          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
962          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))
963      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(self):
964          d=self.domain.getDim()          d=self.domain.getDim()
965          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
966          mypde.setValue(D_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))
967          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
968          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))
969      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
970          d=self.domain.getDim()          d=self.domain.getDim()
971          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
972          mypde.setValue(X_reduced=numarray.ones((self.N,d)))          mypde.setValue(X_reduced=numpy.ones((self.N,d)))
973          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
974          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))
975      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
976          d=self.domain.getDim()          d=self.domain.getDim()
977          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
978          mypde.setValue(Y_reduced=numarray.ones((self.N,)))          mypde.setValue(Y_reduced=numpy.ones((self.N,)))
979          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
980          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))
981      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
982          d=self.domain.getDim()          d=self.domain.getDim()
983          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
984          mypde.setValue(y_reduced=numarray.ones((self.N,)))          mypde.setValue(y_reduced=numpy.ones((self.N,)))
985          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
986          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))
987      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
988          d=self.domain.getDim()          d=self.domain.getDim()
989          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
990          mypde.setValue(d_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))
991          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
992          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))
993      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
994          d=self.domain.getDim()          d=self.domain.getDim()
995          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
996          mypde.setValue(d_contact_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
997          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
998          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))
999      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
1000          d=self.domain.getDim()          d=self.domain.getDim()
1001          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1002          mypde.setValue(y_contact_reduced=numarray.ones((self.N,)))          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
1003          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1004          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))
1005      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
1006          d=self.domain.getDim()          d=self.domain.getDim()
1007          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1008          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
1009          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1010          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))
1011      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
1012          d=self.domain.getDim()          d=self.domain.getDim()
1013          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1014          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
1015          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1016          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))
1017      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
1018          d=self.domain.getDim()          d=self.domain.getDim()
1019          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1020          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1021          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
1022          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1023          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))
1024      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
1025          d=self.domain.getDim()          d=self.domain.getDim()
1026          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1027          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1028          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
1029          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1030          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))
1031    
1032      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
1033          d=self.domain.getDim()          d=self.domain.getDim()
1034          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1035          mypde.setValue(A=Data(numarray.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)))
1036          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1037          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))
1038      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
1039          d=self.domain.getDim()          d=self.domain.getDim()
1040          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1041          mypde.setValue(B=Data(numarray.ones((self.N,d,self.N)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((self.N,d,self.N)),ReducedFunction(self.domain)))
1042          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1043          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))
1044      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
1045          d=self.domain.getDim()          d=self.domain.getDim()
1046          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1047          mypde.setValue(C=Data(numarray.ones((self.N,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((self.N,self.N,d)),ReducedFunction(self.domain)))
1048          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1049          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))
1050      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
1051          d=self.domain.getDim()          d=self.domain.getDim()
1052          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1053          mypde.setValue(D=Data(numarray.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
1054          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1055          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))
1056      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
1057          d=self.domain.getDim()          d=self.domain.getDim()
1058          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1059          mypde.setValue(X=Data(numarray.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
1060          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1061          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))
1062      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
1063          d=self.domain.getDim()          d=self.domain.getDim()
1064          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1065          mypde.setValue(Y=Data(numarray.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
1066          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1067          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))
1068      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
1069          d=self.domain.getDim()          d=self.domain.getDim()
1070          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1071          mypde.setValue(y=Data(numarray.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
1072          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1073          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))
1074      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
1075          d=self.domain.getDim()          d=self.domain.getDim()
1076          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1077          mypde.setValue(d=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
1078          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1079          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))
1080      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
1081          d=self.domain.getDim()          d=self.domain.getDim()
1082          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1083          mypde.setValue(d_contact=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))
1084          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1085          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))
1086      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
1087          d=self.domain.getDim()          d=self.domain.getDim()
1088          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1089          mypde.setValue(y_contact=Data(numarray.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
1090          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1091          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))
1092      def test_resetCoefficient_HomogeneousConstraint(self):      def test_resetCoefficient_HomogeneousConstraint(self):
# Line 1116  class Test_LinearPDE_noLumping(Test_line Line 1116  class Test_LinearPDE_noLumping(Test_line
1116      def test_symmetryCheckTrue_System(self):      def test_symmetryCheckTrue_System(self):
1117          d=self.domain.getDim()          d=self.domain.getDim()
1118          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1119          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1120          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1121          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1122          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1123          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1124          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1125          mypde.setValue(A=A,B=B,C=C,D=D,d=d,d_contact=d_contact,A_reduced=-A,B_reduced=-B,C_reduced=-C,D_reduced=-D,d_reduced=-d,d_contact_reduced=-d_contact)          mypde.setValue(A=A,B=B,C=C,D=D,d=d,d_contact=d_contact,A_reduced=-A,B_reduced=-B,C_reduced=-C,D_reduced=-D,d_reduced=-d,d_contact_reduced=-d_contact)
1126          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")
1127    
1128      def test_symmetryCheckFalse_A_System(self):      def test_symmetryCheckFalse_A_System(self):
1129          d=self.domain.getDim()          d=self.domain.getDim()
1130          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1131          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1132          A[1,1,1,0]=0.          A[1,1,1,0]=0.
1133          mypde.setValue(A=A)          mypde.setValue(A=A)
1134          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1135      def test_symmetryCheckFalse_BC_System(self):      def test_symmetryCheckFalse_BC_System(self):
1136          d=self.domain.getDim()          d=self.domain.getDim()
1137          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1138          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1139          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1140          B[0,0,1]=1.          B[0,0,1]=1.
1141          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
1142          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1143    
1144      def test_symmetryCheckFalse_D_System(self):      def test_symmetryCheckFalse_D_System(self):
1145          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1146          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1147          D[0,1]=0.          D[0,1]=0.
1148          mypde.setValue(D=D)          mypde.setValue(D=D)
1149          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1150    
1151      def test_symmetryCheckFalse_d_System(self):      def test_symmetryCheckFalse_d_System(self):
1152          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1153          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1154          d[0,1]=0.          d[0,1]=0.
1155          mypde.setValue(d=d)          mypde.setValue(d=d)
1156          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1157    
1158      def test_symmetryCheckFalse_d_contact_System(self):      def test_symmetryCheckFalse_d_contact_System(self):
1159          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1160          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1161          d_contact[0,1]=0.          d_contact[0,1]=0.
1162          mypde.setValue(d_contact=d_contact)          mypde.setValue(d_contact=d_contact)
1163          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 1165  class Test_LinearPDE_noLumping(Test_line Line 1165  class Test_LinearPDE_noLumping(Test_line
1165      def test_symmetryCheckFalse_A_reduced_System(self):      def test_symmetryCheckFalse_A_reduced_System(self):
1166          d=self.domain.getDim()          d=self.domain.getDim()
1167          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1168          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1169          A[1,1,1,0]=0.          A[1,1,1,0]=0.
1170          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
1171          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1172      def test_symmetryCheckFalse_BC_reduced_System(self):      def test_symmetryCheckFalse_BC_reduced_System(self):
1173          d=self.domain.getDim()          d=self.domain.getDim()
1174          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1175          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1176          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1177          B[0,0,1]=1.          B[0,0,1]=1.
1178          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
1179          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1180    
1181      def test_symmetryCheckFalse_D_reduced_System(self):      def test_symmetryCheckFalse_D_reduced_System(self):
1182          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1183          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1184          D[0,1]=0.          D[0,1]=0.
1185          mypde.setValue(D_reduced=D)          mypde.setValue(D_reduced=D)
1186          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1187    
1188      def test_symmetryCheckFalse_d_reduced_System(self):      def test_symmetryCheckFalse_d_reduced_System(self):
1189          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1190          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1191          d[0,1]=0.          d[0,1]=0.
1192          mypde.setValue(d_reduced=d)          mypde.setValue(d_reduced=d)
1193          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1194    
1195      def test_symmetryCheckFalse_d_contact_reduced_System(self):      def test_symmetryCheckFalse_d_contact_reduced_System(self):
1196          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1197          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1198          d_contact[0,1]=0.          d_contact[0,1]=0.
1199          mypde.setValue(d_contact_reduced=d_contact)          mypde.setValue(d_contact_reduced=d_contact)
1200          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 1202  class Test_LinearPDE_noLumping(Test_line Line 1202  class Test_LinearPDE_noLumping(Test_line
1202      def test_symmetryCheckTrue_Scalar(self):      def test_symmetryCheckTrue_Scalar(self):
1203          d=self.domain.getDim()          d=self.domain.getDim()
1204          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1205          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1206          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1207          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1208          D=3          D=3
1209          d=4          d=4
1210          d_contact=5          d_contact=5
# Line 1214  class Test_LinearPDE_noLumping(Test_line Line 1214  class Test_LinearPDE_noLumping(Test_line
1214      def test_symmetryCheckFalse_A_Scalar(self):      def test_symmetryCheckFalse_A_Scalar(self):
1215          d=self.domain.getDim()          d=self.domain.getDim()
1216          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1217          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1218          A[1,0]=0.          A[1,0]=0.
1219          mypde.setValue(A=A)          mypde.setValue(A=A)
1220          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1221      def test_symmetryCheckFalse_BC_Scalar(self):      def test_symmetryCheckFalse_BC_Scalar(self):
1222          d=self.domain.getDim()          d=self.domain.getDim()
1223          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1224          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1225          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1226          B[0]=1.          B[0]=1.
1227          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
1228          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1229      def test_symmetryCheckFalse_A_reduced_Scalar(self):      def test_symmetryCheckFalse_A_reduced_Scalar(self):
1230          d=self.domain.getDim()          d=self.domain.getDim()
1231          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1232          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1233          A[1,0]=0.          A[1,0]=0.
1234          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
1235          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1236      def test_symmetryCheckFalse_BC_reduced_Scalar(self):      def test_symmetryCheckFalse_BC_reduced_Scalar(self):
1237          d=self.domain.getDim()          d=self.domain.getDim()
1238          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1239          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1240          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1241          B[0]=1.          B[0]=1.
1242          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
1243          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 1687  class Test_LinearPDE(Test_LinearPDE_noLu Line 1687  class Test_LinearPDE(Test_LinearPDE_noLu
1687      def test_Lumping_System(self):      def test_Lumping_System(self):
1688          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1689      mypde.setSolverMethod(mypde.LUMPING)      mypde.setSolverMethod(mypde.LUMPING)
1690          mypde.setValue(D=numarray.array([[1.,0.],[0.,2.]]),Y=numarray.array([1.,2.]))          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]))
1691          u=mypde.getSolution(verbose=self.VERBOSE)          u=mypde.getSolution(verbose=self.VERBOSE)
1692          self.failUnless(self.check(u,numarray.ones((2,))),'solution is wrong.')          self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')
1693      def test_Constrained_Lumping_System(self):      def test_Constrained_Lumping_System(self):
1694          x=self.domain.getX()          x=self.domain.getX()
1695          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1696      mypde.setSolverMethod(mypde.LUMPING)      mypde.setSolverMethod(mypde.LUMPING)
1697          mypde.setValue(D=numarray.array([[1.,0.],[0.,2.]]),Y=numarray.array([1.,2.]), \          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]), \
1698                         q=whereZero(x[0])*[0.,1],r=[0.,1.])                         q=whereZero(x[0])*[0.,1],r=[0.,1.])
1699          u=mypde.getSolution(verbose=self.VERBOSE)          u=mypde.getSolution(verbose=self.VERBOSE)
1700          self.failUnless(self.check(u,numarray.ones((2,))),'solution is wrong.')          self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')
1701    
1702      def test_Lumping_updateRHS(self):      def test_Lumping_updateRHS(self):
1703          x=self.domain.getX()          x=self.domain.getX()
# Line 1786  class Test_TransportPDE(Test_linearPDEs) Line 1786  class Test_TransportPDE(Test_linearPDEs)
1786      def test_setCoefficient_A_Scalar(self):      def test_setCoefficient_A_Scalar(self):
1787          d=self.domain.getDim()          d=self.domain.getDim()
1788          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1789          mypde.setValue(A=numarray.ones((d,d)))          mypde.setValue(A=numpy.ones((d,d)))
1790          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
1791          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))
1792      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(self):
1793          d=self.domain.getDim()          d=self.domain.getDim()
1794          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1795          mypde.setValue(B=numarray.ones((d,)))          mypde.setValue(B=numpy.ones((d,)))
1796          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
1797          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))
1798      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
1799          d=self.domain.getDim()          d=self.domain.getDim()
1800          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1801          mypde.setValue(C=numarray.ones((d,)))          mypde.setValue(C=numpy.ones((d,)))
1802          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
1803          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))
1804      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
# Line 1810  class Test_TransportPDE(Test_linearPDEs) Line 1810  class Test_TransportPDE(Test_linearPDEs)
1810      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(self):
1811          d=self.domain.getDim()          d=self.domain.getDim()
1812          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1813          mypde.setValue(X=numarray.ones((d,)))          mypde.setValue(X=numpy.ones((d,)))
1814          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
1815          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))
1816      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
# Line 1859  class Test_TransportPDE(Test_linearPDEs) Line 1859  class Test_TransportPDE(Test_linearPDEs)
1859      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
1860          d=self.domain.getDim()          d=self.domain.getDim()
1861          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1862          mypde.setValue(A_reduced=numarray.ones((d,d)))          mypde.setValue(A_reduced=numpy.ones((d,d)))
1863          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1864          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))
1865      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(self):
1866          d=self.domain.getDim()          d=self.domain.getDim()
1867          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1868          mypde.setValue(B_reduced=numarray.ones((d,)))          mypde.setValue(B_reduced=numpy.ones((d,)))
1869          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1870          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))
1871      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(self):
1872          d=self.domain.getDim()          d=self.domain.getDim()
1873          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1874          mypde.setValue(C_reduced=numarray.ones((d,)))          mypde.setValue(C_reduced=numpy.ones((d,)))
1875          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1876          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))
1877      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
# Line 1883  class Test_TransportPDE(Test_linearPDEs) Line 1883  class Test_TransportPDE(Test_linearPDEs)
1883      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(self):
1884          d=self.domain.getDim()          d=self.domain.getDim()
1885          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1886          mypde.setValue(X_reduced=numarray.ones((d,)))          mypde.setValue(X_reduced=numpy.ones((d,)))
1887          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1888          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))
1889      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
# Line 1958  class Test_TransportPDE(Test_linearPDEs) Line 1958  class Test_TransportPDE(Test_linearPDEs)
1958      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
1959          d=self.domain.getDim()          d=self.domain.getDim()
1960          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1961          mypde.setValue(A=Data(numarray.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
1962          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1963          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))
1964      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
1965          d=self.domain.getDim()          d=self.domain.getDim()
1966          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1967          mypde.setValue(B=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1968          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1969          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))
1970      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(self):
1971          d=self.domain.getDim()          d=self.domain.getDim()
1972          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
1973          mypde.setValue(C=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1974          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1975          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))
1976      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
# Line 1982  class Test_TransportPDE(Test_linearPDEs) Line 1982  class Test_TransportPDE(Test_linearPDEs)
1982      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
1983          d=self.domain.getDim()          d=self.domain.getDim()
1984          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1985          mypde.setValue(X_reduced=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1986          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1987          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))
1988      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
# Line 2027  class Test_TransportPDE(Test_linearPDEs) Line 2027  class Test_TransportPDE(Test_linearPDEs)
2027      def test_setCoefficient_M_System(self):      def test_setCoefficient_M_System(self):
2028          d=self.domain.getDim()          d=self.domain.getDim()
2029          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2030          mypde.setValue(M=numarray.ones((self.N,self.N)))          mypde.setValue(M=numpy.ones((self.N,self.N)))
2031          coeff=mypde.getCoefficient("M")          coeff=mypde.getCoefficient("M")
2032          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))
2033      def test_setCoefficient_A_System(self):      def test_setCoefficient_A_System(self):
2034          d=self.domain.getDim()          d=self.domain.getDim()
2035          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2036          mypde.setValue(A=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))
2037          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
2038          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))
2039      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
2040          d=self.domain.getDim()          d=self.domain.getDim()
2041          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2042          mypde.setValue(B=numarray.ones((self.N,d,self.N)))          mypde.setValue(B=numpy.ones((self.N,d,self.N)))
2043          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
2044          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))
2045      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
2046          d=self.domain.getDim()          d=self.domain.getDim()
2047          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2048          mypde.setValue(C=numarray.ones((self.N,self.N,d)))          mypde.setValue(C=numpy.ones((self.N,self.N,d)))
2049          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
2050          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))
2051      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
2052          d=self.domain.getDim()          d=self.domain.getDim()
2053          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2054          mypde.setValue(D=numarray.ones((self.N,self.N)))          mypde.setValue(D=numpy.ones((self.N,self.N)))
2055          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
2056          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))
2057      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
2058          d=self.domain.getDim()          d=self.domain.getDim()
2059          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2060          mypde.setValue(X=numarray.ones((self.N,d)))          mypde.setValue(X=numpy.ones((self.N,d)))
2061          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
2062          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))
2063      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
2064          d=self.domain.getDim()          d=self.domain.getDim()
2065          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2066          mypde.setValue(Y=numarray.ones((self.N,)))          mypde.setValue(Y=numpy.ones((self.N,)))
2067          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
2068          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))
2069      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
2070          d=self.domain.getDim()          d=self.domain.getDim()
2071          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2072          mypde.setValue(y=numarray.ones((self.N,)))          mypde.setValue(y=numpy.ones((self.N,)))
2073          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
2074          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))
2075      def test_setCoefficient_m_System(self):      def test_setCoefficient_m_System(self):
2076          d=self.domain.getDim()          d=self.domain.getDim()
2077          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2078          mypde.setValue(m=numarray.ones((self.N,self.N)))          mypde.setValue(m=numpy.ones((self.N,self.N)))
2079          coeff=mypde.getCoefficient("m")          coeff=mypde.getCoefficient("m")
2080          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))
2081      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
2082          d=self.domain.getDim()          d=self.domain.getDim()
2083          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2084          mypde.setValue(d=numarray.ones((self.N,self.N)))          mypde.setValue(d=numpy.ones((self.N,self.N)))
2085          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
2086          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))
2087      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
2088          d=self.domain.getDim()          d=self.domain.getDim()
2089          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2090          mypde.setValue(d_contact=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
2091          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
2092          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))
2093      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
2094          d=self.domain.getDim()          d=self.domain.getDim()
2095          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2096          mypde.setValue(y_contact=numarray.ones((self.N,)))          mypde.setValue(y_contact=numpy.ones((self.N,)))
2097          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
2098          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))
2099      def test_setCoefficient_M_System_reduced(self):      def test_setCoefficient_M_System_reduced(self):
2100          d=self.domain.getDim()          d=self.domain.getDim()
2101          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2102          mypde.setValue(M_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(M_reduced=numpy.ones((self.N,self.N)))
2103          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2104          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))
2105      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
2106          d=self.domain.getDim()          d=self.domain.getDim()
2107          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2108          mypde.setValue(A_reduced=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))
2109          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2110          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))
2111      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
2112          d=self.domain.getDim()          d=self.domain.getDim()
2113          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2114          mypde.setValue(B_reduced=numarray.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))
2115          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2116          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))
2117      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
2118          d=self.domain.getDim()          d=self.domain.getDim()
2119          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2120          mypde.setValue(C_reduced=numarray.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))
2121          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2122          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))
2123      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(self):
2124          d=self.domain.getDim()          d=self.domain.getDim()
2125          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2126          mypde.setValue(D_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))
2127          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2128          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))
2129      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
2130          d=self.domain.getDim()          d=self.domain.getDim()
2131          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2132          mypde.setValue(X_reduced=numarray.ones((self.N,d)))          mypde.setValue(X_reduced=numpy.ones((self.N,d)))
2133          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2134          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))
2135      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
2136          d=self.domain.getDim()          d=self.domain.getDim()
2137          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2138          mypde.setValue(Y_reduced=numarray.ones((self.N,)))          mypde.setValue(Y_reduced=numpy.ones((self.N,)))
2139          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2140          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))
2141      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
2142          d=self.domain.getDim()          d=self.domain.getDim()
2143          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2144          mypde.setValue(y_reduced=numarray.ones((self.N,)))          mypde.setValue(y_reduced=numpy.ones((self.N,)))
2145          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2146          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))
2147      def test_setCoefficient_m_reduced_System(self):      def test_setCoefficient_m_reduced_System(self):
2148          d=self.domain.getDim()          d=self.domain.getDim()
2149          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2150          mypde.setValue(m_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(m_reduced=numpy.ones((self.N,self.N)))
2151          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2152          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))
2153      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
2154          d=self.domain.getDim()          d=self.domain.getDim()
2155          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2156          mypde.setValue(d_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))
2157          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2158          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))
2159      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
2160          d=self.domain.getDim()          d=self.domain.getDim()
2161          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2162          mypde.setValue(d_contact_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
2163          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2164          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))
2165      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
2166          d=self.domain.getDim()          d=self.domain.getDim()
2167          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2168          mypde.setValue(y_contact_reduced=numarray.ones((self.N,)))          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
2169          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2170          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))
2171      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
2172          d=self.domain.getDim()          d=self.domain.getDim()
2173          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2174          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
2175          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2176          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))
2177      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
2178          d=self.domain.getDim()          d=self.domain.getDim()
2179          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2180          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
2181          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2182          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))
2183      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
2184          d=self.domain.getDim()          d=self.domain.getDim()
2185          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2186          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2187          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
2188          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2189          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))
2190      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
2191          d=self.domain.getDim()          d=self.domain.getDim()
2192          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2193          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2194          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
2195          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2196          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))
2197    
2198      def test_setCoefficient_M_System_reduced_using_D(self):      def test_setCoefficient_M_System_reduced_using_D(self):
2199          d=self.domain.getDim()          d=self.domain.getDim()
2200          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2201          mypde.setValue(M=Data(numarray.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(M=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
2202          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2203          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))
2204      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
2205          d=self.domain.getDim()          d=self.domain.getDim()
2206          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2207          mypde.setValue(A=Data(numarray.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)))
2208          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2209          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))
2210      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
2211          d=self.domain.getDim()          d=self.domain.getDim()
2212          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2213          mypde.setValue(B=Data(numarray.ones((self.N,d,self.N)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((self.N,d,self.N)),ReducedFunction(self.domain)))
2214          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2215          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))
2216      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
2217          d=self.domain.getDim()          d=self.domain.getDim()
2218          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2219          mypde.setValue(C=Data(numarray.ones((self.N,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((self.N,self.N,d)),ReducedFunction(self.domain)))
2220          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2221          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))
2222      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
2223          d=self.domain.getDim()          d=self.domain.getDim()
2224          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2225          mypde.setValue(D=Data(numarray.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
2226          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2227          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))
2228      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
2229          d=self.domain.getDim()          d=self.domain.getDim()
2230          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2231          mypde.setValue(X=Data(numarray.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
2232          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2233          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))
2234      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
2235          d=self.domain.getDim()          d=self.domain.getDim()
2236          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2237          mypde.setValue(Y=Data(numarray.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
2238          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2239          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))
2240      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
2241          d=self.domain.getDim()          d=self.domain.getDim()
2242          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2243          mypde.setValue(y=Data(numarray.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
2244          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2245          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))
2246      def test_setCoefficient_m_reduced_System_using_m(self):      def test_setCoefficient_m_reduced_System_using_m(self):
2247          d=self.domain.getDim()          d=self.domain.getDim()
2248          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2249          mypde.setValue(m=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(m=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
2250          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2251          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))
2252      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
2253          d=self.domain.getDim()          d=self.domain.getDim()
2254          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2255          mypde.setValue(d=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
2256          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2257          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))
2258      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
2259          d=self.domain.getDim()          d=self.domain.getDim()
2260          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2261          mypde.setValue(d_contact=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))
2262          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2263          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))
2264      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
2265          d=self.domain.getDim()          d=self.domain.getDim()
2266          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2267          mypde.setValue(y_contact=Data(numarray.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
2268          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2269          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))
2270    
2271      def test_symmetryCheckTrue_System(self):      def test_symmetryCheckTrue_System(self):
2272          d=self.domain.getDim()          d=self.domain.getDim()
2273          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2274          M=100*numarray.ones((self.N,self.N))          M=100*numpy.ones((self.N,self.N))
2275          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2276          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2277          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2278          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2279          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2280          m=64*numarray.ones((self.N,self.N))          m=64*numpy.ones((self.N,self.N))
2281          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2282          mypde.setValue(M=M,A=A,B=B,C=C,D=D,d=d,d_contact=d_contact,m=m,M_reduced=-M,A_reduced=-A,B_reduced=-B,C_reduced=-C,D_reduced=-D,d_reduced=-d,d_contact_reduced=-d_contact, m_reduced=-m)          mypde.setValue(M=M,A=A,B=B,C=C,D=D,d=d,d_contact=d_contact,m=m,M_reduced=-M,A_reduced=-A,B_reduced=-B,C_reduced=-C,D_reduced=-D,d_reduced=-d,d_contact_reduced=-d_contact, m_reduced=-m)
2283          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")
2284    
2285      def test_symmetryCheckFalse_M_System(self):      def test_symmetryCheckFalse_M_System(self):
2286          d=self.domain.getDim()          d=self.domain.getDim()
2287          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2288          M=numarray.ones((self.N,self.N))          M=numpy.ones((self.N,self.N))
2289          M[1,0]=0.          M[1,0]=0.
2290          mypde.setValue(M=M)          mypde.setValue(M=M)
2291          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 2293  class Test_TransportPDE(Test_linearPDEs) Line 2293  class Test_TransportPDE(Test_linearPDEs)
2293      def test_symmetryCheckFalse_A_System(self):      def test_symmetryCheckFalse_A_System(self):
2294          d=self.domain.getDim()          d=self.domain.getDim()
2295          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2296          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2297          A[1,1,1,0]=0.          A[1,1,1,0]=0.
2298          mypde.setValue(A=A)          mypde.setValue(A=A)
2299          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 2301  class Test_TransportPDE(Test_linearPDEs) Line 2301  class Test_TransportPDE(Test_linearPDEs)
2301      def test_symmetryCheckFalse_BC_System(self):      def test_symmetryCheckFalse_BC_System(self):
2302          d=self.domain.getDim()          d=self.domain.getDim()
2303          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2304          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2305          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2306          B[0,0,1]=1.          B[0,0,1]=1.
2307          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
2308          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2309    
2310      def test_symmetryCheckFalse_D_System(self):      def test_symmetryCheckFalse_D_System(self):
2311          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2312          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2313          D[0,1]=0.          D[0,1]=0.
2314          mypde.setValue(D=D)          mypde.setValue(D=D)
2315          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2316    
2317      def test_symmetryCheckFalse_m_System(self):      def test_symmetryCheckFalse_m_System(self):
2318          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2319          m=4*numarray.ones((self.N,self.N))          m=4*numpy.ones((self.N,self.N))
2320          m[0,1]=0.          m[0,1]=0.
2321          mypde.setValue(m=m)          mypde.setValue(m=m)
2322          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2323    
2324      def test_symmetryCheckFalse_d_System(self):      def test_symmetryCheckFalse_d_System(self):
2325          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2326          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2327          d[0,1]=0.          d[0,1]=0.
2328          mypde.setValue(d=d)          mypde.setValue(d=d)
2329          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2330    
2331      def test_symmetryCheckFalse_d_contact_System(self):      def test_symmetryCheckFalse_d_contact_System(self):
2332          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2333          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2334          d_contact[0,1]=0.          d_contact[0,1]=0.
2335          mypde.setValue(d_contact=d_contact)          mypde.setValue(d_contact=d_contact)
2336          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2337    
2338      def test_symmetryCheckFalse_M_reduced_System(self):      def test_symmetryCheckFalse_M_reduced_System(self):
2339          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2340          M=3*numarray.ones((self.N,self.N))          M=3*numpy.ones((self.N,self.N))
2341          M[0,1]=0.          M[0,1]=0.
2342          mypde.setValue(M_reduced=M)          mypde.setValue(M_reduced=M)
2343          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 2345  class Test_TransportPDE(Test_linearPDEs) Line 2345  class Test_TransportPDE(Test_linearPDEs)
2345      def test_symmetryCheckFalse_A_reduced_System(self):      def test_symmetryCheckFalse_A_reduced_System(self):
2346          d=self.domain.getDim()          d=self.domain.getDim()
2347          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2348          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2349          A[1,1,1,0]=0.          A[1,1,1,0]=0.
2350          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
2351          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 2353  class Test_TransportPDE(Test_linearPDEs) Line 2353  class Test_TransportPDE(Test_linearPDEs)
2353      def test_symmetryCheckFalse_BC_reduced_System(self):      def test_symmetryCheckFalse_BC_reduced_System(self):
2354          d=self.domain.getDim()          d=self.domain.getDim()
2355          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2356          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2357          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2358          B[0,0,1]=1.          B[0,0,1]=1.
2359          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
2360          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2361    
2362      def test_symmetryCheckFalse_D_reduced_System(self):      def test_symmetryCheckFalse_D_reduced_System(self):
2363          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2364          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2365          D[0,1]=0.          D[0,1]=0.
2366          mypde.setValue(D_reduced=D)          mypde.setValue(D_reduced=D)
2367          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2368    
2369      def test_symmetryCheckFalse_m_reduced_System(self):      def test_symmetryCheckFalse_m_reduced_System(self):
2370          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2371          m=4*numarray.ones((self.N,self.N))          m=4*numpy.ones((self.N,self.N))
2372          m[0,1]=0.          m[0,1]=0.
2373          mypde.setValue(m_reduced=m)          mypde.setValue(m_reduced=m)
2374          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2375    
2376      def test_symmetryCheckFalse_d_reduced_System(self):      def test_symmetryCheckFalse_d_reduced_System(self):
2377          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2378          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2379          d[0,1]=0.          d[0,1]=0.
2380          mypde.setValue(d_reduced=d)          mypde.setValue(d_reduced=d)
2381          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2382    
2383      def test_symmetryCheckFalse_d_contact_reduced_System(self):      def test_symmetryCheckFalse_d_contact_reduced_System(self):
2384          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2385          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2386          d_contact[0,1]=0.          d_contact[0,1]=0.
2387          mypde.setValue(d_contact_reduced=d_contact)          mypde.setValue(d_contact_reduced=d_contact)
2388          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 2392  class Test_TransportPDE(Test_linearPDEs) Line 2392  class Test_TransportPDE(Test_linearPDEs)
2392          d=self.domain.getDim()          d=self.domain.getDim()
2393          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2394          M=100          M=100
2395          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2396          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2397          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2398          D=3          D=3
2399          m=10          m=10
2400          d=4          d=4
# Line 2405  class Test_TransportPDE(Test_linearPDEs) Line 2405  class Test_TransportPDE(Test_linearPDEs)
2405      def test_symmetryCheckFalse_A_Scalar(self):      def test_symmetryCheckFalse_A_Scalar(self):
2406          d=self.domain.getDim()          d=self.domain.getDim()
2407          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2408          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2409          A[1,0]=0.          A[1,0]=0.
2410          mypde.setValue(A=A)          mypde.setValue(A=A)
2411          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2412      def test_symmetryCheckFalse_BC_Scalar(self):      def test_symmetryCheckFalse_BC_Scalar(self):
2413          d=self.domain.getDim()          d=self.domain.getDim()
2414          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2415          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2416          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2417          B[0]=1.          B[0]=1.
2418          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
2419          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2420      def test_symmetryCheckFalse_A_reduced_Scalar(self):      def test_symmetryCheckFalse_A_reduced_Scalar(self):
2421          d=self.domain.getDim()          d=self.domain.getDim()
2422          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2423          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2424          A[1,0]=0.          A[1,0]=0.
2425          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
2426          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2427      def test_symmetryCheckFalse_BC_reduced_Scalar(self):      def test_symmetryCheckFalse_BC_reduced_Scalar(self):
2428          d=self.domain.getDim()          d=self.domain.getDim()
2429          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2430          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2431          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2432          B[0]=1.          B[0]=1.
2433          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
2434          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")

Legend:
Removed from v.2454  
changed lines
  Added in v.2455

  ViewVC Help
Powered by ViewVC 1.1.26