/[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 4154 by jfenwick, Tue Jan 22 09:30:23 2013 UTC revision 4219 by caltinay, Wed Feb 20 00:26:19 2013 UTC
# Line 39  class Test_linearPDEs(unittest.TestCase) Line 39  class Test_linearPDEs(unittest.TestCase)
39      SOLVER_TOL=1.e-10      SOLVER_TOL=1.e-10
40      DEBUG=False      DEBUG=False
41      VERBOSE=False      VERBOSE=False
42        _domainCanInterpolateAdvanced=None
43    
44        # Can the domain interpolate from ReducedFunction to Function?
45        def specialInterpolationSupported(self):
46            if self._domainCanInterpolateAdvanced is None:
47                d0=Data(0,(),ReducedFunction(self.domain))
48                try:
49                    d1=Data(d0, Function(self.domain))
50                    self._domainCanInterpolateAdvanced=True
51                except e:
52                    self._domainCanInterpolateAdvanced=False
53            return self._domainCanInterpolateAdvanced
54    
55      def check(self,arg,ref_arg,tol=None):      def check(self,arg,ref_arg,tol=None):
56          """          """
57          checks if arg and ref_arg are nearly identical using the `Lsup`          checks if arg and ref_arg are nearly identical using the `Lsup`
# Line 642  class Test_Poisson(Test_linearPDEs): Line 655  class Test_Poisson(Test_linearPDEs):
655    
656  class Test_LinearPDE_noLumping(Test_linearPDEs):  class Test_LinearPDE_noLumping(Test_linearPDEs):
657      N=4      N=4
658    
659      def test_SolverOptions(self):      def test_SolverOptions(self):
660          so=SolverOptions()          so=SolverOptions()
661                    
# Line 1226  class Test_LinearPDE_noLumping(Test_line Line 1240  class Test_LinearPDE_noLumping(Test_line
1240          d=self.domain.getDim()          d=self.domain.getDim()
1241          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1242          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((d,d)),ReducedFunction(self.domain)))
1243          coeff=mypde.getCoefficient("A_reduced")          if self.specialInterpolationSupported():
1244          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,d),ReducedFunction(self.domain),1,1))              coeff_name='A'
1245                FS=Function
1246            else:
1247                coeff_name='A_reduced'
1248                FS=ReducedFunction
1249            coeff=mypde.getCoefficient(coeff_name)
1250            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,d),FS(self.domain),1,1))
1251          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1252          self.assertFalse(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1253    
1254      def test_setCoefficient_B_reduced_Scalar_usingB(self):      def test_setCoefficient_B_reduced_Scalar_usingB(self):
1255          d=self.domain.getDim()          d=self.domain.getDim()
1256          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1257          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1258          coeff=mypde.getCoefficient("B_reduced")          if self.specialInterpolationSupported():
1259          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))              coeff_name='B'
1260                FS=Function
1261            else:
1262                coeff_name='B_reduced'
1263                FS=ReducedFunction
1264            coeff=mypde.getCoefficient(coeff_name)
1265            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),FS(self.domain),1,1))
1266          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1267          self.assertFalse(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1268    
1269      def test_setCoefficient_C_reduced_Scalar_usingC(self):      def test_setCoefficient_C_reduced_Scalar_usingC(self):
1270          d=self.domain.getDim()          d=self.domain.getDim()
1271          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1272          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1273          coeff=mypde.getCoefficient("C_reduced")          if self.specialInterpolationSupported():
1274          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1,1))              coeff_name='C'
1275                FS=Function
1276            else:
1277                coeff_name='C_reduced'
1278                FS=ReducedFunction
1279            coeff=mypde.getCoefficient(coeff_name)
1280            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((d,),FS(self.domain),1,1))
1281          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1282          self.assertFalse(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1283    
1284      def test_setCoefficient_D_reduced_Scalar_usingD(self):      def test_setCoefficient_D_reduced_Scalar_usingD(self):
1285          d=self.domain.getDim()          d=self.domain.getDim()
1286          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1287          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(D=Scalar(1.,ReducedFunction(self.domain)))
1288          coeff=mypde.getCoefficient("D_reduced")          if self.specialInterpolationSupported():
1289          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))              coeff_name='D'
1290                FS=Function
1291            else:
1292                coeff_name='D_reduced'
1293                FS=ReducedFunction
1294            coeff=mypde.getCoefficient(coeff_name)
1295            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FS(self.domain),1,1))
1296          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1297          self.assertFalse(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1298    
1299      def test_setCoefficient_X_reduced_Scalar_usingX(self):      def test_setCoefficient_X_reduced_Scalar_usingX(self):
1300          d=self.domain.getDim()          d=self.domain.getDim()
1301          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1302          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))          mypde.setValue(X_reduced=Data(numpy.ones((d,)),ReducedFunction(self.domain)))
1303          coeff=mypde.getCoefficient("X_reduced")          coeff=mypde.getCoefficient('X_reduced')
1304          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((d,),ReducedFunction(self.domain),1))
   
1305          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1306          self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced not is empty after reset of right hand side coefficients")          self.assertTrue(mypde.getCoefficient('X_reduced').isEmpty(),"X_reduced is not empty after reset of right hand side coefficients")
1307    
1308      def test_setCoefficient_Y_reduced_Scalar_usingY(self):      def test_setCoefficient_Y_reduced_Scalar_usingY(self):
1309          d=self.domain.getDim()          d=self.domain.getDim()
1310          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1311          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(Y=Scalar(1.,ReducedFunction(self.domain)))
1312          coeff=mypde.getCoefficient("Y_reduced")          if self.specialInterpolationSupported():
1313          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1))              coeff_name='Y'
1314                FS=Function
1315            else:
1316                coeff_name='Y_reduced'
1317                FS=ReducedFunction
1318            coeff=mypde.getCoefficient(coeff_name)
1319            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FS(self.domain),1))
1320          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1321          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced not is empty after reset of right hand side coefficients")          self.assertTrue(mypde.getCoefficient(coeff_name).isEmpty(),"%s is not empty after reset of right hand side coefficients"%coeff_name)
1322    
1323      def test_setCoefficient_y_reduced_Scalar_using_y(self):      def test_setCoefficient_y_reduced_Scalar_using_y(self):
1324          d=self.domain.getDim()          d=self.domain.getDim()
1325          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1326          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
1327          coeff=mypde.getCoefficient("y_reduced")          if self.specialInterpolationSupported():
1328          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1))              coeff_name='y'
1329                FS=FunctionOnBoundary
1330            else:
1331                coeff_name='y_reduced'
1332                FS=ReducedFunctionOnBoundary
1333            coeff=mypde.getCoefficient(coeff_name)
1334            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FS(self.domain),1))
1335          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1336          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced not is empty after reset of right hand side coefficients")          self.assertTrue(mypde.getCoefficient(coeff_name).isEmpty(),"%s is not empty after reset of right hand side coefficients"%coeff_name)
1337    
1338      def test_setCoefficient_d_reduced_Scalar_using_d(self):      def test_setCoefficient_d_reduced_Scalar_using_d(self):
1339          d=self.domain.getDim()          d=self.domain.getDim()
1340          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1341          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
1342          coeff=mypde.getCoefficient("d_reduced")          if self.specialInterpolationSupported():
1343          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))              coeff_name='d'
1344                FS=FunctionOnBoundary
1345            else:
1346                coeff_name='d_reduced'
1347                FS=ReducedFunctionOnBoundary
1348            coeff=mypde.getCoefficient(coeff_name)
1349            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FS(self.domain),1,1))
1350          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1351          self.assertFalse(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced not is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1352    
1353      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_Scalar_using_d_contact(self):
1354          if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1355              d=self.domain.getDim()              d=self.domain.getDim()
1356              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1357              mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))              mypde.setValue(d_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1358              coeff=mypde.getCoefficient("d_contact_reduced")              if self.specialInterpolationSupported():
1359              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1,1))                  coeff_name='d_contact'
1360              mypde.resetRightHandSideCoefficients()                  FS=FunctionOnContactZero
1361              self.assertFalse(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced not is empty after reset of right hand side coefficients")              else:
1362                    coeff_name='d_contact_reduced'
1363                    FS=ReducedFunctionOnContactZero
1364                coeff=mypde.getCoefficient(coeff_name)
1365                self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FS(self.domain),1,1))
1366                mypde.resetRightHandSideCoefficients()
1367                self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1368    
1369      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_Scalar_using_y_contact(self):
1370          if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1371              d=self.domain.getDim()              d=self.domain.getDim()
1372              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1373              mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))              mypde.setValue(y_contact=Scalar(1.,ReducedFunctionOnContactZero(self.domain)))
1374              coeff=mypde.getCoefficient("y_contact_reduced")              if self.specialInterpolationSupported():
1375              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),ReducedFunctionOnContactZero(self.domain),1))                  coeff_name='y_contact'
1376                    FS=FunctionOnContactZero
1377                else:
1378                    coeff_name='y_contact_reduced'
1379                    FS=ReducedFunctionOnContactZero
1380                coeff=mypde.getCoefficient(coeff_name)
1381                self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((),FS(self.domain),1))
1382              mypde.resetRightHandSideCoefficients()              mypde.resetRightHandSideCoefficients()
1383              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced not is empty after reset of right hand side coefficients")              self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1384    
1385      #      #
1386      #  set coefficients for systems:      #  set coefficients for systems:
1387      #      #
# Line 1527  class Test_LinearPDE_noLumping(Test_line Line 1589  class Test_LinearPDE_noLumping(Test_line
1589          d=self.domain.getDim()          d=self.domain.getDim()
1590          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1591          mypde.setValue(A=Data(numpy.ones((self.N,d,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(A=Data(numpy.ones((self.N,d,self.N,d)),ReducedFunction(self.domain)))
1592          coeff=mypde.getCoefficient("A_reduced")          if self.specialInterpolationSupported():
1593          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N,d),ReducedFunction(self.domain),self.N,self.N))              coeff_name='A'
1594                FS=Function
1595            else:
1596                coeff_name='A_reduced'
1597                FS=ReducedFunction
1598            coeff=mypde.getCoefficient(coeff_name)
1599            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N,d),FS(self.domain),self.N,self.N))
1600          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1601          self.assertFalse(mypde.getCoefficient("A_reduced").isEmpty(),"A_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1602    
1603      def test_setCoefficient_B_reduced_System_using_B(self):      def test_setCoefficient_B_reduced_System_using_B(self):
1604          d=self.domain.getDim()          d=self.domain.getDim()
1605          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1606          mypde.setValue(B=Data(numpy.ones((self.N,d,self.N)),ReducedFunction(self.domain)))          mypde.setValue(B=Data(numpy.ones((self.N,d,self.N)),ReducedFunction(self.domain)))
1607          coeff=mypde.getCoefficient("B_reduced")          if self.specialInterpolationSupported():
1608          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N),ReducedFunction(self.domain),self.N,self.N))              coeff_name='B'
1609                FS=Function
1610            else:
1611                coeff_name='B_reduced'
1612                FS=ReducedFunction
1613            coeff=mypde.getCoefficient(coeff_name)
1614            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,d,self.N),FS(self.domain),self.N,self.N))
1615          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1616          self.assertFalse(mypde.getCoefficient("B_reduced").isEmpty(),"B_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1617    
1618      def test_setCoefficient_C_reduced_System_using_C(self):      def test_setCoefficient_C_reduced_System_using_C(self):
1619          d=self.domain.getDim()          d=self.domain.getDim()
1620          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1621          mypde.setValue(C=Data(numpy.ones((self.N,self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(C=Data(numpy.ones((self.N,self.N,d)),ReducedFunction(self.domain)))
1622          coeff=mypde.getCoefficient("C_reduced")          if self.specialInterpolationSupported():
1623          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))              coeff_name='C'
1624                FS=Function
1625            else:
1626                coeff_name='C_reduced'
1627                FS=ReducedFunction
1628            coeff=mypde.getCoefficient(coeff_name)
1629            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),FS(self.domain),self.N,self.N))
1630          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1631          self.assertFalse(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1632      def test_setCoefficient_D_System_reduced_using_D(self):  
1633        def test_setCoefficient_D_reduced_System_using_D(self):
1634          d=self.domain.getDim()          d=self.domain.getDim()
1635          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1636          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
1637          coeff=mypde.getCoefficient("D_reduced")          if self.specialInterpolationSupported():
1638          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))              coeff_name='D'
1639                FS=Function
1640            else:
1641                coeff_name='D_reduced'
1642                FS=ReducedFunction
1643            coeff=mypde.getCoefficient(coeff_name)
1644            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FS(self.domain),self.N,self.N))
1645          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1646          self.assertFalse(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1647      def test_setCoefficient_X_System_reduced_using_X(self):  
1648        def test_setCoefficient_X_reduced_System_using_X(self):
1649          d=self.domain.getDim()          d=self.domain.getDim()
1650          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1651          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
1652          coeff=mypde.getCoefficient("X_reduced")          if self.specialInterpolationSupported():
1653          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))              coeff_name='X'
1654                FS=Function
1655            else:
1656                coeff_name='X_reduced'
1657                FS=ReducedFunction
1658            coeff=mypde.getCoefficient(coeff_name)
1659            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),FS(self.domain),self.N))
1660          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1661          self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty after reset of right hand side coefficients")          self.assertTrue(mypde.getCoefficient(coeff_name).isEmpty(),"%s is not empty after reset of right hand side coefficients"%coeff_name)
1662      def test_setCoefficient_Y_System_reduced_using_Y(self):  
1663        def test_setCoefficient_Y_reduced_System_using_Y(self):
1664          d=self.domain.getDim()          d=self.domain.getDim()
1665          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1666          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
1667          coeff=mypde.getCoefficient("Y_reduced")          if self.specialInterpolationSupported():
1668          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunction(self.domain),self.N))              coeff_name='Y'
1669                FS=Function
1670            else:
1671                coeff_name='Y_reduced'
1672                FS=ReducedFunction
1673            coeff=mypde.getCoefficient(coeff_name)
1674            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FS(self.domain),self.N))
1675          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1676          self.assertTrue(mypde.getCoefficient("Y_reduced").isEmpty(),"Y_reduced is not empty after reset of right hand side coefficients")          self.assertTrue(mypde.getCoefficient(coeff_name).isEmpty(),"%s is not empty after reset of right hand side coefficients"%coeff_name)
1677    
1678      def test_setCoefficient_y_reduced_System_using_y(self):      def test_setCoefficient_y_reduced_System_using_y(self):
1679          d=self.domain.getDim()          d=self.domain.getDim()
1680          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1681          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(y=Data(numpy.ones((self.N,)),ReducedFunctionOnBoundary(self.domain)))
1682          coeff=mypde.getCoefficient("y_reduced")          if self.specialInterpolationSupported():
1683          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnBoundary(self.domain),self.N))              coeff_name='y'
1684                FS=FunctionOnBoundary
1685            else:
1686                coeff_name='y_reduced'
1687                FS=ReducedFunctionOnBoundary
1688            coeff=mypde.getCoefficient(coeff_name)
1689            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FS(self.domain),self.N))
1690          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1691          self.assertTrue(mypde.getCoefficient("y_reduced").isEmpty(),"y_reduced is not empty after reset of right hand side coefficients")          self.assertTrue(mypde.getCoefficient(coeff_name).isEmpty(),"%s is not empty after reset of right hand side coefficients"%coeff_name)
1692    
1693      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
1694          d=self.domain.getDim()          d=self.domain.getDim()
1695          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1696          mypde.setValue(d=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(d=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
1697          coeff=mypde.getCoefficient("d_reduced")          if self.specialInterpolationSupported():
1698          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))              coeff_name='d'
1699                FS=FunctionOnBoundary
1700            else:
1701                coeff_name='d_reduced'
1702                FS=ReducedFunctionOnBoundary
1703            coeff=mypde.getCoefficient(coeff_name)
1704            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FS(self.domain),self.N,self.N))
1705          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
1706          self.assertFalse(mypde.getCoefficient("d_reduced").isEmpty(),"d_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1707    
1708      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):      def test_setCoefficient_d_contact_reduced_System_using_d_contact(self):
1709          if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1710              d=self.domain.getDim()              d=self.domain.getDim()
1711              mypde=LinearPDE(self.domain,debug=self.DEBUG)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1712              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)))
1713              coeff=mypde.getCoefficient("d_contact_reduced")              if self.specialInterpolationSupported():
1714              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnContactZero(self.domain),self.N,self.N))                  coeff_name='d_contact'
1715                    FS=FunctionOnContactZero
1716                else:
1717                    coeff_name='d_contact_reduced'
1718                    FS=ReducedFunctionOnContactZero
1719                coeff=mypde.getCoefficient(coeff_name)
1720                self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(),mypde.getNumEquations()),((self.N,self.N),FS(self.domain),self.N,self.N))
1721              mypde.resetRightHandSideCoefficients()              mypde.resetRightHandSideCoefficients()
1722              self.assertFalse(mypde.getCoefficient("d_contact_reduced").isEmpty(),"d_contact_reduced is empty after reset of right hand side coefficients")              self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
1723    
1724      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):      def test_setCoefficient_y_contact_reduced_System_using_y_contact(self):
1725          if self.domain.supportsContactElements():          if self.domain.supportsContactElements():
1726              d=self.domain.getDim()              d=self.domain.getDim()
1727              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)              mypde=LinearPDE(self.domain,numSolutions=3,debug=self.DEBUG)
1728              mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))              mypde.setValue(y_contact=Data(numpy.ones((self.N,)),ReducedFunctionOnContactZero(self.domain)))
1729              coeff=mypde.getCoefficient("y_contact_reduced")              if self.specialInterpolationSupported():
1730              self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),ReducedFunctionOnContactZero(self.domain),self.N))                  coeff_name='y_contact'
1731                    FS=FunctionOnContactZero
1732                else:
1733                    coeff_name='y_contact_reduced'
1734                    FS=ReducedFunctionOnContactZero
1735                coeff=mypde.getCoefficient(coeff_name)
1736                self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,),FS(self.domain),self.N))
1737              mypde.resetRightHandSideCoefficients()              mypde.resetRightHandSideCoefficients()
1738              self.assertTrue(mypde.getCoefficient("y_contact_reduced").isEmpty(),"y_contact_reduced is not empty after reset of right hand side coefficients")              self.assertTrue(mypde.getCoefficient(coeff_name).isEmpty(),"%s is not empty after reset of right hand side coefficients"%coeff_name)
1739    
1740      def test_resetCoefficient_HomogeneousConstraint(self):      def test_resetCoefficient_HomogeneousConstraint(self):
1741          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
# Line 2718  class Test_LinearPDE_noLumping(Test_line Line 2848  class Test_LinearPDE_noLumping(Test_line
2848          x=self.domain.getX()[0]          x=self.domain.getX()[0]
2849          f = pde.getFlux(x)          f = pde.getFlux(x)
2850          self.assertEqual(f.getShape(),(self.domain.getDim(),),"wrong shape of result.")          self.assertEqual(f.getShape(),(self.domain.getDim(),),"wrong shape of result.")
2851          self.assertEqual(f.getFunctionSpace(),ReducedFunction(self.domain),"wrong function space")          if self.specialInterpolationSupported():
2852          f_ref=x*kronecker(self.domain)[1]*2+(5-1)*kronecker(self.domain)[0]              FS=Function
2853            else:
2854                FS=ReducedFunction
2855            self.assertEqual(f.getFunctionSpace(),FS(self.domain),"wrong function space")
2856            f_ref=Data(x*kronecker(self.domain)[1]*2+(5-1)*kronecker(self.domain)[0], ReducedFunction(self.domain))
2857          self.assertTrue(self.check(f, f_ref),"wrong result")          self.assertTrue(self.check(f, f_ref),"wrong result")
2858    
2859      def test_FluxSystem0(self):      def test_FluxSystem0(self):
# Line 2757  class Test_LinearPDE_noLumping(Test_line Line 2891  class Test_LinearPDE_noLumping(Test_line
2891          x=self.domain.getX()          x=self.domain.getX()
2892          f = pde.getFlux(x[:2])          f = pde.getFlux(x[:2])
2893          self.assertEqual(f.getShape(),(2, self.domain.getDim()),"wrong shape of result.")          self.assertEqual(f.getShape(),(2, self.domain.getDim()),"wrong shape of result.")
2894          self.assertEqual(f.getFunctionSpace(),ReducedFunction(self.domain),"wrong function space")          if self.specialInterpolationSupported():
2895                FS=Function
2896            else:
2897                FS=ReducedFunction
2898            self.assertEqual(f.getFunctionSpace(),FS(self.domain),"wrong function space")
2899          f_ref=X*(5*x[0]-1+10)          f_ref=X*(5*x[0]-1+10)
2900          self.assertTrue(self.check(f, f_ref),"wrong result")          self.assertTrue(self.check(f, f_ref),"wrong result")
2901                    
# Line 3168  class Test_TransportPDE(Test_linearPDEs) Line 3306  class Test_TransportPDE(Test_linearPDEs)
3306          d=self.domain.getDim()          d=self.domain.getDim()
3307          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
3308          mypde.setValue(M=Scalar(1.,ReducedFunction(self.domain)))          mypde.setValue(M=Scalar(1.,ReducedFunction(self.domain)))
3309          coeff=mypde.getCoefficient("M_reduced")          if self.specialInterpolationSupported():
3310          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunction(self.domain),1,1))              coeff_name='M'
3311                FS=Function
3312            else:
3313                coeff_name='M_reduced'
3314                FS=ReducedFunction
3315            coeff=mypde.getCoefficient(coeff_name)
3316            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FS(self.domain),1,1))
3317          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
3318          self.assertFalse(mypde.getCoefficient("M_reduced").isEmpty(),"M_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
3319    
3320      def test_setCoefficient_A_reduced_Scalar_usingA(self):      def test_setCoefficient_A_reduced_Scalar_usingA(self):
3321          d=self.domain.getDim()          d=self.domain.getDim()
3322          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
# Line 3232  class Test_TransportPDE(Test_linearPDEs) Line 3377  class Test_TransportPDE(Test_linearPDEs)
3377          d=self.domain.getDim()          d=self.domain.getDim()
3378          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
3379          mypde.setValue(m=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(m=Scalar(1.,ReducedFunctionOnBoundary(self.domain)))
3380          coeff=mypde.getCoefficient("m_reduced")          if self.specialInterpolationSupported():
3381          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),ReducedFunctionOnBoundary(self.domain),1,1))              coeff_name='m'
3382                FS=FunctionOnBoundary
3383            else:
3384                coeff_name='m_reduced'
3385                FS=ReducedFunctionOnBoundary
3386            coeff=mypde.getCoefficient(coeff_name)
3387            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((),FS(self.domain),1,1))
3388          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
3389          self.assertFalse(mypde.getCoefficient("m_reduced").isEmpty(),"m_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
3390    
3391      def test_setCoefficient_d_reduced_Scalar_using_d(self):      def test_setCoefficient_d_reduced_Scalar_using_d(self):
3392          d=self.domain.getDim()          d=self.domain.getDim()
3393          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
# Line 3491  class Test_TransportPDE(Test_linearPDEs) Line 3643  class Test_TransportPDE(Test_linearPDEs)
3643          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
3644          self.assertFalse(mypde.getCoefficient("q").isEmpty(),"q is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient("q").isEmpty(),"q is empty after reset of right hand side coefficients")
3645    
3646      def test_setCoefficient_M_System_reduced_using_M(self):      def test_setCoefficient_M_reduced_System_using_M(self):
3647          d=self.domain.getDim()          d=self.domain.getDim()
3648          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
3649          mypde.setValue(M=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(M=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
3650          coeff=mypde.getCoefficient("M_reduced")          if self.specialInterpolationSupported():
3651          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))              coeff_name='M'
3652                FS=Function
3653            else:
3654                coeff_name='M_reduced'
3655                FS=ReducedFunction
3656            coeff=mypde.getCoefficient(coeff_name)
3657            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FS(self.domain),self.N,self.N))
3658          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
3659          self.assertFalse(mypde.getCoefficient("M_reduced").isEmpty(),"M_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
3660    
3661      def test_setCoefficient_A_reduced_System_using_A(self):      def test_setCoefficient_A_reduced_System_using_A(self):
3662          d=self.domain.getDim()          d=self.domain.getDim()
3663          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
# Line 3523  class Test_TransportPDE(Test_linearPDEs) Line 3682  class Test_TransportPDE(Test_linearPDEs)
3682          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N,d),ReducedFunction(self.domain),self.N,self.N))
3683          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
3684          self.assertFalse(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient("C_reduced").isEmpty(),"C_reduced is empty after reset of right hand side coefficients")
3685      def test_setCoefficient_D_System_reduced_using_D(self):      def test_setCoefficient_D_reduced_System_using_D(self):
3686          d=self.domain.getDim()          d=self.domain.getDim()
3687          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
3688          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))          mypde.setValue(D=Data(numpy.ones((self.N,self.N)),ReducedFunction(self.domain)))
# Line 3531  class Test_TransportPDE(Test_linearPDEs) Line 3690  class Test_TransportPDE(Test_linearPDEs)
3690          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunction(self.domain),self.N,self.N))
3691          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
3692          self.assertFalse(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient("D_reduced").isEmpty(),"D_reduced is empty after reset of right hand side coefficients")
3693      def test_setCoefficient_X_System_reduced_using_X(self):      def test_setCoefficient_X_reduced_System_using_X(self):
3694          d=self.domain.getDim()          d=self.domain.getDim()
3695          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
3696          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))          mypde.setValue(X=Data(numpy.ones((self.N,d)),ReducedFunction(self.domain)))
# Line 3539  class Test_TransportPDE(Test_linearPDEs) Line 3698  class Test_TransportPDE(Test_linearPDEs)
3698          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumEquations()),((self.N,d),ReducedFunction(self.domain),self.N))
3699          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
3700          self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty after reset of right hand side coefficients")          self.assertTrue(mypde.getCoefficient("X_reduced").isEmpty(),"X_reduced is not empty after reset of right hand side coefficients")
3701      def test_setCoefficient_Y_System_reduced_using_Y(self):      def test_setCoefficient_Y_reduced_System_using_Y(self):
3702          d=self.domain.getDim()          d=self.domain.getDim()
3703          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)          mypde=TransportPDE(self.domain,numSolutions=3,debug=self.DEBUG)
3704          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))          mypde.setValue(Y=Data(numpy.ones((self.N,)),ReducedFunction(self.domain)))
# Line 3559  class Test_TransportPDE(Test_linearPDEs) Line 3718  class Test_TransportPDE(Test_linearPDEs)
3718          d=self.domain.getDim()          d=self.domain.getDim()
3719          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)
3720          mypde.setValue(m=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))          mypde.setValue(m=Data(numpy.ones((self.N,self.N)),ReducedFunctionOnBoundary(self.domain)))
3721          coeff=mypde.getCoefficient("m_reduced")          if self.specialInterpolationSupported():
3722          self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),ReducedFunctionOnBoundary(self.domain),self.N,self.N))              coeff_name='m'
3723                FS=FunctionOnBoundary
3724            else:
3725                coeff_name='m_reduced'
3726                FS=ReducedFunctionOnBoundary
3727            coeff=mypde.getCoefficient(coeff_name)
3728            self.assertEqual((coeff.getShape(),coeff.getFunctionSpace(), mypde.getNumSolutions(), mypde.getNumEquations()),((self.N,self.N),FS(self.domain),self.N,self.N))
3729          mypde.resetRightHandSideCoefficients()          mypde.resetRightHandSideCoefficients()
3730          self.assertFalse(mypde.getCoefficient("m_reduced").isEmpty(),"m_reduced is empty after reset of right hand side coefficients")          self.assertFalse(mypde.getCoefficient(coeff_name).isEmpty(),"%s is empty after reset of right hand side coefficients"%coeff_name)
3731    
3732      def test_setCoefficient_d_reduced_System_using_d(self):      def test_setCoefficient_d_reduced_System_using_d(self):
3733          d=self.domain.getDim()          d=self.domain.getDim()
3734          mypde=TransportPDE(self.domain,debug=self.DEBUG)          mypde=TransportPDE(self.domain,debug=self.DEBUG)

Legend:
Removed from v.4154  
changed lines
  Added in v.4219

  ViewVC Help
Powered by ViewVC 1.1.26