/[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 2817 by artak, Thu Dec 10 02:12:33 2009 UTC revision 3437 by plaub, Mon Jan 10 05:05:15 2011 UTC
# Line 1  Line 1 
1    # -*- coding: utf-8 -*-
2    
3  ########################################################  ########################################################
4  #  #
5  # Copyright (c) 2003-2009 by University of Queensland  # Copyright (c) 2003-2010 by University of Queensland
6  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
7  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
8  #  #
# Line 11  Line 12 
12  #  #
13  ########################################################  ########################################################
14    
15  __copyright__="""Copyright (c) 2003-2009 by University of Queensland  __copyright__="""Copyright (c) 2003-2010 by University of Queensland
16  Earth Systems Science Computational Center (ESSCC)  Earth Systems Science Computational Center (ESSCC)
17  http://www.uq.edu.au/esscc  http://www.uq.edu.au/esscc
18  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
# Line 22  __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 83  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 93  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 112  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 122  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 142  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 152  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 171  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 181  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 200  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 210  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 233  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 243  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 266  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 276  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 298  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 308  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 347  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 357  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 377  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 387  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 408  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 418  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 438  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 448  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 468  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 478  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 498  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 508  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 541  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 551  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 569  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 579  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 597  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 607  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 636  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):
643      N=4      N=4
644      def test_SolverOptions(self):      def test_SolverOptions(self):
645          so=SolverOptions()          so=SolverOptions()
646            
647            self.failUnless(so.getSmoother() == 28, "initial Smoother is wrong.")
648            self.failUnlessRaises(ValueError,so.setSmoother,-1)
649            so.setSmoother(so.GAUSS_SEIDEL)
650            self.failUnless(so.getSmoother() == 28, "Gauss-Seidel smoother is not set.")
651            so.setSmoother(so.JACOBI)
652            self.failUnless(so.getSmoother() == 10, "Jacobi smoother is not set.")
653    
654          self.failUnless(so.getLevelMax() == 3, "initial  LevelMax is wrong.")          self.failUnless(so.getLevelMax() == 100, "initial  LevelMax is wrong.")
655          self.failUnlessRaises(ValueError,so.setLevelMax,-1)          self.failUnlessRaises(ValueError,so.setLevelMax,-1)
656          so.setLevelMax(20)          so.setLevelMax(20)
657          self.failUnless(so.getLevelMax() == 20, "LevelMax is wrong.")          self.failUnless(so.getLevelMax() == 20, "LevelMax is wrong.")
# Line 658  class Test_LinearPDE_noLumping(Test_line Line 666  class Test_LinearPDE_noLumping(Test_line
666          so.setMinCoarseMatrixSize(1000)          so.setMinCoarseMatrixSize(1000)
667          self.failUnless(so.getMinCoarseMatrixSize() == 1000, "Minimum Coarse Matrix Size is wrong.")          self.failUnless(so.getMinCoarseMatrixSize() == 1000, "Minimum Coarse Matrix Size is wrong.")
668    
669          self.failUnless(so.getNumSweeps() == 2, "initial  Sweeps is wrong.")          self.failUnless(so.getNumSweeps() == 1, "initial  Sweeps is wrong.")
670          self.failUnlessRaises(ValueError,so.setNumSweeps,-1)          self.failUnlessRaises(ValueError,so.setNumSweeps,-1)
671          so.setNumSweeps(3)          so.setNumSweeps(3)
672          self.failUnless(so.getNumSweeps() == 3, "Sweeps is wrong.")          self.failUnless(so.getNumSweeps() == 3, "Sweeps is wrong.")
673    
674          self.failUnless(so.getNumPreSweeps() == 2, "initial  PreSweeps is wrong.")          self.failUnless(so.getNumPreSweeps() == 1, "initial  PreSweeps is wrong.")
675          self.failUnlessRaises(ValueError,so.setNumPreSweeps,-1)          self.failUnlessRaises(ValueError,so.setNumPreSweeps,-1)
676          so.setNumPreSweeps(4)          so.setNumPreSweeps(4)
677          self.failUnless(so.getNumPreSweeps() == 4, "PreSweeps is wrong.")          self.failUnless(so.getNumPreSweeps() == 4, "PreSweeps is wrong.")
678    
679          self.failUnless(so.getNumPostSweeps() == 2, "initial  PreSweeps is wrong.")          self.failUnless(so.getNumPostSweeps() == 1, "initial  PostSweeps is wrong.")
680          self.failUnlessRaises(ValueError,so.setNumPostSweeps,-1)          self.failUnlessRaises(ValueError,so.setNumPostSweeps,-1)
681          so.setNumPostSweeps(5)          so.setNumPostSweeps(5)
682          self.failUnless(so.getNumPostSweeps() == 5, "PreSweeps is wrong.")          self.failUnless(so.getNumPostSweeps() == 5, "PostSweeps is wrong.")
683    
684          self.failUnless(so.getTolerance() == 1.e-8, "initial Tolerance is wrong.")          self.failUnless(so.getTolerance() == 1.e-8, "initial Tolerance is wrong.")
685          self.failUnlessRaises(ValueError,so.setTolerance,-1)          self.failUnlessRaises(ValueError,so.setTolerance,-1)
# Line 806  class Test_LinearPDE_noLumping(Test_line Line 814  class Test_LinearPDE_noLumping(Test_line
814          self.failUnless(so.getSolverMethod() == 5, "CGS is not set.")          self.failUnless(so.getSolverMethod() == 5, "CGS is not set.")
815          so.setSolverMethod(so.BICGSTAB)          so.setSolverMethod(so.BICGSTAB)
816          self.failUnless(so.getSolverMethod() == 6, "BICGSTAB is not set.")          self.failUnless(so.getSolverMethod() == 6, "BICGSTAB is not set.")
         so.setSolverMethod(so.SSOR)  
         self.failUnless(so.getSolverMethod() == 7, "SSOR is not set.")  
817          so.setSolverMethod(so.GMRES)          so.setSolverMethod(so.GMRES)
818          self.failUnless(so.getSolverMethod() == 11, "GMRES is not set.")          self.failUnless(so.getSolverMethod() == 11, "GMRES is not set.")
819          so.setSolverMethod(so.PRES20)          so.setSolverMethod(so.PRES20)
# Line 816  class Test_LinearPDE_noLumping(Test_line Line 822  class Test_LinearPDE_noLumping(Test_line
822          self.failUnless(so.getSolverMethod() == 13, "LUMPING is not set.")          self.failUnless(so.getSolverMethod() == 13, "LUMPING is not set.")
823          so.setSolverMethod(so.ITERATIVE)          so.setSolverMethod(so.ITERATIVE)
824          self.failUnless(so.getSolverMethod() == 20, "ITERATIVE is not set.")          self.failUnless(so.getSolverMethod() == 20, "ITERATIVE is not set.")
         so.setSolverMethod(so.AMG)  
         self.failUnless(so.getSolverMethod() == 22, "AMG is not set.")  
825          so.setSolverMethod(so.NONLINEAR_GMRES)          so.setSolverMethod(so.NONLINEAR_GMRES)
826          self.failUnless(so.getSolverMethod() == 25, "NONLINEAR_GMRES is not set.")          self.failUnless(so.getSolverMethod() == 25, "NONLINEAR_GMRES is not set.")
827          so.setSolverMethod(so.TFQMR)          so.setSolverMethod(so.TFQMR)
828          self.failUnless(so.getSolverMethod() == 26, "TFQMR is not set.")          self.failUnless(so.getSolverMethod() == 26, "TFQMR is not set.")
829          so.setSolverMethod(so.MINRES)          so.setSolverMethod(so.MINRES)
830          self.failUnless(so.getSolverMethod() == 27, "MINRES is not set.")          self.failUnless(so.getSolverMethod() == 27, "MINRES is not set.")
         so.setSolverMethod(so.GAUSS_SEIDEL)  
         self.failUnless(so.getSolverMethod() == 28, "GAUSS_SEIDEL is not set.")  
831          so.setSolverMethod(so.DEFAULT)          so.setSolverMethod(so.DEFAULT)
832          self.failUnless(so.getSolverMethod() == 0, "DEFAULT is not set.")          self.failUnless(so.getSolverMethod() == 0, "DEFAULT is not set.")
833    
# Line 833  class Test_LinearPDE_noLumping(Test_line Line 835  class Test_LinearPDE_noLumping(Test_line
835          self.failUnlessRaises(ValueError,so.setPreconditioner,-1)          self.failUnlessRaises(ValueError,so.setPreconditioner,-1)
836          so.setPreconditioner(so.ILU0)          so.setPreconditioner(so.ILU0)
837          self.failUnless(so.getPreconditioner() == 8, "ILU0 is not set.")          self.failUnless(so.getPreconditioner() == 8, "ILU0 is not set.")
         so.setPreconditioner(so.SSOR)  
         self.failUnless(so.getPreconditioner() == 7, "SSOR is not set.")  
838          so.setPreconditioner(so.ILUT)          so.setPreconditioner(so.ILUT)
839          self.failUnless(so.getPreconditioner() == 9, "ILUT is not set.")          self.failUnless(so.getPreconditioner() == 9, "ILUT is not set.")
840          so.setPreconditioner(so.JACOBI)          so.setPreconditioner(so.JACOBI)
# Line 847  class Test_LinearPDE_noLumping(Test_line Line 847  class Test_LinearPDE_noLumping(Test_line
847          self.failUnless(so.getPreconditioner() == 28, "GAUSS_SEIDEL is not set.")          self.failUnless(so.getPreconditioner() == 28, "GAUSS_SEIDEL is not set.")
848          so.setPreconditioner(so.RILU)          so.setPreconditioner(so.RILU)
849          self.failUnless(so.getPreconditioner() == 29, "RILU is not set.")          self.failUnless(so.getPreconditioner() == 29, "RILU is not set.")
850            so.setPreconditioner(so.AMLI)
851            self.failUnless(so.getPreconditioner() == 38, "AMLI is not set.")
852          so.setPreconditioner(so.NO_PRECONDITIONER)          so.setPreconditioner(so.NO_PRECONDITIONER)
853          self.failUnless(so.getPreconditioner() == 36, "NO_PRECONDITIONER is not set.")                  self.failUnless(so.getPreconditioner() == 36, "NO_PRECONDITIONER is not set.")        
854    
# Line 1020  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 1080  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 1167  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 1230  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 1290  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 1377  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 1425  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 1445  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 1479  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 1516  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 1531  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 1588  class Test_LinearPDE_noLumping(Test_line Line 1610  class Test_LinearPDE_noLumping(Test_line
1610      mypde.getSolverOptions().setVerbosity(self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1611          u=mypde.getSolution()          u=mypde.getSolution()
1612          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1613        def test_PCG_GAUSS_SEIDEL(self):
1614            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1615            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1616            mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1617        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1618        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1619            u=mypde.getSolution()
1620            self.failUnless(self.check(u,1.),'solution is wrong.')
1621      def test_PCG_AMG(self):      def test_PCG_AMG(self):
1622          if self.order!=2:          if self.order!=2:
1623              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1636  class Test_LinearPDE_noLumping(Test_line Line 1666  class Test_LinearPDE_noLumping(Test_line
1666          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1667          u=mypde.getSolution()          u=mypde.getSolution()
1668          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1669        def test_BICGSTAB_GAUSS_SEIDEL(self):
1670            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1671        mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1672        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1673            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1674            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1675            u=mypde.getSolution()
1676            self.failUnless(self.check(u,1.),'solution is wrong.')
1677      def test_BICGSTAB_AMG(self):      def test_BICGSTAB_AMG(self):
1678          if self.order!=2:          if self.order!=2:
1679              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1677  class Test_LinearPDE_noLumping(Test_line Line 1715  class Test_LinearPDE_noLumping(Test_line
1715          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1716          u=mypde.getSolution()          u=mypde.getSolution()
1717          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1718        def test_MINRES_GAUSS_SEIDEL(self):
1719            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1720        mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1721        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1722            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1723            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1724            u=mypde.getSolution()
1725            self.failUnless(self.check(u,1.),'solution is wrong.')
1726      def test_MINRES_AMG(self):      def test_MINRES_AMG(self):
1727          if self.order!=2:          if self.order!=2:
1728              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1718  class Test_LinearPDE_noLumping(Test_line Line 1764  class Test_LinearPDE_noLumping(Test_line
1764          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1765          u=mypde.getSolution()          u=mypde.getSolution()
1766          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1767        def test_TFQMR_GAUSS_SEIDEL(self):
1768            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1769        mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1770        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1771            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1772            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1773            u=mypde.getSolution()
1774            self.failUnless(self.check(u,1.),'solution is wrong.')
1775      def test_TFQMR_AMG(self):      def test_TFQMR_AMG(self):
1776          if self.order!=2:          if self.order!=2:
1777              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1725  class Test_LinearPDE_noLumping(Test_line Line 1779  class Test_LinearPDE_noLumping(Test_line
1779              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1780              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1781              mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
             mypde.getSolverOptions().setVerbosity(True)  
1782              u=mypde.getSolution()              u=mypde.getSolution()
1783              self.failUnless(self.check(u,1.),'solution is wrong.')              self.failUnless(self.check(u,1.),'solution is wrong.')
1784      def test_TFQMR_ILU0(self):      def test_TFQMR_ILU0(self):
# Line 1760  class Test_LinearPDE_noLumping(Test_line Line 1813  class Test_LinearPDE_noLumping(Test_line
1813          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1814          u=mypde.getSolution()          u=mypde.getSolution()
1815          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1816        def test_PRES20_GAUSS_SEIDEL(self):
1817            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1818            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1819        mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1820        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1821            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1822            u=mypde.getSolution()
1823            self.failUnless(self.check(u,1.),'solution is wrong.')
1824      def test_PRES20_AMG(self):      def test_PRES20_AMG(self):
1825          if self.order!=2:          if self.order!=2:
1826              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1802  class Test_LinearPDE_noLumping(Test_line Line 1863  class Test_LinearPDE_noLumping(Test_line
1863      mypde.getSolverOptions().setTruncation(50)      mypde.getSolverOptions().setTruncation(50)
1864          u=mypde.getSolution()          u=mypde.getSolution()
1865          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1866        def test_GMRESnoRestart_GAUSS_SEIDEL(self):
1867            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1868            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1869        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1870        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1871        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1872        mypde.getSolverOptions().setTruncation(50)
1873            u=mypde.getSolution()
1874            self.failUnless(self.check(u,1.),'solution is wrong.')
1875      def test_GMRESnoRestart_AMG(self):      def test_GMRESnoRestart_AMG(self):
1876          if self.order!=2:          if self.order!=2:
1877              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1847  class Test_LinearPDE_noLumping(Test_line Line 1917  class Test_LinearPDE_noLumping(Test_line
1917          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1918          u=mypde.getSolution()          u=mypde.getSolution()
1919          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1920        def test_GMRES_GAUSS_SEIDEL(self):
1921            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1922            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1923        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1924        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1925            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1926            u=mypde.getSolution()
1927            self.failUnless(self.check(u,1.),'solution is wrong.')
1928      def test_GMRES_AMG(self):      def test_GMRES_AMG(self):
1929          if self.order!=2:          if self.order!=2:
1930              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1890  class Test_LinearPDE_noLumping(Test_line Line 1968  class Test_LinearPDE_noLumping(Test_line
1968      mypde.getSolverOptions().setRestart(20)      mypde.getSolverOptions().setRestart(20)
1969          u=mypde.getSolution()          u=mypde.getSolution()
1970          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1971        def test_GMRES_truncation_restart_GAUSS_SEIDEL(self):
1972            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1973            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1974        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1975        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1976        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1977        mypde.getSolverOptions().setTruncation(10)
1978        mypde.getSolverOptions().setRestart(20)
1979            u=mypde.getSolution()
1980            self.failUnless(self.check(u,1.),'solution is wrong.')
1981      def test_GMRES_truncation_restart_AMG(self):      def test_GMRES_truncation_restart_AMG(self):
1982          if self.order!=2:          if self.order!=2:
1983              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 1976  class Test_LinearPDE_noLumping(Test_line Line 2064  class Test_LinearPDE_noLumping(Test_line
2064          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2065          u=mypde.getSolution()          u=mypde.getSolution()
2066          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2067        def test_PCG_GAUSS_SEIDEL_System(self):
2068            A=Tensor4(0.,Function(self.domain))
2069            D=Tensor(1.,Function(self.domain))
2070            Y=Vector(self.domain.getDim(),Function(self.domain))
2071            for i in range(self.domain.getDim()):
2072                A[i,:,i,:]=kronecker(self.domain)
2073                D[i,i]+=i
2074                Y[i]+=i
2075            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2076            mypde.setValue(A=A,D=D,Y=Y)
2077            mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
2078        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2079            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2080            u=mypde.getSolution()
2081            self.failUnless(self.check(u,1.),'solution is wrong.')
2082      def test_PCG_AMG_System(self):      def test_PCG_AMG_System(self):
2083          if self.order!=2:          if self.order!=2:
2084              A=Tensor4(0.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
# Line 2036  class Test_LinearPDE_noLumping(Test_line Line 2139  class Test_LinearPDE_noLumping(Test_line
2139          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2140          u=mypde.getSolution()          u=mypde.getSolution()
2141          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2142        def test_BICGSTAB_GAUSS_SEIDEL_System(self):
2143            A=Tensor4(0.,Function(self.domain))
2144            D=Tensor(1.,Function(self.domain))
2145            Y=Vector(self.domain.getDim(),Function(self.domain))
2146            for i in range(self.domain.getDim()):
2147                A[i,:,i,:]=kronecker(self.domain)
2148                D[i,i]+=i
2149                Y[i]+=i
2150            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2151            mypde.setValue(A=A,D=D,Y=Y)
2152        mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2153        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2154            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2155            u=mypde.getSolution()
2156            self.failUnless(self.check(u,1.),'solution is wrong.')
2157      def test_BICGSTAB_AMG_System(self):      def test_BICGSTAB_AMG_System(self):
2158          if self.order!=2:          if self.order!=2:
2159              A=Tensor4(0.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
# Line 2082  class Test_LinearPDE_noLumping(Test_line Line 2200  class Test_LinearPDE_noLumping(Test_line
2200          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2201          u=mypde.getSolution()          u=mypde.getSolution()
2202          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2203        def test_PRES20_GAUSS_SEIDEL_System(self):
2204            A=Tensor4(0.,Function(self.domain))
2205            D=Tensor(1.,Function(self.domain))
2206            Y=Vector(self.domain.getDim(),Function(self.domain))
2207            for i in range(self.domain.getDim()):
2208                A[i,:,i,:]=kronecker(self.domain)
2209                D[i,i]+=i
2210                Y[i]+=i
2211            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2212            mypde.setValue(A=A,D=D,Y=Y)
2213        mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2214        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2215            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2216            u=mypde.getSolution()
2217            self.failUnless(self.check(u,1.),'solution is wrong.')
2218      def test_PRES20_AMG_System(self):      def test_PRES20_AMG_System(self):
2219          if self.order!=2:          if self.order!=2:
2220              A=Tensor4(0.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
# Line 2129  class Test_LinearPDE_noLumping(Test_line Line 2262  class Test_LinearPDE_noLumping(Test_line
2262          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2263          u=mypde.getSolution()          u=mypde.getSolution()
2264          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2265        def test_GMRESnoRestart_GAUSS_SEIDEL_System(self):
2266            A=Tensor4(0.,Function(self.domain))
2267            D=Tensor(1.,Function(self.domain))
2268            Y=Vector(self.domain.getDim(),Function(self.domain))
2269            for i in range(self.domain.getDim()):
2270                A[i,:,i,:]=kronecker(self.domain)
2271                D[i,i]+=i
2272                Y[i]+=i
2273            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2274            mypde.setValue(A=A,D=D,Y=Y)
2275        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2276        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2277            # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2278            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2279            u=mypde.getSolution()
2280            self.failUnless(self.check(u,1.),'solution is wrong.')
2281      def test_GMRESnoRestart_AMG_System(self):      def test_GMRESnoRestart_AMG_System(self):
2282          if self.order!=2:          if self.order!=2:
2283              A=Tensor4(0.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
# Line 2177  class Test_LinearPDE_noLumping(Test_line Line 2326  class Test_LinearPDE_noLumping(Test_line
2326          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2327          u=mypde.getSolution()          u=mypde.getSolution()
2328          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2329        def test_GMRES_GAUSS_SEIDEL_System(self):
2330            A=Tensor4(0.,Function(self.domain))
2331            D=Tensor(1.,Function(self.domain))
2332            Y=Vector(self.domain.getDim(),Function(self.domain))
2333            for i in range(self.domain.getDim()):
2334                A[i,:,i,:]=kronecker(self.domain)
2335                D[i,i]+=i
2336                Y[i]+=i
2337            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2338            mypde.setValue(A=A,D=D,Y=Y)
2339        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2340        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2341            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2342            u=mypde.getSolution()
2343            self.failUnless(self.check(u,1.),'solution is wrong.')
2344      def test_GMRES_AMG_System(self):      def test_GMRES_AMG_System(self):
2345          if self.order!=2:          if self.order!=2:
2346              A=Tensor4(0.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
# Line 2225  class Test_LinearPDE_noLumping(Test_line Line 2389  class Test_LinearPDE_noLumping(Test_line
2389      mypde.getSolverOptions().setRestart(20)      mypde.getSolverOptions().setRestart(20)
2390          u=mypde.getSolution()          u=mypde.getSolution()
2391          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2392        def test_GMRES_truncation_restart_GAUSS_SEIDEL_System(self):
2393            A=Tensor4(0.,Function(self.domain))
2394            D=Tensor(1.,Function(self.domain))
2395            Y=Vector(self.domain.getDim(),Function(self.domain))
2396            for i in range(self.domain.getDim()):
2397                A[i,:,i,:]=kronecker(self.domain)
2398                D[i,i]+=i
2399                Y[i]+=i
2400            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2401            mypde.setValue(A=A,D=D,Y=Y)
2402        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2403        mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2404            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2405        mypde.getSolverOptions().setTruncation(10)
2406        mypde.getSolverOptions().setRestart(20)
2407            u=mypde.getSolution()
2408            self.failUnless(self.check(u,1.),'solution is wrong.')
2409      def test_GMRES_truncation_restart_AMG_System(self):      def test_GMRES_truncation_restart_AMG_System(self):
2410          if self.order!=2:          if self.order!=2:
2411              A=Tensor4(0.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
# Line 2414  class Test_TransportPDE(Test_linearPDEs) Line 2595  class Test_TransportPDE(Test_linearPDEs)
2595          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)
2596          mypde.setInitialSolution(1.)          mypde.setInitialSolution(1.)
2597    
     def test_setInitialSolution_scalar_negative(self):  
         mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)  
         self.failUnlessRaises(RuntimeError, mypde.setInitialSolution,-1.)  
   
2598      def test_setInitialSolution_scalar_WithWrongShape(self):      def test_setInitialSolution_scalar_WithWrongShape(self):
2599          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=1,debug=self.DEBUG)
2600          self.failUnlessRaises(ValueError,mypde.setInitialSolution,[1.,2.])          self.failUnlessRaises(ValueError,mypde.setInitialSolution,[1.,2.])
# Line 2426  class Test_TransportPDE(Test_linearPDEs) Line 2603  class Test_TransportPDE(Test_linearPDEs)
2603          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)
2604          mypde.setInitialSolution([1.,2.])          mypde.setInitialSolution([1.,2.])
2605    
     def test_setInitialSolution_system(self):  
         mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)  
         self.failUnlessRaises(RuntimeError, mypde.setInitialSolution,[-1,2.])  
   
2606      def test_setInitialSolution_system_WithWrongShape(self):      def test_setInitialSolution_system_WithWrongShape(self):
2607          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=2,debug=self.DEBUG)
2608          self.failUnlessRaises(ValueError, mypde.setInitialSolution,1.)          self.failUnlessRaises(ValueError, mypde.setInitialSolution,1.)
2609    
   
2610      def test_attemptToChangeOrderAfterDefinedCoefficient(self):      def test_attemptToChangeOrderAfterDefinedCoefficient(self):
2611          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2612          mypde.setValue(D=1.)          mypde.setValue(D=1.)
# Line 2508  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 2755  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.2817  
changed lines
  Added in v.3437

  ViewVC Help
Powered by ViewVC 1.1.26