1411 |
u2=mypde.getSolution() |
u2=mypde.getSolution() |
1412 |
self.failUnless(self.check(u2,2*u1),'second solution is wrong.') |
self.failUnless(self.check(u2,2*u1),'second solution is wrong.') |
1413 |
|
|
1414 |
|
def test_Status(self): |
1415 |
|
DIM=self.domain.getDim() |
1416 |
|
x=self.domain.getX() |
1417 |
|
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
1418 |
|
mypde.getSolverOptions().setSymmetryOn() |
1419 |
|
mypde.getSolverOptions().setTolerance(self.RES_TOL) |
1420 |
|
mypde.setValue(A=kronecker(self.domain), q=whereZero(x[0])+whereZero(x[0]-1.), Y=2.) |
1421 |
|
x1=self.domain.getX() |
1422 |
|
u1_ref=x1[0]*(1.-x1[0]) |
1423 |
|
u1=mypde.getSolution() |
1424 |
|
error1=Lsup(u1-u1_ref)/Lsup(u1_ref) |
1425 |
|
self.failUnless(mypde.getDomainStatus() == mypde.getSystemStatus(), "status of first pde does not match domain status.") |
1426 |
|
|
1427 |
|
self.domain.setX(x*5) |
1428 |
|
|
1429 |
|
self.failUnless(mypde.getDomainStatus() != mypde.getSystemStatus(), "status of first pde matches updated domain status.") |
1430 |
|
x2=self.domain.getX() |
1431 |
|
u2_ref=x2[0]*(5.-x2[0]) |
1432 |
|
u2=mypde.getSolution() |
1433 |
|
error2=Lsup(u2-u2_ref)/Lsup(u2_ref) |
1434 |
|
self.failUnless(error2 <= max(error1,self.RES_TOL)*10., "solution of second PDE wrong.") |
1435 |
|
self.failUnless(mypde.getDomainStatus() == mypde.getSystemStatus(), "status of second pde does not match domain status.") |
1436 |
|
|
1437 |
def test_symmetryCheckTrue_System(self): |
def test_symmetryCheckTrue_System(self): |
1438 |
d=self.domain.getDim() |
d=self.domain.getDim() |
1439 |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |