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

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

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

revision 2344 by jfenwick, Mon Mar 30 02:13:58 2009 UTC revision 2470 by gross, Thu Jun 11 08:32:32 2009 UTC
# Line 46  __author__="Lutz Gross, l.gross@uq.edu.a Line 46  __author__="Lutz Gross, l.gross@uq.edu.a
46    
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, SolverOptions
50  import numarray  import numpy
51  import unittest  import unittest
52    
53  class Test_linearPDEs(unittest.TestCase):  class Test_linearPDEs(unittest.TestCase):
# Line 640  class Test_Poisson(Test_linearPDEs): Line 640  class Test_Poisson(Test_linearPDEs):
640    
641  class Test_LinearPDE_noLumping(Test_linearPDEs):  class Test_LinearPDE_noLumping(Test_linearPDEs):
642      N=4      N=4
643        def test_SolverOptions(self):
644            so=SolverOptions()
645    
646            self.failUnless(so.getLevelMax() == 10, "initial  LevelMax is wrong.")
647            self.failUnlessRaises(ValueError,so.setLevelMax,-1)
648            so.setLevelMax(3)
649            self.failUnless(so.getLevelMax() == 3, "LevelMax is wrong.")
650    
651            self.failUnless(so.getCoarseningThreshold() == 0.05, "initial  CoarseningThreshold is wrong.")
652            self.failUnlessRaises(ValueError,so.setCoarseningThreshold,-1)
653            so.setCoarseningThreshold(0.1)
654            self.failUnless(so.getCoarseningThreshold() == 0.1, "CoarseningThreshold is wrong.")
655    
656            self.failUnless(so.getNumSweeps() == 2, "initial  Sweeps is wrong.")
657            self.failUnlessRaises(ValueError,so.setNumSweeps,-1)
658            so.setNumSweeps(3)
659            self.failUnless(so.getNumSweeps() == 3, "Sweeps is wrong.")
660    
661            self.failUnless(so.getNumPreSweeps() == 2, "initial  PreSweeps is wrong.")
662            self.failUnlessRaises(ValueError,so.setNumPreSweeps,-1)
663            so.setNumPreSweeps(4)
664            self.failUnless(so.getNumPreSweeps() == 4, "PreSweeps is wrong.")
665    
666            self.failUnless(so.getNumPostSweeps() == 2, "initial  PreSweeps is wrong.")
667            self.failUnlessRaises(ValueError,so.setNumPostSweeps,-1)
668            so.setNumPostSweeps(5)
669            self.failUnless(so.getNumPostSweeps() == 5, "PreSweeps is wrong.")
670    
671            self.failUnless(so.getTolerance() == 1.e-8, "initial Tolerance is wrong.")
672            self.failUnlessRaises(ValueError,so.setTolerance,-1)
673            so.setTolerance(0.2)
674            self.failUnless(so.getTolerance() == 0.2, "Tolerance is wrong.")
675    
676            self.failUnless(so.getAbsoluteTolerance() == 0., "initial  AbsoluteTolerance is wrong.")
677            self.failUnlessRaises(ValueError,so.setAbsoluteTolerance,-1)
678            so.setAbsoluteTolerance(0.3)
679            self.failUnless(so.getAbsoluteTolerance() == 0.3, "AbsoluteTolerance is wrong.")
680    
681            self.failUnless(so.getInnerTolerance() == 0.9, "initial InnerTolerance is wrong.")
682            self.failUnlessRaises(ValueError,so.setInnerTolerance,-1)
683            so.setInnerTolerance(0.4)
684            self.failUnless(so.getInnerTolerance() == 0.4, "InnerTolerance is wrong.")
685    
686            self.failUnless(so.getDropTolerance() == 0.01, "initial DropTolerance is wrong.")
687            self.failUnlessRaises(ValueError,so.setDropTolerance,-1)
688            so.setDropTolerance(0.5)
689            self.failUnless(so.getDropTolerance() == 0.5, "DropDropTolerance is wrong.")
690    
691            self.failUnless(so.getDropStorage() == 2., "initial DropStorage is wrong.")
692            self.failUnlessRaises(ValueError,so.setDropStorage,-1)
693            so.setDropStorage(10)
694            self.failUnless(so.getDropStorage() == 10, "DropStorage is wrong.")
695            
696            self.failUnless(so.getRelaxationFactor() == 0.3, "initial RelaxationFactor is wrong.")
697            self.failUnlessRaises(ValueError,so.setRelaxationFactor,-1)
698            so.setRelaxationFactor(0.1)
699            self.failUnless(so.getRelaxationFactor() == 0.1, "Relaxation is wrong.")
700    
701    
702            self.failUnless(so.getIterMax() == 10000, "initial IterMax is wrong.")
703            self.failUnlessRaises(ValueError,so.setIterMax,0)
704            so.setIterMax(11)
705            self.failUnless(so.getIterMax() == 11, "IterMax is wrong.")
706    
707            self.failUnless(so.getInnerIterMax() == 10, "initial InnerIterMax is wrong.")
708            self.failUnlessRaises(ValueError,so.setInnerIterMax,0)
709            so.setInnerIterMax(12)
710            self.failUnless(so.getInnerIterMax() == 12, "InnerIterMax is wrong.")
711    
712            self.failUnless(so.getTruncation() == 20, "initial Truncation is wrong.")
713            self.failUnlessRaises(ValueError,so.setTruncation,0)
714            so.setTruncation(13)
715            self.failUnless(so.getTruncation() == 13, "Truncation is wrong.")
716    
717            self.failUnless(so.getRestart() == None, "initial Truncation is wrong.")
718            self.failUnlessRaises(ValueError,so.setTruncation,0)
719            so.setRestart(14)
720            self.failUnless(so.getRestart() == 14, "Truncation is wrong.")
721            so.setRestart(None)
722            self.failUnless(so.getRestart() == None, "Truncation is wrong.")
723        
724            self.failUnless(not so.isSymmetric(), "initial symmetry flag is wrong.")
725            so.setSymmetryOn()
726            self.failUnless(so.isSymmetric(), "symmetry (1) flag is wrong.")
727            so.setSymmetryOff()
728            self.failUnless(not so.isSymmetric(), "symmetry (2) flag is wrong.")
729            so.setSymmetry(flag=True)
730            self.failUnless(so.isSymmetric(), "symmetry (3) flag is wrong.")
731            so.setSymmetry(flag=False)
732            self.failUnless(not so.isSymmetric(), "symmetry (4) flag is wrong.")
733    
734            self.failUnless(so.adaptInnerTolerance(), "initial InnerToleranceAdaption flag is wrong.")
735            so.setInnerToleranceAdaptionOn()
736            self.failUnless(so.adaptInnerTolerance(), "InnerToleranceAdaption (1) flag is wrong.")
737            so.setInnerToleranceAdaptionOff()
738            self.failUnless(not so.adaptInnerTolerance(), "InnerToleranceAdaption (2) flag is wrong.")
739            so.setInnerToleranceAdaption(adapt=True)
740            self.failUnless(so.adaptInnerTolerance(), "InnerToleranceAdaption (3) flag is wrong.")
741            so.setInnerToleranceAdaption(adapt=False)
742            self.failUnless(not so.adaptInnerTolerance(), "InnerToleranceAdaption (4) flag is wrong.")
743        
744            self.failUnless(not so.acceptConvergenceFailure(), "initial acceptConvergenceFailure flag is wrong.")
745            so.setAcceptanceConvergenceFailureOn()
746            self.failUnless(so.acceptConvergenceFailure(), "acceptConvergenceFailure (1) flag is wrong.")
747            so.setAcceptanceConvergenceFailureOff()
748            self.failUnless(not so.acceptConvergenceFailure(), "acceptConvergenceFailure (2) flag is wrong.")
749            so.setAcceptanceConvergenceFailure(accept=True)
750            self.failUnless(so.acceptConvergenceFailure(), "acceptConvergenceFailure (3) flag is wrong.")
751            so.setAcceptanceConvergenceFailure(accept=False)
752            self.failUnless(not so.acceptConvergenceFailure(), "acceptConvergenceFailure (4) flag is wrong.")  
753            
754            self.failUnless(so.getReordering() == 30, "initial Reordering is wrong.")
755            self.failUnlessRaises(ValueError,so.setReordering,-1)
756            so.setReordering(so.NO_REORDERING)
757            self.failUnless(so.getReordering() == 17, "NO_REORDERING is not set.")
758            so.setReordering(so.MINIMUM_FILL_IN)
759            self.failUnless(so.getReordering() == 18, "MINIMUM_FILL_IN is not set.")
760            so.setReordering(so.NESTED_DISSECTION)
761            self.failUnless(so.getReordering() == 19, "NESTED_DISSECTION is not set.")
762            so.setReordering(so.DEFAULT_REORDERING)
763            self.failUnless(so.getReordering() == 30, "DEFAULT_REORDERING is not set.")
764            
765            self.failUnless(so.getPackage() == 0, "initial solver package is wrong.")
766            self.failUnlessRaises(ValueError,so.setPackage,-1)
767            so.setPackage(so.PASO)
768            self.failUnless(so.getPackage() == 21, "PASO is not set.")
769            so.setPackage(so.SUPER_LU)
770            self.failUnless(so.getPackage() == 31, "SUPER_LU is not set.")
771            so.setPackage(so.PASTIX)
772            self.failUnless(so.getPackage() == 32, "PASTIX is not set.")
773            so.setPackage(so.MKL)
774            self.failUnless(so.getPackage() == 15, "MKL is not set.")
775            so.setPackage(so.UMFPACK)
776            self.failUnless(so.getPackage() == 16, "UMFPACK is not set.")
777            so.setPackage(so.TRILINOS)
778            self.failUnless(so.getPackage() == 24, "TRILINOS is not set.")
779    
780            self.failUnless(so.getSolverMethod() == 0, "initial SolverMethod is wrong.")
781            self.failUnlessRaises(ValueError,so.setSolverMethod,-1)
782            so.setSolverMethod(so.DIRECT)
783            self.failUnless(so.getSolverMethod() == 1, "DIRECT is not set.")
784            so.setSolverMethod(so.CHOLEVSKY)
785            self.failUnless(so.getSolverMethod() == 2, "CHOLEVSKY is not set.")
786            so.setSolverMethod(so.PCG)
787            self.failUnless(so.getSolverMethod() == 3, "PCG is not set.")
788            so.setSolverMethod(so.CR)
789            self.failUnless(so.getSolverMethod() == 4, "CR is not set.")
790            so.setSolverMethod(so.CGS)
791            self.failUnless(so.getSolverMethod() == 5, "CGS is not set.")
792            so.setSolverMethod(so.BICGSTAB)
793            self.failUnless(so.getSolverMethod() == 6, "BICGSTAB is not set.")
794            so.setSolverMethod(so.SSOR)
795            self.failUnless(so.getSolverMethod() == 7, "SSOR is not set.")
796            so.setSolverMethod(so.GMRES)
797            self.failUnless(so.getSolverMethod() == 11, "GMRES is not set.")
798            so.setSolverMethod(so.PRES20)
799            self.failUnless(so.getSolverMethod() == 12, "PRES20 is not set.")
800            so.setSolverMethod(so.LUMPING)
801            self.failUnless(so.getSolverMethod() == 13, "LUMPING is not set.")
802            so.setSolverMethod(so.ITERATIVE)
803            self.failUnless(so.getSolverMethod() == 20, "ITERATIVE is not set.")
804            so.setSolverMethod(so.AMG)
805            self.failUnless(so.getSolverMethod() == 22, "AMG is not set.")
806            so.setSolverMethod(so.NONLINEAR_GMRES)
807            self.failUnless(so.getSolverMethod() == 25, "NONLINEAR_GMRES is not set.")
808            so.setSolverMethod(so.TFQMR)
809            self.failUnless(so.getSolverMethod() == 26, "TFQMR is not set.")
810            so.setSolverMethod(so.MINRES)
811            self.failUnless(so.getSolverMethod() == 27, "MINRES is not set.")
812            so.setSolverMethod(so.GAUSS_SEIDEL)
813            self.failUnless(so.getSolverMethod() == 28, "GAUSS_SEIDEL is not set.")
814            so.setSolverMethod(so.DEFAULT)
815            self.failUnless(so.getSolverMethod() == 0, "DEFAULT is not set.")
816    
817            self.failUnless(so.getPreconditioner() == 10, "initial Preconditioner is wrong.")
818            self.failUnlessRaises(ValueError,so.setPreconditioner,-1)
819            so.setPreconditioner(so.ILU0)
820            self.failUnless(so.getPreconditioner() == 8, "ILU0 is not set.")
821            so.setPreconditioner(so.SSOR)
822            self.failUnless(so.getPreconditioner() == 7, "SSOR is not set.")
823            so.setPreconditioner(so.ILUT)
824            self.failUnless(so.getPreconditioner() == 9, "ILUT is not set.")
825            so.setPreconditioner(so.JACOBI)
826            self.failUnless(so.getPreconditioner() == 10, "JACOBI is not set.")
827            so.setPreconditioner(so.AMG)
828            self.failUnless(so.getPreconditioner() == 22, "AMG is not set.")
829            so.setPreconditioner(so.REC_ILU)
830            self.failUnless(so.getPreconditioner() == 23, "REC_ILU is not set.")
831            so.setPreconditioner(so.GAUSS_SEIDEL)
832            self.failUnless(so.getPreconditioner() == 28, "GAUSS_SEIDEL is not set.")
833            so.setPreconditioner(so.RILU)
834            self.failUnless(so.getPreconditioner() == 29, "RILU is not set.")
835            so.setPreconditioner(so.NO_PRECONDITIONER)
836            self.failUnless(so.getPreconditioner() == 36, "NO_PRECONDITIONER is not set.")        
837    
838            self.failUnless(so.getCoarsening() == 0, "initial Coarseningr is wrong.")
839            self.failUnlessRaises(ValueError,so.setCoarsening,-1)
840            so.setCoarsening(so.YAIR_SHAPIRA_COARSENING)
841            self.failUnless(so.getCoarsening() == 33, "YAIR_SHAPIRA_COARSENING is not set.")
842            so.setCoarsening(so.RUGE_STUEBEN_COARSENING)
843            self.failUnless(so.getCoarsening() == 34, "RUGE_STUEBEN_COARSENING is not set.")
844            so.setCoarsening(so.AGGREGATION_COARSENING)
845            self.failUnless(so.getCoarsening() == 35, "AGREGATION_COARSENING is not set.")
846            so.setCoarsening(so.DEFAULT)
847            self.failUnless(so.getCoarsening() == 0, "DEFAULT is not set.")
848    
849            self.failUnless(so.getDiagnostics("num_iter") == None, "initial num_iter is wrong.")
850            self.failUnless(so.getDiagnostics("num_inner_iter") == None, "initial num_inner_iter is wrong.")
851            self.failUnless(so.getDiagnostics("time") == None, "initial time is wrong.")
852            self.failUnless(so.getDiagnostics("set_up_time") == None, "initial set_up_time is wrong.")
853            self.failUnless(so.getDiagnostics("residual_norm") == None, "initial residual_norm is wrong.")
854            self.failUnless(so.getDiagnostics("converged") == None, "initial converged is wrong.")
855            self.failUnless(so.hasConverged() == None, "initial convergence flag is wrong.")
856            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 0, "initial cum_num_inner_iter is wrong.")
857            self.failUnless(so.getDiagnostics("cum_num_iter") == 0, "initial cum_num_iter is wrong.")
858            self.failUnless(so.getDiagnostics("cum_time") ==0, "initial cum_time is wrong.")
859            self.failUnless(so.getDiagnostics("cum_set_up_time") == 0, "initial cum_set_up_time is wrong.")
860    
861            so._updateDiagnostics("num_iter",1)
862            so._updateDiagnostics("num_inner_iter",2)
863            so._updateDiagnostics("time",3)
864            so._updateDiagnostics("set_up_time",4)
865            so._updateDiagnostics("residual_norm",5)
866            so._updateDiagnostics("converged",True)
867    
868            self.failUnless(so.getDiagnostics("num_iter") == 1, "num_iter is wrong.")
869            self.failUnless(so.getDiagnostics("num_inner_iter") == 2, "num_inner_iter is wrong.")
870            self.failUnless(so.getDiagnostics("time") == 3, "time is wrong.")
871            self.failUnless(so.getDiagnostics("set_up_time") == 4, "set_up_time is wrong.")
872            self.failUnless(so.getDiagnostics("residual_norm") == 5, "residual_norm is wrong.")
873            self.failUnless(so.getDiagnostics("converged"), "converged is wrong.")
874            self.failUnless(so.hasConverged(), "convergence flag is wrong.")
875            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 2, "cum_num_inner_iter is wrong.")
876            self.failUnless(so.getDiagnostics("cum_num_iter") == 1, "cum_num_iter is wrong.")
877            self.failUnless(so.getDiagnostics("cum_time") ==3, "cum_time is wrong.")
878            self.failUnless(so.getDiagnostics("cum_set_up_time") == 4, "cum_set_up_time is wrong.")  
879            
880            so.resetDiagnostics()
881            self.failUnless(so.getDiagnostics("num_iter") == None, "initial num_iter is wrong.")
882            self.failUnless(so.getDiagnostics("num_inner_iter") == None, "initial num_inner_iter is wrong.")
883            self.failUnless(so.getDiagnostics("time") == None, "initial time is wrong.")
884            self.failUnless(so.getDiagnostics("set_up_time") == None, "initial set_up_time is wrong.")
885            self.failUnless(so.getDiagnostics("residual_norm") == None, "initial residual_norm is wrong.")
886            self.failUnless(so.getDiagnostics("converged") == None, "initial converged is wrong.")
887            self.failUnless(so.hasConverged() == None, "initial convergence flag is wrong")      
888            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 2, "cum_num_inner_iter is wrong.")
889            self.failUnless(so.getDiagnostics("cum_num_iter") == 1, "cum_num_iter is wrong.")
890            self.failUnless(so.getDiagnostics("cum_time") ==3, "cum_time is wrong.")
891            self.failUnless(so.getDiagnostics("cum_set_up_time") == 4, "cum_set_up_time is wrong.")
892    
893            so._updateDiagnostics("num_iter",10)
894            so._updateDiagnostics("num_inner_iter",20)
895            so._updateDiagnostics("time",30)
896            so._updateDiagnostics("set_up_time",40)
897            so._updateDiagnostics("residual_norm",50)
898            so._updateDiagnostics("converged",False)
899    
900            self.failUnless(so.getDiagnostics("num_iter") == 10, "num_iter is wrong.")
901            self.failUnless(so.getDiagnostics("num_inner_iter") == 20, "num_inner_iter is wrong.")
902            self.failUnless(so.getDiagnostics("time") == 30, "time is wrong.")
903            self.failUnless(so.getDiagnostics("set_up_time") == 40, "set_up_time is wrong.")
904            self.failUnless(so.getDiagnostics("residual_norm") == 50, "residual_norm is wrong.")
905            self.failUnless(not so.getDiagnostics("converged"), "converged is wrong.")
906            self.failUnless(not so.hasConverged(), "convergence flag is wrong.")
907            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 22, "cum_num_inner_iter is wrong.")
908            self.failUnless(so.getDiagnostics("cum_num_iter") == 11, "cum_num_iter is wrong.")
909            self.failUnless(so.getDiagnostics("cum_time") ==33, "cum_time is wrong.")
910            self.failUnless(so.getDiagnostics("cum_set_up_time") == 44, "cum_set_up_time is wrong.")  
911    
912            so.resetDiagnostics(all=True)
913            self.failUnless(so.getDiagnostics("num_iter") == None, "initial num_iter is wrong.")
914            self.failUnless(so.getDiagnostics("num_inner_iter") == None, "initial num_inner_iter is wrong.")
915            self.failUnless(so.getDiagnostics("time") == None, "initial time is wrong.")
916            self.failUnless(so.getDiagnostics("set_up_time") == None, "initial set_up_time is wrong.")
917            self.failUnless(so.getDiagnostics("residual_norm") == None, "initial residual_norm is wrong.")
918            self.failUnless(so.getDiagnostics("converged") == None, "initial converged is wrong.")
919            self.failUnless(so.hasConverged() == None, "initial convergence flag is wrong.")
920            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 0, "initial cum_num_inner_iter is wrong.")
921            self.failUnless(so.getDiagnostics("cum_num_iter") == 0, "initial cum_num_iter is wrong.")
922            self.failUnless(so.getDiagnostics("cum_time") ==0, "initial cum_time is wrong.")
923            self.failUnless(so.getDiagnostics("cum_set_up_time") == 0, "initial cum_set_up_time is wrong.")
924            
925      def test_setCoefficient_WithIllegalFunctionSpace(self):      def test_setCoefficient_WithIllegalFunctionSpace(self):
926          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
927          self.failUnlessRaises(IllegalCoefficientFunctionSpace,mypde.setValue, C=Vector(0.,FunctionOnBoundary(self.domain)))          self.failUnlessRaises(IllegalCoefficientFunctionSpace,mypde.setValue, C=Vector(0.,FunctionOnBoundary(self.domain)))
# Line 675  class Test_LinearPDE_noLumping(Test_line Line 957  class Test_LinearPDE_noLumping(Test_line
957      def test_setCoefficient_A_Scalar(self):      def test_setCoefficient_A_Scalar(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(A=numarray.ones((d,d)))          mypde.setValue(A=numpy.ones((d,d)))
961          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
962          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))
963      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(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(B=numarray.ones((d,)))          mypde.setValue(B=numpy.ones((d,)))
967          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
968          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))
969      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
970          d=self.domain.getDim()          d=self.domain.getDim()
971          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
972          mypde.setValue(C=numarray.ones((d,)))          mypde.setValue(C=numpy.ones((d,)))
973          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
974          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))
975      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
# Line 699  class Test_LinearPDE_noLumping(Test_line Line 981  class Test_LinearPDE_noLumping(Test_line
981      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(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(X=numarray.ones((d,)))          mypde.setValue(X=numpy.ones((d,)))
985          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
986          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))
987      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
# Line 735  class Test_LinearPDE_noLumping(Test_line Line 1017  class Test_LinearPDE_noLumping(Test_line
1017      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
1018          d=self.domain.getDim()          d=self.domain.getDim()
1019          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1020          mypde.setValue(A_reduced=numarray.ones((d,d)))          mypde.setValue(A_reduced=numpy.ones((d,d)))
1021          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1022          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))
1023      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(self):
1024          d=self.domain.getDim()          d=self.domain.getDim()
1025          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1026          mypde.setValue(B_reduced=numarray.ones((d,)))          mypde.setValue(B_reduced=numpy.ones((d,)))
1027          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1028          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))
1029      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(self):
1030          d=self.domain.getDim()          d=self.domain.getDim()
1031          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1032          mypde.setValue(C_reduced=numarray.ones((d,)))          mypde.setValue(C_reduced=numpy.ones((d,)))
1033          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1034          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))
1035      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
# Line 759  class Test_LinearPDE_noLumping(Test_line Line 1041  class Test_LinearPDE_noLumping(Test_line
1041      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(self):
1042          d=self.domain.getDim()          d=self.domain.getDim()
1043          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1044          mypde.setValue(X_reduced=numarray.ones((d,)))          mypde.setValue(X_reduced=numpy.ones((d,)))
1045          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1046          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))
1047      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
# Line 822  class Test_LinearPDE_noLumping(Test_line Line 1104  class Test_LinearPDE_noLumping(Test_line
1104      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
1105          d=self.domain.getDim()          d=self.domain.getDim()
1106          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1107          mypde.setValue(A=Data(numarray.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
1108          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1109          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))
1110      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
1111          d=self.domain.getDim()          d=self.domain.getDim()
1112          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1113          mypde.setValue(B=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1114          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1115          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))
1116      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(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          mypde.setValue(C=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1120          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1121          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))
1122      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 1128  class Test_LinearPDE_noLumping(Test_line
1128      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
1129          d=self.domain.getDim()          d=self.domain.getDim()
1130          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1131          mypde.setValue(X_reduced=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1132          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1133          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))
1134      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 1167  class Test_LinearPDE_noLumping(Test_line
1167      def test_setCoefficient_A_System(self):      def test_setCoefficient_A_System(self):
1168          d=self.domain.getDim()          d=self.domain.getDim()
1169          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1170          mypde.setValue(A=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))
1171          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
1172          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))
1173      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
1174          d=self.domain.getDim()          d=self.domain.getDim()
1175          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1176          mypde.setValue(B=numarray.ones((self.N,d,self.N)))          mypde.setValue(B=numpy.ones((self.N,d,self.N)))
1177          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
1178          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))
1179      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
1180          d=self.domain.getDim()          d=self.domain.getDim()
1181          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1182          mypde.setValue(C=numarray.ones((self.N,self.N,d)))          mypde.setValue(C=numpy.ones((self.N,self.N,d)))
1183          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
1184          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))
1185      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
1186          d=self.domain.getDim()          d=self.domain.getDim()
1187          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1188          mypde.setValue(D=numarray.ones((self.N,self.N)))          mypde.setValue(D=numpy.ones((self.N,self.N)))
1189          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
1190          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))
1191      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
1192          d=self.domain.getDim()          d=self.domain.getDim()
1193          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1194          mypde.setValue(X=numarray.ones((self.N,d)))          mypde.setValue(X=numpy.ones((self.N,d)))
1195          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
1196          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))
1197      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
1198          d=self.domain.getDim()          d=self.domain.getDim()
1199          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1200          mypde.setValue(Y=numarray.ones((self.N,)))          mypde.setValue(Y=numpy.ones((self.N,)))
1201          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
1202          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))
1203      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
1204          d=self.domain.getDim()          d=self.domain.getDim()
1205          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1206          mypde.setValue(y=numarray.ones((self.N,)))          mypde.setValue(y=numpy.ones((self.N,)))
1207          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
1208          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))
1209      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
1210          d=self.domain.getDim()          d=self.domain.getDim()
1211          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1212          mypde.setValue(d=numarray.ones((self.N,self.N)))          mypde.setValue(d=numpy.ones((self.N,self.N)))
1213          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1214          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))
1215      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
1216          d=self.domain.getDim()          d=self.domain.getDim()
1217          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1218          mypde.setValue(d_contact=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
1219          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
1220          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))
1221      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
1222          d=self.domain.getDim()          d=self.domain.getDim()
1223          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1224          mypde.setValue(y_contact=numarray.ones((self.N,)))          mypde.setValue(y_contact=numpy.ones((self.N,)))
1225          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
1226          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))
1227      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
1228          d=self.domain.getDim()          d=self.domain.getDim()
1229          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1230          mypde.setValue(A_reduced=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))
1231          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1232          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))
1233      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
1234          d=self.domain.getDim()          d=self.domain.getDim()
1235          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1236          mypde.setValue(B_reduced=numarray.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))
1237          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1238          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))
1239      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
1240          d=self.domain.getDim()          d=self.domain.getDim()
1241          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1242          mypde.setValue(C_reduced=numarray.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))
1243          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1244          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))
1245      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(self):
1246          d=self.domain.getDim()          d=self.domain.getDim()
1247          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1248          mypde.setValue(D_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))
1249          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1250          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))
1251      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
1252          d=self.domain.getDim()          d=self.domain.getDim()
1253          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1254          mypde.setValue(X_reduced=numarray.ones((self.N,d)))          mypde.setValue(X_reduced=numpy.ones((self.N,d)))
1255          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1256          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))
1257      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
1258          d=self.domain.getDim()          d=self.domain.getDim()
1259          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1260          mypde.setValue(Y_reduced=numarray.ones((self.N,)))          mypde.setValue(Y_reduced=numpy.ones((self.N,)))
1261          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1262          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))
1263      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
1264          d=self.domain.getDim()          d=self.domain.getDim()
1265          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1266          mypde.setValue(y_reduced=numarray.ones((self.N,)))          mypde.setValue(y_reduced=numpy.ones((self.N,)))
1267          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1268          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))
1269      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
1270          d=self.domain.getDim()          d=self.domain.getDim()
1271          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1272          mypde.setValue(d_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))
1273          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1274          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))
1275      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
1276          d=self.domain.getDim()          d=self.domain.getDim()
1277          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1278          mypde.setValue(d_contact_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
1279          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1280          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))
1281      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
1282          d=self.domain.getDim()          d=self.domain.getDim()
1283          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1284          mypde.setValue(y_contact_reduced=numarray.ones((self.N,)))          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
1285          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1286          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))
1287      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
1288          d=self.domain.getDim()          d=self.domain.getDim()
1289          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1290          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
1291          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1292          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))
1293      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
1294          d=self.domain.getDim()          d=self.domain.getDim()
1295          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1296          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
1297          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1298          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))
1299      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
1300          d=self.domain.getDim()          d=self.domain.getDim()
1301          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1302          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1303          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
1304          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1305          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))
1306      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
1307          d=self.domain.getDim()          d=self.domain.getDim()
1308          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1309          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1310          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
1311          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1312          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))
1313    
1314      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
1315          d=self.domain.getDim()          d=self.domain.getDim()
1316          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1317          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)))
1318          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1319          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))
1320      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
1321          d=self.domain.getDim()          d=self.domain.getDim()
1322          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1323          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)))
1324          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1325          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))
1326      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
1327          d=self.domain.getDim()          d=self.domain.getDim()
1328          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1329          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)))
1330          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1331          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))
1332      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
1333          d=self.domain.getDim()          d=self.domain.getDim()
1334          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1335          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)))
1336          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1337          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))
1338      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
1339          d=self.domain.getDim()          d=self.domain.getDim()
1340          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1341          mypde.setValue(X=Data(numarray.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
1342          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1343          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))
1344      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
1345          d=self.domain.getDim()          d=self.domain.getDim()
1346          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1347          mypde.setValue(Y=Data(numarray.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
1348          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1349          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))
1350      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
1351          d=self.domain.getDim()          d=self.domain.getDim()
1352          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1353          mypde.setValue(y=Data(numarray.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
1354          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1355          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))
1356      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
1357          d=self.domain.getDim()          d=self.domain.getDim()
1358          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1359          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)))
1360          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1361          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))
1362      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
1363          d=self.domain.getDim()          d=self.domain.getDim()
1364          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1365          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)))
1366          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1367          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))
1368      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
1369          d=self.domain.getDim()          d=self.domain.getDim()
1370          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1371          mypde.setValue(y_contact=Data(numarray.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
1372          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1373          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))
1374      def test_resetCoefficient_HomogeneousConstraint(self):      def test_resetCoefficient_HomogeneousConstraint(self):
# Line 1116  class Test_LinearPDE_noLumping(Test_line Line 1398  class Test_LinearPDE_noLumping(Test_line
1398      def test_symmetryCheckTrue_System(self):      def test_symmetryCheckTrue_System(self):
1399          d=self.domain.getDim()          d=self.domain.getDim()
1400          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1401          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1402          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1403          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1404          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1405          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1406          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1407          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)
1408          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")
1409    
1410      def test_symmetryCheckFalse_A_System(self):      def test_symmetryCheckFalse_A_System(self):
1411          d=self.domain.getDim()          d=self.domain.getDim()
1412          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1413          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1414          A[1,1,1,0]=0.          A[1,1,1,0]=0.
1415          mypde.setValue(A=A)          mypde.setValue(A=A)
1416          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1417      def test_symmetryCheckFalse_BC_System(self):      def test_symmetryCheckFalse_BC_System(self):
1418          d=self.domain.getDim()          d=self.domain.getDim()
1419          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1420          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1421          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1422          B[0,0,1]=1.          B[0,0,1]=1.
1423          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
1424          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1425    
1426      def test_symmetryCheckFalse_D_System(self):      def test_symmetryCheckFalse_D_System(self):
1427          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1428          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1429          D[0,1]=0.          D[0,1]=0.
1430          mypde.setValue(D=D)          mypde.setValue(D=D)
1431          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1432    
1433      def test_symmetryCheckFalse_d_System(self):      def test_symmetryCheckFalse_d_System(self):
1434          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1435          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1436          d[0,1]=0.          d[0,1]=0.
1437          mypde.setValue(d=d)          mypde.setValue(d=d)
1438          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1439    
1440      def test_symmetryCheckFalse_d_contact_System(self):      def test_symmetryCheckFalse_d_contact_System(self):
1441          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1442          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1443          d_contact[0,1]=0.          d_contact[0,1]=0.
1444          mypde.setValue(d_contact=d_contact)          mypde.setValue(d_contact=d_contact)
1445          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 1447  class Test_LinearPDE_noLumping(Test_line
1447      def test_symmetryCheckFalse_A_reduced_System(self):      def test_symmetryCheckFalse_A_reduced_System(self):
1448          d=self.domain.getDim()          d=self.domain.getDim()
1449          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1450          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1451          A[1,1,1,0]=0.          A[1,1,1,0]=0.
1452          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
1453          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1454      def test_symmetryCheckFalse_BC_reduced_System(self):      def test_symmetryCheckFalse_BC_reduced_System(self):
1455          d=self.domain.getDim()          d=self.domain.getDim()
1456          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1457          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1458          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1459          B[0,0,1]=1.          B[0,0,1]=1.
1460          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
1461          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1462    
1463      def test_symmetryCheckFalse_D_reduced_System(self):      def test_symmetryCheckFalse_D_reduced_System(self):
1464          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1465          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1466          D[0,1]=0.          D[0,1]=0.
1467          mypde.setValue(D_reduced=D)          mypde.setValue(D_reduced=D)
1468          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1469    
1470      def test_symmetryCheckFalse_d_reduced_System(self):      def test_symmetryCheckFalse_d_reduced_System(self):
1471          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1472          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1473          d[0,1]=0.          d[0,1]=0.
1474          mypde.setValue(d_reduced=d)          mypde.setValue(d_reduced=d)
1475          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1476    
1477      def test_symmetryCheckFalse_d_contact_reduced_System(self):      def test_symmetryCheckFalse_d_contact_reduced_System(self):
1478          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1479          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1480          d_contact[0,1]=0.          d_contact[0,1]=0.
1481          mypde.setValue(d_contact_reduced=d_contact)          mypde.setValue(d_contact_reduced=d_contact)
1482          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 1484  class Test_LinearPDE_noLumping(Test_line
1484      def test_symmetryCheckTrue_Scalar(self):      def test_symmetryCheckTrue_Scalar(self):
1485          d=self.domain.getDim()          d=self.domain.getDim()
1486          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1487          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1488          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1489          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1490          D=3          D=3
1491          d=4          d=4
1492          d_contact=5          d_contact=5
# Line 1214  class Test_LinearPDE_noLumping(Test_line Line 1496  class Test_LinearPDE_noLumping(Test_line
1496      def test_symmetryCheckFalse_A_Scalar(self):      def test_symmetryCheckFalse_A_Scalar(self):
1497          d=self.domain.getDim()          d=self.domain.getDim()
1498          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1499          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1500          A[1,0]=0.          A[1,0]=0.
1501          mypde.setValue(A=A)          mypde.setValue(A=A)
1502          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1503      def test_symmetryCheckFalse_BC_Scalar(self):      def test_symmetryCheckFalse_BC_Scalar(self):
1504          d=self.domain.getDim()          d=self.domain.getDim()
1505          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1506          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1507          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1508          B[0]=1.          B[0]=1.
1509          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
1510          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1511      def test_symmetryCheckFalse_A_reduced_Scalar(self):      def test_symmetryCheckFalse_A_reduced_Scalar(self):
1512          d=self.domain.getDim()          d=self.domain.getDim()
1513          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1514          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1515          A[1,0]=0.          A[1,0]=0.
1516          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
1517          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1518      def test_symmetryCheckFalse_BC_reduced_Scalar(self):      def test_symmetryCheckFalse_BC_reduced_Scalar(self):
1519          d=self.domain.getDim()          d=self.domain.getDim()
1520          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1521          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1522          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1523          B[0]=1.          B[0]=1.
1524          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
1525          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 1969  class Test_LinearPDE(Test_LinearPDE_noLu
1969      def test_Lumping_System(self):      def test_Lumping_System(self):
1970          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1971      mypde.setSolverMethod(mypde.LUMPING)      mypde.setSolverMethod(mypde.LUMPING)
1972          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.]))
1973          u=mypde.getSolution(verbose=self.VERBOSE)          u=mypde.getSolution(verbose=self.VERBOSE)
1974          self.failUnless(self.check(u,numarray.ones((2,))),'solution is wrong.')          self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')
1975      def test_Constrained_Lumping_System(self):      def test_Constrained_Lumping_System(self):
1976          x=self.domain.getX()          x=self.domain.getX()
1977          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1978      mypde.setSolverMethod(mypde.LUMPING)      mypde.setSolverMethod(mypde.LUMPING)
1979          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.]), \
1980                         q=whereZero(x[0])*[0.,1],r=[0.,1.])                         q=whereZero(x[0])*[0.,1],r=[0.,1.])
1981          u=mypde.getSolution(verbose=self.VERBOSE)          u=mypde.getSolution(verbose=self.VERBOSE)
1982          self.failUnless(self.check(u,numarray.ones((2,))),'solution is wrong.')          self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')
1983    
1984      def test_Lumping_updateRHS(self):      def test_Lumping_updateRHS(self):
1985          x=self.domain.getX()          x=self.domain.getX()
# Line 1786  class Test_TransportPDE(Test_linearPDEs) Line 2068  class Test_TransportPDE(Test_linearPDEs)
2068      def test_setCoefficient_A_Scalar(self):      def test_setCoefficient_A_Scalar(self):
2069          d=self.domain.getDim()          d=self.domain.getDim()
2070          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2071          mypde.setValue(A=numarray.ones((d,d)))          mypde.setValue(A=numpy.ones((d,d)))
2072          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
2073          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))
2074      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(self):
2075          d=self.domain.getDim()          d=self.domain.getDim()
2076          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2077          mypde.setValue(B=numarray.ones((d,)))          mypde.setValue(B=numpy.ones((d,)))
2078          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
2079          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))
2080      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
2081          d=self.domain.getDim()          d=self.domain.getDim()
2082          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2083          mypde.setValue(C=numarray.ones((d,)))          mypde.setValue(C=numpy.ones((d,)))
2084          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
2085          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))
2086      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
# Line 1810  class Test_TransportPDE(Test_linearPDEs) Line 2092  class Test_TransportPDE(Test_linearPDEs)
2092      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(self):
2093          d=self.domain.getDim()          d=self.domain.getDim()
2094          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2095          mypde.setValue(X=numarray.ones((d,)))          mypde.setValue(X=numpy.ones((d,)))
2096          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
2097          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))
2098      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
# Line 1859  class Test_TransportPDE(Test_linearPDEs) Line 2141  class Test_TransportPDE(Test_linearPDEs)
2141      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
2142          d=self.domain.getDim()          d=self.domain.getDim()
2143          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2144          mypde.setValue(A_reduced=numarray.ones((d,d)))          mypde.setValue(A_reduced=numpy.ones((d,d)))
2145          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2146          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))
2147      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(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(B_reduced=numarray.ones((d,)))          mypde.setValue(B_reduced=numpy.ones((d,)))
2151          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2152          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))
2153      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(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(C_reduced=numarray.ones((d,)))          mypde.setValue(C_reduced=numpy.ones((d,)))
2157          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2158          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))
2159      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
# Line 1883  class Test_TransportPDE(Test_linearPDEs) Line 2165  class Test_TransportPDE(Test_linearPDEs)
2165      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(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(X_reduced=numarray.ones((d,)))          mypde.setValue(X_reduced=numpy.ones((d,)))
2169          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2170          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))
2171      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
# Line 1958  class Test_TransportPDE(Test_linearPDEs) Line 2240  class Test_TransportPDE(Test_linearPDEs)
2240      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
2241          d=self.domain.getDim()          d=self.domain.getDim()
2242          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2243          mypde.setValue(A=Data(numarray.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
2244          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2245          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))
2246      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(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(B=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2250          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2251          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))
2252      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(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(C=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2256          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2257          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))
2258      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
# Line 1982  class Test_TransportPDE(Test_linearPDEs) Line 2264  class Test_TransportPDE(Test_linearPDEs)
2264      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(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(X_reduced=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2268          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2269          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))
2270      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
# Line 2027  class Test_TransportPDE(Test_linearPDEs) Line 2309  class Test_TransportPDE(Test_linearPDEs)
2309      def test_setCoefficient_M_System(self):      def test_setCoefficient_M_System(self):
2310          d=self.domain.getDim()          d=self.domain.getDim()
2311          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2312          mypde.setValue(M=numarray.ones((self.N,self.N)))          mypde.setValue(M=numpy.ones((self.N,self.N)))
2313          coeff=mypde.getCoefficient("M")          coeff=mypde.getCoefficient("M")
2314          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))
2315      def test_setCoefficient_A_System(self):      def test_setCoefficient_A_System(self):
2316          d=self.domain.getDim()          d=self.domain.getDim()
2317          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2318          mypde.setValue(A=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))
2319          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
2320          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))
2321      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
2322          d=self.domain.getDim()          d=self.domain.getDim()
2323          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2324          mypde.setValue(B=numarray.ones((self.N,d,self.N)))          mypde.setValue(B=numpy.ones((self.N,d,self.N)))
2325          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
2326          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))
2327      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
2328          d=self.domain.getDim()          d=self.domain.getDim()
2329          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2330          mypde.setValue(C=numarray.ones((self.N,self.N,d)))          mypde.setValue(C=numpy.ones((self.N,self.N,d)))
2331          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
2332          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))
2333      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
2334          d=self.domain.getDim()          d=self.domain.getDim()
2335          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2336          mypde.setValue(D=numarray.ones((self.N,self.N)))          mypde.setValue(D=numpy.ones((self.N,self.N)))
2337          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
2338          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))
2339      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
2340          d=self.domain.getDim()          d=self.domain.getDim()
2341          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2342          mypde.setValue(X=numarray.ones((self.N,d)))          mypde.setValue(X=numpy.ones((self.N,d)))
2343          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
2344          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))
2345      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
2346          d=self.domain.getDim()          d=self.domain.getDim()
2347          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2348          mypde.setValue(Y=numarray.ones((self.N,)))          mypde.setValue(Y=numpy.ones((self.N,)))
2349          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
2350          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))
2351      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
2352          d=self.domain.getDim()          d=self.domain.getDim()
2353          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2354          mypde.setValue(y=numarray.ones((self.N,)))          mypde.setValue(y=numpy.ones((self.N,)))
2355          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
2356          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))
2357      def test_setCoefficient_m_System(self):      def test_setCoefficient_m_System(self):
2358          d=self.domain.getDim()          d=self.domain.getDim()
2359          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2360          mypde.setValue(m=numarray.ones((self.N,self.N)))          mypde.setValue(m=numpy.ones((self.N,self.N)))
2361          coeff=mypde.getCoefficient("m")          coeff=mypde.getCoefficient("m")
2362          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))
2363      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
2364          d=self.domain.getDim()          d=self.domain.getDim()
2365          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2366          mypde.setValue(d=numarray.ones((self.N,self.N)))          mypde.setValue(d=numpy.ones((self.N,self.N)))
2367          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
2368          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))
2369      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
2370          d=self.domain.getDim()          d=self.domain.getDim()
2371          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2372          mypde.setValue(d_contact=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
2373          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
2374          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))
2375      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
2376          d=self.domain.getDim()          d=self.domain.getDim()
2377          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2378          mypde.setValue(y_contact=numarray.ones((self.N,)))          mypde.setValue(y_contact=numpy.ones((self.N,)))
2379          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
2380          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))
2381      def test_setCoefficient_M_System_reduced(self):      def test_setCoefficient_M_System_reduced(self):
2382          d=self.domain.getDim()          d=self.domain.getDim()
2383          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2384          mypde.setValue(M_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(M_reduced=numpy.ones((self.N,self.N)))
2385          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2386          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))
2387      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
2388          d=self.domain.getDim()          d=self.domain.getDim()
2389          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2390          mypde.setValue(A_reduced=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))
2391          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2392          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))
2393      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
2394          d=self.domain.getDim()          d=self.domain.getDim()
2395          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2396          mypde.setValue(B_reduced=numarray.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))
2397          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2398          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))
2399      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
2400          d=self.domain.getDim()          d=self.domain.getDim()
2401          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2402          mypde.setValue(C_reduced=numarray.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))
2403          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2404          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))
2405      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(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          mypde.setValue(D_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))
2409          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2410          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))
2411      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
2412          d=self.domain.getDim()          d=self.domain.getDim()
2413          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2414          mypde.setValue(X_reduced=numarray.ones((self.N,d)))          mypde.setValue(X_reduced=numpy.ones((self.N,d)))
2415          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2416          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))
2417      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
2418          d=self.domain.getDim()          d=self.domain.getDim()
2419          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2420          mypde.setValue(Y_reduced=numarray.ones((self.N,)))          mypde.setValue(Y_reduced=numpy.ones((self.N,)))
2421          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2422          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))
2423      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
2424          d=self.domain.getDim()          d=self.domain.getDim()
2425          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2426          mypde.setValue(y_reduced=numarray.ones((self.N,)))          mypde.setValue(y_reduced=numpy.ones((self.N,)))
2427          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2428          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))
2429      def test_setCoefficient_m_reduced_System(self):      def test_setCoefficient_m_reduced_System(self):
2430          d=self.domain.getDim()          d=self.domain.getDim()
2431          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2432          mypde.setValue(m_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(m_reduced=numpy.ones((self.N,self.N)))
2433          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2434          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))
2435      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
2436          d=self.domain.getDim()          d=self.domain.getDim()
2437          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2438          mypde.setValue(d_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))
2439          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2440          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))
2441      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
2442          d=self.domain.getDim()          d=self.domain.getDim()
2443          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2444          mypde.setValue(d_contact_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
2445          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2446          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))
2447      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
2448          d=self.domain.getDim()          d=self.domain.getDim()
2449          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2450          mypde.setValue(y_contact_reduced=numarray.ones((self.N,)))          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
2451          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2452          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))
2453      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
2454          d=self.domain.getDim()          d=self.domain.getDim()
2455          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2456          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
2457          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2458          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))
2459      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
2460          d=self.domain.getDim()          d=self.domain.getDim()
2461          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2462          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
2463          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2464          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))
2465      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
2466          d=self.domain.getDim()          d=self.domain.getDim()
2467          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2468          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2469          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
2470          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2471          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))
2472      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
2473          d=self.domain.getDim()          d=self.domain.getDim()
2474          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2475          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2476          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
2477          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2478          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))
2479    
2480      def test_setCoefficient_M_System_reduced_using_D(self):      def test_setCoefficient_M_System_reduced_using_D(self):
2481          d=self.domain.getDim()          d=self.domain.getDim()
2482          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2483          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)))
2484          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2485          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))
2486      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
2487          d=self.domain.getDim()          d=self.domain.getDim()
2488          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2489          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)))
2490          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2491          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))
2492      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
2493          d=self.domain.getDim()          d=self.domain.getDim()
2494          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2495          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)))
2496          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2497          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))
2498      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
2499          d=self.domain.getDim()          d=self.domain.getDim()
2500          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2501          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)))
2502          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2503          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))
2504      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
2505          d=self.domain.getDim()          d=self.domain.getDim()
2506          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2507          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)))
2508          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2509          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))
2510      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
2511          d=self.domain.getDim()          d=self.domain.getDim()
2512          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2513          mypde.setValue(X=Data(numarray.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
2514          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2515          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))
2516      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
2517          d=self.domain.getDim()          d=self.domain.getDim()
2518          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2519          mypde.setValue(Y=Data(numarray.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
2520          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2521          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))
2522      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
2523          d=self.domain.getDim()          d=self.domain.getDim()
2524          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2525          mypde.setValue(y=Data(numarray.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
2526          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2527          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))
2528      def test_setCoefficient_m_reduced_System_using_m(self):      def test_setCoefficient_m_reduced_System_using_m(self):
2529          d=self.domain.getDim()          d=self.domain.getDim()
2530          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2531          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)))
2532          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2533          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))
2534      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
2535          d=self.domain.getDim()          d=self.domain.getDim()
2536          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2537          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)))
2538          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2539          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))
2540      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
2541          d=self.domain.getDim()          d=self.domain.getDim()
2542          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2543          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)))
2544          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2545          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))
2546      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
2547          d=self.domain.getDim()          d=self.domain.getDim()
2548          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2549          mypde.setValue(y_contact=Data(numarray.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
2550          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2551          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))
2552    
2553      def test_symmetryCheckTrue_System(self):      def test_symmetryCheckTrue_System(self):
2554          d=self.domain.getDim()          d=self.domain.getDim()
2555          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2556          M=100*numarray.ones((self.N,self.N))          M=100*numpy.ones((self.N,self.N))
2557          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2558          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2559          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2560          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2561          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2562          m=64*numarray.ones((self.N,self.N))          m=64*numpy.ones((self.N,self.N))
2563          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2564          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)
2565          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")
2566    
2567      def test_symmetryCheckFalse_M_System(self):      def test_symmetryCheckFalse_M_System(self):
2568          d=self.domain.getDim()          d=self.domain.getDim()
2569          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2570          M=numarray.ones((self.N,self.N))          M=numpy.ones((self.N,self.N))
2571          M[1,0]=0.          M[1,0]=0.
2572          mypde.setValue(M=M)          mypde.setValue(M=M)
2573          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 2575  class Test_TransportPDE(Test_linearPDEs)
2575      def test_symmetryCheckFalse_A_System(self):      def test_symmetryCheckFalse_A_System(self):
2576          d=self.domain.getDim()          d=self.domain.getDim()
2577          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2578          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2579          A[1,1,1,0]=0.          A[1,1,1,0]=0.
2580          mypde.setValue(A=A)          mypde.setValue(A=A)
2581          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 2583  class Test_TransportPDE(Test_linearPDEs)
2583      def test_symmetryCheckFalse_BC_System(self):      def test_symmetryCheckFalse_BC_System(self):
2584          d=self.domain.getDim()          d=self.domain.getDim()
2585          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2586          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2587          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2588          B[0,0,1]=1.          B[0,0,1]=1.
2589          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
2590          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2591    
2592      def test_symmetryCheckFalse_D_System(self):      def test_symmetryCheckFalse_D_System(self):
2593          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2594          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2595          D[0,1]=0.          D[0,1]=0.
2596          mypde.setValue(D=D)          mypde.setValue(D=D)
2597          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2598    
2599      def test_symmetryCheckFalse_m_System(self):      def test_symmetryCheckFalse_m_System(self):
2600          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2601          m=4*numarray.ones((self.N,self.N))          m=4*numpy.ones((self.N,self.N))
2602          m[0,1]=0.          m[0,1]=0.
2603          mypde.setValue(m=m)          mypde.setValue(m=m)
2604          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2605    
2606      def test_symmetryCheckFalse_d_System(self):      def test_symmetryCheckFalse_d_System(self):
2607          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2608          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2609          d[0,1]=0.          d[0,1]=0.
2610          mypde.setValue(d=d)          mypde.setValue(d=d)
2611          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2612    
2613      def test_symmetryCheckFalse_d_contact_System(self):      def test_symmetryCheckFalse_d_contact_System(self):
2614          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2615          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2616          d_contact[0,1]=0.          d_contact[0,1]=0.
2617          mypde.setValue(d_contact=d_contact)          mypde.setValue(d_contact=d_contact)
2618          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2619    
2620      def test_symmetryCheckFalse_M_reduced_System(self):      def test_symmetryCheckFalse_M_reduced_System(self):
2621          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2622          M=3*numarray.ones((self.N,self.N))          M=3*numpy.ones((self.N,self.N))
2623          M[0,1]=0.          M[0,1]=0.
2624          mypde.setValue(M_reduced=M)          mypde.setValue(M_reduced=M)
2625          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 2627  class Test_TransportPDE(Test_linearPDEs)
2627      def test_symmetryCheckFalse_A_reduced_System(self):      def test_symmetryCheckFalse_A_reduced_System(self):
2628          d=self.domain.getDim()          d=self.domain.getDim()
2629          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2630          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2631          A[1,1,1,0]=0.          A[1,1,1,0]=0.
2632          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
2633          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 2635  class Test_TransportPDE(Test_linearPDEs)
2635      def test_symmetryCheckFalse_BC_reduced_System(self):      def test_symmetryCheckFalse_BC_reduced_System(self):
2636          d=self.domain.getDim()          d=self.domain.getDim()
2637          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2638          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2639          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2640          B[0,0,1]=1.          B[0,0,1]=1.
2641          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
2642          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2643    
2644      def test_symmetryCheckFalse_D_reduced_System(self):      def test_symmetryCheckFalse_D_reduced_System(self):
2645          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2646          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2647          D[0,1]=0.          D[0,1]=0.
2648          mypde.setValue(D_reduced=D)          mypde.setValue(D_reduced=D)
2649          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2650    
2651      def test_symmetryCheckFalse_m_reduced_System(self):      def test_symmetryCheckFalse_m_reduced_System(self):
2652          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2653          m=4*numarray.ones((self.N,self.N))          m=4*numpy.ones((self.N,self.N))
2654          m[0,1]=0.          m[0,1]=0.
2655          mypde.setValue(m_reduced=m)          mypde.setValue(m_reduced=m)
2656          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2657    
2658      def test_symmetryCheckFalse_d_reduced_System(self):      def test_symmetryCheckFalse_d_reduced_System(self):
2659          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2660          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2661          d[0,1]=0.          d[0,1]=0.
2662          mypde.setValue(d_reduced=d)          mypde.setValue(d_reduced=d)
2663          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2664    
2665      def test_symmetryCheckFalse_d_contact_reduced_System(self):      def test_symmetryCheckFalse_d_contact_reduced_System(self):
2666          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2667          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2668          d_contact[0,1]=0.          d_contact[0,1]=0.
2669          mypde.setValue(d_contact_reduced=d_contact)          mypde.setValue(d_contact_reduced=d_contact)
2670          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 2674  class Test_TransportPDE(Test_linearPDEs)
2674          d=self.domain.getDim()          d=self.domain.getDim()
2675          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2676          M=100          M=100
2677          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2678          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2679          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2680          D=3          D=3
2681          m=10          m=10
2682          d=4          d=4
# Line 2405  class Test_TransportPDE(Test_linearPDEs) Line 2687  class Test_TransportPDE(Test_linearPDEs)
2687      def test_symmetryCheckFalse_A_Scalar(self):      def test_symmetryCheckFalse_A_Scalar(self):
2688          d=self.domain.getDim()          d=self.domain.getDim()
2689          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2690          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2691          A[1,0]=0.          A[1,0]=0.
2692          mypde.setValue(A=A)          mypde.setValue(A=A)
2693          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2694      def test_symmetryCheckFalse_BC_Scalar(self):      def test_symmetryCheckFalse_BC_Scalar(self):
2695          d=self.domain.getDim()          d=self.domain.getDim()
2696          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2697          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2698          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2699          B[0]=1.          B[0]=1.
2700          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
2701          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2702      def test_symmetryCheckFalse_A_reduced_Scalar(self):      def test_symmetryCheckFalse_A_reduced_Scalar(self):
2703          d=self.domain.getDim()          d=self.domain.getDim()
2704          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2705          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2706          A[1,0]=0.          A[1,0]=0.
2707          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
2708          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2709      def test_symmetryCheckFalse_BC_reduced_Scalar(self):      def test_symmetryCheckFalse_BC_reduced_Scalar(self):
2710          d=self.domain.getDim()          d=self.domain.getDim()
2711          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2712          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2713          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2714          B[0]=1.          B[0]=1.
2715          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
2716          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")

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

  ViewVC Help
Powered by ViewVC 1.1.26