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

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

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

revision 1659 by gross, Fri Jul 18 02:28:13 2008 UTC revision 1679 by artak, Wed Jul 30 00:09:12 2008 UTC
# Line 396  class PlateMantelModel(HomogeneousSaddle Line 396  class PlateMantelModel(HomogeneousSaddle
396           self.__pde_u.setValue(X=-self.getStressChange(u)-p*util.kronecker(self.getDomain()))           self.__pde_u.setValue(X=-self.getStressChange(u)-p*util.kronecker(self.getDomain()))
397           return  self.__pde_u.getSolution(verbose=self.show_details)           return  self.__pde_u.getSolution(verbose=self.show_details)
398    
399    ##############Added by Artak ##########################
400          def inner_a(self,a0,a1):
401             p0=util.interpolate(a0[1],Function(self.domain))
402             p1=util.interpolate(a1[1],Function(self.domain))
403             alfa=(1/self.vol)*util.integrate(p0)
404             beta=(1/self.vol)*util.integrate(p1)
405         v0=util.grad(a0[0])
406         v1=util.grad(a1[0])
407             return util.integrate((p0-alfa)*(p1-beta)+((1/self.eta)**2)*util.inner(v0,v1))
408    
409        def stoppingcriterium(self,Bv,v,p):        def stoppingcriterium(self,Bv,v,p):
410            n_r=util.sqrt(self.inner(Bv,Bv))            n_r=util.sqrt(self.inner(Bv,Bv))
# Line 409  class PlateMantelModel(HomogeneousSaddle Line 418  class PlateMantelModel(HomogeneousSaddle
418                return True                return True
419            else:            else:
420                return False                return False
421    
422          def stoppingcriterium2(self,norm_r,norm_b,solver='GMRES',TOL=None):
423          if TOL==None:
424                 TOL=self.getTolerance()
425              if self.verbose: print "%s step %s: L2(r) = %s, L2(b)*TOL=%s"%(solver,self.iter,norm_r,norm_b*TOL)
426              self.iter+=1
427              
428              if norm_r <= norm_b*TOL:
429                  if self.verbose: print "%s terminated after %s steps."%(solver,self.iter)
430                  return True
431              else:
432                  return False
433    
434    ######################################################

Legend:
Removed from v.1659  
changed lines
  Added in v.1679

  ViewVC Help
Powered by ViewVC 1.1.26