/[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 4657 by jfenwick, Thu Feb 6 06:12:20 2014 UTC revision 4783 by sshaw, Thu Mar 20 06:23:23 2014 UTC
# Line 54  class Test_linearPDEs(unittest.TestCase) Line 54  class Test_linearPDEs(unittest.TestCase)
54          """          """
55          if tol==None: tol=self.TOL          if tol==None: tol=self.TOL
56          return Lsup(arg-ref_arg)<=tol*Lsup(ref_arg)          return Lsup(arg-ref_arg)<=tol*Lsup(ref_arg)
57    
58        def checkIfNotEmpty(self, pde, coefs):
59            for coef in coefs:
60                self.assertTrue(pde.getCoefficient(coef).isEmpty(),
61                        "%s is not empty"%coef)
62    
63        def checkIfReducedNotEmpty(self, pde, coefs):
64            for coef in coefs:
65                coef += "_reduced"
66                self.assertTrue(pde.getCoefficient(coef).isEmpty(),
67                        "%s is not empty"%coef)
68        
69        def checkContactsNotEmpty(self, pde):
70            if self.domain.supportsContactElements():
71                self.checkIfNotEmpty(mypde, ["d_contact", "y_contact"])
72                self.checkIfReducedNotEmpty(mypde, ["d_contact", "y_contact"])
73            
74  class Test_LameEquation(Test_linearPDEs):  class Test_LameEquation(Test_linearPDEs):
   
75      def test_config(self):      def test_config(self):
76          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
77          d=self.domain.getDim()          d=self.domain.getDim()
# Line 66  class Test_LameEquation(Test_linearPDEs) Line 81  class Test_LameEquation(Test_linearPDEs)
81          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
82          x=self.domain.getX()          x=self.domain.getX()
83          mypde.setValue(q=x)          mypde.setValue(q=x)
   
84          q_ref=interpolate(x,Solution(self.domain))          q_ref=interpolate(x,Solution(self.domain))
85    
86            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "r"])
87            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
88            self.checkContactsNotEmpty(mypde)
89    
90          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
91          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
92    
93    
94      def test_setCoefficient_r(self):      def test_setCoefficient_r(self):
95          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
96          x=self.domain.getX()          x=self.domain.getX()
97          mypde.setValue(r=x)          mypde.setValue(r=x)
   
98          r_ref=interpolate(x,Solution(self.domain))          r_ref=interpolate(x,Solution(self.domain))
99    
100            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "q"])
101            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
102            self.checkContactsNotEmpty(mypde)
103            
104          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
105          self.assertTrue(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x")          self.assertTrue(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x")
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
106    
107    
108      def test_setCoefficient_F(self):      def test_setCoefficient_F(self):
# Line 130  class Test_LameEquation(Test_linearPDEs) Line 111  class Test_LameEquation(Test_linearPDEs)
111          mypde.setValue(F=x)          mypde.setValue(F=x)
112    
113          Y_ref=interpolate(x,Function(self.domain))          Y_ref=interpolate(x,Function(self.domain))
114    
115            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "y", "d", "q", "r"])
116            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
117            self.checkContactsNotEmpty(mypde)
118    
119          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
120          self.assertTrue(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x")          self.assertTrue(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x")
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
121    
122      def test_setCoefficient_f(self):      def test_setCoefficient_f(self):
123          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
# Line 160  class Test_LameEquation(Test_linearPDEs) Line 125  class Test_LameEquation(Test_linearPDEs)
125          mypde.setValue(f=x)          mypde.setValue(f=x)
126    
127          y_ref=interpolate(x,FunctionOnBoundary(self.domain))          y_ref=interpolate(x,FunctionOnBoundary(self.domain))
128            
129            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "d", "q", "r"])
130            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
131            self.checkContactsNotEmpty(mypde)
132    
133          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")
134          self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")          self.assertTrue(self.check(mypde.getCoefficient("y"),y_ref),"y is not x[0]")
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(self.check(mypde.getCoefficient("y"),y_ref),"d is not x[0]")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
135    
136      def test_setCoefficient_sigma(self):      def test_setCoefficient_sigma(self):
137          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
138          x=self.domain.getX()          x=self.domain.getX()
139          mypde.setValue(sigma=outer(x,x))          mypde.setValue(sigma=outer(x,x))
140    
141            self.checkIfNotEmpty(mypde, ["B", "C", "D", "Y", "y", "d", "q", "r"])
142            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
143            self.checkContactsNotEmpty(mypde)
144    
145          X_ref=interpolate(outer(x,x),Function(self.domain))          X_ref=interpolate(outer(x,x),Function(self.domain))
146          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")          self.assertTrue(self.check(mypde.getCoefficient("A"),0),"A is not 0")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
147          self.assertTrue(self.check(mypde.getCoefficient("X"),X_ref),"X is not x X x")          self.assertTrue(self.check(mypde.getCoefficient("X"),X_ref),"X is not x X x")
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
148    
149      def test_setCoefficient_lambda(self):      def test_setCoefficient_lambda(self):
150          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
# Line 224  class Test_LameEquation(Test_linearPDEs) Line 156  class Test_LameEquation(Test_linearPDEs)
156          k3Xk3=outer(k3,k3)          k3Xk3=outer(k3,k3)
157          A_ref=x[0]*k3Xk3          A_ref=x[0]*k3Xk3
158    
159            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "q", "r"])
160            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
161            self.checkContactsNotEmpty(mypde)
162    
163          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
164    
165      def test_setCoefficient_mu(self):      def test_setCoefficient_mu(self):
166          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
# Line 258  class Test_LameEquation(Test_linearPDEs) Line 172  class Test_LameEquation(Test_linearPDEs)
172          k3Xk3=outer(k3,k3)          k3Xk3=outer(k3,k3)
173          A_ref=x[0]*(swap_axes(k3Xk3,0,3)+swap_axes(k3Xk3,1,3))          A_ref=x[0]*(swap_axes(k3Xk3,0,3)+swap_axes(k3Xk3,1,3))
174    
175            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "q", "r"])
176            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
177            self.checkContactsNotEmpty(mypde)
178    
179          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")          
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
180    
181      def test_setCoefficient_lambdamu(self):      def test_setCoefficient_lambdamu(self):
182          mypde=LameEquation(self.domain,debug=self.DEBUG)          mypde=LameEquation(self.domain,debug=self.DEBUG)
# Line 291  class Test_LameEquation(Test_linearPDEs) Line 187  class Test_LameEquation(Test_linearPDEs)
187          k3Xk3=outer(k3,k3)          k3Xk3=outer(k3,k3)
188          A_ref=x[0]*k3Xk3+x[1]*(swap_axes(k3Xk3,0,3)+swap_axes(k3Xk3,1,3))          A_ref=x[0]*k3Xk3+x[1]*(swap_axes(k3Xk3,0,3)+swap_axes(k3Xk3,1,3))
189    
190            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "q", "r"])
191            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
192            self.checkContactsNotEmpty(mypde)
193    
194          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
195    
196      def test_solve(self):      def test_solve(self):
197         d=self.domain.getDim()         d=self.domain.getDim()
# Line 341  class Test_Helmholtz(Test_linearPDEs): Line 219  class Test_Helmholtz(Test_linearPDEs):
219          q_ref=interpolate(whereZero(x[0]),Solution(self.domain))          q_ref=interpolate(whereZero(x[0]),Solution(self.domain))
220          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
221    
222            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "r"])
223            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
224            self.checkContactsNotEmpty(mypde)
225    
226          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
227          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
228    
229      def test_setCoefficient_r(self):      def test_setCoefficient_r(self):
230          mypde=Helmholtz(self.domain,debug=self.DEBUG)          mypde=Helmholtz(self.domain,debug=self.DEBUG)
# Line 372  class Test_Helmholtz(Test_linearPDEs): Line 233  class Test_Helmholtz(Test_linearPDEs):
233    
234          r_ref=interpolate(x[0],Solution(self.domain))          r_ref=interpolate(x[0],Solution(self.domain))
235          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
236    
237            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "q"])
238            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
239            self.checkContactsNotEmpty(mypde)
240    
241          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
242          self.assertTrue(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x[0]")          self.assertTrue(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x[0]")
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
243    
244    
245      def test_setCoefficient_f(self):      def test_setCoefficient_f(self):
# Line 404  class Test_Helmholtz(Test_linearPDEs): Line 249  class Test_Helmholtz(Test_linearPDEs):
249    
250          Y_ref=interpolate(x[0],Function(self.domain))          Y_ref=interpolate(x[0],Function(self.domain))
251          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
252    
253            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "y", "d", "q", "r"])
254            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
255            self.checkContactsNotEmpty(mypde)
256    
257          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
258          self.assertTrue(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")          self.assertTrue(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
259    
260      def test_setCoefficient_alpha(self):      def test_setCoefficient_alpha(self):
261          mypde=Helmholtz(self.domain,debug=self.DEBUG)          mypde=Helmholtz(self.domain,debug=self.DEBUG)
# Line 435  class Test_Helmholtz(Test_linearPDEs): Line 264  class Test_Helmholtz(Test_linearPDEs):
264    
265          d_ref=interpolate(x[0],FunctionOnBoundary(self.domain))          d_ref=interpolate(x[0],FunctionOnBoundary(self.domain))
266          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
267    
268            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "q", "r"])
269            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
270            self.checkContactsNotEmpty(mypde)
271    
272          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
273          self.assertTrue(self.check(mypde.getCoefficient("d"),d_ref),"d is not x[0]")          self.assertTrue(self.check(mypde.getCoefficient("d"),d_ref),"d is not x[0]")
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
274    
275      def test_setCoefficient_g(self):      def test_setCoefficient_g(self):
276          mypde=Helmholtz(self.domain,debug=self.DEBUG)          mypde=Helmholtz(self.domain,debug=self.DEBUG)
# Line 466  class Test_Helmholtz(Test_linearPDEs): Line 279  class Test_Helmholtz(Test_linearPDEs):
279    
280          y_ref=interpolate(x[0],FunctionOnBoundary(self.domain))          y_ref=interpolate(x[0],FunctionOnBoundary(self.domain))
281          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
282    
283            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "d", "q", "r"])
284            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
285            self.checkContactsNotEmpty(mypde)
286    
287          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
288          self.assertTrue(self.check(mypde.getCoefficient("y"),y_ref),"y is not x[0]")          self.assertTrue(self.check(mypde.getCoefficient("y"),y_ref),"y is not x[0]")
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
289    
290      def test_setCoefficient_omega(self):      def test_setCoefficient_omega(self):
291          mypde=Helmholtz(self.domain,debug=self.DEBUG)          mypde=Helmholtz(self.domain,debug=self.DEBUG)
# Line 497  class Test_Helmholtz(Test_linearPDEs): Line 294  class Test_Helmholtz(Test_linearPDEs):
294    
295          D_ref=interpolate(x[0],Function(self.domain))          D_ref=interpolate(x[0],Function(self.domain))
296          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
297    
298            self.checkIfNotEmpty(mypde, ["B", "C", "X", "Y", "y", "d", "q", "r"])
299            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
300            self.checkContactsNotEmpty(mypde)
301    
302          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
303          self.assertTrue(self.check(mypde.getCoefficient("D"),D_ref),"D is not x[0]")          self.assertTrue(self.check(mypde.getCoefficient("D"),D_ref),"D is not x[0]")
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")          
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
304    
305      def test_solve(self):      def test_solve(self):
306         d=self.domain.getDim()         d=self.domain.getDim()
# Line 535  class Test_Poisson(Test_linearPDEs): Line 316  class Test_Poisson(Test_linearPDEs):
316      def test_config(self):      def test_config(self):
317          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
318          self.assertEqual((mypde.getNumEquations(), mypde.getNumSolutions(), mypde.getSolverOptions().isSymmetric()),(1,1,True),"set up incorrect")          self.assertEqual((mypde.getNumEquations(), mypde.getNumSolutions(), mypde.getSolverOptions().isSymmetric()),(1,1,True),"set up incorrect")
319    
320      def test_setCoefficient_q(self):      def test_setCoefficient_q(self):
321          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
322          x=self.domain.getX()          x=self.domain.getX()
323          q_ref=interpolate(whereZero(x[0]),Solution(self.domain))          q_ref=interpolate(whereZero(x[0]),Solution(self.domain))
324          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
325          mypde.setValue(q=whereZero(x[0]))          mypde.setValue(q=whereZero(x[0]))
326    
327            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "r"])
328            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
329            self.checkContactsNotEmpty(mypde)
330    
331          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
332          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
333          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
334      def test_setCoefficient_f(self):      def test_setCoefficient_f(self):
335          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
336          x=self.domain.getX()          x=self.domain.getX()
337          Y_ref=interpolate(x[0],Function(self.domain))          Y_ref=interpolate(x[0],Function(self.domain))
338          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
339          mypde.setValue(f=x[0])          mypde.setValue(f=x[0])
340    
341            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "y", "d", "q", "r"])
342            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "Y", "y", "d"])
343            self.checkContactsNotEmpty(mypde)
344    
345          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
346          self.assertTrue(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")          self.assertTrue(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")
347          self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
348      def test_setCoefficient_f_reduced(self):      def test_setCoefficient_f_reduced(self):
349          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
350          x=self.domain.getX()          x=self.domain.getX()
351          Y_ref=interpolate(x[0],ReducedFunction(self.domain))          Y_ref=interpolate(x[0],ReducedFunction(self.domain))
352          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
353          mypde.setValue(f_reduced=x[0])          mypde.setValue(f_reduced=x[0])
354    
355            self.checkIfNotEmpty(mypde, ["B", "C", "D", "X", "Y", "y", "d", "q", "r"])
356            self.checkIfReducedNotEmpty(mypde, ["A", "B", "C", "D", "X", "y", "d"])
357            self.checkContactsNotEmpty(mypde)
358    
359          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")          self.assertTrue(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
         self.assertTrue(mypde.getCoefficient("B").isEmpty(),"B is not empty")  
         self.assertTrue(mypde.getCoefficient("C").isEmpty(),"C is not empty")  
         self.assertTrue(mypde.getCoefficient("D").isEmpty(),"D is not empty")  
         self.assertTrue(mypde.getCoefficient("X").isEmpty(),"X is not empty")  
         self.assertTrue(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")  
         self.assertTrue(mypde.getCoefficient("y").isEmpty(),"y is not empty")  
         self.assertTrue(mypde.getCoefficient("d").isEmpty(),"d is not empty")  
         self.assertTrue(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")  
360          self.assertTrue(self.check(mypde.getCoefficient("Y_reduced"),Y_ref),"Y_reduced is not x[0]")          self.assertTrue(self.check(mypde.getCoefficient("Y_reduced"),Y_ref),"Y_reduced is not x[0]")
361          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")  
         self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")  
         if self.domain.supportsContactElements():  
             self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")  
             self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
             self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")          
         self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")  
         self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")  
362      def test_solve(self):      def test_solve(self):
363         d=self.domain.getDim()         d=self.domain.getDim()
364         cf=ContinuousFunction(self.domain)         cf=ContinuousFunction(self.domain)

Legend:
Removed from v.4657  
changed lines
  Added in v.4783

  ViewVC Help
Powered by ViewVC 1.1.26