/[escript]/trunk/escript/py_src/flows.py
ViewVC logotype

Diff of /trunk/escript/py_src/flows.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1465 by artak, Wed Apr 2 03:28:25 2008 UTC revision 1517 by artak, Fri Apr 18 02:36:37 2008 UTC
# Line 63  class StokesProblemCartesian(Homogeneous Line 63  class StokesProblemCartesian(Homogeneous
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()
# Line 105  class StokesProblemCartesian(Homogeneous Line 105  class StokesProblemCartesian(Homogeneous
105           solves Av=f-Au-B^*p (v=0 on fixed_u_mask)           solves Av=f-Au-B^*p (v=0 on fixed_u_mask)
106           """           """
107           self.__pde_u.setTolerance(self.getSubProblemTolerance())           self.__pde_u.setTolerance(self.getSubProblemTolerance())
108           self.__pde_u.setValue(X=-self.getStress(u)+p*util.kronecker(self.domain))           self.__pde_u.setValue(X=-self.getStress(u)-p*util.kronecker(self.domain))
109           return  self.__pde_u.getSolution(verbose=self.show_details)           return  self.__pde_u.getSolution(verbose=self.show_details)
110    
111        def solve_prec(self,p):        def solve_prec(self,p):
# Line 123  class StokesProblemCartesian(Homogeneous Line 123  class StokesProblemCartesian(Homogeneous
123                return True                return True
124            else:            else:
125                return False                return False
126        def stoppingcriterium_GMRES(self,rho,r):        def stoppingcriterium2(self,norm_r,norm_b,solver='GMRES'):
127            if self.verbose: print "GMRES step %s: L2(rho) = %s, L2(b)*TOL=%s"%(self.iter,rho,r*self.getTolerance())        if self.verbose: print "%s step %s: L2(r) = %s, L2(b)*TOL=%s"%(solver,self.iter,norm_r,norm_b*self.getTolerance())
128            self.iter+=1            self.iter+=1
129            if rho <= r*self.getTolerance():            if norm_r <= norm_b*self.getTolerance():
130                if self.verbose: print "GMRES terminated after %s steps."%self.iter                if self.verbose: print "%s terminated after %s steps."%(solver,self.iter)
131                return True                return True
132            else:            else:
133                return False                return False
134    
135    

Legend:
Removed from v.1465  
changed lines
  Added in v.1517

  ViewVC Help
Powered by ViewVC 1.1.26