341 |
|
|
342 |
def test_resetCoefficient_InHomogeneousConstraint(self): |
def test_resetCoefficient_InHomogeneousConstraint(self): |
343 |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
344 |
|
mypde.setSymmetryOn() |
345 |
x=self.domain.getX() |
x=self.domain.getX() |
346 |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.,r=1,q=x[0].whereZero()) |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.,r=1,q=x[0].whereZero()) |
347 |
u1=mypde.getSolution() |
u1=mypde.getSolution(verbose=self.VERBOSE) |
348 |
mypde.setValue(Y=2.,D=2) |
mypde.setValue(Y=2.,D=2) |
349 |
u2=mypde.getSolution() |
u2=mypde.getSolution(verbose=self.VERBOSE) |
350 |
self.failUnless(self.check(u2,u1),'solution is wrong.') |
self.failUnless(self.check(u2,u1),'first solution is wrong.') |
351 |
|
u2=mypde.getSolution(verbose=self.VERBOSE) |
352 |
|
self.failUnless(self.check(u2,u1),'first solution is wrong.') |
353 |
mypde.setValue(r=2,Y=4.) |
mypde.setValue(r=2,Y=4.) |
354 |
u2=mypde.getSolution() |
u2=mypde.getSolution(verbose=self.VERBOSE) |
355 |
self.failUnless(self.check(u2,2*u1),'solution is wrong.') |
self.failUnless(self.check(u2,2*u1),'second solution is wrong.') |
356 |
|
|
357 |
def test_symmetryCheckTrue_System(self): |
def test_symmetryCheckTrue_System(self): |
358 |
d=self.domain.getDim() |
d=self.domain.getDim() |
460 |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
461 |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.) |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.) |
462 |
mypde.setSolverMethod(mypde.DIRECT) |
mypde.setSolverMethod(mypde.DIRECT) |
463 |
u=mypde.getSolution(verbose=self.VERBOSE,preconditioner=mypde.ILU0) |
u=mypde.getSolution(verbose=self.VERBOSE) |
464 |
self.failUnless(self.check(u,1.),'solution is wrong.') |
self.failUnless(self.check(u,1.),'solution is wrong.') |
465 |
def test_BICGSTAB_JACOBI(self): |
def test_BICGSTAB_JACOBI(self): |
466 |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
490 |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
491 |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.) |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.) |
492 |
mypde.setSolverMethod(mypde.GMRES) |
mypde.setSolverMethod(mypde.GMRES) |
493 |
|
# u=mypde.getSolution(verbose=self.VERBOSE,preconditioner=mypde.JACOBI,truncation=5) |
494 |
u=mypde.getSolution(verbose=self.VERBOSE,preconditioner=mypde.JACOBI) |
u=mypde.getSolution(verbose=self.VERBOSE,preconditioner=mypde.JACOBI) |
495 |
self.failUnless(self.check(u,1.),'solution is wrong.') |
self.failUnless(self.check(u,1.),'solution is wrong.') |
496 |
def test_GMRESnoRestart_ILU0(self): |
def test_GMRESnoRestart_ILU0(self): |
497 |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
498 |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.) |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.) |
499 |
mypde.setSolverMethod(mypde.GMRES) |
mypde.setSolverMethod(mypde.GMRES) |
500 |
|
# u=mypde.getSolution(verbose=self.VERBOSE,preconditioner=mypde.ILU0,truncation=5) |
501 |
u=mypde.getSolution(verbose=self.VERBOSE,preconditioner=mypde.ILU0) |
u=mypde.getSolution(verbose=self.VERBOSE,preconditioner=mypde.ILU0) |
502 |
self.failUnless(self.check(u,1.),'solution is wrong.') |
self.failUnless(self.check(u,1.),'solution is wrong.') |
503 |
def test_GMRES_JACOBI(self): |
def test_GMRES_JACOBI(self): |
522 |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
523 |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.) |
mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.) |
524 |
mypde.setSolverMethod(mypde.GMRES) |
mypde.setSolverMethod(mypde.GMRES) |
525 |
mypde.setTolerance(1.e-12) |
u=mypde.getSolution(verbose=self.VERBOSE,preconditioner=mypde.ILU0,truncation=10,restart=20) |
|
u=mypde.getSolution(verbose=self.VERBOSE or True,preconditioner=mypde.ILU0,truncation=10,restart=20) |
|
526 |
self.failUnless(self.check(u,1.),'solution is wrong.') |
self.failUnless(self.check(u,1.),'solution is wrong.') |
527 |
def test_Lumping_attemptToSetA(self): |
def test_Lumping_attemptToSetA(self): |
528 |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |
mypde=LinearPDE(self.domain,debug=self.DEBUG) |