63 |
self.vol=util.integrate(1.,Function(self.domain)) |
self.vol=util.integrate(1.,Function(self.domain)) |
64 |
self.__pde_u=LinearPDE(domain,numEquations=self.domain.getDim(),numSolutions=self.domain.getDim()) |
self.__pde_u=LinearPDE(domain,numEquations=self.domain.getDim(),numSolutions=self.domain.getDim()) |
65 |
self.__pde_u.setSymmetryOn() |
self.__pde_u.setSymmetryOn() |
66 |
# self.__pde_u.setSolverMethod(preconditioner=LinearPDE.ILU0) |
self.__pde_u.setSolverMethod(preconditioner=LinearPDE.ILU0) |
67 |
|
|
68 |
self.__pde_prec=LinearPDE(domain) |
self.__pde_prec=LinearPDE(domain) |
69 |
self.__pde_prec.setReducedOrderOn() |
self.__pde_prec.setReducedOrderOn() |
123 |
return True |
return True |
124 |
else: |
else: |
125 |
return False |
return False |
126 |
def stoppingcriterium2(self,norm_r,norm_b,solver='GMRES'): |
def stoppingcriterium2(self,norm_r,norm_b,solver='GMRES',TOL=None): |
127 |
if self.verbose: print "%s step %s: L2(r) = %s, L2(b)*TOL=%s"%(solver,self.iter,norm_r,norm_b*self.getTolerance()) |
if TOL==None: |
128 |
|
TOL=self.getTolerance() |
129 |
|
if self.verbose: print "%s step %s: L2(r) = %s, L2(b)*TOL=%s"%(solver,self.iter,norm_r,norm_b*TOL) |
130 |
self.iter+=1 |
self.iter+=1 |
131 |
if norm_r <= norm_b*self.getTolerance(): |
|
132 |
|
if norm_r <= norm_b*TOL: |
133 |
if self.verbose: print "%s terminated after %s steps."%(solver,self.iter) |
if self.verbose: print "%s terminated after %s steps."%(solver,self.iter) |
134 |
return True |
return True |
135 |
else: |
else: |