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

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

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

revision 3258 by gross, Mon Sep 6 09:17:28 2010 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 23  __url__="https://launchpad.net/escript-f Line 23  __url__="https://launchpad.net/escript-f
23  """  """
24  Test suite for linearPDEs class  Test suite for linearPDEs class
25    
 The tests must be linked with a Domain class object in the setUp method:  
   
    from esys.finley import Rectangle  
    class Test_LinearPDEOnFinley(Test_LinearPDE):  
        def setUp(self):  
            self.domain = Rectangle(10,10,2)  
        def tearDown(self):  
            del self.domain  
    suite = unittest.TestSuite()  
    suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley))  
    unittest.TextTestRunner(verbosity=2).run(suite)  
   
 :var __author__: name of author  
 :var __copyright__: copyrights  
 :var __license__: licence agreement  
 :var __url__: url entry point on documentation  
 :var __version__: version  
 :var __date__: date of the version  
26  """  """
27    
28  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
# Line 84  class Test_LameEquation(Test_linearPDEs) Line 66  class Test_LameEquation(Test_linearPDEs)
66          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
67          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
68          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
69          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
70          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
71          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 94  class Test_LameEquation(Test_linearPDEs) Line 74  class Test_LameEquation(Test_linearPDEs)
74          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
75          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
76          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
77          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
78          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
79                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
80            self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
81                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
82          self.failUnless(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")          self.failUnless(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
83          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
84    
# Line 113  class Test_LameEquation(Test_linearPDEs) Line 96  class Test_LameEquation(Test_linearPDEs)
96          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
97          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
98          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
99          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
100          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
101          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 123  class Test_LameEquation(Test_linearPDEs) Line 104  class Test_LameEquation(Test_linearPDEs)
104          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
105          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
106          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
107          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
108          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
109                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
110            self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
111                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
112          self.failUnless(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x")          self.failUnless(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x")
113          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
114    
# Line 143  class Test_LameEquation(Test_linearPDEs) Line 127  class Test_LameEquation(Test_linearPDEs)
127          self.failUnless(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x")          self.failUnless(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x")
128          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
129          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
130          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
131          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
132          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 153  class Test_LameEquation(Test_linearPDEs) Line 135  class Test_LameEquation(Test_linearPDEs)
135          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
136          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
137          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
138          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
139          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
140          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")              self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
141                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
142                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
143        self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
144          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
145    
146      def test_setCoefficient_f(self):      def test_setCoefficient_f(self):
# Line 172  class Test_LameEquation(Test_linearPDEs) Line 157  class Test_LameEquation(Test_linearPDEs)
157          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
158          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
159          self.failUnless(self.check(mypde.getCoefficient("y"),y_ref),"d is not x[0]")          self.failUnless(self.check(mypde.getCoefficient("y"),y_ref),"d is not x[0]")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
160          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
161          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
162          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 182  class Test_LameEquation(Test_linearPDEs) Line 165  class Test_LameEquation(Test_linearPDEs)
165          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")
166          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
167          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
168          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
169          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
170                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
171                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
172                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
173          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
174          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
175    
# Line 201  class Test_LameEquation(Test_linearPDEs) Line 187  class Test_LameEquation(Test_linearPDEs)
187          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
188          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
189          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
190          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
191          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
192          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 211  class Test_LameEquation(Test_linearPDEs) Line 195  class Test_LameEquation(Test_linearPDEs)
195          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")
196          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
197          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
198          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")          if self.domain.supportsContactElements():
199          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
200                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
201            self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
202                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
203          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
204          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
205    
# Line 234  class Test_LameEquation(Test_linearPDEs) Line 221  class Test_LameEquation(Test_linearPDEs)
221          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
222          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
223          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
224          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
225          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
226          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 244  class Test_LameEquation(Test_linearPDEs) Line 229  class Test_LameEquation(Test_linearPDEs)
229          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
230          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
231          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
232          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
233          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
234                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
235                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
236                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
237          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
238          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
239    
# Line 267  class Test_LameEquation(Test_linearPDEs) Line 255  class Test_LameEquation(Test_linearPDEs)
255          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
256          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
257          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
258          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
259          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
260          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 277  class Test_LameEquation(Test_linearPDEs) Line 263  class Test_LameEquation(Test_linearPDEs)
263          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
264          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
265          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
266          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
267          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
268          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")              self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
269                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
270                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
271        self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
272          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
273    
274      def test_setCoefficient_lambdamu(self):      def test_setCoefficient_lambdamu(self):
# Line 299  class Test_LameEquation(Test_linearPDEs) Line 288  class Test_LameEquation(Test_linearPDEs)
288          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
289          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
290          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
291          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
292          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
293          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 309  class Test_LameEquation(Test_linearPDEs) Line 296  class Test_LameEquation(Test_linearPDEs)
296          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
297          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
298          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
299          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
300          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
301          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")              self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
302                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
303                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
304        self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
305          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
306    
307      def test_solve(self):      def test_solve(self):
# Line 348  class Test_Helmholtz(Test_linearPDEs): Line 338  class Test_Helmholtz(Test_linearPDEs):
338          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
339          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
340          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
341          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
342          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
343          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 358  class Test_Helmholtz(Test_linearPDEs): Line 346  class Test_Helmholtz(Test_linearPDEs):
346          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
347          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
348          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
349          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
350          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
351                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
352                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
353                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
354          self.failUnless(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")          self.failUnless(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
355          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
356    
# Line 378  class Test_Helmholtz(Test_linearPDEs): Line 369  class Test_Helmholtz(Test_linearPDEs):
369          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
370          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
371          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
372          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
373          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
374          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 388  class Test_Helmholtz(Test_linearPDEs): Line 377  class Test_Helmholtz(Test_linearPDEs):
377          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
378          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
379          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
380          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
381          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
382          self.failUnless(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x[0]")              self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
383                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
384                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
385        self.failUnless(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x[0]")
386          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
387    
388    
# Line 409  class Test_Helmholtz(Test_linearPDEs): Line 401  class Test_Helmholtz(Test_linearPDEs):
401          self.failUnless(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")          self.failUnless(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")
402          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
403          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
404          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
405          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
406          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 419  class Test_Helmholtz(Test_linearPDEs): Line 409  class Test_Helmholtz(Test_linearPDEs):
409          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
410          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
411          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
412          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
413          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
414                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
415                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
416                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
417          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
418          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
419    
# Line 439  class Test_Helmholtz(Test_linearPDEs): Line 432  class Test_Helmholtz(Test_linearPDEs):
432          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
433          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
434          self.failUnless(self.check(mypde.getCoefficient("d"),d_ref),"d is not x[0]")          self.failUnless(self.check(mypde.getCoefficient("d"),d_ref),"d is not x[0]")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
435          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
436          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
437          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 449  class Test_Helmholtz(Test_linearPDEs): Line 440  class Test_Helmholtz(Test_linearPDEs):
440          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")
441          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
442          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
443          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
444          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
445                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
446                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
447                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
448          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
449          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
450    
# Line 469  class Test_Helmholtz(Test_linearPDEs): Line 463  class Test_Helmholtz(Test_linearPDEs):
463          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
464          self.failUnless(self.check(mypde.getCoefficient("y"),y_ref),"y is not x[0]")          self.failUnless(self.check(mypde.getCoefficient("y"),y_ref),"y is not x[0]")
465          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
466          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
467          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
468          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 479  class Test_Helmholtz(Test_linearPDEs): Line 471  class Test_Helmholtz(Test_linearPDEs):
471          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
472          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
473          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
474          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
475          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
476                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
477                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
478                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
479          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
480          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
481    
# Line 499  class Test_Helmholtz(Test_linearPDEs): Line 494  class Test_Helmholtz(Test_linearPDEs):
494          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
495          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
496          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
497          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
498          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
499          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 509  class Test_Helmholtz(Test_linearPDEs): Line 502  class Test_Helmholtz(Test_linearPDEs):
502          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
503          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
504          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
505          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
506          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
507          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")              self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
508                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
509                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
510        self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
511          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
512    
513      def test_solve(self):      def test_solve(self):
# Line 542  class Test_Poisson(Test_linearPDEs): Line 538  class Test_Poisson(Test_linearPDEs):
538          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
539          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
540          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
541          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
542          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
543          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 552  class Test_Poisson(Test_linearPDEs): Line 546  class Test_Poisson(Test_linearPDEs):
546          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
547          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
548          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
549          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
550          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
551          self.failUnless(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")              self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
552                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
553                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
554        self.failUnless(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
555          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
556      def test_setCoefficient_f(self):      def test_setCoefficient_f(self):
557          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
# Line 570  class Test_Poisson(Test_linearPDEs): Line 567  class Test_Poisson(Test_linearPDEs):
567          self.failUnless(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")          self.failUnless(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")
568          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
569          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
570          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
571          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
572          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 580  class Test_Poisson(Test_linearPDEs): Line 575  class Test_Poisson(Test_linearPDEs):
575          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
576          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
577          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
578          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")          if self.domain.supportsContactElements():
579          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
580                self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
581            self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
582                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
583          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
584          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
585      def test_setCoefficient_f_reduced(self):      def test_setCoefficient_f_reduced(self):
# Line 598  class Test_Poisson(Test_linearPDEs): Line 596  class Test_Poisson(Test_linearPDEs):
596          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
597          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
598          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
         self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")  
         self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")  
599          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
600          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
601          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
# Line 608  class Test_Poisson(Test_linearPDEs): Line 604  class Test_Poisson(Test_linearPDEs):
604          self.failUnless(self.check(mypde.getCoefficient("Y_reduced"),Y_ref),"Y_reduced is not x[0]")          self.failUnless(self.check(mypde.getCoefficient("Y_reduced"),Y_ref),"Y_reduced is not x[0]")
605          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
606          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
607          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")      if self.domain.supportsContactElements():
608          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
609          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")              self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
610                self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
611                self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
612        self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
613          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
614      def test_solve(self):      def test_solve(self):
615         d=self.domain.getDim()         d=self.domain.getDim()
# Line 637  class Test_Poisson(Test_linearPDEs): Line 636  class Test_Poisson(Test_linearPDEs):
636         mypde=Poisson(self.domain)         mypde=Poisson(self.domain)
637         mypde.setValue(f=f,q=msk)         mypde.setValue(f=f,q=msk)
638         u=mypde.getSolution()         u=mypde.getSolution()
639           print u,u_ex, self.TOL
640         self.failUnless(self.check(u,u_ex,10*self.TOL),"incorrect solution")         self.failUnless(self.check(u,u_ex,10*self.TOL),"incorrect solution")
641    
642  class Test_LinearPDE_noLumping(Test_linearPDEs):  class Test_LinearPDE_noLumping(Test_linearPDEs):
# Line 1022  class Test_LinearPDE_noLumping(Test_line Line 1022  class Test_LinearPDE_noLumping(Test_line
1022          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1023          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))
1024      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(self):
1025          d=self.domain.getDim()      if self.domain.supportsContactElements():
1026          mypde=LinearPDE(self.domain,debug=self.DEBUG)              d=self.domain.getDim()
1027          mypde.setValue(d_contact=1.)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1028          coeff=mypde.getCoefficient("d_contact")              mypde.setValue(d_contact=1.)
1029          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))              coeff=mypde.getCoefficient("d_contact")
1030                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))
1031      def test_setCoefficient_y_contact_Scalar(self):      def test_setCoefficient_y_contact_Scalar(self):
1032          d=self.domain.getDim()          d=self.domain.getDim()
1033          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)      if self.domain.supportsContactElements():
1034          mypde.setValue(y_contact=1.)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1035          coeff=mypde.getCoefficient("y_contact")              mypde.setValue(y_contact=1.)
1036          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))              coeff=mypde.getCoefficient("y_contact")
1037                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))
1038      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_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)
# Line 1082  class Test_LinearPDE_noLumping(Test_line Line 1084  class Test_LinearPDE_noLumping(Test_line
1084          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1085          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))
1086      def test_setCoefficient_d_contact_reduced_Scalar(self):      def test_setCoefficient_d_contact_reduced_Scalar(self):
1087          d=self.domain.getDim()      if self.domain.supportsContactElements():
1088          mypde=LinearPDE(self.domain,debug=self.DEBUG)              d=self.domain.getDim()
1089          mypde.setValue(d_contact_reduced=1.)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1090          coeff=mypde.getCoefficient("d_contact_reduced")              mypde.setValue(d_contact_reduced=1.)
1091          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))              coeff=mypde.getCoefficient("d_contact_reduced")
1092                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
1093      def test_setCoefficient_y_contact_reduced_Scalar(self):      def test_setCoefficient_y_contact_reduced_Scalar(self):
1094          d=self.domain.getDim()      if self.domain.supportsContactElements():
1095          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              d=self.domain.getDim()
1096          mypde.setValue(y_contact_reduced=1.)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1097          coeff=mypde.getCoefficient("y_contact_reduced")              mypde.setValue(y_contact_reduced=1.)
1098          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))              coeff=mypde.getCoefficient("y_contact_reduced")
1099                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
1100      def test_setCoefficient_r_Scalar(self):      def test_setCoefficient_r_Scalar(self):
1101          d=self.domain.getDim()          d=self.domain.getDim()
1102          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
# Line 1169  class Test_LinearPDE_noLumping(Test_line Line 1173  class Test_LinearPDE_noLumping(Test_line
1173          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1174          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))
1175      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):
1176          d=self.domain.getDim()      if self.domain.supportsContactElements():
1177          mypde=LinearPDE(self.domain,debug=self.DEBUG)              d=self.domain.getDim()
1178          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1179          coeff=mypde.getCoefficient("d_contact_reduced")              mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1180          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))              coeff=mypde.getCoefficient("d_contact_reduced")
1181                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
1182      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):
1183          d=self.domain.getDim()      if self.domain.supportsContactElements():
1184          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              d=self.domain.getDim()
1185          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1186          coeff=mypde.getCoefficient("y_contact_reduced")              mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1187          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))              coeff=mypde.getCoefficient("y_contact_reduced")
1188                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
1189      #      #
1190      #  set coefficients for systems:      #  set coefficients for systems:
1191      #      #
# Line 1232  class Test_LinearPDE_noLumping(Test_line Line 1238  class Test_LinearPDE_noLumping(Test_line
1238          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1239          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))
1240      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
1241          d=self.domain.getDim()      if self.domain.supportsContactElements():
1242          mypde=LinearPDE(self.domain,debug=self.DEBUG)              d=self.domain.getDim()
1243          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1244          coeff=mypde.getCoefficient("d_contact")              mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
1245          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))              coeff=mypde.getCoefficient("d_contact")
1246                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))
1247      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
1248          d=self.domain.getDim()      if self.domain.supportsContactElements():
1249          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              d=self.domain.getDim()
1250          mypde.setValue(y_contact=numpy.ones((self.N,)))              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1251          coeff=mypde.getCoefficient("y_contact")              mypde.setValue(y_contact=numpy.ones((self.N,)))
1252          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FunctionOnContactZero(self.domain),self.N))              coeff=mypde.getCoefficient("y_contact")
1253                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FunctionOnContactZero(self.domain),self.N))
1254      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_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)
# Line 1292  class Test_LinearPDE_noLumping(Test_line Line 1300  class Test_LinearPDE_noLumping(Test_line
1300          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1301          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))
1302      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
1303          d=self.domain.getDim()      if self.domain.supportsContactElements():
1304          mypde=LinearPDE(self.domain,debug=self.DEBUG)              d=self.domain.getDim()
1305          mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1306          coeff=mypde.getCoefficient("d_contact_reduced")              mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
1307          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))              coeff=mypde.getCoefficient("d_contact_reduced")
1308                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
1309      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
1310          d=self.domain.getDim()      if self.domain.supportsContactElements():
1311          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              d=self.domain.getDim()
1312          mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1313          coeff=mypde.getCoefficient("y_contact_reduced")              mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
1314          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))              coeff=mypde.getCoefficient("y_contact_reduced")
1315                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))
1316      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
1317          d=self.domain.getDim()          d=self.domain.getDim()
1318          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
# Line 1379  class Test_LinearPDE_noLumping(Test_line Line 1389  class Test_LinearPDE_noLumping(Test_line
1389          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1390          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))
1391      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
1392          d=self.domain.getDim()      if self.domain.supportsContactElements():
1393          mypde=LinearPDE(self.domain,debug=self.DEBUG)              d=self.domain.getDim()
1394          mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1395          coeff=mypde.getCoefficient("d_contact_reduced")              mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))
1396          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))              coeff=mypde.getCoefficient("d_contact_reduced")
1397                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
1398      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
1399          d=self.domain.getDim()      if self.domain.supportsContactElements():
1400          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              d=self.domain.getDim()
1401          mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1402          coeff=mypde.getCoefficient("y_contact_reduced")              mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
1403          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))              coeff=mypde.getCoefficient("y_contact_reduced")
1404                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))
1405      def test_resetCoefficient_HomogeneousConstraint(self):      def test_resetCoefficient_HomogeneousConstraint(self):
1406          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1407          x=self.domain.getX()          x=self.domain.getX()
# Line 1427  class Test_LinearPDE_noLumping(Test_line Line 1439  class Test_LinearPDE_noLumping(Test_line
1439          u1=mypde.getSolution()          u1=mypde.getSolution()
1440          error1=Lsup(u1-u1_ref)/Lsup(u1_ref)          error1=Lsup(u1-u1_ref)/Lsup(u1_ref)
1441          self.failUnless(mypde.getDomainStatus() == mypde.getSystemStatus(), "status of first pde does not match domain status.")          self.failUnless(mypde.getDomainStatus() == mypde.getSystemStatus(), "status of first pde does not match domain status.")
   
1442          self.domain.setX(x*5)          self.domain.setX(x*5)
   
1443          self.failUnless(mypde.getDomainStatus() != mypde.getSystemStatus(), "status of first pde matches updated domain status.")          self.failUnless(mypde.getDomainStatus() != mypde.getSystemStatus(), "status of first pde matches updated domain status.")
1444          x2=self.domain.getX()          x2=self.domain.getX()
1445          u2_ref=x2[0]*(5.-x2[0])          u2_ref=x2[0]*(5.-x2[0])
# Line 1447  class Test_LinearPDE_noLumping(Test_line Line 1457  class Test_LinearPDE_noLumping(Test_line
1457          D=3*numpy.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1458          d=4*numpy.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1459          d_contact=5*numpy.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1460          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)      pars={"A":A, "B":B, "C":C, "D":D, "d":d, "A_reduced":-A, "B_reduced":-B, "C_reduced":-C, "D_reduced":-D, "d_reduced":-d}
1461        if self.domain.supportsContactElements():
1462            pars["d_contact"]=d_contact
1463            pars["d_contact_reduced"]=-d_contact
1464        mypde.setValue(**pars)
1465          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")
1466    
1467      def test_symmetryCheckFalse_A_System(self):      def test_symmetryCheckFalse_A_System(self):
# Line 1481  class Test_LinearPDE_noLumping(Test_line Line 1495  class Test_LinearPDE_noLumping(Test_line
1495          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1496    
1497      def test_symmetryCheckFalse_d_contact_System(self):      def test_symmetryCheckFalse_d_contact_System(self):
1498          mypde=LinearPDE(self.domain,debug=self.DEBUG)      if self.domain.supportsContactElements():
1499          d_contact=5*numpy.ones((self.N,self.N))              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1500          d_contact[0,1]=0.              d_contact=5*numpy.ones((self.N,self.N))
1501          mypde.setValue(d_contact=d_contact)              d_contact[0,1]=0.
1502          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")              mypde.setValue(d_contact=d_contact)
1503                self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1504    
1505      def test_symmetryCheckFalse_A_reduced_System(self):      def test_symmetryCheckFalse_A_reduced_System(self):
1506          d=self.domain.getDim()          d=self.domain.getDim()
# Line 1518  class Test_LinearPDE_noLumping(Test_line Line 1533  class Test_LinearPDE_noLumping(Test_line
1533          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1534    
1535      def test_symmetryCheckFalse_d_contact_reduced_System(self):      def test_symmetryCheckFalse_d_contact_reduced_System(self):
1536          mypde=LinearPDE(self.domain,debug=self.DEBUG)      if self.domain.supportsContactElements():
1537          d_contact=5*numpy.ones((self.N,self.N))              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1538          d_contact[0,1]=0.              d_contact=5*numpy.ones((self.N,self.N))
1539          mypde.setValue(d_contact_reduced=d_contact)              d_contact[0,1]=0.
1540          self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")              mypde.setValue(d_contact_reduced=d_contact)
1541                self.failUnless(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1542    
1543      def test_symmetryCheckTrue_Scalar(self):      def test_symmetryCheckTrue_Scalar(self):
1544          d=self.domain.getDim()          d=self.domain.getDim()
# Line 1533  class Test_LinearPDE_noLumping(Test_line Line 1549  class Test_LinearPDE_noLumping(Test_line
1549          D=3          D=3
1550          d=4          d=4
1551          d_contact=5          d_contact=5
1552          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)      pars={"A":A, "B":B, "C":C, "D":D, "d":d, "A_reduced":-A, "B_reduced":-B, "C_reduced":-C, "D_reduced":-D, "d_reduced":-d}
1553        if self.domain.supportsContactElements():
1554            pars["d_contact"]=d_contact
1555            pars["d_contact_reduced"]=-d_contact
1556        mypde.setValue(**pars)
1557          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.failUnless(mypde.checkSymmetry(verbose=False),"symmetry detected")
1558    
1559      def test_symmetryCheckFalse_A_Scalar(self):      def test_symmetryCheckFalse_A_Scalar(self):
# Line 2660  class Test_TransportPDE(Test_linearPDEs) Line 2680  class Test_TransportPDE(Test_linearPDEs)
2680          coeff=mypde.getCoefficient("m")          coeff=mypde.getCoefficient("m")
2681          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))
2682      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(self):
2683          d=self.domain.getDim()      if self.domain.supportsContactElements():
2684          mypde=TransportPDE(self.domain,debug=self.DEBUG)              d=self.domain.getDim()
2685          mypde.setValue(d_contact=1.)              mypde=TransportPDE(self.domain,debug=self.DEBUG)
2686          coeff=mypde.getCoefficient("d_contact")              mypde.setValue(d_contact=1.)
2687          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))              coeff=mypde.getCoefficient("d_contact")
2688                self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))
2689      def test_setCoefficient_y_contact_Scalar(self):      def test_setCoefficient_y_contact_Scalar(self):
2690          d=self.domain.getDim()          d=self.domain.getDim()
2691          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
# Line 2907  class Test_TransportPDE(Test_linearPDEs) Line 2928  class Test_TransportPDE(Test_linearPDEs)
2928          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
2929          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))
2930      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
2931        
2932          d=self.domain.getDim()          d=self.domain.getDim()
2933          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2934          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))

Legend:
Removed from v.3258  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26