/[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 1809 by ksteube, Thu Sep 25 06:43:44 2008 UTC revision 1841 by gross, Fri Oct 3 03:57:52 2008 UTC
# Line 73  class Test_Poisson(Test_linearPDEs): Line 73  class Test_Poisson(Test_linearPDEs):
73          q_ref=interpolate(whereZero(x[0]),Solution(self.domain))          q_ref=interpolate(whereZero(x[0]),Solution(self.domain))
74          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
75          mypde.setValue(q=whereZero(x[0]))          mypde.setValue(q=whereZero(x[0]))
76          self.failUnless(self.check(mypde.getCoefficientOfGeneralPDE("A"),A_ref),"A is not kronecker")          self.failUnless(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
77          self.failUnless(mypde.getCoefficientOfGeneralPDE("B").isEmpty(),"B is not empty")          self.failUnless(mypde.getCoefficient("B").isEmpty(),"B is not empty")
78          self.failUnless(mypde.getCoefficientOfGeneralPDE("C").isEmpty(),"C is not empty")          self.failUnless(mypde.getCoefficient("C").isEmpty(),"C is not empty")
79          self.failUnless(mypde.getCoefficientOfGeneralPDE("D").isEmpty(),"D is not empty")          self.failUnless(mypde.getCoefficient("D").isEmpty(),"D is not empty")
80          self.failUnless(mypde.getCoefficientOfGeneralPDE("X").isEmpty(),"X is not empty")          self.failUnless(mypde.getCoefficient("X").isEmpty(),"X is not empty")
81          self.failUnless(mypde.getCoefficientOfGeneralPDE("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
82          self.failUnless(mypde.getCoefficientOfGeneralPDE("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
83          self.failUnless(mypde.getCoefficientOfGeneralPDE("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
84          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_contact").isEmpty(),"d_contact is not empty")          self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
85          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_contact").isEmpty(),"y_contact is not empty")          self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
86          self.failUnless(mypde.getCoefficientOfGeneralPDE("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
87          self.failUnless(mypde.getCoefficientOfGeneralPDE("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
88          self.failUnless(mypde.getCoefficientOfGeneralPDE("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
89          self.failUnless(mypde.getCoefficientOfGeneralPDE("D_reduced").isEmpty(),"D_reduced is not empty")          self.failUnless(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")
90          self.failUnless(mypde.getCoefficientOfGeneralPDE("X_reduced").isEmpty(),"X_reduced is not empty")          self.failUnless(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")
91          self.failUnless(mypde.getCoefficientOfGeneralPDE("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
92          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
93          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
94          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
95          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
96          self.failUnless(self.check(mypde.getCoefficientOfGeneralPDE("q"),q_ref),"q is not empty")          self.failUnless(self.check(mypde.getCoefficient("q"),q_ref),"q is not empty")
97          self.failUnless(mypde.getCoefficientOfGeneralPDE("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
98      def test_setCoefficient_f(self):      def test_setCoefficient_f(self):
99          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
100          x=self.domain.getX()          x=self.domain.getX()
101          Y_ref=interpolate(x[0],Function(self.domain))          Y_ref=interpolate(x[0],Function(self.domain))
102          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
103          mypde.setValue(f=x[0])          mypde.setValue(f=x[0])
104          self.failUnless(self.check(mypde.getCoefficientOfGeneralPDE("A"),A_ref),"A is not kronecker")          self.failUnless(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
105          self.failUnless(mypde.getCoefficientOfGeneralPDE("B").isEmpty(),"B is not empty")          self.failUnless(mypde.getCoefficient("B").isEmpty(),"B is not empty")
106          self.failUnless(mypde.getCoefficientOfGeneralPDE("C").isEmpty(),"C is not empty")          self.failUnless(mypde.getCoefficient("C").isEmpty(),"C is not empty")
107          self.failUnless(mypde.getCoefficientOfGeneralPDE("D").isEmpty(),"D is not empty")          self.failUnless(mypde.getCoefficient("D").isEmpty(),"D is not empty")
108          self.failUnless(mypde.getCoefficientOfGeneralPDE("X").isEmpty(),"X is not empty")          self.failUnless(mypde.getCoefficient("X").isEmpty(),"X is not empty")
109          self.failUnless(self.check(mypde.getCoefficientOfGeneralPDE("Y"),Y_ref),"Y is not x[0]")          self.failUnless(self.check(mypde.getCoefficient("Y"),Y_ref),"Y is not x[0]")
110          self.failUnless(mypde.getCoefficientOfGeneralPDE("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
111          self.failUnless(mypde.getCoefficientOfGeneralPDE("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
112          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_contact").isEmpty(),"d_contact is not empty")          self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
113          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_contact").isEmpty(),"y_contact is not empty")          self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
114          self.failUnless(mypde.getCoefficientOfGeneralPDE("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
115          self.failUnless(mypde.getCoefficientOfGeneralPDE("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
116          self.failUnless(mypde.getCoefficientOfGeneralPDE("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
117          self.failUnless(mypde.getCoefficientOfGeneralPDE("D_reduced").isEmpty(),"D_reduced is not empty")          self.failUnless(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")
118          self.failUnless(mypde.getCoefficientOfGeneralPDE("X_reduced").isEmpty(),"X_reduced is not empty")          self.failUnless(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")
119          self.failUnless(mypde.getCoefficientOfGeneralPDE("Y_reduced").isEmpty(),"Y_reduced is not empty")          self.failUnless(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty")
120          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
121          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
122          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
123          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
124          self.failUnless(mypde.getCoefficientOfGeneralPDE("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
125          self.failUnless(mypde.getCoefficientOfGeneralPDE("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
126      def test_setCoefficient_f_reduced(self):      def test_setCoefficient_f_reduced(self):
127          mypde=Poisson(self.domain,debug=self.DEBUG)          mypde=Poisson(self.domain,debug=self.DEBUG)
128          x=self.domain.getX()          x=self.domain.getX()
129          Y_ref=interpolate(x[0],ReducedFunction(self.domain))          Y_ref=interpolate(x[0],ReducedFunction(self.domain))
130          A_ref=kronecker(self.domain)          A_ref=kronecker(self.domain)
131          mypde.setValue(f_reduced=x[0])          mypde.setValue(f_reduced=x[0])
132          self.failUnless(self.check(mypde.getCoefficientOfGeneralPDE("A"),A_ref),"A is not kronecker")          self.failUnless(self.check(mypde.getCoefficient("A"),A_ref),"A is not kronecker")
133          self.failUnless(mypde.getCoefficientOfGeneralPDE("B").isEmpty(),"B is not empty")          self.failUnless(mypde.getCoefficient("B").isEmpty(),"B is not empty")
134          self.failUnless(mypde.getCoefficientOfGeneralPDE("C").isEmpty(),"C is not empty")          self.failUnless(mypde.getCoefficient("C").isEmpty(),"C is not empty")
135          self.failUnless(mypde.getCoefficientOfGeneralPDE("D").isEmpty(),"D is not empty")          self.failUnless(mypde.getCoefficient("D").isEmpty(),"D is not empty")
136          self.failUnless(mypde.getCoefficientOfGeneralPDE("X").isEmpty(),"X is not empty")          self.failUnless(mypde.getCoefficient("X").isEmpty(),"X is not empty")
137          self.failUnless(mypde.getCoefficientOfGeneralPDE("Y").isEmpty(),"Y is not empty")          self.failUnless(mypde.getCoefficient("Y").isEmpty(),"Y is not empty")
138          self.failUnless(mypde.getCoefficientOfGeneralPDE("y").isEmpty(),"y is not empty")          self.failUnless(mypde.getCoefficient("y").isEmpty(),"y is not empty")
139          self.failUnless(mypde.getCoefficientOfGeneralPDE("d").isEmpty(),"d is not empty")          self.failUnless(mypde.getCoefficient("d").isEmpty(),"d is not empty")
140          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_contact").isEmpty(),"d_contact is not empty")          self.failUnless(mypde.getCoefficient("d_contact").isEmpty(),"d_contact is not empty")
141          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_contact").isEmpty(),"y_contact is not empty")          self.failUnless(mypde.getCoefficient("y_contact").isEmpty(),"y_contact is not empty")
142          self.failUnless(mypde.getCoefficientOfGeneralPDE("A_reduced").isEmpty(),"A_reduced is not empty")          self.failUnless(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is not empty")
143          self.failUnless(mypde.getCoefficientOfGeneralPDE("B_reduced").isEmpty(),"B_reduced is not empty")          self.failUnless(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is not empty")
144          self.failUnless(mypde.getCoefficientOfGeneralPDE("C_reduced").isEmpty(),"C_reduced is not empty")          self.failUnless(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is not empty")
145          self.failUnless(mypde.getCoefficientOfGeneralPDE("D_reduced").isEmpty(),"D_reduced is not empty")          self.failUnless(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is not empty")
146          self.failUnless(mypde.getCoefficientOfGeneralPDE("X_reduced").isEmpty(),"X_reduced is not empty")          self.failUnless(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty")
147          self.failUnless(self.check(mypde.getCoefficientOfGeneralPDE("Y_reduced"),Y_ref),"Y_reduced is not x[0]")          self.failUnless(self.check(mypde.getCoefficient("Y_reduced"),Y_ref),"Y_reduced is not x[0]")
148          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_reduced").isEmpty(),"y_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty")
149          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_reduced").isEmpty(),"d_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is not empty")
150          self.failUnless(mypde.getCoefficientOfGeneralPDE("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")          self.failUnless(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is not empty")
151          self.failUnless(mypde.getCoefficientOfGeneralPDE("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")          self.failUnless(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty")
152          self.failUnless(mypde.getCoefficientOfGeneralPDE("q").isEmpty(),"q is not empty")          self.failUnless(mypde.getCoefficient("q").isEmpty(),"q is not empty")
153          self.failUnless(mypde.getCoefficientOfGeneralPDE("r").isEmpty(),"r is not empty")          self.failUnless(mypde.getCoefficient("r").isEmpty(),"r is not empty")
154      def test_solve(self):      def test_solve(self):
155         d=self.domain.getDim()         d=self.domain.getDim()
156         cf=ContinuousFunction(self.domain)         cf=ContinuousFunction(self.domain)
# Line 226  class Test_LinearPDE_noLumping(Test_line Line 226  class Test_LinearPDE_noLumping(Test_line
226          d=self.domain.getDim()          d=self.domain.getDim()
227          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
228          mypde.setValue(A=numarray.ones((d,d)))          mypde.setValue(A=numarray.ones((d,d)))
229          coeff=mypde.getCoefficientOfGeneralPDE("A")          coeff=mypde.getCoefficient("A")
230          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),Function(self.domain),1,1))
231      def test_setCoefficient_B_Scalar(self):      def test_setCoefficient_B_Scalar(self):
232          d=self.domain.getDim()          d=self.domain.getDim()
233          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
234          mypde.setValue(B=numarray.ones((d,)))          mypde.setValue(B=numarray.ones((d,)))
235          coeff=mypde.getCoefficientOfGeneralPDE("B")          coeff=mypde.getCoefficient("B")
236          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),Function(self.domain),1,1))
237      def test_setCoefficient_C_Scalar(self):      def test_setCoefficient_C_Scalar(self):
238          d=self.domain.getDim()          d=self.domain.getDim()
239          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
240          mypde.setValue(C=numarray.ones((d,)))          mypde.setValue(C=numarray.ones((d,)))
241          coeff=mypde.getCoefficientOfGeneralPDE("C")          coeff=mypde.getCoefficient("C")
242          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),Function(self.domain),1,1))
243      def test_setCoefficient_D_Scalar(self):      def test_setCoefficient_D_Scalar(self):
244          d=self.domain.getDim()          d=self.domain.getDim()
245          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
246          mypde.setValue(D=1.)          mypde.setValue(D=1.)
247          coeff=mypde.getCoefficientOfGeneralPDE("D")          coeff=mypde.getCoefficient("D")
248          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),Function(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),Function(self.domain),1,1))
249      def test_setCoefficient_X_Scalar(self):      def test_setCoefficient_X_Scalar(self):
250          d=self.domain.getDim()          d=self.domain.getDim()
251          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
252          mypde.setValue(X=numarray.ones((d,)))          mypde.setValue(X=numarray.ones((d,)))
253          coeff=mypde.getCoefficientOfGeneralPDE("X")          coeff=mypde.getCoefficient("X")
254          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),Function(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),Function(self.domain),1))
255      def test_setCoefficient_Y_Scalar(self):      def test_setCoefficient_Y_Scalar(self):
256          d=self.domain.getDim()          d=self.domain.getDim()
257          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
258          mypde.setValue(Y=1.)          mypde.setValue(Y=1.)
259          coeff=mypde.getCoefficientOfGeneralPDE("Y")          coeff=mypde.getCoefficient("Y")
260          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),Function(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),Function(self.domain),1))
261      def test_setCoefficient_y_Scalar(self):      def test_setCoefficient_y_Scalar(self):
262          d=self.domain.getDim()          d=self.domain.getDim()
263          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
264          mypde.setValue(y=1.)          mypde.setValue(y=1.)
265          coeff=mypde.getCoefficientOfGeneralPDE("y")          coeff=mypde.getCoefficient("y")
266          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1))
267      def test_setCoefficient_d_Scalar(self):      def test_setCoefficient_d_Scalar(self):
268          d=self.domain.getDim()          d=self.domain.getDim()
269          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
270          mypde.setValue(d=1.)          mypde.setValue(d=1.)
271          coeff=mypde.getCoefficientOfGeneralPDE("d")          coeff=mypde.getCoefficient("d")
272          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnBoundary(self.domain),1,1))
273      def test_setCoefficient_d_contact_Scalar(self):      def test_setCoefficient_d_contact_Scalar(self):
274          d=self.domain.getDim()          d=self.domain.getDim()
275          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
276          mypde.setValue(d_contact=1.)          mypde.setValue(d_contact=1.)
277          coeff=mypde.getCoefficientOfGeneralPDE("d_contact")          coeff=mypde.getCoefficient("d_contact")
278          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1,1))
279      def test_setCoefficient_y_contact_Scalar(self):      def test_setCoefficient_y_contact_Scalar(self):
280          d=self.domain.getDim()          d=self.domain.getDim()
281          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
282          mypde.setValue(y_contact=1.)          mypde.setValue(y_contact=1.)
283          coeff=mypde.getCoefficientOfGeneralPDE("y_contact")          coeff=mypde.getCoefficient("y_contact")
284          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),FunctionOnContactZero(self.domain),1))
285      def test_setCoefficient_A_reduced_Scalar(self):      def test_setCoefficient_A_reduced_Scalar(self):
286          d=self.domain.getDim()          d=self.domain.getDim()
287          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
288          mypde.setValue(A_reduced=numarray.ones((d,d)))          mypde.setValue(A_reduced=numarray.ones((d,d)))
289          coeff=mypde.getCoefficientOfGeneralPDE("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
290          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))
291      def test_setCoefficient_B_reduced_Scalar(self):      def test_setCoefficient_B_reduced_Scalar(self):
292          d=self.domain.getDim()          d=self.domain.getDim()
293          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
294          mypde.setValue(B_reduced=numarray.ones((d,)))          mypde.setValue(B_reduced=numarray.ones((d,)))
295          coeff=mypde.getCoefficientOfGeneralPDE("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
296          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
297      def test_setCoefficient_C_reduced_Scalar(self):      def test_setCoefficient_C_reduced_Scalar(self):
298          d=self.domain.getDim()          d=self.domain.getDim()
299          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
300          mypde.setValue(C_reduced=numarray.ones((d,)))          mypde.setValue(C_reduced=numarray.ones((d,)))
301          coeff=mypde.getCoefficientOfGeneralPDE("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
302          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
303      def test_setCoefficient_D_reduced_Scalar(self):      def test_setCoefficient_D_reduced_Scalar(self):
304          d=self.domain.getDim()          d=self.domain.getDim()
305          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
306          mypde.setValue(D_reduced=1.)          mypde.setValue(D_reduced=1.)
307          coeff=mypde.getCoefficientOfGeneralPDE("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
308          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
309      def test_setCoefficient_X_reduced_Scalar(self):      def test_setCoefficient_X_reduced_Scalar(self):
310          d=self.domain.getDim()          d=self.domain.getDim()
311          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
312          mypde.setValue(X_reduced=numarray.ones((d,)))          mypde.setValue(X_reduced=numarray.ones((d,)))
313          coeff=mypde.getCoefficientOfGeneralPDE("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
314          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))
315      def test_setCoefficient_Y_reduced_Scalar(self):      def test_setCoefficient_Y_reduced_Scalar(self):
316          d=self.domain.getDim()          d=self.domain.getDim()
317          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
318          mypde.setValue(Y_reduced=1.)          mypde.setValue(Y_reduced=1.)
319          coeff=mypde.getCoefficientOfGeneralPDE("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
320          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
321      def test_setCoefficient_y_reduced_Scalar(self):      def test_setCoefficient_y_reduced_Scalar(self):
322          d=self.domain.getDim()          d=self.domain.getDim()
323          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
324          mypde.setValue(y_reduced=1.)          mypde.setValue(y_reduced=1.)
325          coeff=mypde.getCoefficientOfGeneralPDE("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
326          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
327      def test_setCoefficient_d_reduced_Scalar(self):      def test_setCoefficient_d_reduced_Scalar(self):
328          d=self.domain.getDim()          d=self.domain.getDim()
329          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
330          mypde.setValue(d_reduced=1.)          mypde.setValue(d_reduced=1.)
331          coeff=mypde.getCoefficientOfGeneralPDE("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
332          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
333      def test_setCoefficient_d_contact_reduced_Scalar(self):      def test_setCoefficient_d_contact_reduced_Scalar(self):
334          d=self.domain.getDim()          d=self.domain.getDim()
335          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
336          mypde.setValue(d_contact_reduced=1.)          mypde.setValue(d_contact_reduced=1.)
337          coeff=mypde.getCoefficientOfGeneralPDE("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
338          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
339      def test_setCoefficient_y_contact_reduced_Scalar(self):      def test_setCoefficient_y_contact_reduced_Scalar(self):
340          d=self.domain.getDim()          d=self.domain.getDim()
341          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
342          mypde.setValue(y_contact_reduced=1.)          mypde.setValue(y_contact_reduced=1.)
343          coeff=mypde.getCoefficientOfGeneralPDE("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
344          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
345      def test_setCoefficient_r_Scalar(self):      def test_setCoefficient_r_Scalar(self):
346          d=self.domain.getDim()          d=self.domain.getDim()
347          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
348          mypde.setValue(r=1.)          mypde.setValue(r=1.)
349          coeff=mypde.getCoefficientOfGeneralPDE("r")          coeff=mypde.getCoefficient("r")
350          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))
351      def test_setCoefficient_q_Scalar(self):      def test_setCoefficient_q_Scalar(self):
352          d=self.domain.getDim()          d=self.domain.getDim()
353          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
354          mypde.setValue(q=1.)          mypde.setValue(q=1.)
355          coeff=mypde.getCoefficientOfGeneralPDE("q")          coeff=mypde.getCoefficient("q")
356          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),Solution(self.domain),1))
357      def test_setCoefficient_r_Scalar_reducedOn(self):      def test_setCoefficient_r_Scalar_reducedOn(self):
358          d=self.domain.getDim()          d=self.domain.getDim()
359          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
360          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
361          mypde.setValue(r=1.)          mypde.setValue(r=1.)
362          coeff=mypde.getCoefficientOfGeneralPDE("r")          coeff=mypde.getCoefficient("r")
363          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
364      def test_setCoefficient_q_Scalar_reducedOn(self):      def test_setCoefficient_q_Scalar_reducedOn(self):
365          d=self.domain.getDim()          d=self.domain.getDim()
366          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
367          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
368          mypde.setValue(q=1.)          mypde.setValue(q=1.)
369          coeff=mypde.getCoefficientOfGeneralPDE("q")          coeff=mypde.getCoefficient("q")
370          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((),ReducedSolution(self.domain),1))
371    
372      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
373          d=self.domain.getDim()          d=self.domain.getDim()
374          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
375          mypde.setValue(A=Data(numarray.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numarray.ones((d,d)),ReducedFunction(self.domain)))
376          coeff=mypde.getCoefficientOfGeneralPDE("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
377          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))
378      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
379          d=self.domain.getDim()          d=self.domain.getDim()
380          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
381          mypde.setValue(B=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numarray.ones((d,)),ReducedFunction(self.domain)))
382          coeff=mypde.getCoefficientOfGeneralPDE("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
383          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
384      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(self):
385          d=self.domain.getDim()          d=self.domain.getDim()
386          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
387          mypde.setValue(C=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numarray.ones((d,)),ReducedFunction(self.domain)))
388          coeff=mypde.getCoefficientOfGeneralPDE("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
389          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))
390      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
391          d=self.domain.getDim()          d=self.domain.getDim()
392          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
393          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))
394          coeff=mypde.getCoefficientOfGeneralPDE("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
395          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))
396      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
397          d=self.domain.getDim()          d=self.domain.getDim()
398          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
399          mypde.setValue(X_reduced=Data(numarray.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numarray.ones((d,)),ReducedFunction(self.domain)))
400          coeff=mypde.getCoefficientOfGeneralPDE("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
401          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))
402      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
403          d=self.domain.getDim()          d=self.domain.getDim()
404          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
405          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))
406          coeff=mypde.getCoefficientOfGeneralPDE("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
407          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunction(self.domain),1))
408      def test_setCoefficient_y_reduced_Scalar_using_y(self):      def test_setCoefficient_y_reduced_Scalar_using_y(self):
409          d=self.domain.getDim()          d=self.domain.getDim()
410          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
411          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
412          coeff=mypde.getCoefficientOfGeneralPDE("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
413          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))
414      def test_setCoefficient_d_reduced_Scalar_using_d(self):      def test_setCoefficient_d_reduced_Scalar_using_d(self):
415          d=self.domain.getDim()          d=self.domain.getDim()
416          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
417          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
418          coeff=mypde.getCoefficientOfGeneralPDE("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
419          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))
420      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):
421          d=self.domain.getDim()          d=self.domain.getDim()
422          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
423          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
424          coeff=mypde.getCoefficientOfGeneralPDE("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
425          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))
426      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):
427          d=self.domain.getDim()          d=self.domain.getDim()
428          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
429          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
430          coeff=mypde.getCoefficientOfGeneralPDE("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
431          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))
432      #      #
433      #  set coefficients for systems:      #  set coefficients for systems:
# Line 436  class Test_LinearPDE_noLumping(Test_line Line 436  class Test_LinearPDE_noLumping(Test_line
436          d=self.domain.getDim()          d=self.domain.getDim()
437          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
438          mypde.setValue(A=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A=numarray.ones((self.N,d,self.N,d)))
439          coeff=mypde.getCoefficientOfGeneralPDE("A")          coeff=mypde.getCoefficient("A")
440          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),Function(self.domain),self.N,self.N))
441      def test_setCoefficient_B_System(self):      def test_setCoefficient_B_System(self):
442          d=self.domain.getDim()          d=self.domain.getDim()
443          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
444          mypde.setValue(B=numarray.ones((self.N,d,self.N)))          mypde.setValue(B=numarray.ones((self.N,d,self.N)))
445          coeff=mypde.getCoefficientOfGeneralPDE("B")          coeff=mypde.getCoefficient("B")
446          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),Function(self.domain),self.N,self.N))
447      def test_setCoefficient_C_System(self):      def test_setCoefficient_C_System(self):
448          d=self.domain.getDim()          d=self.domain.getDim()
449          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
450          mypde.setValue(C=numarray.ones((self.N,self.N,d)))          mypde.setValue(C=numarray.ones((self.N,self.N,d)))
451          coeff=mypde.getCoefficientOfGeneralPDE("C")          coeff=mypde.getCoefficient("C")
452          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),Function(self.domain),self.N,self.N))
453      def test_setCoefficient_D_System(self):      def test_setCoefficient_D_System(self):
454          d=self.domain.getDim()          d=self.domain.getDim()
455          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
456          mypde.setValue(D=numarray.ones((self.N,self.N)))          mypde.setValue(D=numarray.ones((self.N,self.N)))
457          coeff=mypde.getCoefficientOfGeneralPDE("D")          coeff=mypde.getCoefficient("D")
458          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),Function(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),Function(self.domain),self.N,self.N))
459      def test_setCoefficient_X_System(self):      def test_setCoefficient_X_System(self):
460          d=self.domain.getDim()          d=self.domain.getDim()
461          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
462          mypde.setValue(X=numarray.ones((self.N,d)))          mypde.setValue(X=numarray.ones((self.N,d)))
463          coeff=mypde.getCoefficientOfGeneralPDE("X")          coeff=mypde.getCoefficient("X")
464          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),Function(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),Function(self.domain),self.N))
465      def test_setCoefficient_Y_System(self):      def test_setCoefficient_Y_System(self):
466          d=self.domain.getDim()          d=self.domain.getDim()
467          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
468          mypde.setValue(Y=numarray.ones((self.N,)))          mypde.setValue(Y=numarray.ones((self.N,)))
469          coeff=mypde.getCoefficientOfGeneralPDE("Y")          coeff=mypde.getCoefficient("Y")
470          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),Function(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),Function(self.domain),self.N))
471      def test_setCoefficient_y_System(self):      def test_setCoefficient_y_System(self):
472          d=self.domain.getDim()          d=self.domain.getDim()
473          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
474          mypde.setValue(y=numarray.ones((self.N,)))          mypde.setValue(y=numarray.ones((self.N,)))
475          coeff=mypde.getCoefficientOfGeneralPDE("y")          coeff=mypde.getCoefficient("y")
476          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),FunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),FunctionOnBoundary(self.domain),self.N))
477      def test_setCoefficient_d_System(self):      def test_setCoefficient_d_System(self):
478          d=self.domain.getDim()          d=self.domain.getDim()
479          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
480          mypde.setValue(d=numarray.ones((self.N,self.N)))          mypde.setValue(d=numarray.ones((self.N,self.N)))
481          coeff=mypde.getCoefficientOfGeneralPDE("d")          coeff=mypde.getCoefficient("d")
482          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnBoundary(self.domain),self.N,self.N))
483      def test_setCoefficient_d_contact_System(self):      def test_setCoefficient_d_contact_System(self):
484          d=self.domain.getDim()          d=self.domain.getDim()
485          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
486          mypde.setValue(d_contact=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact=numarray.ones((self.N,self.N)))
487          coeff=mypde.getCoefficientOfGeneralPDE("d_contact")          coeff=mypde.getCoefficient("d_contact")
488          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FunctionOnContactZero(self.domain),self.N,self.N))
489      def test_setCoefficient_y_contact_System(self):      def test_setCoefficient_y_contact_System(self):
490          d=self.domain.getDim()          d=self.domain.getDim()
491          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
492          mypde.setValue(y_contact=numarray.ones((self.N,)))          mypde.setValue(y_contact=numarray.ones((self.N,)))
493          coeff=mypde.getCoefficientOfGeneralPDE("y_contact")          coeff=mypde.getCoefficient("y_contact")
494          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),FunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),FunctionOnContactZero(self.domain),self.N))
495      def test_setCoefficient_A_reduced_System(self):      def test_setCoefficient_A_reduced_System(self):
496          d=self.domain.getDim()          d=self.domain.getDim()
497          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
498          mypde.setValue(A_reduced=numarray.ones((self.N,d,self.N,d)))          mypde.setValue(A_reduced=numarray.ones((self.N,d,self.N,d)))
499          coeff=mypde.getCoefficientOfGeneralPDE("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
500          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))
501      def test_setCoefficient_B_reduced_System(self):      def test_setCoefficient_B_reduced_System(self):
502          d=self.domain.getDim()          d=self.domain.getDim()
503          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
504          mypde.setValue(B_reduced=numarray.ones((self.N,d,self.N)))          mypde.setValue(B_reduced=numarray.ones((self.N,d,self.N)))
505          coeff=mypde.getCoefficientOfGeneralPDE("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
506          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))
507      def test_setCoefficient_C_reduced_System(self):      def test_setCoefficient_C_reduced_System(self):
508          d=self.domain.getDim()          d=self.domain.getDim()
509          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
510          mypde.setValue(C_reduced=numarray.ones((self.N,self.N,d)))          mypde.setValue(C_reduced=numarray.ones((self.N,self.N,d)))
511          coeff=mypde.getCoefficientOfGeneralPDE("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
512          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))
513      def test_setCoefficient_D_System_reduced(self):      def test_setCoefficient_D_System_reduced(self):
514          d=self.domain.getDim()          d=self.domain.getDim()
515          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
516          mypde.setValue(D_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(D_reduced=numarray.ones((self.N,self.N)))
517          coeff=mypde.getCoefficientOfGeneralPDE("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
518          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
519      def test_setCoefficient_X_System_reduced(self):      def test_setCoefficient_X_System_reduced(self):
520          d=self.domain.getDim()          d=self.domain.getDim()
521          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
522          mypde.setValue(X_reduced=numarray.ones((self.N,d)))          mypde.setValue(X_reduced=numarray.ones((self.N,d)))
523          coeff=mypde.getCoefficientOfGeneralPDE("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
524          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))
525      def test_setCoefficient_Y_System_reduced(self):      def test_setCoefficient_Y_System_reduced(self):
526          d=self.domain.getDim()          d=self.domain.getDim()
527          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
528          mypde.setValue(Y_reduced=numarray.ones((self.N,)))          mypde.setValue(Y_reduced=numarray.ones((self.N,)))
529          coeff=mypde.getCoefficientOfGeneralPDE("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
530          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))
531      def test_setCoefficient_y_System_reduced(self):      def test_setCoefficient_y_System_reduced(self):
532          d=self.domain.getDim()          d=self.domain.getDim()
533          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
534          mypde.setValue(y_reduced=numarray.ones((self.N,)))          mypde.setValue(y_reduced=numarray.ones((self.N,)))
535          coeff=mypde.getCoefficientOfGeneralPDE("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
536          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))
537      def test_setCoefficient_d_reduced_System(self):      def test_setCoefficient_d_reduced_System(self):
538          d=self.domain.getDim()          d=self.domain.getDim()
539          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
540          mypde.setValue(d_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_reduced=numarray.ones((self.N,self.N)))
541          coeff=mypde.getCoefficientOfGeneralPDE("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
542          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
543      def test_setCoefficient_d_contact_reduced_System(self):      def test_setCoefficient_d_contact_reduced_System(self):
544          d=self.domain.getDim()          d=self.domain.getDim()
545          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
546          mypde.setValue(d_contact_reduced=numarray.ones((self.N,self.N)))          mypde.setValue(d_contact_reduced=numarray.ones((self.N,self.N)))
547          coeff=mypde.getCoefficientOfGeneralPDE("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
548          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
549      def test_setCoefficient_y_contact_reduced_System(self):      def test_setCoefficient_y_contact_reduced_System(self):
550          d=self.domain.getDim()          d=self.domain.getDim()
551          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
552          mypde.setValue(y_contact_reduced=numarray.ones((self.N,)))          mypde.setValue(y_contact_reduced=numarray.ones((self.N,)))
553          coeff=mypde.getCoefficientOfGeneralPDE("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
554          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))
555      def test_setCoefficient_r_System(self):      def test_setCoefficient_r_System(self):
556          d=self.domain.getDim()          d=self.domain.getDim()
557          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
558          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numarray.ones((self.N,)))
559          coeff=mypde.getCoefficientOfGeneralPDE("r")          coeff=mypde.getCoefficient("r")
560          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))
561      def test_setCoefficient_q_System(self):      def test_setCoefficient_q_System(self):
562          d=self.domain.getDim()          d=self.domain.getDim()
563          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
564          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numarray.ones((self.N,)))
565          coeff=mypde.getCoefficientOfGeneralPDE("q")          coeff=mypde.getCoefficient("q")
566          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),Solution(self.domain),self.N))
567      def test_setCoefficient_r_System_reducedOn(self):      def test_setCoefficient_r_System_reducedOn(self):
568          d=self.domain.getDim()          d=self.domain.getDim()
569          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
570          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
571          mypde.setValue(r=numarray.ones((self.N,)))          mypde.setValue(r=numarray.ones((self.N,)))
572          coeff=mypde.getCoefficientOfGeneralPDE("r")          coeff=mypde.getCoefficient("r")
573          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))
574      def test_setCoefficient_q_System_reducedOn(self):      def test_setCoefficient_q_System_reducedOn(self):
575          d=self.domain.getDim()          d=self.domain.getDim()
576          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numEquations=3,debug=self.DEBUG)
577          mypde.setReducedOrderOn()          mypde.setReducedOrderOn()
578          mypde.setValue(q=numarray.ones((self.N,)))          mypde.setValue(q=numarray.ones((self.N,)))
579          coeff=mypde.getCoefficientOfGeneralPDE("q")          coeff=mypde.getCoefficient("q")
580          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions()),((self.N,),ReducedSolution(self.domain),self.N))
581    
582      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
583          d=self.domain.getDim()          d=self.domain.getDim()
584          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
585          mypde.setValue(A=Data(numarray.ones((self.N,d,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numarray.ones((self.N,d,self.N,d)),ReducedFunction(self.domain)))
586          coeff=mypde.getCoefficientOfGeneralPDE("A_reduced")          coeff=mypde.getCoefficient("A_reduced")
587          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))
588      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
589          d=self.domain.getDim()          d=self.domain.getDim()
590          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
591          mypde.setValue(B=Data(numarray.ones((self.N,d,self.N)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numarray.ones((self.N,d,self.N)),ReducedFunction(self.domain)))
592          coeff=mypde.getCoefficientOfGeneralPDE("B_reduced")          coeff=mypde.getCoefficient("B_reduced")
593          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))
594      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
595          d=self.domain.getDim()          d=self.domain.getDim()
596          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
597          mypde.setValue(C=Data(numarray.ones((self.N,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numarray.ones((self.N,self.N,d)),ReducedFunction(self.domain)))
598          coeff=mypde.getCoefficientOfGeneralPDE("C_reduced")          coeff=mypde.getCoefficient("C_reduced")
599          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))
600      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_System_reduced_using_D(self):
601          d=self.domain.getDim()          d=self.domain.getDim()
602          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
603          mypde.setValue(D=Data(numarray.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(D=Data(numarray.ones((self.N,self.N)),ReducedFunction(self.domain)))
604          coeff=mypde.getCoefficientOfGeneralPDE("D_reduced")          coeff=mypde.getCoefficient("D_reduced")
605          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
606      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_System_reduced_using_X(self):
607          d=self.domain.getDim()          d=self.domain.getDim()
608          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
609          mypde.setValue(X=Data(numarray.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numarray.ones((self.N,d)),ReducedFunction(self.domain)))
610          coeff=mypde.getCoefficientOfGeneralPDE("X_reduced")          coeff=mypde.getCoefficient("X_reduced")
611          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))
612      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_System_reduced_using_Y(self):
613          d=self.domain.getDim()          d=self.domain.getDim()
614          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
615          mypde.setValue(Y=Data(numarray.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numarray.ones((self.N,)),ReducedFunction(self.domain)))
616          coeff=mypde.getCoefficientOfGeneralPDE("Y_reduced")          coeff=mypde.getCoefficient("Y_reduced")
617          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))
618      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
619          d=self.domain.getDim()          d=self.domain.getDim()
620          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
621          mypde.setValue(y=Data(numarray.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numarray.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
622          coeff=mypde.getCoefficientOfGeneralPDE("y_reduced")          coeff=mypde.getCoefficient("y_reduced")
623          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))
624      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
625          d=self.domain.getDim()          d=self.domain.getDim()
626          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
627          mypde.setValue(d=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
628          coeff=mypde.getCoefficientOfGeneralPDE("d_reduced")          coeff=mypde.getCoefficient("d_reduced")
629          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))
630      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
631          d=self.domain.getDim()          d=self.domain.getDim()
632          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
633          mypde.setValue(d_contact=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(d_contact=Data(numarray.ones((self.N,self.N)),ReducedFunctionOnContactZero(self.domain)))
634          coeff=mypde.getCoefficientOfGeneralPDE("d_contact_reduced")          coeff=mypde.getCoefficient("d_contact_reduced")
635          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))
636      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
637          d=self.domain.getDim()          d=self.domain.getDim()
638          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
639          mypde.setValue(y_contact=Data(numarray.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))          mypde.setValue(y_contact=Data(numarray.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
640          coeff=mypde.getCoefficientOfGeneralPDE("y_contact_reduced")          coeff=mypde.getCoefficient("y_contact_reduced")
641          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))          self.failUnlessEqual((coeff.getShape(),coeff.getFunctionSpace(),mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))
642      def test_resetCoefficient_HomogeneousConstraint(self):      def test_resetCoefficient_HomogeneousConstraint(self):
643          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)

Legend:
Removed from v.1809  
changed lines
  Added in v.1841

  ViewVC Help
Powered by ViewVC 1.1.26