/[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 3837 by caltinay, Thu Feb 16 03:58:58 2012 UTC revision 3892 by jfenwick, Tue Apr 10 08:57:23 2012 UTC
# Line 74  class Test_LameEquation(Test_linearPDEs) Line 74  class Test_LameEquation(Test_linearPDEs)
74          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
75          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
76          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
77      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
78              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
79              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
80          self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
81              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
82          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
83          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
# Line 104  class Test_LameEquation(Test_linearPDEs) Line 104  class Test_LameEquation(Test_linearPDEs)
104          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
105          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
106          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
107      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
108              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
109              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
110          self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
111              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
112          self.assertTrue(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x")          self.assertTrue(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x")
113          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
# Line 135  class Test_LameEquation(Test_linearPDEs) Line 135  class Test_LameEquation(Test_linearPDEs)
135          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
136          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
137          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
138      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
139              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
140              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
141              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
142              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
143      self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
144          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
145    
146      def test_setCoefficient_f(self):      def test_setCoefficient_f(self):
# Line 165  class Test_LameEquation(Test_linearPDEs) Line 165  class Test_LameEquation(Test_linearPDEs)
165          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")
166          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
167          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
168      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
169              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
170              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
171              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
172              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")      
173          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
174          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
175    
# Line 196  class Test_LameEquation(Test_linearPDEs) Line 196  class Test_LameEquation(Test_linearPDEs)
196          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
197          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
198          if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
199          self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
200              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
201          self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
202              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
203          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
204          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
# Line 229  class Test_LameEquation(Test_linearPDEs) Line 229  class Test_LameEquation(Test_linearPDEs)
229          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
230          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
231          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
232      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
233              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
234              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
235              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
236              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")      
237          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
238          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
239    
# Line 263  class Test_LameEquation(Test_linearPDEs) Line 263  class Test_LameEquation(Test_linearPDEs)
263          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
264          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
265          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
266      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
267              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
268              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
269              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
270              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                      self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
271      self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
272          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
273    
274      def test_setCoefficient_lambdamu(self):      def test_setCoefficient_lambdamu(self):
# Line 296  class Test_LameEquation(Test_linearPDEs) Line 296  class Test_LameEquation(Test_linearPDEs)
296          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
297          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
298          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
299      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
300              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
301              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
302              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
303              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
304      self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
305          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
306    
307      def test_solve(self):      def test_solve(self):
# Line 346  class Test_Helmholtz(Test_linearPDEs): Line 346  class Test_Helmholtz(Test_linearPDEs):
346          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
347          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
348          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
349      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
350              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
351              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
352              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
353              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")      
354          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
355          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
356    
# Line 377  class Test_Helmholtz(Test_linearPDEs): Line 377  class Test_Helmholtz(Test_linearPDEs):
377          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
378          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
379          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
380      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
381              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
382              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
383              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
384              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
385      self.assertTrue(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x[0]")          self.assertTrue(self.check(mypde.getCoefficient("r"),r_ref),"r is nor x[0]")
386          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
387    
388    
# Line 409  class Test_Helmholtz(Test_linearPDEs): Line 409  class Test_Helmholtz(Test_linearPDEs):
409          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
410          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
411          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
412      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
413              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
414              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
415              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
416              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")      
417          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
418          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
419    
# Line 440  class Test_Helmholtz(Test_linearPDEs): Line 440  class Test_Helmholtz(Test_linearPDEs):
440          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"X_reduced is not empty")
441          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
442          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
443      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
444              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
445              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
446              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
447              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")      
448          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
449          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
450    
# Line 471  class Test_Helmholtz(Test_linearPDEs): Line 471  class Test_Helmholtz(Test_linearPDEs):
471          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
472          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
473          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
474      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
475              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
476              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
477              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
478              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")      
479          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
480          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
481    
# Line 502  class Test_Helmholtz(Test_linearPDEs): Line 502  class Test_Helmholtz(Test_linearPDEs):
502          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
503          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
504          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
505      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
506              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
507              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
508              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
509              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                      self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
510      self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
511          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
512    
513      def test_solve(self):      def test_solve(self):
# Line 546  class Test_Poisson(Test_linearPDEs): Line 546  class Test_Poisson(Test_linearPDEs):
546          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
547          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
548          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
549      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
550              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
551              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
552              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
553              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
554      self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")          self.assertTrue(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
555          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(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 576  class Test_Poisson(Test_linearPDEs): Line 576  class Test_Poisson(Test_linearPDEs):
576          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
577          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
578          if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
579          self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
580              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
581          self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
582              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
583          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
584          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")
# Line 604  class Test_Poisson(Test_linearPDEs): Line 604  class Test_Poisson(Test_linearPDEs):
604          self.assertTrue(self.check(mypde.getCoefficient("Y_reduced"),Y_ref),"Y_reduced is not x[0]")          self.assertTrue(self.check(mypde.getCoefficient("Y_reduced"),Y_ref),"Y_reduced is not x[0]")
605          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
606          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")          self.assertTrue(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
607      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
608              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
609              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
610              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")              self.assertTrue(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
611              self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")                      self.assertTrue(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")        
612      self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")          self.assertTrue(mypde.getCoefficient("q").isEmpty(),"q is not empty")
613          self.assertTrue(mypde.getCoefficient("r").isEmpty(),"r is not empty")          self.assertTrue(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 732  class Test_LinearPDE_noLumping(Test_line Line 732  class Test_LinearPDE_noLumping(Test_line
732          self.assertTrue(so.getRestart() == 14, "Truncation is wrong.")          self.assertTrue(so.getRestart() == 14, "Truncation is wrong.")
733          so.setRestart(None)          so.setRestart(None)
734          self.assertTrue(so.getRestart() == None, "Truncation is wrong.")          self.assertTrue(so.getRestart() == None, "Truncation is wrong.")
735                
736          self.assertTrue(not so.isVerbose(), "initial verbosity flag is wrong.")          self.assertTrue(not so.isVerbose(), "initial verbosity flag is wrong.")
737          so.setVerbosityOn()          so.setVerbosityOn()
738          self.assertTrue(so.isVerbose(), "verbosity (1) flag is wrong.")          self.assertTrue(so.isVerbose(), "verbosity (1) flag is wrong.")
# Line 1021  class Test_LinearPDE_noLumping(Test_line Line 1021  class Test_LinearPDE_noLumping(Test_line
1021          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1022          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
1023      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(self):
1024      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1025              d=self.domain.getDim()              d=self.domain.getDim()
1026              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1027              mypde.setValue(d_contact=1.)              mypde.setValue(d_contact=1.)
# Line 1029  class Test_LinearPDE_noLumping(Test_line Line 1029  class Test_LinearPDE_noLumping(Test_line
1029              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))
1030      def test_setCoefficient_y_contact_Scalar(self):      def test_setCoefficient_y_contact_Scalar(self):
1031          d=self.domain.getDim()          d=self.domain.getDim()
1032      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1033              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1034              mypde.setValue(y_contact=1.)              mypde.setValue(y_contact=1.)
1035              coeff=mypde.getCoefficient("y_contact")              coeff=mypde.getCoefficient("y_contact")
# Line 1083  class Test_LinearPDE_noLumping(Test_line Line 1083  class Test_LinearPDE_noLumping(Test_line
1083          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1084          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
1085      def test_setCoefficient_d_contact_reduced_Scalar(self):      def test_setCoefficient_d_contact_reduced_Scalar(self):
1086      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1087              d=self.domain.getDim()              d=self.domain.getDim()
1088              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1089              mypde.setValue(d_contact_reduced=1.)              mypde.setValue(d_contact_reduced=1.)
1090              coeff=mypde.getCoefficient("d_contact_reduced")              coeff=mypde.getCoefficient("d_contact_reduced")
1091              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
1092      def test_setCoefficient_y_contact_reduced_Scalar(self):      def test_setCoefficient_y_contact_reduced_Scalar(self):
1093      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1094              d=self.domain.getDim()              d=self.domain.getDim()
1095              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1096              mypde.setValue(y_contact_reduced=1.)              mypde.setValue(y_contact_reduced=1.)
# Line 1172  class Test_LinearPDE_noLumping(Test_line Line 1172  class Test_LinearPDE_noLumping(Test_line
1172          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1173          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
1174      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):
1175      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1176              d=self.domain.getDim()              d=self.domain.getDim()
1177              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1178              mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))              mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1179              coeff=mypde.getCoefficient("d_contact_reduced")              coeff=mypde.getCoefficient("d_contact_reduced")
1180              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
1181      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):
1182      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1183              d=self.domain.getDim()              d=self.domain.getDim()
1184              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1185              mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))              mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
# Line 1237  class Test_LinearPDE_noLumping(Test_line Line 1237  class Test_LinearPDE_noLumping(Test_line
1237          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
1238          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))
1239      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
1240      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1241              d=self.domain.getDim()              d=self.domain.getDim()
1242              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1243              mypde.setValue(d_contact=numpy.ones((self.N,self.N)))              mypde.setValue(d_contact=numpy.ones((self.N,self.N)))
1244              coeff=mypde.getCoefficient("d_contact")              coeff=mypde.getCoefficient("d_contact")
1245              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))
1246      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
1247      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1248              d=self.domain.getDim()              d=self.domain.getDim()
1249              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1250              mypde.setValue(y_contact=numpy.ones((self.N,)))              mypde.setValue(y_contact=numpy.ones((self.N,)))
# Line 1299  class Test_LinearPDE_noLumping(Test_line Line 1299  class Test_LinearPDE_noLumping(Test_line
1299          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1300          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
1301      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
1302      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1303              d=self.domain.getDim()              d=self.domain.getDim()
1304              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1305              mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))              mypde.setValue(d_contact_reduced=numpy.ones((self.N,self.N)))
1306              coeff=mypde.getCoefficient("d_contact_reduced")              coeff=mypde.getCoefficient("d_contact_reduced")
1307              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
1308      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
1309      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1310              d=self.domain.getDim()              d=self.domain.getDim()
1311              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1312              mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))              mypde.setValue(y_contact_reduced=numpy.ones((self.N,)))
# Line 1388  class Test_LinearPDE_noLumping(Test_line Line 1388  class Test_LinearPDE_noLumping(Test_line
1388          coeff=mypde.getCoefficient("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
1389          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
1390      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
1391      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1392              d=self.domain.getDim()              d=self.domain.getDim()
1393              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1394              mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))              mypde.setValue(d_contact=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))
1395              coeff=mypde.getCoefficient("d_contact_reduced")              coeff=mypde.getCoefficient("d_contact_reduced")
1396              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
1397      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
1398      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1399              d=self.domain.getDim()              d=self.domain.getDim()
1400              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1401              mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))              mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
# Line 1413  class Test_LinearPDE_noLumping(Test_line Line 1413  class Test_LinearPDE_noLumping(Test_line
1413      def test_resetCoefficient_InHomogeneousConstraint(self):      def test_resetCoefficient_InHomogeneousConstraint(self):
1414          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1415          mypde.setSymmetryOn()          mypde.setSymmetryOn()
1416      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1417          x=self.domain.getX()          x=self.domain.getX()
1418          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.,r=1,q=whereZero(x[0]))          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.,r=1,q=whereZero(x[0]))
1419          u1=mypde.getSolution()          u1=mypde.getSolution()
# Line 1460  class Test_LinearPDE_noLumping(Test_line Line 1460  class Test_LinearPDE_noLumping(Test_line
1460          D=3*numpy.ones((self.N,self.N))          D=3*numpy.ones((self.N,self.N))
1461          d=4*numpy.ones((self.N,self.N))          d=4*numpy.ones((self.N,self.N))
1462          d_contact=5*numpy.ones((self.N,self.N))          d_contact=5*numpy.ones((self.N,self.N))
1463      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}          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}
1464      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1465          pars["d_contact"]=d_contact                  pars["d_contact"]=d_contact
1466          pars["d_contact_reduced"]=-d_contact                  pars["d_contact_reduced"]=-d_contact
1467      mypde.setValue(**pars)          mypde.setValue(**pars)
1468          self.assertTrue(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.assertTrue(mypde.checkSymmetry(verbose=False),"symmetry detected")
1469    
1470      def test_symmetryCheckFalse_A_System(self):      def test_symmetryCheckFalse_A_System(self):
# Line 1498  class Test_LinearPDE_noLumping(Test_line Line 1498  class Test_LinearPDE_noLumping(Test_line
1498          self.assertTrue(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.assertTrue(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1499    
1500      def test_symmetryCheckFalse_d_contact_System(self):      def test_symmetryCheckFalse_d_contact_System(self):
1501      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1502              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1503              d_contact=5*numpy.ones((self.N,self.N))              d_contact=5*numpy.ones((self.N,self.N))
1504              d_contact[0,1]=0.              d_contact[0,1]=0.
# Line 1536  class Test_LinearPDE_noLumping(Test_line Line 1536  class Test_LinearPDE_noLumping(Test_line
1536          self.assertTrue(not mypde.checkSymmetry(verbose=False),"symmetry detected")          self.assertTrue(not mypde.checkSymmetry(verbose=False),"symmetry detected")
1537    
1538      def test_symmetryCheckFalse_d_contact_reduced_System(self):      def test_symmetryCheckFalse_d_contact_reduced_System(self):
1539      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1540              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1541              d_contact=5*numpy.ones((self.N,self.N))              d_contact=5*numpy.ones((self.N,self.N))
1542              d_contact[0,1]=0.              d_contact[0,1]=0.
# Line 1552  class Test_LinearPDE_noLumping(Test_line Line 1552  class Test_LinearPDE_noLumping(Test_line
1552          D=3          D=3
1553          d=4          d=4
1554          d_contact=5          d_contact=5
1555      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}          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}
1556      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1557          pars["d_contact"]=d_contact                  pars["d_contact"]=d_contact
1558          pars["d_contact_reduced"]=-d_contact                  pars["d_contact_reduced"]=-d_contact
1559      mypde.setValue(**pars)          mypde.setValue(**pars)
1560          self.assertTrue(mypde.checkSymmetry(verbose=False),"symmetry detected")          self.assertTrue(mypde.checkSymmetry(verbose=False),"symmetry detected")
1561    
1562      def test_symmetryCheckFalse_A_Scalar(self):      def test_symmetryCheckFalse_A_Scalar(self):
# Line 1595  class Test_LinearPDE_noLumping(Test_line Line 1595  class Test_LinearPDE_noLumping(Test_line
1595      def test_symmetryOnIterative(self):      def test_symmetryOnIterative(self):
1596          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1597          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1598      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1599          u=mypde.getSolution()          u=mypde.getSolution()
1600          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1601      def test_symmetryOnDirect(self):      def test_symmetryOnDirect(self):
1602          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1603          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1604          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1605      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1606          u=mypde.getSolution()          u=mypde.getSolution()
1607          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1608      def test_PCG_JACOBI(self):      def test_PCG_JACOBI(self):
1609          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1610          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1611          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1612      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1613      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1614          u=mypde.getSolution()          u=mypde.getSolution()
1615          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1616      def test_PCG_GAUSS_SEIDEL(self):      def test_PCG_GAUSS_SEIDEL(self):
1617          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1618          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1619          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1620      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1621      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1622          u=mypde.getSolution()          u=mypde.getSolution()
1623          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1624      def test_PCG_AMG(self):      def test_PCG_AMG(self):
# Line 1633  class Test_LinearPDE_noLumping(Test_line Line 1633  class Test_LinearPDE_noLumping(Test_line
1633      def test_PCG_ILU0(self):      def test_PCG_ILU0(self):
1634          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1635          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1636      mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1637      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1638      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1639          u=mypde.getSolution()          u=mypde.getSolution()
1640          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1641      def test_PCG_RILU(self):      def test_PCG_RILU(self):
1642          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1643          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1644      mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1645      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1646      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1647          u=mypde.getSolution()          u=mypde.getSolution()
1648          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1649      def test_PCG_REC_ILU(self):      def test_PCG_REC_ILU(self):
1650          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1651          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1652      mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1653      mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1654      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1655          u=mypde.getSolution()          u=mypde.getSolution()
1656          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1657      def test_DIRECT(self):      def test_DIRECT(self):
1658          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1659          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1660          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)          mypde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1661      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1662          u=mypde.getSolution()          u=mypde.getSolution()
1663          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1664      def test_BICGSTAB_JACOBI(self):      def test_BICGSTAB_JACOBI(self):
1665          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1666      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)          mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1667      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1668          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1669          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1670          u=mypde.getSolution()          u=mypde.getSolution()
1671          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1672      def test_BICGSTAB_GAUSS_SEIDEL(self):      def test_BICGSTAB_GAUSS_SEIDEL(self):
1673          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1674      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)          mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1675      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1676          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1677          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1678          u=mypde.getSolution()          u=mypde.getSolution()
# Line 1689  class Test_LinearPDE_noLumping(Test_line Line 1689  class Test_LinearPDE_noLumping(Test_line
1689      def test_BICGSTAB_ILU0(self):      def test_BICGSTAB_ILU0(self):
1690          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1691          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1692      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)          mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1693      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1694          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1695          u=mypde.getSolution()          u=mypde.getSolution()
1696          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1697      def test_BICGSTAB_RILU(self):      def test_BICGSTAB_RILU(self):
1698          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1699          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1700      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)          mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1701      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1702          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1703          u=mypde.getSolution()          u=mypde.getSolution()
1704          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1705      def test_BICGSTAB_REC_ILU(self):      def test_BICGSTAB_REC_ILU(self):
1706          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1707          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1708      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)          mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1709      mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1710          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1711          u=mypde.getSolution()          u=mypde.getSolution()
1712          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1713      def test_MINRES_JACOBI(self):      def test_MINRES_JACOBI(self):
1714          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1715      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1716      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1717          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1718          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1719          u=mypde.getSolution()          u=mypde.getSolution()
1720          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1721      def test_MINRES_GAUSS_SEIDEL(self):      def test_MINRES_GAUSS_SEIDEL(self):
1722          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1723      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1724      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1725          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1726          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1727          u=mypde.getSolution()          u=mypde.getSolution()
# Line 1738  class Test_LinearPDE_noLumping(Test_line Line 1738  class Test_LinearPDE_noLumping(Test_line
1738      def test_MINRES_ILU0(self):      def test_MINRES_ILU0(self):
1739          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1740          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1741      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1742      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1743          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1744          u=mypde.getSolution()          u=mypde.getSolution()
1745          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1746      def test_MINRES_RILU(self):      def test_MINRES_RILU(self):
1747          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1748          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1749      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1750      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1751          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1752          u=mypde.getSolution()          u=mypde.getSolution()
1753          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1754      def test_MINRES_REC_ILU(self):      def test_MINRES_REC_ILU(self):
1755          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1756          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1757      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1758      mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1759          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1760          u=mypde.getSolution()          u=mypde.getSolution()
1761          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1762      def test_TFQMR_JACOBI(self):      def test_TFQMR_JACOBI(self):
1763          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1764      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)          mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1765      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1766          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1767          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1768          u=mypde.getSolution()          u=mypde.getSolution()
1769          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1770      def test_TFQMR_GAUSS_SEIDEL(self):      def test_TFQMR_GAUSS_SEIDEL(self):
1771          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1772      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)          mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1773      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1774          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1775          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1776          u=mypde.getSolution()          u=mypde.getSolution()
# Line 1787  class Test_LinearPDE_noLumping(Test_line Line 1787  class Test_LinearPDE_noLumping(Test_line
1787      def test_TFQMR_ILU0(self):      def test_TFQMR_ILU0(self):
1788          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1789          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1790      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)          mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1791      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1792          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1793          u=mypde.getSolution()          u=mypde.getSolution()
1794          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1795      def test_TFQMR_RILU(self):      def test_TFQMR_RILU(self):
1796          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1797          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1798      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)          mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1799      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1800          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1801          u=mypde.getSolution()          u=mypde.getSolution()
1802          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1803      def test_TFQMR_REC_ILU(self):      def test_TFQMR_REC_ILU(self):
1804          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1805          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1806      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)          mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1807      mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1808          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1809          u=mypde.getSolution()          u=mypde.getSolution()
1810          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1811      def test_PRES20_JACOBI(self):      def test_PRES20_JACOBI(self):
1812          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1813          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1814      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1815      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1816          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1817          u=mypde.getSolution()          u=mypde.getSolution()
1818          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1819      def test_PRES20_GAUSS_SEIDEL(self):      def test_PRES20_GAUSS_SEIDEL(self):
1820          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1821          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1822      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1823      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1824          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1825          u=mypde.getSolution()          u=mypde.getSolution()
1826          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 1836  class Test_LinearPDE_noLumping(Test_line Line 1836  class Test_LinearPDE_noLumping(Test_line
1836      def test_PRES20_ILU0(self):      def test_PRES20_ILU0(self):
1837          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1838          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1839      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1840      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1841          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1842          u=mypde.getSolution()          u=mypde.getSolution()
1843          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1844      def test_PRES20_RILU(self):      def test_PRES20_RILU(self):
1845          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1846          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1847      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1848      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1849          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1850          u=mypde.getSolution()          u=mypde.getSolution()
1851          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1852      def test_PRES20_REC_ILU(self):      def test_PRES20_REC_ILU(self):
1853          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1854          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1855      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1856      mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1857          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1858          u=mypde.getSolution()          u=mypde.getSolution()
1859          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1860      def test_GMRESnoRestart_JACOBI(self):      def test_GMRESnoRestart_JACOBI(self):
1861          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1862          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1863      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1864      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1865      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1866      mypde.getSolverOptions().setTruncation(50)          mypde.getSolverOptions().setTruncation(50)
1867          u=mypde.getSolution()          u=mypde.getSolution()
1868          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1869      def test_GMRESnoRestart_GAUSS_SEIDEL(self):      def test_GMRESnoRestart_GAUSS_SEIDEL(self):
1870          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1871          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1872      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1873      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1874      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1875      mypde.getSolverOptions().setTruncation(50)          mypde.getSolverOptions().setTruncation(50)
1876          u=mypde.getSolution()          u=mypde.getSolution()
1877          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1878      def test_GMRESnoRestart_AMG(self):      def test_GMRESnoRestart_AMG(self):
# Line 1888  class Test_LinearPDE_noLumping(Test_line Line 1888  class Test_LinearPDE_noLumping(Test_line
1888      def test_GMRESnoRestart_ILU0(self):      def test_GMRESnoRestart_ILU0(self):
1889          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1890          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1891      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1892      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1893      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1894      mypde.getSolverOptions().setTruncation(50)                                  mypde.getSolverOptions().setTruncation(50)                        
1895          u=mypde.getSolution()          u=mypde.getSolution()
1896          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1897      def test_GMRESnoRestart_RILU(self):      def test_GMRESnoRestart_RILU(self):
1898          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1899          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1900      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1901      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1902      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1903      mypde.getSolverOptions().setTruncation(50)          mypde.getSolverOptions().setTruncation(50)
1904          u=mypde.getSolution()          u=mypde.getSolution()
1905          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1906      def test_GMRESnoRestart_REC_ILU(self):      def test_GMRESnoRestart_REC_ILU(self):
1907          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1908          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1909      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1910      mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1911      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1912      mypde.getSolverOptions().setTruncation(50)          mypde.getSolverOptions().setTruncation(50)
1913          u=mypde.getSolution()          u=mypde.getSolution()
1914          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1915      def test_GMRES_JACOBI(self):      def test_GMRES_JACOBI(self):
1916          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1917          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1918      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1919      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1920          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1921          u=mypde.getSolution()          u=mypde.getSolution()
1922          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1923      def test_GMRES_GAUSS_SEIDEL(self):      def test_GMRES_GAUSS_SEIDEL(self):
1924          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1925          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1926      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1927      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1928          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1929          u=mypde.getSolution()          u=mypde.getSolution()
1930          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 1940  class Test_LinearPDE_noLumping(Test_line Line 1940  class Test_LinearPDE_noLumping(Test_line
1940      def test_GMRES_ILU0(self):      def test_GMRES_ILU0(self):
1941          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1942          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1943      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1944      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
1945          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1946          u=mypde.getSolution()          u=mypde.getSolution()
1947          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1948      def test_GMRES_RILU(self):      def test_GMRES_RILU(self):
1949          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1950          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1951      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1952      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
1953          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1954          u=mypde.getSolution()          u=mypde.getSolution()
1955          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1956      def test_GMRES_REC_ILU(self):      def test_GMRES_REC_ILU(self):
1957          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1958          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1959      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1960      mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
1961          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1962          u=mypde.getSolution()          u=mypde.getSolution()
1963          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1964      def test_GMRES_truncation_restart_JACOBI(self):      def test_GMRES_truncation_restart_JACOBI(self):
1965          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1966          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1967      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1968      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
1969      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1970      mypde.getSolverOptions().setTruncation(10)          mypde.getSolverOptions().setTruncation(10)
1971      mypde.getSolverOptions().setRestart(20)          mypde.getSolverOptions().setRestart(20)
1972          u=mypde.getSolution()          u=mypde.getSolution()
1973          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1974      def test_GMRES_truncation_restart_GAUSS_SEIDEL(self):      def test_GMRES_truncation_restart_GAUSS_SEIDEL(self):
1975          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1976          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1977      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1978      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
1979      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1980      mypde.getSolverOptions().setTruncation(10)          mypde.getSolverOptions().setTruncation(10)
1981      mypde.getSolverOptions().setRestart(20)          mypde.getSolverOptions().setRestart(20)
1982          u=mypde.getSolution()          u=mypde.getSolution()
1983          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
1984      def test_GMRES_truncation_restart_AMG(self):      def test_GMRES_truncation_restart_AMG(self):
# Line 1995  class Test_LinearPDE_noLumping(Test_line Line 1995  class Test_LinearPDE_noLumping(Test_line
1995      def test_GMRES_truncation_restart_ILU0(self):      def test_GMRES_truncation_restart_ILU0(self):
1996          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1997          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1998      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1999      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2000      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2001      mypde.getSolverOptions().setTruncation(10)          mypde.getSolverOptions().setTruncation(10)
2002      mypde.getSolverOptions().setRestart(20)          mypde.getSolverOptions().setRestart(20)
2003          u=mypde.getSolution()          u=mypde.getSolution()
2004          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
2005      def test_GMRES_truncation_restart_RILU(self):      def test_GMRES_truncation_restart_RILU(self):
2006          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2007          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
2008      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2009      mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.RILU)
2010      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2011      mypde.getSolverOptions().setTruncation(10)          mypde.getSolverOptions().setTruncation(10)
2012      mypde.getSolverOptions().setRestart(20)          mypde.getSolverOptions().setRestart(20)
2013          u=mypde.getSolution()          u=mypde.getSolution()
2014          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
2015      def test_GMRES_truncation_restart_REC_ILU(self):      def test_GMRES_truncation_restart_REC_ILU(self):
2016          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2017          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
2018      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2019      mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)          mypde.getSolverOptions().setPreconditioner(SolverOptions.REC_ILU)
2020      mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2021      mypde.getSolverOptions().setTruncation(10)          mypde.getSolverOptions().setTruncation(10)
2022      mypde.getSolverOptions().setRestart(20)          mypde.getSolverOptions().setRestart(20)
2023          u=mypde.getSolution()          u=mypde.getSolution()
2024          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
2025      #      #
# Line 2063  class Test_LinearPDE_noLumping(Test_line Line 2063  class Test_LinearPDE_noLumping(Test_line
2063          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2064          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2065          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
2066      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2067          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2068          u=mypde.getSolution()          u=mypde.getSolution()
2069          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2078  class Test_LinearPDE_noLumping(Test_line Line 2078  class Test_LinearPDE_noLumping(Test_line
2078          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2079          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2080          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
2081      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2082          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2083          u=mypde.getSolution()          u=mypde.getSolution()
2084          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2109  class Test_LinearPDE_noLumping(Test_line Line 2109  class Test_LinearPDE_noLumping(Test_line
2109          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2110          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2111          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
2112      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2113          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2114          u=mypde.getSolution()          u=mypde.getSolution()
2115          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2137  class Test_LinearPDE_noLumping(Test_line Line 2137  class Test_LinearPDE_noLumping(Test_line
2137              Y[i]+=i              Y[i]+=i
2138          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2139          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2140      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)          mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2141      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2142          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2143          u=mypde.getSolution()          u=mypde.getSolution()
2144          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2152  class Test_LinearPDE_noLumping(Test_line Line 2152  class Test_LinearPDE_noLumping(Test_line
2152              Y[i]+=i              Y[i]+=i
2153          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2154          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2155      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)          mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2156      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2157          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2158          u=mypde.getSolution()          u=mypde.getSolution()
2159          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2183  class Test_LinearPDE_noLumping(Test_line Line 2183  class Test_LinearPDE_noLumping(Test_line
2183              Y[i]+=i              Y[i]+=i
2184          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2185          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2186      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)          mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2187      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2188          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2189          u=mypde.getSolution()          u=mypde.getSolution()
2190          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2198  class Test_LinearPDE_noLumping(Test_line Line 2198  class Test_LinearPDE_noLumping(Test_line
2198              Y[i]+=i              Y[i]+=i
2199          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2200          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2201      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2202      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2203          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2204          u=mypde.getSolution()          u=mypde.getSolution()
2205          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2213  class Test_LinearPDE_noLumping(Test_line Line 2213  class Test_LinearPDE_noLumping(Test_line
2213              Y[i]+=i              Y[i]+=i
2214          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2215          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2216      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2217      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2218          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2219          u=mypde.getSolution()          u=mypde.getSolution()
2220          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2244  class Test_LinearPDE_noLumping(Test_line Line 2244  class Test_LinearPDE_noLumping(Test_line
2244              Y[i]+=i              Y[i]+=i
2245          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2246          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2247      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)          mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2248      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2249          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2250          u=mypde.getSolution()          u=mypde.getSolution()
2251          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2259  class Test_LinearPDE_noLumping(Test_line Line 2259  class Test_LinearPDE_noLumping(Test_line
2259              Y[i]+=i              Y[i]+=i
2260          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2261          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2262      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2263      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2264          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2265          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2266          u=mypde.getSolution()          u=mypde.getSolution()
# Line 2275  class Test_LinearPDE_noLumping(Test_line Line 2275  class Test_LinearPDE_noLumping(Test_line
2275              Y[i]+=i              Y[i]+=i
2276          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2277          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2278      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2279      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2280          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2281          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2282          u=mypde.getSolution()          u=mypde.getSolution()
# Line 2308  class Test_LinearPDE_noLumping(Test_line Line 2308  class Test_LinearPDE_noLumping(Test_line
2308              Y[i]+=i              Y[i]+=i
2309          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2310          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2311      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2312      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2313          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2314          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2315          u=mypde.getSolution()          u=mypde.getSolution()
# Line 2324  class Test_LinearPDE_noLumping(Test_line Line 2324  class Test_LinearPDE_noLumping(Test_line
2324              Y[i]+=i              Y[i]+=i
2325          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2326          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2327      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2328      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2329          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2330          u=mypde.getSolution()          u=mypde.getSolution()
2331          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2339  class Test_LinearPDE_noLumping(Test_line Line 2339  class Test_LinearPDE_noLumping(Test_line
2339              Y[i]+=i              Y[i]+=i
2340          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2341          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2342      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2343      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2344          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2345          u=mypde.getSolution()          u=mypde.getSolution()
2346          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2370  class Test_LinearPDE_noLumping(Test_line Line 2370  class Test_LinearPDE_noLumping(Test_line
2370              Y[i]+=i              Y[i]+=i
2371          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2372          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2373      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2374      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2375          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2376          u=mypde.getSolution()          u=mypde.getSolution()
2377          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
# Line 2385  class Test_LinearPDE_noLumping(Test_line Line 2385  class Test_LinearPDE_noLumping(Test_line
2385              Y[i]+=i              Y[i]+=i
2386          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2387          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2388      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2389      mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)          mypde.getSolverOptions().setPreconditioner(SolverOptions.JACOBI)
2390          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2391      mypde.getSolverOptions().setTruncation(10)          mypde.getSolverOptions().setTruncation(10)
2392      mypde.getSolverOptions().setRestart(20)          mypde.getSolverOptions().setRestart(20)
2393          u=mypde.getSolution()          u=mypde.getSolution()
2394          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
2395      def test_GMRES_truncation_restart_GAUSS_SEIDEL_System(self):      def test_GMRES_truncation_restart_GAUSS_SEIDEL_System(self):
# Line 2402  class Test_LinearPDE_noLumping(Test_line Line 2402  class Test_LinearPDE_noLumping(Test_line
2402              Y[i]+=i              Y[i]+=i
2403          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2404          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2405      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2406      mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)          mypde.getSolverOptions().setPreconditioner(SolverOptions.GAUSS_SEIDEL)
2407          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2408      mypde.getSolverOptions().setTruncation(10)          mypde.getSolverOptions().setTruncation(10)
2409      mypde.getSolverOptions().setRestart(20)          mypde.getSolverOptions().setRestart(20)
2410          u=mypde.getSolution()          u=mypde.getSolution()
2411          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
2412      def test_GMRES_truncation_restart_AMG_System(self):      def test_GMRES_truncation_restart_AMG_System(self):
# Line 2437  class Test_LinearPDE_noLumping(Test_line Line 2437  class Test_LinearPDE_noLumping(Test_line
2437              Y[i]+=i              Y[i]+=i
2438          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2439          mypde.setValue(A=A,D=D,Y=Y)          mypde.setValue(A=A,D=D,Y=Y)
2440      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)          mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2441      mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)          mypde.getSolverOptions().setPreconditioner(SolverOptions.ILU0)
2442          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2443      mypde.getSolverOptions().setTruncation(10)          mypde.getSolverOptions().setTruncation(10)
2444      mypde.getSolverOptions().setRestart(20)          mypde.getSolverOptions().setRestart(20)
2445          u=mypde.getSolution()          u=mypde.getSolution()
2446          self.assertTrue(self.check(u,1.),'solution is wrong.')          self.assertTrue(self.check(u,1.),'solution is wrong.')
2447    
# Line 2518  class Test_LinearPDE(Test_LinearPDE_noLu Line 2518  class Test_LinearPDE(Test_LinearPDE_noLu
2518          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2519          try:          try:
2520             success=True             success=True
2521         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)             mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2522             mypde.setValue(A=kronecker(self.domain))             mypde.setValue(A=kronecker(self.domain))
2523             mypde.getSolverOptions().setVerbosity(self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2524             u=mypde.getSolution()                 u=mypde.getSolution()        
2525          except ValueError:          except ValueError:
2526             success=False             success=False
2527          self.assertTrue(not success,'error should be issued')          self.assertTrue(not success,'error should be issued')
# Line 2529  class Test_LinearPDE(Test_LinearPDE_noLu Line 2529  class Test_LinearPDE(Test_LinearPDE_noLu
2529          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2530          try:          try:
2531             success=True             success=True
2532         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)             mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2533             mypde.setValue(B=kronecker(self.domain)[0])             mypde.setValue(B=kronecker(self.domain)[0])
2534             mypde.getSolverOptions().setVerbosity(self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2535             u=mypde.getSolution()             u=mypde.getSolution()
# Line 2540  class Test_LinearPDE(Test_LinearPDE_noLu Line 2540  class Test_LinearPDE(Test_LinearPDE_noLu
2540          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2541          try:          try:
2542             success=True             success=True
2543         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)             mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2544             mypde.setValue(C=kronecker(self.domain)[0])             mypde.setValue(C=kronecker(self.domain)[0])
2545             mypde.getSolverOptions().setVerbosity(self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2546             u=mypde.getSolution()             u=mypde.getSolution()
# Line 2552  class Test_LinearPDE(Test_LinearPDE_noLu Line 2552  class Test_LinearPDE(Test_LinearPDE_noLu
2552          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2553          try:          try:
2554             success=True             success=True
2555         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)             mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2556             mypde.setValue(A_reduced=kronecker(self.domain))             mypde.setValue(A_reduced=kronecker(self.domain))
2557             mypde.getSolverOptions().setVerbosity(self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2558             u=mypde.getSolution()             u=mypde.getSolution()
# Line 2563  class Test_LinearPDE(Test_LinearPDE_noLu Line 2563  class Test_LinearPDE(Test_LinearPDE_noLu
2563          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2564          try:          try:
2565             success=True             success=True
2566         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)             mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2567             mypde.setValue(B_reduced=kronecker(self.domain)[0])             mypde.setValue(B_reduced=kronecker(self.domain)[0])
2568             mypde.getSolverOptions().setVerbosity(self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2569             u=mypde.getSolution()             u=mypde.getSolution()
# Line 2574  class Test_LinearPDE(Test_LinearPDE_noLu Line 2574  class Test_LinearPDE(Test_LinearPDE_noLu
2574          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2575          try:          try:
2576             success=True             success=True
2577         mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)             mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2578             mypde.setValue(C_reduced=kronecker(self.domain)[0])             mypde.setValue(C_reduced=kronecker(self.domain)[0])
2579             mypde.getSolverOptions().setVerbosity(self.VERBOSE)             mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2580             u=mypde.getSolution()             u=mypde.getSolution()
# Line 2584  class Test_LinearPDE(Test_LinearPDE_noLu Line 2584  class Test_LinearPDE(Test_LinearPDE_noLu
2584                    
2585      def test_Lumping(self):      def test_Lumping(self):
2586          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2587      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)          mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2588          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2589          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2590          u=mypde.getSolution()          u=mypde.getSolution()
# Line 2592  class Test_LinearPDE(Test_LinearPDE_noLu Line 2592  class Test_LinearPDE(Test_LinearPDE_noLu
2592      def test_Constrained_Lumping(self):      def test_Constrained_Lumping(self):
2593          x=self.domain.getX()          x=self.domain.getX()
2594          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2595      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)          mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2596          mypde.setValue(D=1.,Y=1.,q=whereZero(x[0]),r=1.)          mypde.setValue(D=1.,Y=1.,q=whereZero(x[0]),r=1.)
2597          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2598          u=mypde.getSolution()          u=mypde.getSolution()
# Line 2600  class Test_LinearPDE(Test_LinearPDE_noLu Line 2600  class Test_LinearPDE(Test_LinearPDE_noLu
2600    
2601      def test_Lumping_System(self):      def test_Lumping_System(self):
2602          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2603      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)          mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2604          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]))          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]))
2605          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2606          u=mypde.getSolution()          u=mypde.getSolution()
# Line 2608  class Test_LinearPDE(Test_LinearPDE_noLu Line 2608  class Test_LinearPDE(Test_LinearPDE_noLu
2608      def test_Constrained_Lumping_System(self):      def test_Constrained_Lumping_System(self):
2609          x=self.domain.getX()          x=self.domain.getX()
2610          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2611      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)          mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2612          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]), \          mypde.setValue(D=numpy.array([[1.,0.],[0.,2.]]),Y=numpy.array([1.,2.]), \
2613                         q=whereZero(x[0])*[0.,1],r=[0.,1.])                         q=whereZero(x[0])*[0.,1],r=[0.,1.])
2614          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
# Line 2618  class Test_LinearPDE(Test_LinearPDE_noLu Line 2618  class Test_LinearPDE(Test_LinearPDE_noLu
2618      def test_Lumping_updateRHS(self):      def test_Lumping_updateRHS(self):
2619          x=self.domain.getX()          x=self.domain.getX()
2620          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2621      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)          mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2622          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2623          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2624          u=mypde.getSolution()          u=mypde.getSolution()
# Line 2630  class Test_LinearPDE(Test_LinearPDE_noLu Line 2630  class Test_LinearPDE(Test_LinearPDE_noLu
2630      def test_Lumping_updateOperator(self):      def test_Lumping_updateOperator(self):
2631          x=self.domain.getX()          x=self.domain.getX()
2632          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
2633      mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)          mypde.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
2634          mypde.setValue(D=1.,Y=1.)          mypde.setValue(D=1.,Y=1.)
2635          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2636          u=mypde.getSolution()          u=mypde.getSolution()
# Line 2649  class Test_TransportPDE(Test_linearPDEs) Line 2649  class Test_TransportPDE(Test_linearPDEs)
2649      def test_setCoefficient_WithWrongName(self):      def test_setCoefficient_WithWrongName(self):
2650          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2651          self.assertRaises(IllegalCoefficient)          self.assertRaises(IllegalCoefficient)
2652      mypde.getSolverOptions().setSolverMethod(SolverOptions.setValue, ROMA=Vector(0.,FunctionOnBoundary(self.domain)))          mypde.getSolverOptions().setSolverMethod(SolverOptions.setValue, ROMA=Vector(0.,FunctionOnBoundary(self.domain)))
2653    
2654      def test_setCoefficient_WithIllegalFunctionSpace(self):      def test_setCoefficient_WithIllegalFunctionSpace(self):
2655          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
2656          self.assertRaises(IllegalCoefficientFunctionSpace)          self.assertRaises(IllegalCoefficientFunctionSpace)
2657      mypde.getSolverOptions().setSolverMethod(SolverOptions.setValue,C=Vector(0.,FunctionOnBoundary(self.domain)))          mypde.getSolverOptions().setSolverMethod(SolverOptions.setValue,C=Vector(0.,FunctionOnBoundary(self.domain)))
2658                    
2659      def test_resetCoefficient_WithWrongShape(self):      def test_resetCoefficient_WithWrongShape(self):
2660          mypde=TransportPDE(self.domain,numEquations=2,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numEquations=2,debug=self.DEBUG)
# Line 2749  class Test_TransportPDE(Test_linearPDEs) Line 2749  class Test_TransportPDE(Test_linearPDEs)
2749          coeff=mypde.getCoefficient("m")          coeff=mypde.getCoefficient("m")
2750          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
2751      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(self):
2752      if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
2753              d=self.domain.getDim()              d=self.domain.getDim()
2754              mypde=TransportPDE(self.domain,debug=self.DEBUG)              mypde=TransportPDE(self.domain,debug=self.DEBUG)
2755              mypde.setValue(d_contact=1.)              mypde.setValue(d_contact=1.)
# Line 2997  class Test_TransportPDE(Test_linearPDEs) Line 2997  class Test_TransportPDE(Test_linearPDEs)
2997          coeff=mypde.getCoefficient("d")          coeff=mypde.getCoefficient("d")
2998          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))
2999      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
3000                
3001          d=self.domain.getDim()          d=self.domain.getDim()
3002          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
3003          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))          mypde.setValue(d_contact=numpy.ones((self.N,self.N)))

Legend:
Removed from v.3837  
changed lines
  Added in v.3892

  ViewVC Help
Powered by ViewVC 1.1.26