/[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 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC
# Line 1  Line 1 
1    
2  ########################################################  ########################################################
3  #  #
4  # Copyright (c) 2003-2008 by University of Queensland  # Copyright (c) 2003-2009 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
6  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
7  #  #
# Line 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 67  class Test_LameEquation(Test_linearPDEs) Line 67  class Test_LameEquation(Test_linearPDEs)
67      def test_config(self):      def test_config(self):
68          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
69          d=self.domain.getDim()          d=self.domain.getDim()
70          self.failUnlessEqual((mypde.getNumEquations(),mypde.getNumSolutions(),mypde.isSymmetric()),(d,d,True),"set up incorrect")          self.failUnlessEqual((mypde.getNumEquations(), mypde.getNumSolutions(), mypde.getSolverOptions().isSymmetric()),(d,d,True),"set up incorrect")
71    
72      def test_setCoefficient_q(self):      def test_setCoefficient_q(self):
73          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
# Line 330  class Test_Helmholtz(Test_linearPDEs): Line 330  class Test_Helmholtz(Test_linearPDEs):
330    
331      def test_config(self):      def test_config(self):
332          mypde=Helmholtz(self.domain,debug=self.DEBUG)          mypde=Helmholtz(self.domain,debug=self.DEBUG)
333          self.failUnlessEqual((mypde.getNumEquations(),mypde.getNumSolutions(),mypde.isSymmetric()),(1,1,True),"set up incorrect")          self.failUnlessEqual((mypde.getNumEquations(), mypde.getNumSolutions(), mypde.getSolverOptions().isSymmetric()),(1,1,True),"set up incorrect")
334      def test_setCoefficient_q(self):      def test_setCoefficient_q(self):
335          mypde=Helmholtz(self.domain,debug=self.DEBUG)          mypde=Helmholtz(self.domain,debug=self.DEBUG)
336          x=self.domain.getX()          x=self.domain.getX()
# Line 526  class Test_Poisson(Test_linearPDEs): Line 526  class Test_Poisson(Test_linearPDEs):
526    
527      def test_config(self):      def test_config(self):
528          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
529          self.failUnlessEqual((mypde.getNumEquations(),mypde.getNumSolutions(),mypde.isSymmetric()),(1,1,True),"set up incorrect")          self.failUnlessEqual((mypde.getNumEquations(), mypde.getNumSolutions(), mypde.getSolverOptions().isSymmetric()),(1,1,True),"set up incorrect")
530      def test_setCoefficient_q(self):      def test_setCoefficient_q(self):
531          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
532          x=self.domain.getX()          x=self.domain.getX()
# Line 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.getMinCoarseMatrixSize() == 500, "initial  Minimum Coarse Matrix Size is wrong.")
657            self.failUnlessRaises(ValueError,so.setMinCoarseMatrixSize,-1)
658            so.setMinCoarseMatrixSize(1000)
659            self.failUnless(so.getMinCoarseMatrixSize() == 1000, "Minimum Coarse Matrix Size is wrong.")
660    
661            self.failUnless(so.getNumSweeps() == 2, "initial  Sweeps is wrong.")
662            self.failUnlessRaises(ValueError,so.setNumSweeps,-1)
663            so.setNumSweeps(3)
664            self.failUnless(so.getNumSweeps() == 3, "Sweeps is wrong.")
665    
666            self.failUnless(so.getNumPreSweeps() == 2, "initial  PreSweeps is wrong.")
667            self.failUnlessRaises(ValueError,so.setNumPreSweeps,-1)
668            so.setNumPreSweeps(4)
669            self.failUnless(so.getNumPreSweeps() == 4, "PreSweeps is wrong.")
670    
671            self.failUnless(so.getNumPostSweeps() == 2, "initial  PreSweeps is wrong.")
672            self.failUnlessRaises(ValueError,so.setNumPostSweeps,-1)
673            so.setNumPostSweeps(5)
674            self.failUnless(so.getNumPostSweeps() == 5, "PreSweeps is wrong.")
675    
676            self.failUnless(so.getTolerance() == 1.e-8, "initial Tolerance is wrong.")
677            self.failUnlessRaises(ValueError,so.setTolerance,-1)
678            so.setTolerance(0.2)
679            self.failUnless(so.getTolerance() == 0.2, "Tolerance is wrong.")
680    
681            self.failUnless(so.getAbsoluteTolerance() == 0., "initial  AbsoluteTolerance is wrong.")
682            self.failUnlessRaises(ValueError,so.setAbsoluteTolerance,-1)
683            so.setAbsoluteTolerance(0.3)
684            self.failUnless(so.getAbsoluteTolerance() == 0.3, "AbsoluteTolerance is wrong.")
685    
686            self.failUnless(so.getInnerTolerance() == 0.9, "initial InnerTolerance is wrong.")
687            self.failUnlessRaises(ValueError,so.setInnerTolerance,-1)
688            so.setInnerTolerance(0.4)
689            self.failUnless(so.getInnerTolerance() == 0.4, "InnerTolerance is wrong.")
690    
691            self.failUnless(so.getDropTolerance() == 0.01, "initial DropTolerance is wrong.")
692            self.failUnlessRaises(ValueError,so.setDropTolerance,-1)
693            so.setDropTolerance(0.5)
694            self.failUnless(so.getDropTolerance() == 0.5, "DropDropTolerance is wrong.")
695    
696            self.failUnless(so.getDropStorage() == 2., "initial DropStorage is wrong.")
697            self.failUnlessRaises(ValueError,so.setDropStorage,-1)
698            so.setDropStorage(10)
699            self.failUnless(so.getDropStorage() == 10, "DropStorage is wrong.")
700            
701            self.failUnless(so.getRelaxationFactor() == 0.3, "initial RelaxationFactor is wrong.")
702            self.failUnlessRaises(ValueError,so.setRelaxationFactor,-1)
703            so.setRelaxationFactor(0.1)
704            self.failUnless(so.getRelaxationFactor() == 0.1, "Relaxation is wrong.")
705    
706    
707            self.failUnless(so.getIterMax() == 100000, "initial IterMax is wrong.")
708            self.failUnlessRaises(ValueError,so.setIterMax,0)
709            so.setIterMax(11)
710            self.failUnless(so.getIterMax() == 11, "IterMax is wrong.")
711    
712            self.failUnless(so.getInnerIterMax() == 10, "initial InnerIterMax is wrong.")
713            self.failUnlessRaises(ValueError,so.setInnerIterMax,0)
714            so.setInnerIterMax(12)
715            self.failUnless(so.getInnerIterMax() == 12, "InnerIterMax is wrong.")
716    
717            self.failUnless(so.getTruncation() == 20, "initial Truncation is wrong.")
718            self.failUnlessRaises(ValueError,so.setTruncation,0)
719            so.setTruncation(13)
720            self.failUnless(so.getTruncation() == 13, "Truncation is wrong.")
721    
722            self.failUnless(so.getRestart() == None, "initial Truncation is wrong.")
723            self.failUnlessRaises(ValueError,so.setTruncation,0)
724            so.setRestart(14)
725            self.failUnless(so.getRestart() == 14, "Truncation is wrong.")
726            so.setRestart(None)
727            self.failUnless(so.getRestart() == None, "Truncation is wrong.")
728        
729            self.failUnless(not so.isVerbose(), "initial verbosity flag is wrong.")
730            so.setVerbosityOn()
731            self.failUnless(so.isVerbose(), "verbosity (1) flag is wrong.")
732            so.setVerbosityOff()
733            self.failUnless(not so.isVerbose(), "verbosity (2) flag is wrong.")
734            so.setVerbosity(verbose=True)
735            self.failUnless(so.isVerbose(), "verbosity (3) flag is wrong.")
736            so.setVerbosity(verbose=False)
737            self.failUnless(not so.isVerbose(), "verbosity (4) flag is wrong.")
738    
739            self.failUnless(not so.isSymmetric(), "initial symmetry flag is wrong.")
740            so.setSymmetryOn()
741            self.failUnless(so.isSymmetric(), "symmetry (1) flag is wrong.")
742            so.setSymmetryOff()
743            self.failUnless(not so.isSymmetric(), "symmetry (2) flag is wrong.")
744            so.setSymmetry(flag=True)
745            self.failUnless(so.isSymmetric(), "symmetry (3) flag is wrong.")
746            so.setSymmetry(flag=False)
747            self.failUnless(not so.isSymmetric(), "symmetry (4) flag is wrong.")
748    
749            self.failUnless(so.adaptInnerTolerance(), "initial InnerToleranceAdaption flag is wrong.")
750            so.setInnerToleranceAdaptionOn()
751            self.failUnless(so.adaptInnerTolerance(), "InnerToleranceAdaption (1) flag is wrong.")
752            so.setInnerToleranceAdaptionOff()
753            self.failUnless(not so.adaptInnerTolerance(), "InnerToleranceAdaption (2) flag is wrong.")
754            so.setInnerToleranceAdaption(adapt=True)
755            self.failUnless(so.adaptInnerTolerance(), "InnerToleranceAdaption (3) flag is wrong.")
756            so.setInnerToleranceAdaption(adapt=False)
757            self.failUnless(not so.adaptInnerTolerance(), "InnerToleranceAdaption (4) flag is wrong.")
758        
759            self.failUnless(not so.acceptConvergenceFailure(), "initial acceptConvergenceFailure flag is wrong.")
760            so.setAcceptanceConvergenceFailureOn()
761            self.failUnless(so.acceptConvergenceFailure(), "acceptConvergenceFailure (1) flag is wrong.")
762            so.setAcceptanceConvergenceFailureOff()
763            self.failUnless(not so.acceptConvergenceFailure(), "acceptConvergenceFailure (2) flag is wrong.")
764            so.setAcceptanceConvergenceFailure(accept=True)
765            self.failUnless(so.acceptConvergenceFailure(), "acceptConvergenceFailure (3) flag is wrong.")
766            so.setAcceptanceConvergenceFailure(accept=False)
767            self.failUnless(not so.acceptConvergenceFailure(), "acceptConvergenceFailure (4) flag is wrong.")  
768            
769            self.failUnless(so.getReordering() == 30, "initial Reordering is wrong.")
770            self.failUnlessRaises(ValueError,so.setReordering,-1)
771            so.setReordering(so.NO_REORDERING)
772            self.failUnless(so.getReordering() == 17, "NO_REORDERING is not set.")
773            so.setReordering(so.MINIMUM_FILL_IN)
774            self.failUnless(so.getReordering() == 18, "MINIMUM_FILL_IN is not set.")
775            so.setReordering(so.NESTED_DISSECTION)
776            self.failUnless(so.getReordering() == 19, "NESTED_DISSECTION is not set.")
777            so.setReordering(so.DEFAULT_REORDERING)
778            self.failUnless(so.getReordering() == 30, "DEFAULT_REORDERING is not set.")
779            
780            self.failUnless(so.getPackage() == 0, "initial solver package is wrong.")
781            self.failUnlessRaises(ValueError,so.setPackage,-1)
782            so.setPackage(so.PASO)
783            self.failUnless(so.getPackage() == 21, "PASO is not set.")
784            so.setPackage(so.SUPER_LU)
785            self.failUnless(so.getPackage() == 31, "SUPER_LU is not set.")
786            so.setPackage(so.PASTIX)
787            self.failUnless(so.getPackage() == 32, "PASTIX is not set.")
788            so.setPackage(so.MKL)
789            self.failUnless(so.getPackage() == 15, "MKL is not set.")
790            so.setPackage(so.UMFPACK)
791            self.failUnless(so.getPackage() == 16, "UMFPACK is not set.")
792            so.setPackage(so.TRILINOS)
793            self.failUnless(so.getPackage() == 24, "TRILINOS is not set.")
794    
795            self.failUnless(so.getSolverMethod() == 0, "initial SolverMethod is wrong.")
796            self.failUnlessRaises(ValueError,so.setSolverMethod,-1)
797            so.setSolverMethod(so.DIRECT)
798            self.failUnless(so.getSolverMethod() == 1, "DIRECT is not set.")
799            so.setSolverMethod(so.CHOLEVSKY)
800            self.failUnless(so.getSolverMethod() == 2, "CHOLEVSKY is not set.")
801            so.setSolverMethod(so.PCG)
802            self.failUnless(so.getSolverMethod() == 3, "PCG is not set.")
803            so.setSolverMethod(so.CR)
804            self.failUnless(so.getSolverMethod() == 4, "CR is not set.")
805            so.setSolverMethod(so.CGS)
806            self.failUnless(so.getSolverMethod() == 5, "CGS is not set.")
807            so.setSolverMethod(so.BICGSTAB)
808            self.failUnless(so.getSolverMethod() == 6, "BICGSTAB is not set.")
809            so.setSolverMethod(so.SSOR)
810            self.failUnless(so.getSolverMethod() == 7, "SSOR is not set.")
811            so.setSolverMethod(so.GMRES)
812            self.failUnless(so.getSolverMethod() == 11, "GMRES is not set.")
813            so.setSolverMethod(so.PRES20)
814            self.failUnless(so.getSolverMethod() == 12, "PRES20 is not set.")
815            so.setSolverMethod(so.LUMPING)
816            self.failUnless(so.getSolverMethod() == 13, "LUMPING is not set.")
817            so.setSolverMethod(so.ITERATIVE)
818            self.failUnless(so.getSolverMethod() == 20, "ITERATIVE is not set.")
819            so.setSolverMethod(so.AMG)
820            self.failUnless(so.getSolverMethod() == 22, "AMG is not set.")
821            so.setSolverMethod(so.NONLINEAR_GMRES)
822            self.failUnless(so.getSolverMethod() == 25, "NONLINEAR_GMRES is not set.")
823            so.setSolverMethod(so.TFQMR)
824            self.failUnless(so.getSolverMethod() == 26, "TFQMR is not set.")
825            so.setSolverMethod(so.MINRES)
826            self.failUnless(so.getSolverMethod() == 27, "MINRES is not set.")
827            so.setSolverMethod(so.GAUSS_SEIDEL)
828            self.failUnless(so.getSolverMethod() == 28, "GAUSS_SEIDEL is not set.")
829            so.setSolverMethod(so.DEFAULT)
830            self.failUnless(so.getSolverMethod() == 0, "DEFAULT is not set.")
831    
832            self.failUnless(so.getPreconditioner() == 10, "initial Preconditioner is wrong.")
833            self.failUnlessRaises(ValueError,so.setPreconditioner,-1)
834            so.setPreconditioner(so.ILU0)
835            self.failUnless(so.getPreconditioner() == 8, "ILU0 is not set.")
836            so.setPreconditioner(so.SSOR)
837            self.failUnless(so.getPreconditioner() == 7, "SSOR is not set.")
838            so.setPreconditioner(so.ILUT)
839            self.failUnless(so.getPreconditioner() == 9, "ILUT is not set.")
840            so.setPreconditioner(so.JACOBI)
841            self.failUnless(so.getPreconditioner() == 10, "JACOBI is not set.")
842            so.setPreconditioner(so.AMG)
843            self.failUnless(so.getPreconditioner() == 22, "AMG is not set.")
844            so.setPreconditioner(so.REC_ILU)
845            self.failUnless(so.getPreconditioner() == 23, "REC_ILU is not set.")
846            so.setPreconditioner(so.GAUSS_SEIDEL)
847            self.failUnless(so.getPreconditioner() == 28, "GAUSS_SEIDEL is not set.")
848            so.setPreconditioner(so.RILU)
849            self.failUnless(so.getPreconditioner() == 29, "RILU is not set.")
850            so.setPreconditioner(so.NO_PRECONDITIONER)
851            self.failUnless(so.getPreconditioner() == 36, "NO_PRECONDITIONER is not set.")        
852    
853            self.failUnless(so.getCoarsening() == 0, "initial Coarseningr is wrong.")
854            self.failUnlessRaises(ValueError,so.setCoarsening,-1)
855            so.setCoarsening(so.YAIR_SHAPIRA_COARSENING)
856            self.failUnless(so.getCoarsening() == 33, "YAIR_SHAPIRA_COARSENING is not set.")
857            so.setCoarsening(so.RUGE_STUEBEN_COARSENING)
858            self.failUnless(so.getCoarsening() == 34, "RUGE_STUEBEN_COARSENING is not set.")
859            so.setCoarsening(so.AGGREGATION_COARSENING)
860            self.failUnless(so.getCoarsening() == 35, "AGREGATION_COARSENING is not set.")
861            so.setCoarsening(so.DEFAULT)
862            self.failUnless(so.getCoarsening() == 0, "DEFAULT is not set.")
863    
864            self.failUnless(so.getDiagnostics("num_iter") == None, "initial num_iter is wrong.")
865            self.failUnless(so.getDiagnostics("num_inner_iter") == None, "initial num_inner_iter is wrong.")
866            self.failUnless(so.getDiagnostics("time") == None, "initial time is wrong.")
867            self.failUnless(so.getDiagnostics("set_up_time") == None, "initial set_up_time is wrong.")
868            self.failUnless(so.getDiagnostics("residual_norm") == None, "initial residual_norm is wrong.")
869            self.failUnless(so.getDiagnostics("converged") == None, "initial converged is wrong.")
870            self.failUnless(so.hasConverged() == None, "initial convergence flag is wrong.")
871            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 0, "initial cum_num_inner_iter is wrong.")
872            self.failUnless(so.getDiagnostics("cum_num_iter") == 0, "initial cum_num_iter is wrong.")
873            self.failUnless(so.getDiagnostics("cum_time") ==0, "initial cum_time is wrong.")
874            self.failUnless(so.getDiagnostics("cum_set_up_time") == 0, "initial cum_set_up_time is wrong.")
875    
876            so._updateDiagnostics("num_iter",1)
877            so._updateDiagnostics("num_inner_iter",2)
878            so._updateDiagnostics("time",3)
879            so._updateDiagnostics("set_up_time",4)
880            so._updateDiagnostics("residual_norm",5)
881            so._updateDiagnostics("converged",True)
882    
883            self.failUnless(so.getDiagnostics("num_iter") == 1, "num_iter is wrong.")
884            self.failUnless(so.getDiagnostics("num_inner_iter") == 2, "num_inner_iter is wrong.")
885            self.failUnless(so.getDiagnostics("time") == 3, "time is wrong.")
886            self.failUnless(so.getDiagnostics("set_up_time") == 4, "set_up_time is wrong.")
887            self.failUnless(so.getDiagnostics("residual_norm") == 5, "residual_norm is wrong.")
888            self.failUnless(so.getDiagnostics("converged"), "converged is wrong.")
889            self.failUnless(so.hasConverged(), "convergence flag is wrong.")
890            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 2, "cum_num_inner_iter is wrong.")
891            self.failUnless(so.getDiagnostics("cum_num_iter") == 1, "cum_num_iter is wrong.")
892            self.failUnless(so.getDiagnostics("cum_time") ==3, "cum_time is wrong.")
893            self.failUnless(so.getDiagnostics("cum_set_up_time") == 4, "cum_set_up_time is wrong.")  
894            
895            so.resetDiagnostics()
896            self.failUnless(so.getDiagnostics("num_iter") == None, "initial num_iter is wrong.")
897            self.failUnless(so.getDiagnostics("num_inner_iter") == None, "initial num_inner_iter is wrong.")
898            self.failUnless(so.getDiagnostics("time") == None, "initial time is wrong.")
899            self.failUnless(so.getDiagnostics("set_up_time") == None, "initial set_up_time is wrong.")
900            self.failUnless(so.getDiagnostics("residual_norm") == None, "initial residual_norm is wrong.")
901            self.failUnless(so.getDiagnostics("converged") == None, "initial converged is wrong.")
902            self.failUnless(so.hasConverged() == None, "initial convergence flag is wrong")      
903            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 2, "cum_num_inner_iter is wrong.")
904            self.failUnless(so.getDiagnostics("cum_num_iter") == 1, "cum_num_iter is wrong.")
905            self.failUnless(so.getDiagnostics("cum_time") ==3, "cum_time is wrong.")
906            self.failUnless(so.getDiagnostics("cum_set_up_time") == 4, "cum_set_up_time is wrong.")
907    
908            so._updateDiagnostics("num_iter",10)
909            so._updateDiagnostics("num_inner_iter",20)
910            so._updateDiagnostics("time",30)
911            so._updateDiagnostics("set_up_time",40)
912            so._updateDiagnostics("residual_norm",50)
913            so._updateDiagnostics("converged",False)
914    
915            self.failUnless(so.getDiagnostics("num_iter") == 10, "num_iter is wrong.")
916            self.failUnless(so.getDiagnostics("num_inner_iter") == 20, "num_inner_iter is wrong.")
917            self.failUnless(so.getDiagnostics("time") == 30, "time is wrong.")
918            self.failUnless(so.getDiagnostics("set_up_time") == 40, "set_up_time is wrong.")
919            self.failUnless(so.getDiagnostics("residual_norm") == 50, "residual_norm is wrong.")
920            self.failUnless(not so.getDiagnostics("converged"), "converged is wrong.")
921            self.failUnless(not so.hasConverged(), "convergence flag is wrong.")
922            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 22, "cum_num_inner_iter is wrong.")
923            self.failUnless(so.getDiagnostics("cum_num_iter") == 11, "cum_num_iter is wrong.")
924            self.failUnless(so.getDiagnostics("cum_time") ==33, "cum_time is wrong.")
925            self.failUnless(so.getDiagnostics("cum_set_up_time") == 44, "cum_set_up_time is wrong.")  
926    
927            so.resetDiagnostics(all=True)
928            self.failUnless(so.getDiagnostics("num_iter") == None, "initial num_iter is wrong.")
929            self.failUnless(so.getDiagnostics("num_inner_iter") == None, "initial num_inner_iter is wrong.")
930            self.failUnless(so.getDiagnostics("time") == None, "initial time is wrong.")
931            self.failUnless(so.getDiagnostics("set_up_time") == None, "initial set_up_time is wrong.")
932            self.failUnless(so.getDiagnostics("residual_norm") == None, "initial residual_norm is wrong.")
933            self.failUnless(so.getDiagnostics("converged") == None, "initial converged is wrong.")
934            self.failUnless(so.hasConverged() == None, "initial convergence flag is wrong.")
935            self.failUnless(so.getDiagnostics("cum_num_inner_iter") == 0, "initial cum_num_inner_iter is wrong.")
936            self.failUnless(so.getDiagnostics("cum_num_iter") == 0, "initial cum_num_iter is wrong.")
937            self.failUnless(so.getDiagnostics("cum_time") ==0, "initial cum_time is wrong.")
938            self.failUnless(so.getDiagnostics("cum_set_up_time") == 0, "initial cum_set_up_time is wrong.")
939            
940      def test_setCoefficient_WithIllegalFunctionSpace(self):      def test_setCoefficient_WithIllegalFunctionSpace(self):
941          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
942          self.failUnlessRaises(IllegalCoefficientFunctionSpace,mypde.setValue, C=Vector(0.,FunctionOnBoundary(self.domain)))          self.failUnlessRaises(IllegalCoefficientFunctionSpace, mypde.setValue, C=Vector(0.,FunctionOnBoundary(self.domain)))
943    
944      def test_setCoefficient_WithWrongName(self):      def test_setCoefficient_WithWrongName(self):
945          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 663  class Test_LinearPDE_noLumping(Test_line Line 960  class Test_LinearPDE_noLumping(Test_line
960      def test_attemptToChangeOrderAfterDefinedCoefficient(self):      def test_attemptToChangeOrderAfterDefinedCoefficient(self):
961          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
962          mypde.setValue(D=1.)          mypde.setValue(D=1.)
963          self.failUnlessRaises(RuntimeError,mypde.setReducedOrderOn)          self.failUnlessRaises(RuntimeError, mypde.setReducedOrderOn)
964    
965      def test_reducedOnConfig(self):      def test_reducedOnConfig(self):
966          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
967          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
968          self.failUnlessEqual((mypde.getFunctionSpaceForSolution(),mypde.getFunctionSpaceForEquation()),(ReducedSolution(self.domain),ReducedSolution(self.domain)),"reduced function spaces expected.")          self.failUnlessEqual((mypde.getFunctionSpaceForSolution(), mypde.getFunctionSpaceForEquation()),(ReducedSolution(self.domain),ReducedSolution(self.domain)),"reduced function spaces expected.")
969      #      #
970      #  set coefficients for scalars:      #  set coefficients for scalars:
971      #      #
972      def test_setCoefficient_A_Scalar(self):      def test_setCoefficient_A_Scalar(self):
973          d=self.domain.getDim()          d=self.domain.getDim()
974          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
975          mypde.setValue(A=numarray.ones((d,d)))          mypde.setValue(A=numpy.ones((d,d)))
976          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
977          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))
978      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(self):
979          d=self.domain.getDim()          d=self.domain.getDim()
980          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
981          mypde.setValue(B=numarray.ones((d,)))          mypde.setValue(B=numpy.ones((d,)))
982          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
983          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))
984      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
985          d=self.domain.getDim()          d=self.domain.getDim()
986          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
987          mypde.setValue(C=numarray.ones((d,)))          mypde.setValue(C=numpy.ones((d,)))
988          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
989          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))
990      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
991          d=self.domain.getDim()          d=self.domain.getDim()
992          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
993          mypde.setValue(D=1.)          mypde.setValue(D=1.)
994          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
995          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),Function(self.domain),1,1))
996      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(self):
997          d=self.domain.getDim()          d=self.domain.getDim()
998          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
999          mypde.setValue(X=numarray.ones((d,)))          mypde.setValue(X=numpy.ones((d,)))
1000          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
1001          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))
1002      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
1003          d=self.domain.getDim()          d=self.domain.getDim()
1004          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1005          mypde.setValue(Y=1.)          mypde.setValue(Y=1.)
1006          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
1007          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),Function(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),Function(self.domain),1))
1008      def test_setCoefficient_y_Scalar(self):      def test_setCoefficient_y_Scalar(self):
1009          d=self.domain.getDim()          d=self.domain.getDim()
1010          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1011          mypde.setValue(y=1.)          mypde.setValue(y=1.)
1012          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
1013          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))
1014      def test_setCoefficient_d_Scalar(self):      def test_setCoefficient_d_Scalar(self):
1015          d=self.domain.getDim()          d=self.domain.getDim()
1016          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1017          mypde.setValue(d=1.)          mypde.setValue(d=1.)
1018          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1019          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
1020      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(self):
1021          d=self.domain.getDim()          d=self.domain.getDim()
1022          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1023          mypde.setValue(d_contact=1.)          mypde.setValue(d_contact=1.)
1024          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
1025          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))
1026      def test_setCoefficient_y_contact_Scalar(self):      def test_setCoefficient_y_contact_Scalar(self):
1027          d=self.domain.getDim()          d=self.domain.getDim()
1028          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1029          mypde.setValue(y_contact=1.)          mypde.setValue(y_contact=1.)
1030          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
1031          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))
1032      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
1033          d=self.domain.getDim()          d=self.domain.getDim()
1034          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1035          mypde.setValue(A_reduced=numarray.ones((d,d)))          mypde.setValue(A_reduced=numpy.ones((d,d)))
1036          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1037          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))
1038      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(self):
1039          d=self.domain.getDim()          d=self.domain.getDim()
1040          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1041          mypde.setValue(B_reduced=numarray.ones((d,)))          mypde.setValue(B_reduced=numpy.ones((d,)))
1042          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1043          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))
1044      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(self):
1045          d=self.domain.getDim()          d=self.domain.getDim()
1046          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1047          mypde.setValue(C_reduced=numarray.ones((d,)))          mypde.setValue(C_reduced=numpy.ones((d,)))
1048          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1049          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))
1050      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
1051          d=self.domain.getDim()          d=self.domain.getDim()
1052          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1053          mypde.setValue(D_reduced=1.)          mypde.setValue(D_reduced=1.)
1054          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1055          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
1056      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(self):
1057          d=self.domain.getDim()          d=self.domain.getDim()
1058          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1059          mypde.setValue(X_reduced=numarray.ones((d,)))          mypde.setValue(X_reduced=numpy.ones((d,)))
1060          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1061          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))
1062      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
1063          d=self.domain.getDim()          d=self.domain.getDim()
1064          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1065          mypde.setValue(Y_reduced=1.)          mypde.setValue(Y_reduced=1.)
1066          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1067          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
1068      def test_setCoefficient_y_reduced_Scalar(self):      def test_setCoefficient_y_reduced_Scalar(self):
1069          d=self.domain.getDim()          d=self.domain.getDim()
1070          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1071          mypde.setValue(y_reduced=1.)          mypde.setValue(y_reduced=1.)
1072          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1073          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
1074      def test_setCoefficient_d_reduced_Scalar(self):      def test_setCoefficient_d_reduced_Scalar(self):
1075          d=self.domain.getDim()          d=self.domain.getDim()
1076          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1077          mypde.setValue(d_reduced=1.)          mypde.setValue(d_reduced=1.)
1078          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1079          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
1080      def test_setCoefficient_d_contact_reduced_Scalar(self):      def test_setCoefficient_d_contact_reduced_Scalar(self):
1081          d=self.domain.getDim()          d=self.domain.getDim()
1082          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1083          mypde.setValue(d_contact_reduced=1.)          mypde.setValue(d_contact_reduced=1.)
1084          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1085          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
1086      def test_setCoefficient_y_contact_reduced_Scalar(self):      def test_setCoefficient_y_contact_reduced_Scalar(self):
1087          d=self.domain.getDim()          d=self.domain.getDim()
1088          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1089          mypde.setValue(y_contact_reduced=1.)          mypde.setValue(y_contact_reduced=1.)
1090          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1091          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
1092      def test_setCoefficient_r_Scalar(self):      def test_setCoefficient_r_Scalar(self):
1093          d=self.domain.getDim()          d=self.domain.getDim()
1094          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1095          mypde.setValue(r=1.)          mypde.setValue(r=1.)
1096          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1097          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),Solution(self.domain),1))
1098      def test_setCoefficient_q_Scalar(self):      def test_setCoefficient_q_Scalar(self):
1099          d=self.domain.getDim()          d=self.domain.getDim()
1100          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1101          mypde.setValue(q=1.)          mypde.setValue(q=1.)
1102          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1103          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),Solution(self.domain),1))
1104      def test_setCoefficient_r_Scalar_reducedOn(self):      def test_setCoefficient_r_Scalar_reducedOn(self):
1105          d=self.domain.getDim()          d=self.domain.getDim()
1106          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1107          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1108          mypde.setValue(r=1.)          mypde.setValue(r=1.)
1109          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1110          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
1111      def test_setCoefficient_q_Scalar_reducedOn(self):      def test_setCoefficient_q_Scalar_reducedOn(self):
1112          d=self.domain.getDim()          d=self.domain.getDim()
1113          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1114          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1115          mypde.setValue(q=1.)          mypde.setValue(q=1.)
1116          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1117          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
1118    
1119      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
1120          d=self.domain.getDim()          d=self.domain.getDim()
1121          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1122          mypde.setValue(A=Data(numarray.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
1123          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1124          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))
1125      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
1126          d=self.domain.getDim()          d=self.domain.getDim()
1127          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1128          mypde.setValue(B=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1129          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1130          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))
1131      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(self):
1132          d=self.domain.getDim()          d=self.domain.getDim()
1133          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1134          mypde.setValue(C=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1135          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1136          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))
1137      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
1138          d=self.domain.getDim()          d=self.domain.getDim()
1139          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1140          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))
1141          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1142          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
1143      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
1144          d=self.domain.getDim()          d=self.domain.getDim()
1145          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1146          mypde.setValue(X_reduced=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1147          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1148          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))
1149      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
1150          d=self.domain.getDim()          d=self.domain.getDim()
1151          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1152          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))
1153          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1154          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
1155      def test_setCoefficient_y_reduced_Scalar_using_y(self):      def test_setCoefficient_y_reduced_Scalar_using_y(self):
1156          d=self.domain.getDim()          d=self.domain.getDim()
1157          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1158          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
1159          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1160          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
1161      def test_setCoefficient_d_reduced_Scalar_using_d(self):      def test_setCoefficient_d_reduced_Scalar_using_d(self):
1162          d=self.domain.getDim()          d=self.domain.getDim()
1163          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1164          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
1165          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1166          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
1167      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(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(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1171          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1172          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
1173      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):
1174          d=self.domain.getDim()          d=self.domain.getDim()
1175          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1176          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1177          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1178          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
1179      #      #
1180      #  set coefficients for systems:      #  set coefficients for systems:
1181      #      #
1182      def test_setCoefficient_A_System(self):      def test_setCoefficient_A_System(self):
1183          d=self.domain.getDim()          d=self.domain.getDim()
1184          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1185          mypde.setValue(A=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))
1186          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
1187          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))
1188      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
1189          d=self.domain.getDim()          d=self.domain.getDim()
1190          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1191          mypde.setValue(B=numarray.ones((self.N,d,self.N)))          mypde.setValue(B=numpy.ones((self.N,d,self.N)))
1192          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
1193          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))
1194      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
1195          d=self.domain.getDim()          d=self.domain.getDim()
1196          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1197          mypde.setValue(C=numarray.ones((self.N,self.N,d)))          mypde.setValue(C=numpy.ones((self.N,self.N,d)))
1198          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
1199          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))
1200      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
1201          d=self.domain.getDim()          d=self.domain.getDim()
1202          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1203          mypde.setValue(D=numarray.ones((self.N,self.N)))          mypde.setValue(D=numpy.ones((self.N,self.N)))
1204          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
1205          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))
1206      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
1207          d=self.domain.getDim()          d=self.domain.getDim()
1208          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1209          mypde.setValue(X=numarray.ones((self.N,d)))          mypde.setValue(X=numpy.ones((self.N,d)))
1210          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
1211          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))
1212      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
1213          d=self.domain.getDim()          d=self.domain.getDim()
1214          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1215          mypde.setValue(Y=numarray.ones((self.N,)))          mypde.setValue(Y=numpy.ones((self.N,)))
1216          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
1217          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))
1218      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
1219          d=self.domain.getDim()          d=self.domain.getDim()
1220          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1221          mypde.setValue(y=numarray.ones((self.N,)))          mypde.setValue(y=numpy.ones((self.N,)))
1222          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
1223          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))
1224      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
1225          d=self.domain.getDim()          d=self.domain.getDim()
1226          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1227          mypde.setValue(d=numarray.ones((self.N,self.N)))          mypde.setValue(d=numpy.ones((self.N,self.N)))
1228          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1229          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))
1230      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
1231          d=self.domain.getDim()          d=self.domain.getDim()
1232          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1233          mypde.setValue(d_contact=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
1234          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
1235          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))
1236      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
1237          d=self.domain.getDim()          d=self.domain.getDim()
1238          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1239          mypde.setValue(y_contact=numarray.ones((self.N,)))          mypde.setValue(y_contact=numpy.ones((self.N,)))
1240          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
1241          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))
1242      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
1243          d=self.domain.getDim()          d=self.domain.getDim()
1244          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1245          mypde.setValue(A_reduced=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))
1246          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1247          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))
1248      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
1249          d=self.domain.getDim()          d=self.domain.getDim()
1250          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1251          mypde.setValue(B_reduced=numarray.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))
1252          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1253          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))
1254      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
1255          d=self.domain.getDim()          d=self.domain.getDim()
1256          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1257          mypde.setValue(C_reduced=numarray.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))
1258          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1259          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))
1260      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(self):
1261          d=self.domain.getDim()          d=self.domain.getDim()
1262          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1263          mypde.setValue(D_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))
1264          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1265          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))
1266      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
1267          d=self.domain.getDim()          d=self.domain.getDim()
1268          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1269          mypde.setValue(X_reduced=numarray.ones((self.N,d)))          mypde.setValue(X_reduced=numpy.ones((self.N,d)))
1270          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1271          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))
1272      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
1273          d=self.domain.getDim()          d=self.domain.getDim()
1274          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1275          mypde.setValue(Y_reduced=numarray.ones((self.N,)))          mypde.setValue(Y_reduced=numpy.ones((self.N,)))
1276          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1277          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))
1278      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
1279          d=self.domain.getDim()          d=self.domain.getDim()
1280          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1281          mypde.setValue(y_reduced=numarray.ones((self.N,)))          mypde.setValue(y_reduced=numpy.ones((self.N,)))
1282          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1283          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))
1284      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
1285          d=self.domain.getDim()          d=self.domain.getDim()
1286          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1287          mypde.setValue(d_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))
1288          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1289          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))
1290      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
1291          d=self.domain.getDim()          d=self.domain.getDim()
1292          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1293          mypde.setValue(d_contact_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
1294          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1295          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))
1296      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
1297          d=self.domain.getDim()          d=self.domain.getDim()
1298          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1299          mypde.setValue(y_contact_reduced=numarray.ones((self.N,)))          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
1300          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1301          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))
1302      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
1303          d=self.domain.getDim()          d=self.domain.getDim()
1304          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1305          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
1306          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1307          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))
1308      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
1309          d=self.domain.getDim()          d=self.domain.getDim()
1310          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1311          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
1312          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1313          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))
1314      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
1315          d=self.domain.getDim()          d=self.domain.getDim()
1316          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1317          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1318          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
1319          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
1320          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))
1321      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
1322          d=self.domain.getDim()          d=self.domain.getDim()
1323          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
1324          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
1325          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
1326          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
1327          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))
1328    
1329      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
1330          d=self.domain.getDim()          d=self.domain.getDim()
1331          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1332          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)))
1333          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
1334          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))
1335      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
1336          d=self.domain.getDim()          d=self.domain.getDim()
1337          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1338          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)))
1339          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
1340          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))
1341      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
1342          d=self.domain.getDim()          d=self.domain.getDim()
1343          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1344          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)))
1345          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
1346          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))
1347      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
1348          d=self.domain.getDim()          d=self.domain.getDim()
1349          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1350          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)))
1351          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
1352          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))
1353      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
1354          d=self.domain.getDim()          d=self.domain.getDim()
1355          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1356          mypde.setValue(X=Data(numarray.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
1357          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
1358          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))
1359      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
1360          d=self.domain.getDim()          d=self.domain.getDim()
1361          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1362          mypde.setValue(Y=Data(numarray.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
1363          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
1364          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))
1365      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
1366          d=self.domain.getDim()          d=self.domain.getDim()
1367          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1368          mypde.setValue(y=Data(numarray.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
1369          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
1370          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))
1371      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
1372          d=self.domain.getDim()          d=self.domain.getDim()
1373          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1374          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)))
1375          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1376          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))
1377      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
1378          d=self.domain.getDim()          d=self.domain.getDim()
1379          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1380          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)))
1381          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
1382          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))
1383      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
1384          d=self.domain.getDim()          d=self.domain.getDim()
1385          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1386          mypde.setValue(y_contact=Data(numarray.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
1387          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
1388          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))
1389      def test_resetCoefficient_HomogeneousConstraint(self):      def test_resetCoefficient_HomogeneousConstraint(self):
1390          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1391          x=self.domain.getX()          x=self.domain.getX()
# Line 1101  class Test_LinearPDE_noLumping(Test_line Line 1398  class Test_LinearPDE_noLumping(Test_line
1398      def test_resetCoefficient_InHomogeneousConstraint(self):      def test_resetCoefficient_InHomogeneousConstraint(self):
1399          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1400          mypde.setSymmetryOn()          mypde.setSymmetryOn()
1401        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1402          x=self.domain.getX()          x=self.domain.getX()
1403          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.,r=1,q=whereZero(x[0]))          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.,r=1,q=whereZero(x[0]))
1404          u1=mypde.getSolution(verbose=self.VERBOSE)          u1=mypde.getSolution()
1405          mypde.setValue(Y=2.,D=2)          mypde.setValue(Y=2.,D=2)
1406          u2=mypde.getSolution(verbose=self.VERBOSE)          u2=mypde.getSolution()
1407          self.failUnless(self.check(u2,u1),'first solution is wrong.')          self.failUnless(self.check(u2,u1),'first solution is wrong.')
1408          u2=mypde.getSolution(verbose=self.VERBOSE)          u2=mypde.getSolution()
1409          self.failUnless(self.check(u2,u1),'first solution is wrong.')          self.failUnless(self.check(u2,u1),'first solution is wrong.')
1410          mypde.setValue(r=2,Y=4.)          mypde.setValue(r=2,Y=4.)
1411          u2=mypde.getSolution(verbose=self.VERBOSE)          u2=mypde.getSolution()
1412          self.failUnless(self.check(u2,2*u1),'second solution is wrong.')          self.failUnless(self.check(u2,2*u1),'second solution is wrong.')
1413    
1414        def test_Status(self):
1415            DIM=self.domain.getDim()
1416            x=self.domain.getX()
1417            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1418            mypde.getSolverOptions().setSymmetryOn()
1419            mypde.getSolverOptions().setTolerance(self.RES_TOL)
1420            mypde.setValue(A=kronecker(self.domain), q=whereZero(x[0])+whereZero(x[0]-1.), Y=2.)
1421            x1=self.domain.getX()
1422            u1_ref=x1[0]*(1.-x1[0])
1423            u1=mypde.getSolution()
1424            error1=Lsup(u1-u1_ref)/Lsup(u1_ref)
1425            self.failUnless(mypde.getDomainStatus() == mypde.getSystemStatus(), "status of first pde does not match domain status.")
1426    
1427            self.domain.setX(x*5)
1428    
1429            self.failUnless(mypde.getDomainStatus() != mypde.getSystemStatus(), "status of first pde matches updated domain status.")
1430            x2=self.domain.getX()
1431            u2_ref=x2[0]*(5.-x2[0])
1432            u2=mypde.getSolution()
1433            error2=Lsup(u2-u2_ref)/Lsup(u2_ref)
1434            self.failUnless(error2 <= max(error1,self.RES_TOL)*10., "solution of second PDE wrong.")
1435            self.failUnless(mypde.getDomainStatus() == mypde.getSystemStatus(), "status of second pde does not match domain status.")
1436    
1437      def test_symmetryCheckTrue_System(self):      def test_symmetryCheckTrue_System(self):
1438          d=self.domain.getDim()          d=self.domain.getDim()
1439          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1440          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1441          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1442          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1443          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1444          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1445          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1446          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)
1447          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")
1448    
1449      def test_symmetryCheckFalse_A_System(self):      def test_symmetryCheckFalse_A_System(self):
1450          d=self.domain.getDim()          d=self.domain.getDim()
1451          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1452          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1453          A[1,1,1,0]=0.          A[1,1,1,0]=0.
1454          mypde.setValue(A=A)          mypde.setValue(A=A)
1455          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1456      def test_symmetryCheckFalse_BC_System(self):      def test_symmetryCheckFalse_BC_System(self):
1457          d=self.domain.getDim()          d=self.domain.getDim()
1458          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1459          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1460          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1461          B[0,0,1]=1.          B[0,0,1]=1.
1462          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
1463          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1464    
1465      def test_symmetryCheckFalse_D_System(self):      def test_symmetryCheckFalse_D_System(self):
1466          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1467          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1468          D[0,1]=0.          D[0,1]=0.
1469          mypde.setValue(D=D)          mypde.setValue(D=D)
1470          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1471    
1472      def test_symmetryCheckFalse_d_System(self):      def test_symmetryCheckFalse_d_System(self):
1473          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1474          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1475          d[0,1]=0.          d[0,1]=0.
1476          mypde.setValue(d=d)          mypde.setValue(d=d)
1477          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1478    
1479      def test_symmetryCheckFalse_d_contact_System(self):      def test_symmetryCheckFalse_d_contact_System(self):
1480          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1481          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1482          d_contact[0,1]=0.          d_contact[0,1]=0.
1483          mypde.setValue(d_contact=d_contact)          mypde.setValue(d_contact=d_contact)
1484          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 1486  class Test_LinearPDE_noLumping(Test_line
1486      def test_symmetryCheckFalse_A_reduced_System(self):      def test_symmetryCheckFalse_A_reduced_System(self):
1487          d=self.domain.getDim()          d=self.domain.getDim()
1488          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1489          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
1490          A[1,1,1,0]=0.          A[1,1,1,0]=0.
1491          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
1492          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1493      def test_symmetryCheckFalse_BC_reduced_System(self):      def test_symmetryCheckFalse_BC_reduced_System(self):
1494          d=self.domain.getDim()          d=self.domain.getDim()
1495          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1496          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
1497          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
1498          B[0,0,1]=1.          B[0,0,1]=1.
1499          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
1500          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1501    
1502      def test_symmetryCheckFalse_D_reduced_System(self):      def test_symmetryCheckFalse_D_reduced_System(self):
1503          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1504          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1505          D[0,1]=0.          D[0,1]=0.
1506          mypde.setValue(D_reduced=D)          mypde.setValue(D_reduced=D)
1507          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1508    
1509      def test_symmetryCheckFalse_d_reduced_System(self):      def test_symmetryCheckFalse_d_reduced_System(self):
1510          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1511          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1512          d[0,1]=0.          d[0,1]=0.
1513          mypde.setValue(d_reduced=d)          mypde.setValue(d_reduced=d)
1514          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1515    
1516      def test_symmetryCheckFalse_d_contact_reduced_System(self):      def test_symmetryCheckFalse_d_contact_reduced_System(self):
1517          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1518          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1519          d_contact[0,1]=0.          d_contact[0,1]=0.
1520          mypde.setValue(d_contact_reduced=d_contact)          mypde.setValue(d_contact_reduced=d_contact)
1521          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 1523  class Test_LinearPDE_noLumping(Test_line
1523      def test_symmetryCheckTrue_Scalar(self):      def test_symmetryCheckTrue_Scalar(self):
1524          d=self.domain.getDim()          d=self.domain.getDim()
1525          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1526          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1527          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1528          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1529          D=3          D=3
1530          d=4          d=4
1531          d_contact=5          d_contact=5
# Line 1214  class Test_LinearPDE_noLumping(Test_line Line 1535  class Test_LinearPDE_noLumping(Test_line
1535      def test_symmetryCheckFalse_A_Scalar(self):      def test_symmetryCheckFalse_A_Scalar(self):
1536          d=self.domain.getDim()          d=self.domain.getDim()
1537          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1538          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1539          A[1,0]=0.          A[1,0]=0.
1540          mypde.setValue(A=A)          mypde.setValue(A=A)
1541          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1542      def test_symmetryCheckFalse_BC_Scalar(self):      def test_symmetryCheckFalse_BC_Scalar(self):
1543          d=self.domain.getDim()          d=self.domain.getDim()
1544          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1545          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1546          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1547          B[0]=1.          B[0]=1.
1548          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
1549          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1550      def test_symmetryCheckFalse_A_reduced_Scalar(self):      def test_symmetryCheckFalse_A_reduced_Scalar(self):
1551          d=self.domain.getDim()          d=self.domain.getDim()
1552          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1553          A=numarray.ones((d,d))          A=numpy.ones((d,d))
1554          A[1,0]=0.          A[1,0]=0.
1555          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
1556          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1557      def test_symmetryCheckFalse_BC_reduced_Scalar(self):      def test_symmetryCheckFalse_BC_reduced_Scalar(self):
1558          d=self.domain.getDim()          d=self.domain.getDim()
1559          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1560          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
1561          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
1562          B[0]=1.          B[0]=1.
1563          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
1564          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
# Line 1247  class Test_LinearPDE_noLumping(Test_line Line 1568  class Test_LinearPDE_noLumping(Test_line
1568      def test_symmetryOnIterative(self):      def test_symmetryOnIterative(self):
1569          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1570          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1571          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1572            u=mypde.getSolution()
1573          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1574      def test_symmetryOnDirect(self):      def test_symmetryOnDirect(self):
1575          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1576          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1577          mypde.setSolverMethod(mypde.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1578          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1579            u=mypde.getSolution()
1580          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1581      def test_PCG_JACOBI(self):      def test_PCG_JACOBI(self):
1582          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1583          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1584          mypde.setSolverMethod(mypde.PCG,mypde.JACOBI)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1585          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1586        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1587            u=mypde.getSolution()
1588          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1589      def test_PCG_ILU0(self):      def test_PCG_ILU0(self):
1590          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1591          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1592          mypde.setSolverMethod(mypde.PCG,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1593          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1594        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1595            u=mypde.getSolution()
1596          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1597      def test_PCG_RILU(self):      def test_PCG_RILU(self):
1598          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1599          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1600          mypde.setSolverMethod(mypde.PCG,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1601          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1602        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1603            u=mypde.getSolution()
1604            self.failUnless(self.check(u,1.),'solution is wrong.')
1605        def test_PCG_REC_ILU(self):
1606            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1607            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1608        mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1609        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1610        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1611            u=mypde.getSolution()
1612          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1613      def test_DIRECT(self):      def test_DIRECT(self):
1614          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1615          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1616          mypde.setSolverMethod(mypde.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1617          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1618            u=mypde.getSolution()
1619          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1620      def test_BICGSTAB_JACOBI(self):      def test_BICGSTAB_JACOBI(self):
1621          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1622      mypde.setSolverMethod(mypde.BICGSTAB,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1623        mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1624          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1625          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1626            u=mypde.getSolution()
1627          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1628      def test_BICGSTAB_ILU0(self):      def test_BICGSTAB_ILU0(self):
1629          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1630          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1631      mypde.setSolverMethod(mypde.BICGSTAB,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1632          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1633            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1634            u=mypde.getSolution()
1635          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1636      def test_BICGSTAB_RILU(self):      def test_BICGSTAB_RILU(self):
1637          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1638          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1639      mypde.setSolverMethod(mypde.BICGSTAB,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1640          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1641            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1642            u=mypde.getSolution()
1643            self.failUnless(self.check(u,1.),'solution is wrong.')
1644        def test_BICGSTAB_REC_ILU(self):
1645            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1646            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1647        mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1648        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1649            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1650            u=mypde.getSolution()
1651          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1652      def test_MINRES_JACOBI(self):      def test_MINRES_JACOBI(self):
1653          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1654      mypde.setSolverMethod(mypde.MINRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1655        mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1656          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1657          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1658            u=mypde.getSolution()
1659          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1660      def test_MINRES_ILU0(self):      def test_MINRES_ILU0(self):
1661          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1662          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1663      mypde.setSolverMethod(mypde.MINRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1664          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1665            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1666            u=mypde.getSolution()
1667          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1668      def test_MINRES_RILU(self):      def test_MINRES_RILU(self):
1669          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1670          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1671      mypde.setSolverMethod(mypde.MINRES,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1672          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1673            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1674            u=mypde.getSolution()
1675            self.failUnless(self.check(u,1.),'solution is wrong.')
1676        def test_MINRES_REC_ILU(self):
1677            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1678            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1679        mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1680        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1681            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1682            u=mypde.getSolution()
1683          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1684      def test_TFQMR_JACOBI(self):      def test_TFQMR_JACOBI(self):
1685          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1686      mypde.setSolverMethod(mypde.TFQMR,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1687        mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1688          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1689          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1690            u=mypde.getSolution()
1691          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1692      def test_TFQMR_ILU0(self):      def test_TFQMR_ILU0(self):
1693          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1694          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1695      mypde.setSolverMethod(mypde.TFQMR,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1696          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1697            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1698            u=mypde.getSolution()
1699          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1700      def test_TFQMR_RILU(self):      def test_TFQMR_RILU(self):
1701          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1702          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1703      mypde.setSolverMethod(mypde.TFQMR,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1704          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1705            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1706            u=mypde.getSolution()
1707            self.failUnless(self.check(u,1.),'solution is wrong.')
1708        def test_TFQMR_REC_ILU(self):
1709            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1710            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1711        mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1712        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1713            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1714            u=mypde.getSolution()
1715          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1716      def test_PRES20_JACOBI(self):      def test_PRES20_JACOBI(self):
1717          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1718          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1719      mypde.setSolverMethod(mypde.PRES20,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1720          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1721            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1722            u=mypde.getSolution()
1723          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1724      def test_PRES20_ILU0(self):      def test_PRES20_ILU0(self):
1725          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1726          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1727      mypde.setSolverMethod(mypde.PRES20,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1728          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1729            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1730            u=mypde.getSolution()
1731          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1732      def test_PRES20_RILU(self):      def test_PRES20_RILU(self):
1733          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1734          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1735      mypde.setSolverMethod(mypde.PRES20,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1736          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1737            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1738            u=mypde.getSolution()
1739            self.failUnless(self.check(u,1.),'solution is wrong.')
1740        def test_PRES20_REC_ILU(self):
1741            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1742            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1743        mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1744        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1745            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1746            u=mypde.getSolution()
1747          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1748      def test_GMRESnoRestart_JACOBI(self):      def test_GMRESnoRestart_JACOBI(self):
1749          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1750          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1751      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1752          u=mypde.getSolution(verbose=self.VERBOSE,truncation=50)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1753        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1754        mypde.getSolverOptions().setTruncation(50)
1755            u=mypde.getSolution()
1756          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1757      def test_GMRESnoRestart_ILU0(self):      def test_GMRESnoRestart_ILU0(self):
1758          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1759          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1760      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1761          u=mypde.getSolution(verbose=self.VERBOSE,truncation=50)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1762          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1763        mypde.getSolverOptions().setTruncation(50)                        
1764            u=mypde.getSolution()
1765          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1766      def test_GMRESnoRestart_RILU(self):      def test_GMRESnoRestart_RILU(self):
1767          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1768          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1769      mypde.setSolverMethod(mypde.GMRES,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1770          u=mypde.getSolution(verbose=self.VERBOSE,truncation=50)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1771          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1772        mypde.getSolverOptions().setTruncation(50)
1773            u=mypde.getSolution()
1774            self.failUnless(self.check(u,1.),'solution is wrong.')
1775        def test_GMRESnoRestart_REC_ILU(self):
1776            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1777            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1778        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1779        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1780        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1781        mypde.getSolverOptions().setTruncation(50)
1782            u=mypde.getSolution()
1783          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1784      def test_GMRES_JACOBI(self):      def test_GMRES_JACOBI(self):
1785          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1786          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1787      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1788          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1789            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1790            u=mypde.getSolution()
1791          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1792      def test_GMRES_ILU0(self):      def test_GMRES_ILU0(self):
1793          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1794          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1795      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1796          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1797            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1798            u=mypde.getSolution()
1799          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1800      def test_GMRES_RILU(self):      def test_GMRES_RILU(self):
1801          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1802          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1803      mypde.setSolverMethod(mypde.GMRES,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1804          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1805            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1806            u=mypde.getSolution()
1807            self.failUnless(self.check(u,1.),'solution is wrong.')
1808        def test_GMRES_REC_ILU(self):
1809            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1810            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1811        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1812        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1813            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1814            u=mypde.getSolution()
1815          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1816      def test_GMRES_truncation_restart_JACOBI(self):      def test_GMRES_truncation_restart_JACOBI(self):
1817          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1818          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1819      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1820          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1821        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1822        mypde.getSolverOptions().setTruncation(10)
1823        mypde.getSolverOptions().setRestart(20)
1824            u=mypde.getSolution()
1825          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1826      def test_GMRES_truncation_restart_ILU0(self):      def test_GMRES_truncation_restart_ILU0(self):
1827          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1828          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1829      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1830          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1831        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1832        mypde.getSolverOptions().setTruncation(10)
1833        mypde.getSolverOptions().setRestart(20)
1834            u=mypde.getSolution()
1835          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1836      def test_GMRES_truncation_restart_RILU(self):      def test_GMRES_truncation_restart_RILU(self):
1837          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1838          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1839      mypde.setSolverMethod(mypde.GMRES,mypde.RILU)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1840          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1841        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1842        mypde.getSolverOptions().setTruncation(10)
1843        mypde.getSolverOptions().setRestart(20)
1844            u=mypde.getSolution()
1845            self.failUnless(self.check(u,1.),'solution is wrong.')
1846        def test_GMRES_truncation_restart_REC_ILU(self):
1847            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1848            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1849        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1850        mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1851        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1852        mypde.getSolverOptions().setTruncation(10)
1853        mypde.getSolverOptions().setRestart(20)
1854            u=mypde.getSolution()
1855          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1856      #      #
1857      #   solver checks (PDE system)      #   solver checks (PDE system)
# Line 1420  class Test_LinearPDE_noLumping(Test_line Line 1866  class Test_LinearPDE_noLumping(Test_line
1866              Y[i]+=i              Y[i]+=i
1867          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1868          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1869          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1870            u=mypde.getSolution()
1871          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1872      def test_symmetryOnDirect_System(self):      def test_symmetryOnDirect_System(self):
1873          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1432  class Test_LinearPDE_noLumping(Test_line Line 1879  class Test_LinearPDE_noLumping(Test_line
1879              Y[i]+=i              Y[i]+=i
1880          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1881          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1882          mypde.setSolverMethod(mypde.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1883          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1884            u=mypde.getSolution()
1885          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1886      def test_PCG_JACOBI_System(self):      def test_PCG_JACOBI_System(self):
1887          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1445  class Test_LinearPDE_noLumping(Test_line Line 1893  class Test_LinearPDE_noLumping(Test_line
1893              Y[i]+=i              Y[i]+=i
1894          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1895          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1896          mypde.setSolverMethod(mypde.PCG,mypde.JACOBI)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1897          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1898            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1899            u=mypde.getSolution()
1900          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1901      def test_PCG_ILU0_System(self):      def test_PCG_ILU0_System(self):
1902          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1458  class Test_LinearPDE_noLumping(Test_line Line 1908  class Test_LinearPDE_noLumping(Test_line
1908              Y[i]+=i              Y[i]+=i
1909          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1910          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1911          mypde.setSolverMethod(mypde.PCG,mypde.ILU0)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1912          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1913            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1914            u=mypde.getSolution()
1915          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1916      def test_DIRECT_System(self):      def test_DIRECT_System(self):
1917          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1471  class Test_LinearPDE_noLumping(Test_line Line 1923  class Test_LinearPDE_noLumping(Test_line
1923              Y[i]+=i              Y[i]+=i
1924          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1925          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1926          mypde.setSolverMethod(mypde.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1927          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1928            u=mypde.getSolution()
1929          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1930      def test_BICGSTAB_JACOBI_System(self):      def test_BICGSTAB_JACOBI_System(self):
1931          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1484  class Test_LinearPDE_noLumping(Test_line Line 1937  class Test_LinearPDE_noLumping(Test_line
1937              Y[i]+=i              Y[i]+=i
1938          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1939          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1940      mypde.setSolverMethod(mypde.BICGSTAB,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1941          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1942            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1943            u=mypde.getSolution()
1944          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1945      def test_BICGSTAB_ILU0_System(self):      def test_BICGSTAB_ILU0_System(self):
1946          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1497  class Test_LinearPDE_noLumping(Test_line Line 1952  class Test_LinearPDE_noLumping(Test_line
1952              Y[i]+=i              Y[i]+=i
1953          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1954          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1955      mypde.setSolverMethod(mypde.BICGSTAB,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1956          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1957            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1958            u=mypde.getSolution()
1959          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1960      def test_PRES20_JACOBI_System(self):      def test_PRES20_JACOBI_System(self):
1961          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1510  class Test_LinearPDE_noLumping(Test_line Line 1967  class Test_LinearPDE_noLumping(Test_line
1967              Y[i]+=i              Y[i]+=i
1968          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1969          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1970      mypde.setSolverMethod(mypde.PRES20,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1971          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1972            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1973            u=mypde.getSolution()
1974          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1975      def test_PRES20_ILU0_System(self):      def test_PRES20_ILU0_System(self):
1976          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1523  class Test_LinearPDE_noLumping(Test_line Line 1982  class Test_LinearPDE_noLumping(Test_line
1982              Y[i]+=i              Y[i]+=i
1983          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1984          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
1985      mypde.setSolverMethod(mypde.PRES20,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1986          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1987            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1988            u=mypde.getSolution()
1989          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1990      def test_GMRESnoRestart_JACOBI_System(self):      def test_GMRESnoRestart_JACOBI_System(self):
1991          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1536  class Test_LinearPDE_noLumping(Test_line Line 1997  class Test_LinearPDE_noLumping(Test_line
1997              Y[i]+=i              Y[i]+=i
1998          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1999          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2000      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2001        mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2002          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2003          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2004            u=mypde.getSolution()
2005          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2006      def test_GMRESnoRestart_ILU0_System(self):      def test_GMRESnoRestart_ILU0_System(self):
2007          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1550  class Test_LinearPDE_noLumping(Test_line Line 2013  class Test_LinearPDE_noLumping(Test_line
2013              Y[i]+=i              Y[i]+=i
2014          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2015          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2016      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2017        mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2018          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2019          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2020            u=mypde.getSolution()
2021          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2022      def test_GMRES_JACOBI_System(self):      def test_GMRES_JACOBI_System(self):
2023          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1564  class Test_LinearPDE_noLumping(Test_line Line 2029  class Test_LinearPDE_noLumping(Test_line
2029              Y[i]+=i              Y[i]+=i
2030          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2031          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2032      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2033          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2034            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2035            u=mypde.getSolution()
2036          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2037      def test_GMRES_ILU0_System(self):      def test_GMRES_ILU0_System(self):
2038          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1577  class Test_LinearPDE_noLumping(Test_line Line 2044  class Test_LinearPDE_noLumping(Test_line
2044              Y[i]+=i              Y[i]+=i
2045          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2046          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2047      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2048          u=mypde.getSolution(verbose=self.VERBOSE)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2049            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2050            u=mypde.getSolution()
2051          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2052      def test_GMRES_truncation_restart_JACOBI_System(self):      def test_GMRES_truncation_restart_JACOBI_System(self):
2053          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1590  class Test_LinearPDE_noLumping(Test_line Line 2059  class Test_LinearPDE_noLumping(Test_line
2059              Y[i]+=i              Y[i]+=i
2060          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2061          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2062      mypde.setSolverMethod(mypde.GMRES,mypde.JACOBI)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2063          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2064            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2065        mypde.getSolverOptions().setTruncation(10)
2066        mypde.getSolverOptions().setRestart(20)
2067            u=mypde.getSolution()
2068          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2069      def test_GMRES_truncation_restart_ILU0_System(self):      def test_GMRES_truncation_restart_ILU0_System(self):
2070          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
# Line 1603  class Test_LinearPDE_noLumping(Test_line Line 2076  class Test_LinearPDE_noLumping(Test_line
2076              Y[i]+=i              Y[i]+=i
2077          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2078          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2079      mypde.setSolverMethod(mypde.GMRES,mypde.ILU0)      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2080          u=mypde.getSolution(verbose=self.VERBOSE,truncation=10,restart=20)      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2081            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2082        mypde.getSolverOptions().setTruncation(10)
2083        mypde.getSolverOptions().setRestart(20)
2084            u=mypde.getSolution()
2085          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2086    
2087  class Test_LinearPDE(Test_LinearPDE_noLumping):  class Test_LinearPDE(Test_LinearPDE_noLumping):
# Line 1612  class Test_LinearPDE(Test_LinearPDE_noLu Line 2089  class Test_LinearPDE(Test_LinearPDE_noLu
2089          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2090          try:          try:
2091             success=True             success=True
2092         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2093             mypde.setValue(A=kronecker(self.domain))             mypde.setValue(A=kronecker(self.domain))
2094             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2095               u=mypde.getSolution()    
2096          except ValueError:          except ValueError:
2097             success=False             success=False
2098          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1622  class Test_LinearPDE(Test_LinearPDE_noLu Line 2100  class Test_LinearPDE(Test_LinearPDE_noLu
2100          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2101          try:          try:
2102             success=True             success=True
2103         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2104             mypde.setValue(B=kronecker(self.domain)[0])             mypde.setValue(B=kronecker(self.domain)[0])
2105             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2106               u=mypde.getSolution()
2107          except ValueError:          except ValueError:
2108             success=False             success=False
2109          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1632  class Test_LinearPDE(Test_LinearPDE_noLu Line 2111  class Test_LinearPDE(Test_LinearPDE_noLu
2111          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2112          try:          try:
2113             success=True             success=True
2114         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2115             mypde.setValue(C=kronecker(self.domain)[0])             mypde.setValue(C=kronecker(self.domain)[0])
2116             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2117               u=mypde.getSolution()
2118          except ValueError:          except ValueError:
2119             success=False             success=False
2120          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1643  class Test_LinearPDE(Test_LinearPDE_noLu Line 2123  class Test_LinearPDE(Test_LinearPDE_noLu
2123          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2124          try:          try:
2125             success=True             success=True
2126         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2127             mypde.setValue(A_reduced=kronecker(self.domain))             mypde.setValue(A_reduced=kronecker(self.domain))
2128             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2129               u=mypde.getSolution()
2130          except ValueError:          except ValueError:
2131             success=False             success=False
2132          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1653  class Test_LinearPDE(Test_LinearPDE_noLu Line 2134  class Test_LinearPDE(Test_LinearPDE_noLu
2134          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2135          try:          try:
2136             success=True             success=True
2137         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2138             mypde.setValue(B_reduced=kronecker(self.domain)[0])             mypde.setValue(B_reduced=kronecker(self.domain)[0])
2139             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2140               u=mypde.getSolution()
2141          except ValueError:          except ValueError:
2142             success=False             success=False
2143          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
# Line 1663  class Test_LinearPDE(Test_LinearPDE_noLu Line 2145  class Test_LinearPDE(Test_LinearPDE_noLu
2145          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2146          try:          try:
2147             success=True             success=True
2148         mypde.setSolverMethod(mypde.LUMPING)         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2149             mypde.setValue(C_reduced=kronecker(self.domain)[0])             mypde.setValue(C_reduced=kronecker(self.domain)[0])
2150             u=mypde.getSolution(verbose=self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2151               u=mypde.getSolution()
2152          except ValueError:          except ValueError:
2153             success=False             success=False
2154          self.failUnless(not success,'error should be issued')          self.failUnless(not success,'error should be issued')
2155                    
2156      def test_Lumping(self):      def test_Lumping(self):
2157          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2158      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2159          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2160          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2161            u=mypde.getSolution()
2162          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2163      def test_Constrained_Lumping(self):      def test_Constrained_Lumping(self):
2164          x=self.domain.getX()          x=self.domain.getX()
2165          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2166      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2167          mypde.setValue(D=1.,Y=1.,q=whereZero(x[0]),r=1.)          mypde.setValue(D=1.,Y=1.,q=whereZero(x[0]),r=1.)
2168          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2169            u=mypde.getSolution()
2170          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2171    
2172      def test_Lumping_System(self):      def test_Lumping_System(self):
2173          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2174      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2175          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.]))
2176          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2177          self.failUnless(self.check(u,numarray.ones((2,))),'solution is wrong.')          u=mypde.getSolution()
2178            self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')
2179      def test_Constrained_Lumping_System(self):      def test_Constrained_Lumping_System(self):
2180          x=self.domain.getX()          x=self.domain.getX()
2181          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2182      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2183          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.]), \
2184                         q=whereZero(x[0])*[0.,1],r=[0.,1.])                         q=whereZero(x[0])*[0.,1],r=[0.,1.])
2185          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2186          self.failUnless(self.check(u,numarray.ones((2,))),'solution is wrong.')          u=mypde.getSolution()
2187            self.failUnless(self.check(u,numpy.ones((2,))),'solution is wrong.')
2188    
2189      def test_Lumping_updateRHS(self):      def test_Lumping_updateRHS(self):
2190          x=self.domain.getX()          x=self.domain.getX()
2191          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2192      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2193          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2194          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2195            u=mypde.getSolution()
2196          self.failUnless(self.check(u,1.),'first solution is wrong.')          self.failUnless(self.check(u,1.),'first solution is wrong.')
2197          mypde.setValue(Y=2.,q=whereZero(x[0]),r=2.)          mypde.setValue(Y=2.,q=whereZero(x[0]),r=2.)
2198          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2199            u=mypde.getSolution()
2200          self.failUnless(self.check(u,2.),'second solution is wrong.')          self.failUnless(self.check(u,2.),'second solution is wrong.')
2201      def test_Lumping_updateOperator(self):      def test_Lumping_updateOperator(self):
2202          x=self.domain.getX()          x=self.domain.getX()
2203          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2204      mypde.setSolverMethod(mypde.LUMPING)      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2205          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2206          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2207            u=mypde.getSolution()
2208          mypde.setValue(D=2.)          mypde.setValue(D=2.)
2209          u=mypde.getSolution(verbose=self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2210            u=mypde.getSolution()
2211          self.failUnless(self.check(u,0.5),'second solution is wrong.')          self.failUnless(self.check(u,0.5),'second solution is wrong.')
2212    
2213    
# Line 1730  class Test_TransportPDE(Test_linearPDEs) Line 2221  class Test_TransportPDE(Test_linearPDEs)
2221          self.failUnless(mypde.useBackwardEuler()==False,'backward Euler should not be used')          self.failUnless(mypde.useBackwardEuler()==False,'backward Euler should not be used')
2222      def test_setCoefficient_WithWrongName(self):      def test_setCoefficient_WithWrongName(self):
2223          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2224          self.failUnlessRaises(IllegalCoefficient,mypde.setValue, ROMA=Vector(0.,FunctionOnBoundary(self.domain)))          self.failUnlessRaises(IllegalCoefficient)
2225        mypde.getSolverOptions().setSolverMethod(SolverOptions.setValue, ROMA=Vector(0.,FunctionOnBoundary(self.domain)))
2226    
2227      def test_setCoefficient_WithIllegalFunctionSpace(self):      def test_setCoefficient_WithIllegalFunctionSpace(self):
2228          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2229          self.failUnlessRaises(IllegalCoefficientFunctionSpace,mypde.setValue,C=Vector(0.,FunctionOnBoundary(self.domain)))          self.failUnlessRaises(IllegalCoefficientFunctionSpace)
2230        mypde.getSolverOptions().setSolverMethod(SolverOptions.setValue,C=Vector(0.,FunctionOnBoundary(self.domain)))
2231                    
2232      def test_resetCoefficient_WithWrongShape(self):      def test_resetCoefficient_WithWrongShape(self):
2233          mypde=TransportPDE(self.domain,numEquations=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=2,debug=self.DEBUG)
# Line 1746  class Test_TransportPDE(Test_linearPDEs) Line 2239  class Test_TransportPDE(Test_linearPDEs)
2239    
2240      def test_setInitialSolution_scalar_negative(self):      def test_setInitialSolution_scalar_negative(self):
2241          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)
2242          self.failUnlessRaises(RuntimeError,mypde.setInitialSolution,-1.)          self.failUnlessRaises(RuntimeError, mypde.setInitialSolution,-1.)
2243    
2244      def test_setInitialSolution_scalar_WithWrongShape(self):      def test_setInitialSolution_scalar_WithWrongShape(self):
2245          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)
# Line 1758  class Test_TransportPDE(Test_linearPDEs) Line 2251  class Test_TransportPDE(Test_linearPDEs)
2251    
2252      def test_setInitialSolution_system(self):      def test_setInitialSolution_system(self):
2253          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)
2254          self.failUnlessRaises(RuntimeError,mypde.setInitialSolution,[-1,2.])          self.failUnlessRaises(RuntimeError, mypde.setInitialSolution,[-1,2.])
2255    
2256      def test_setInitialSolution_system_WithWrongShape(self):      def test_setInitialSolution_system_WithWrongShape(self):
2257          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)
2258          self.failUnlessRaises(ValueError,mypde.setInitialSolution,1.)          self.failUnlessRaises(ValueError, mypde.setInitialSolution,1.)
2259    
2260    
2261      def test_attemptToChangeOrderAfterDefinedCoefficient(self):      def test_attemptToChangeOrderAfterDefinedCoefficient(self):
# Line 1773  class Test_TransportPDE(Test_linearPDEs) Line 2266  class Test_TransportPDE(Test_linearPDEs)
2266      def test_reducedOnConfig(self):      def test_reducedOnConfig(self):
2267          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2268          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2269          self.failUnlessEqual((mypde.getFunctionSpaceForSolution(),mypde.getFunctionSpaceForEquation()),(ReducedSolution(self.domain),ReducedSolution(self.domain)),"reduced function spaces expected.")          self.failUnlessEqual((mypde.getFunctionSpaceForSolution(), mypde.getFunctionSpaceForEquation()),(ReducedSolution(self.domain),ReducedSolution(self.domain)),"reduced function spaces expected.")
2270      #      #
2271      #  set coefficients for scalars:      #  set coefficients for scalars:
2272      #      #
# Line 1782  class Test_TransportPDE(Test_linearPDEs) Line 2275  class Test_TransportPDE(Test_linearPDEs)
2275          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2276          mypde.setValue(M=1.)          mypde.setValue(M=1.)
2277          coeff=mypde.getCoefficient("M")          coeff=mypde.getCoefficient("M")
2278          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),Function(self.domain),1,1))
2279      def test_setCoefficient_A_Scalar(self):      def test_setCoefficient_A_Scalar(self):
2280          d=self.domain.getDim()          d=self.domain.getDim()
2281          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2282          mypde.setValue(A=numarray.ones((d,d)))          mypde.setValue(A=numpy.ones((d,d)))
2283          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
2284          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))
2285      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(self):
2286          d=self.domain.getDim()          d=self.domain.getDim()
2287          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2288          mypde.setValue(B=numarray.ones((d,)))          mypde.setValue(B=numpy.ones((d,)))
2289          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
2290          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))
2291      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
2292          d=self.domain.getDim()          d=self.domain.getDim()
2293          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2294          mypde.setValue(C=numarray.ones((d,)))          mypde.setValue(C=numpy.ones((d,)))
2295          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
2296          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))
2297      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
2298          d=self.domain.getDim()          d=self.domain.getDim()
2299          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2300          mypde.setValue(D=1.)          mypde.setValue(D=1.)
2301          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
2302          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),Function(self.domain),1,1))
2303      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(self):
2304          d=self.domain.getDim()          d=self.domain.getDim()
2305          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2306          mypde.setValue(X=numarray.ones((d,)))          mypde.setValue(X=numpy.ones((d,)))
2307          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
2308          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))
2309      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
2310          d=self.domain.getDim()          d=self.domain.getDim()
2311          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2312          mypde.setValue(Y=1.)          mypde.setValue(Y=1.)
2313          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
2314          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),Function(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),Function(self.domain),1))
2315      def test_setCoefficient_y_Scalar(self):      def test_setCoefficient_y_Scalar(self):
2316          d=self.domain.getDim()          d=self.domain.getDim()
2317          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2318          mypde.setValue(y=1.)          mypde.setValue(y=1.)
2319          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
2320          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))
2321      def test_setCoefficient_d_Scalar(self):      def test_setCoefficient_d_Scalar(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(d=1.)          mypde.setValue(d=1.)
2325          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
2326          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
2327      def test_setCoefficient_m_Scalar(self):      def test_setCoefficient_m_Scalar(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(m=1.)          mypde.setValue(m=1.)
2331          coeff=mypde.getCoefficient("m")          coeff=mypde.getCoefficient("m")
2332          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
2333      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(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_contact=1.)          mypde.setValue(d_contact=1.)
2337          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
2338          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))
2339      def test_setCoefficient_y_contact_Scalar(self):      def test_setCoefficient_y_contact_Scalar(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(y_contact=1.)          mypde.setValue(y_contact=1.)
2343          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
2344          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))
2345    
2346      def test_setCoefficient_M_reduced_Scalar(self):      def test_setCoefficient_M_reduced_Scalar(self):
2347          d=self.domain.getDim()          d=self.domain.getDim()
2348          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2349          mypde.setValue(M_reduced=1.)          mypde.setValue(M_reduced=1.)
2350          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2351          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
2352      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
2353          d=self.domain.getDim()          d=self.domain.getDim()
2354          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2355          mypde.setValue(A_reduced=numarray.ones((d,d)))          mypde.setValue(A_reduced=numpy.ones((d,d)))
2356          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2357          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))
2358      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(self):
2359          d=self.domain.getDim()          d=self.domain.getDim()
2360          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2361          mypde.setValue(B_reduced=numarray.ones((d,)))          mypde.setValue(B_reduced=numpy.ones((d,)))
2362          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2363          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))
2364      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(self):
2365          d=self.domain.getDim()          d=self.domain.getDim()
2366          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2367          mypde.setValue(C_reduced=numarray.ones((d,)))          mypde.setValue(C_reduced=numpy.ones((d,)))
2368          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2369          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))
2370      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
2371          d=self.domain.getDim()          d=self.domain.getDim()
2372          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2373          mypde.setValue(D_reduced=1.)          mypde.setValue(D_reduced=1.)
2374          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2375          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
2376      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(self):
2377          d=self.domain.getDim()          d=self.domain.getDim()
2378          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2379          mypde.setValue(X_reduced=numarray.ones((d,)))          mypde.setValue(X_reduced=numpy.ones((d,)))
2380          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2381          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))
2382      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
2383          d=self.domain.getDim()          d=self.domain.getDim()
2384          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2385          mypde.setValue(Y_reduced=1.)          mypde.setValue(Y_reduced=1.)
2386          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2387          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
2388      def test_setCoefficient_y_reduced_Scalar(self):      def test_setCoefficient_y_reduced_Scalar(self):
2389          d=self.domain.getDim()          d=self.domain.getDim()
2390          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2391          mypde.setValue(y_reduced=1.)          mypde.setValue(y_reduced=1.)
2392          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2393          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
2394      def test_setCoefficient_m_reduced_Scalar(self):      def test_setCoefficient_m_reduced_Scalar(self):
2395          d=self.domain.getDim()          d=self.domain.getDim()
2396          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2397          mypde.setValue(m_reduced=1.)          mypde.setValue(m_reduced=1.)
2398          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2399          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
2400      def test_setCoefficient_d_reduced_Scalar(self):      def test_setCoefficient_d_reduced_Scalar(self):
2401          d=self.domain.getDim()          d=self.domain.getDim()
2402          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2403          mypde.setValue(d_reduced=1.)          mypde.setValue(d_reduced=1.)
2404          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2405          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
2406      def test_setCoefficient_d_contact_reduced_Scalar(self):      def test_setCoefficient_d_contact_reduced_Scalar(self):
2407          d=self.domain.getDim()          d=self.domain.getDim()
2408          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2409          mypde.setValue(d_contact_reduced=1.)          mypde.setValue(d_contact_reduced=1.)
2410          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2411          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
2412      def test_setCoefficient_y_contact_reduced_Scalar(self):      def test_setCoefficient_y_contact_reduced_Scalar(self):
2413          d=self.domain.getDim()          d=self.domain.getDim()
2414          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2415          mypde.setValue(y_contact_reduced=1.)          mypde.setValue(y_contact_reduced=1.)
2416          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2417          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
2418      def test_setCoefficient_r_Scalar(self):      def test_setCoefficient_r_Scalar(self):
2419          d=self.domain.getDim()          d=self.domain.getDim()
2420          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2421          mypde.setValue(r=1.)          mypde.setValue(r=1.)
2422          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2423          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),Solution(self.domain),1))
2424      def test_setCoefficient_q_Scalar(self):      def test_setCoefficient_q_Scalar(self):
2425          d=self.domain.getDim()          d=self.domain.getDim()
2426          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2427          mypde.setValue(q=1.)          mypde.setValue(q=1.)
2428          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2429          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),Solution(self.domain),1))
2430      def test_setCoefficient_r_Scalar_reducedOn(self):      def test_setCoefficient_r_Scalar_reducedOn(self):
2431          d=self.domain.getDim()          d=self.domain.getDim()
2432          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2433          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2434          mypde.setValue(r=1.)          mypde.setValue(r=1.)
2435          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2436          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
2437      def test_setCoefficient_q_Scalar_reducedOn(self):      def test_setCoefficient_q_Scalar_reducedOn(self):
2438          d=self.domain.getDim()          d=self.domain.getDim()
2439          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2440          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2441          mypde.setValue(q=1.)          mypde.setValue(q=1.)
2442          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2443          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
2444    
2445      def test_setCoefficient_M_reduced_Scalar_usingM(self):      def test_setCoefficient_M_reduced_Scalar_usingM(self):
2446          d=self.domain.getDim()          d=self.domain.getDim()
2447          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2448          mypde.setValue(M=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(M=Scalar(1.,ReducedFunction(self.domain)))
2449          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2450          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
2451      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
2452          d=self.domain.getDim()          d=self.domain.getDim()
2453          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2454          mypde.setValue(A=Data(numarray.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
2455          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2456          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))
2457      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
2458          d=self.domain.getDim()          d=self.domain.getDim()
2459          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2460          mypde.setValue(B=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2461          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2462          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))
2463      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(self):
2464          d=self.domain.getDim()          d=self.domain.getDim()
2465          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2466          mypde.setValue(C=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2467          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2468          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))
2469      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
2470          d=self.domain.getDim()          d=self.domain.getDim()
2471          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2472          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))
2473          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2474          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
2475      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
2476          d=self.domain.getDim()          d=self.domain.getDim()
2477          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2478          mypde.setValue(X_reduced=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
2479          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2480          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))
2481      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
2482          d=self.domain.getDim()          d=self.domain.getDim()
2483          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2484          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))
2485          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2486          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
2487      def test_setCoefficient_y_reduced_Scalar_using_y(self):      def test_setCoefficient_y_reduced_Scalar_using_y(self):
2488          d=self.domain.getDim()          d=self.domain.getDim()
2489          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2490          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
2491          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2492          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
2493      def test_setCoefficient_m_reduced_Scalar_using_m(self):      def test_setCoefficient_m_reduced_Scalar_using_m(self):
2494          d=self.domain.getDim()          d=self.domain.getDim()
2495          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2496          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
2497          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2498          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
2499      def test_setCoefficient_d_reduced_Scalar_using_d(self):      def test_setCoefficient_d_reduced_Scalar_using_d(self):
2500          d=self.domain.getDim()          d=self.domain.getDim()
2501          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2502          mypde.setValue(m=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(m=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
2503          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2504          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
2505      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):
2506          d=self.domain.getDim()          d=self.domain.getDim()
2507          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2508          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
2509          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2510          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
2511      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):
2512          d=self.domain.getDim()          d=self.domain.getDim()
2513          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2514          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
2515          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2516          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
2517      #      #
2518      #  set coefficients for systems:      #  set coefficients for systems:
2519      #      #
2520      def test_setCoefficient_M_System(self):      def test_setCoefficient_M_System(self):
2521          d=self.domain.getDim()          d=self.domain.getDim()
2522          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2523          mypde.setValue(M=numarray.ones((self.N,self.N)))          mypde.setValue(M=numpy.ones((self.N,self.N)))
2524          coeff=mypde.getCoefficient("M")          coeff=mypde.getCoefficient("M")
2525          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))
2526      def test_setCoefficient_A_System(self):      def test_setCoefficient_A_System(self):
2527          d=self.domain.getDim()          d=self.domain.getDim()
2528          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2529          mypde.setValue(A=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A=numpy.ones((self.N,d,self.N,d)))
2530          coeff=mypde.getCoefficient("A")          coeff=mypde.getCoefficient("A")
2531          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))
2532      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
2533          d=self.domain.getDim()          d=self.domain.getDim()
2534          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2535          mypde.setValue(B=numarray.ones((self.N,d,self.N)))          mypde.setValue(B=numpy.ones((self.N,d,self.N)))
2536          coeff=mypde.getCoefficient("B")          coeff=mypde.getCoefficient("B")
2537          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))
2538      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
2539          d=self.domain.getDim()          d=self.domain.getDim()
2540          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2541          mypde.setValue(C=numarray.ones((self.N,self.N,d)))          mypde.setValue(C=numpy.ones((self.N,self.N,d)))
2542          coeff=mypde.getCoefficient("C")          coeff=mypde.getCoefficient("C")
2543          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))
2544      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
2545          d=self.domain.getDim()          d=self.domain.getDim()
2546          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2547          mypde.setValue(D=numarray.ones((self.N,self.N)))          mypde.setValue(D=numpy.ones((self.N,self.N)))
2548          coeff=mypde.getCoefficient("D")          coeff=mypde.getCoefficient("D")
2549          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))
2550      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
2551          d=self.domain.getDim()          d=self.domain.getDim()
2552          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2553          mypde.setValue(X=numarray.ones((self.N,d)))          mypde.setValue(X=numpy.ones((self.N,d)))
2554          coeff=mypde.getCoefficient("X")          coeff=mypde.getCoefficient("X")
2555          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))
2556      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
2557          d=self.domain.getDim()          d=self.domain.getDim()
2558          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2559          mypde.setValue(Y=numarray.ones((self.N,)))          mypde.setValue(Y=numpy.ones((self.N,)))
2560          coeff=mypde.getCoefficient("Y")          coeff=mypde.getCoefficient("Y")
2561          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))
2562      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
2563          d=self.domain.getDim()          d=self.domain.getDim()
2564          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2565          mypde.setValue(y=numarray.ones((self.N,)))          mypde.setValue(y=numpy.ones((self.N,)))
2566          coeff=mypde.getCoefficient("y")          coeff=mypde.getCoefficient("y")
2567          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))
2568      def test_setCoefficient_m_System(self):      def test_setCoefficient_m_System(self):
2569          d=self.domain.getDim()          d=self.domain.getDim()
2570          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2571          mypde.setValue(m=numarray.ones((self.N,self.N)))          mypde.setValue(m=numpy.ones((self.N,self.N)))
2572          coeff=mypde.getCoefficient("m")          coeff=mypde.getCoefficient("m")
2573          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))
2574      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
2575          d=self.domain.getDim()          d=self.domain.getDim()
2576          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2577          mypde.setValue(d=numarray.ones((self.N,self.N)))          mypde.setValue(d=numpy.ones((self.N,self.N)))
2578          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
2579          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))
2580      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
2581          d=self.domain.getDim()          d=self.domain.getDim()
2582          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2583          mypde.setValue(d_contact=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
2584          coeff=mypde.getCoefficient("d_contact")          coeff=mypde.getCoefficient("d_contact")
2585          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))
2586      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
2587          d=self.domain.getDim()          d=self.domain.getDim()
2588          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2589          mypde.setValue(y_contact=numarray.ones((self.N,)))          mypde.setValue(y_contact=numpy.ones((self.N,)))
2590          coeff=mypde.getCoefficient("y_contact")          coeff=mypde.getCoefficient("y_contact")
2591          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))
2592      def test_setCoefficient_M_System_reduced(self):      def test_setCoefficient_M_System_reduced(self):
2593          d=self.domain.getDim()          d=self.domain.getDim()
2594          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2595          mypde.setValue(M_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(M_reduced=numpy.ones((self.N,self.N)))
2596          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2597          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))
2598      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
2599          d=self.domain.getDim()          d=self.domain.getDim()
2600          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2601          mypde.setValue(A_reduced=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numpy.ones((self.N,d,self.N,d)))
2602          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2603          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))
2604      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
2605          d=self.domain.getDim()          d=self.domain.getDim()
2606          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2607          mypde.setValue(B_reduced=numarray.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numpy.ones((self.N,d,self.N)))
2608          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2609          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))
2610      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
2611          d=self.domain.getDim()          d=self.domain.getDim()
2612          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2613          mypde.setValue(C_reduced=numarray.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numpy.ones((self.N,self.N,d)))
2614          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2615          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))
2616      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(self):
2617          d=self.domain.getDim()          d=self.domain.getDim()
2618          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2619          mypde.setValue(D_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(D_reduced=numpy.ones((self.N,self.N)))
2620          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2621          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))
2622      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
2623          d=self.domain.getDim()          d=self.domain.getDim()
2624          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2625          mypde.setValue(X_reduced=numarray.ones((self.N,d)))          mypde.setValue(X_reduced=numpy.ones((self.N,d)))
2626          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2627          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))
2628      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
2629          d=self.domain.getDim()          d=self.domain.getDim()
2630          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2631          mypde.setValue(Y_reduced=numarray.ones((self.N,)))          mypde.setValue(Y_reduced=numpy.ones((self.N,)))
2632          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2633          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))
2634      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
2635          d=self.domain.getDim()          d=self.domain.getDim()
2636          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2637          mypde.setValue(y_reduced=numarray.ones((self.N,)))          mypde.setValue(y_reduced=numpy.ones((self.N,)))
2638          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2639          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))
2640      def test_setCoefficient_m_reduced_System(self):      def test_setCoefficient_m_reduced_System(self):
2641          d=self.domain.getDim()          d=self.domain.getDim()
2642          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2643          mypde.setValue(m_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(m_reduced=numpy.ones((self.N,self.N)))
2644          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2645          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))
2646      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
2647          d=self.domain.getDim()          d=self.domain.getDim()
2648          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2649          mypde.setValue(d_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_reduced=numpy.ones((self.N,self.N)))
2650          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2651          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))
2652      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
2653          d=self.domain.getDim()          d=self.domain.getDim()
2654          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2655          mypde.setValue(d_contact_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
2656          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2657          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))
2658      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
2659          d=self.domain.getDim()          d=self.domain.getDim()
2660          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2661          mypde.setValue(y_contact_reduced=numarray.ones((self.N,)))          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
2662          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2663          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))
2664      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
2665          d=self.domain.getDim()          d=self.domain.getDim()
2666          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2667          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
2668          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2669          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))
2670      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
2671          d=self.domain.getDim()          d=self.domain.getDim()
2672          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2673          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
2674          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2675          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))
2676      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
2677          d=self.domain.getDim()          d=self.domain.getDim()
2678          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2679          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2680          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numpy.ones((self.N,)))
2681          coeff=mypde.getCoefficient("r")          coeff=mypde.getCoefficient("r")
2682          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))
2683      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
2684          d=self.domain.getDim()          d=self.domain.getDim()
2685          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=3,debug=self.DEBUG)
2686          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
2687          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numpy.ones((self.N,)))
2688          coeff=mypde.getCoefficient("q")          coeff=mypde.getCoefficient("q")
2689          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))
2690    
2691      def test_setCoefficient_M_System_reduced_using_D(self):      def test_setCoefficient_M_System_reduced_using_D(self):
2692          d=self.domain.getDim()          d=self.domain.getDim()
2693          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2694          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)))
2695          coeff=mypde.getCoefficient("M_reduced")          coeff=mypde.getCoefficient("M_reduced")
2696          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))
2697      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
2698          d=self.domain.getDim()          d=self.domain.getDim()
2699          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2700          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)))
2701          coeff=mypde.getCoefficient("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
2702          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))
2703      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
2704          d=self.domain.getDim()          d=self.domain.getDim()
2705          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2706          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)))
2707          coeff=mypde.getCoefficient("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
2708          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))
2709      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(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          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)))
2713          coeff=mypde.getCoefficient("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
2714          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))
2715      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
2716          d=self.domain.getDim()          d=self.domain.getDim()
2717          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2718          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)))
2719          coeff=mypde.getCoefficient("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
2720          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))
2721      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
2722          d=self.domain.getDim()          d=self.domain.getDim()
2723          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2724          mypde.setValue(X=Data(numarray.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
2725          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
2726          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))
2727      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
2728          d=self.domain.getDim()          d=self.domain.getDim()
2729          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2730          mypde.setValue(Y=Data(numarray.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
2731          coeff=mypde.getCoefficient("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
2732          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))
2733      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
2734          d=self.domain.getDim()          d=self.domain.getDim()
2735          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2736          mypde.setValue(y=Data(numarray.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
2737          coeff=mypde.getCoefficient("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
2738          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))
2739      def test_setCoefficient_m_reduced_System_using_m(self):      def test_setCoefficient_m_reduced_System_using_m(self):
2740          d=self.domain.getDim()          d=self.domain.getDim()
2741          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2742          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)))
2743          coeff=mypde.getCoefficient("m_reduced")          coeff=mypde.getCoefficient("m_reduced")
2744          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))
2745      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
2746          d=self.domain.getDim()          d=self.domain.getDim()
2747          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2748          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)))
2749          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
2750          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))
2751      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
2752          d=self.domain.getDim()          d=self.domain.getDim()
2753          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2754          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)))
2755          coeff=mypde.getCoefficient("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
2756          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))
2757      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
2758          d=self.domain.getDim()          d=self.domain.getDim()
2759          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
2760          mypde.setValue(y_contact=Data(numarray.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
2761          coeff=mypde.getCoefficient("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
2762          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))
2763    
2764      def test_symmetryCheckTrue_System(self):      def test_symmetryCheckTrue_System(self):
2765          d=self.domain.getDim()          d=self.domain.getDim()
2766          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2767          M=100*numarray.ones((self.N,self.N))          M=100*numpy.ones((self.N,self.N))
2768          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2769          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2770          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2771          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2772          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2773          m=64*numarray.ones((self.N,self.N))          m=64*numpy.ones((self.N,self.N))
2774          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2775          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)
2776          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")
2777    
2778      def test_symmetryCheckFalse_M_System(self):      def test_symmetryCheckFalse_M_System(self):
2779          d=self.domain.getDim()          d=self.domain.getDim()
2780          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2781          M=numarray.ones((self.N,self.N))          M=numpy.ones((self.N,self.N))
2782          M[1,0]=0.          M[1,0]=0.
2783          mypde.setValue(M=M)          mypde.setValue(M=M)
2784          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 2786  class Test_TransportPDE(Test_linearPDEs)
2786      def test_symmetryCheckFalse_A_System(self):      def test_symmetryCheckFalse_A_System(self):
2787          d=self.domain.getDim()          d=self.domain.getDim()
2788          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2789          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2790          A[1,1,1,0]=0.          A[1,1,1,0]=0.
2791          mypde.setValue(A=A)          mypde.setValue(A=A)
2792          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 2794  class Test_TransportPDE(Test_linearPDEs)
2794      def test_symmetryCheckFalse_BC_System(self):      def test_symmetryCheckFalse_BC_System(self):
2795          d=self.domain.getDim()          d=self.domain.getDim()
2796          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2797          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2798          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2799          B[0,0,1]=1.          B[0,0,1]=1.
2800          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
2801          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2802    
2803      def test_symmetryCheckFalse_D_System(self):      def test_symmetryCheckFalse_D_System(self):
2804          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2805          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2806          D[0,1]=0.          D[0,1]=0.
2807          mypde.setValue(D=D)          mypde.setValue(D=D)
2808          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2809    
2810      def test_symmetryCheckFalse_m_System(self):      def test_symmetryCheckFalse_m_System(self):
2811          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2812          m=4*numarray.ones((self.N,self.N))          m=4*numpy.ones((self.N,self.N))
2813          m[0,1]=0.          m[0,1]=0.
2814          mypde.setValue(m=m)          mypde.setValue(m=m)
2815          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2816    
2817      def test_symmetryCheckFalse_d_System(self):      def test_symmetryCheckFalse_d_System(self):
2818          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2819          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2820          d[0,1]=0.          d[0,1]=0.
2821          mypde.setValue(d=d)          mypde.setValue(d=d)
2822          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2823    
2824      def test_symmetryCheckFalse_d_contact_System(self):      def test_symmetryCheckFalse_d_contact_System(self):
2825          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2826          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2827          d_contact[0,1]=0.          d_contact[0,1]=0.
2828          mypde.setValue(d_contact=d_contact)          mypde.setValue(d_contact=d_contact)
2829          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2830    
2831      def test_symmetryCheckFalse_M_reduced_System(self):      def test_symmetryCheckFalse_M_reduced_System(self):
2832          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2833          M=3*numarray.ones((self.N,self.N))          M=3*numpy.ones((self.N,self.N))
2834          M[0,1]=0.          M[0,1]=0.
2835          mypde.setValue(M_reduced=M)          mypde.setValue(M_reduced=M)
2836          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 2838  class Test_TransportPDE(Test_linearPDEs)
2838      def test_symmetryCheckFalse_A_reduced_System(self):      def test_symmetryCheckFalse_A_reduced_System(self):
2839          d=self.domain.getDim()          d=self.domain.getDim()
2840          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2841          A=numarray.ones((self.N,d,self.N,d))          A=numpy.ones((self.N,d,self.N,d))
2842          A[1,1,1,0]=0.          A[1,1,1,0]=0.
2843          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
2844          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 2846  class Test_TransportPDE(Test_linearPDEs)
2846      def test_symmetryCheckFalse_BC_reduced_System(self):      def test_symmetryCheckFalse_BC_reduced_System(self):
2847          d=self.domain.getDim()          d=self.domain.getDim()
2848          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2849          C=2*numarray.ones((self.N,self.N,d))          C=2*numpy.ones((self.N,self.N,d))
2850          B=2*numarray.ones((self.N,d,self.N))          B=2*numpy.ones((self.N,d,self.N))
2851          B[0,0,1]=1.          B[0,0,1]=1.
2852          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
2853          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2854    
2855      def test_symmetryCheckFalse_D_reduced_System(self):      def test_symmetryCheckFalse_D_reduced_System(self):
2856          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2857          D=3*numarray.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
2858          D[0,1]=0.          D[0,1]=0.
2859          mypde.setValue(D_reduced=D)          mypde.setValue(D_reduced=D)
2860          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2861    
2862      def test_symmetryCheckFalse_m_reduced_System(self):      def test_symmetryCheckFalse_m_reduced_System(self):
2863          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2864          m=4*numarray.ones((self.N,self.N))          m=4*numpy.ones((self.N,self.N))
2865          m[0,1]=0.          m[0,1]=0.
2866          mypde.setValue(m_reduced=m)          mypde.setValue(m_reduced=m)
2867          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2868    
2869      def test_symmetryCheckFalse_d_reduced_System(self):      def test_symmetryCheckFalse_d_reduced_System(self):
2870          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2871          d=4*numarray.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
2872          d[0,1]=0.          d[0,1]=0.
2873          mypde.setValue(d_reduced=d)          mypde.setValue(d_reduced=d)
2874          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2875    
2876      def test_symmetryCheckFalse_d_contact_reduced_System(self):      def test_symmetryCheckFalse_d_contact_reduced_System(self):
2877          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2878          d_contact=5*numarray.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
2879          d_contact[0,1]=0.          d_contact[0,1]=0.
2880          mypde.setValue(d_contact_reduced=d_contact)          mypde.setValue(d_contact_reduced=d_contact)
2881          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 2885  class Test_TransportPDE(Test_linearPDEs)
2885          d=self.domain.getDim()          d=self.domain.getDim()
2886          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2887          M=100          M=100
2888          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2889          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2890          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2891          D=3          D=3
2892          m=10          m=10
2893          d=4          d=4
# Line 2405  class Test_TransportPDE(Test_linearPDEs) Line 2898  class Test_TransportPDE(Test_linearPDEs)
2898      def test_symmetryCheckFalse_A_Scalar(self):      def test_symmetryCheckFalse_A_Scalar(self):
2899          d=self.domain.getDim()          d=self.domain.getDim()
2900          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2901          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2902          A[1,0]=0.          A[1,0]=0.
2903          mypde.setValue(A=A)          mypde.setValue(A=A)
2904          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2905      def test_symmetryCheckFalse_BC_Scalar(self):      def test_symmetryCheckFalse_BC_Scalar(self):
2906          d=self.domain.getDim()          d=self.domain.getDim()
2907          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2908          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2909          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2910          B[0]=1.          B[0]=1.
2911          mypde.setValue(B=B,C=C)          mypde.setValue(B=B,C=C)
2912          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2913      def test_symmetryCheckFalse_A_reduced_Scalar(self):      def test_symmetryCheckFalse_A_reduced_Scalar(self):
2914          d=self.domain.getDim()          d=self.domain.getDim()
2915          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2916          A=numarray.ones((d,d))          A=numpy.ones((d,d))
2917          A[1,0]=0.          A[1,0]=0.
2918          mypde.setValue(A_reduced=A)          mypde.setValue(A_reduced=A)
2919          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
2920      def test_symmetryCheckFalse_BC_reduced_Scalar(self):      def test_symmetryCheckFalse_BC_reduced_Scalar(self):
2921          d=self.domain.getDim()          d=self.domain.getDim()
2922          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2923          C=2*numarray.ones((d,))          C=2*numpy.ones((d,))
2924          B=2*numarray.ones((d,))          B=2*numpy.ones((d,))
2925          B[0]=1.          B[0]=1.
2926          mypde.setValue(B_reduced=B,C_reduced=C)          mypde.setValue(B_reduced=B,C_reduced=C)
2927          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.2548

  ViewVC Help
Powered by ViewVC 1.1.26