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

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

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

revision 727 by gross, Fri May 12 06:31:06 2006 UTC revision 969 by ksteube, Tue Feb 13 23:02:23 2007 UTC
# Line 413  class LinearPDE(object): Line 413  class LinearPDE(object):
413     @cvar SCSL: SGI SCSL solver library     @cvar SCSL: SGI SCSL solver library
414     @cvar MKL: Intel's MKL solver library     @cvar MKL: Intel's MKL solver library
415     @cvar UMFPACK: the UMFPACK library     @cvar UMFPACK: the UMFPACK library
416       @cvar TRILINOS: the TRILINOS parallel solver class library from Sandia Natl Labs
417     @cvar ITERATIVE: The default iterative solver     @cvar ITERATIVE: The default iterative solver
418     @cvar AMG: algebraic multi grid     @cvar AMG: algebraic multi grid
419     @cvar RILU: recursive ILU     @cvar RILU: recursive ILU
# Line 442  class LinearPDE(object): Line 443  class LinearPDE(object):
443     PASO= 21     PASO= 21
444     AMG= 22     AMG= 22
445     RILU = 23     RILU = 23
446       TRILINOS = 24
447    
448     SMALL_TOLERANCE=1.e-13     SMALL_TOLERANCE=1.e-13
449     __PACKAGE_KEY="package"     __PACKAGE_KEY="package"
# Line 664  class LinearPDE(object): Line 666  class LinearPDE(object):
666       @rtype: L{Data<escript.Data>}       @rtype: L{Data<escript.Data>}
667       """       """
668       if u==None:       if u==None:
669            return self.getOperator()*self.getSolution()          return self.getOperator()*self.getSolution()
670       else:       else:
671          self.getOperator()*escript.Data(u,self.getFunctionSpaceForSolution())          return self.getOperator()*escript.Data(u,self.getFunctionSpaceForSolution())
672    
673     def getResidual(self,u=None):     def getResidual(self,u=None):
674       """       """
# Line 868  class LinearPDE(object): Line 870  class LinearPDE(object):
870         elif p==self.MKL: package= "MKL"         elif p==self.MKL: package= "MKL"
871         elif p==self.SCSL: package= "SCSL"         elif p==self.SCSL: package= "SCSL"
872         elif p==self.UMFPACK: package= "UMFPACK"         elif p==self.UMFPACK: package= "UMFPACK"
873           elif p==self.TRILINOS: package= "TRILINOS"
874         else : method="unknown"         else : method="unknown"
875         return "%s solver of %s package"%(method,package)         return "%s solver of %s package"%(method,package)
876    
# Line 886  class LinearPDE(object): Line 889  class LinearPDE(object):
889         sets a new solver package         sets a new solver package
890    
891         @param package: sets a new solver method.         @param package: sets a new solver method.
892         @type package: one of L{DEFAULT}, L{PASO} L{SCSL}, L{MKL}, L{UMFPACK}         @type package: one of L{DEFAULT}, L{PASO} L{SCSL}, L{MKL}, L{UMFPACK}, L{TRILINOS}
893         """         """
894         if package==None: package=self.DEFAULT         if package==None: package=self.DEFAULT
895         if not package==self.getSolverPackage():         if not package==self.getSolverPackage():
# Line 923  class LinearPDE(object): Line 926  class LinearPDE(object):
926         @param tol: new tolerance for the solver. If the tol is lower then the current tolerence         @param tol: new tolerance for the solver. If the tol is lower then the current tolerence
927                     the system will be resolved.                     the system will be resolved.
928         @type tol: positive C{float}         @type tol: positive C{float}
929         @raise ValueException: if tolerance is not positive.         @raise ValueError: if tolerance is not positive.
930         """         """
931         if not tol>0:         if not tol>0:
932             raise ValueException,"Tolerance as to be positive"             raise ValueError,"Tolerance as to be positive"
933         if tol<self.getTolerance(): self.__invalidateSolution()         if tol<self.getTolerance(): self.__invalidateSolution()
934         self.trace("New tolerance %e"%tol)         self.trace("New tolerance %e"%tol)
935         self.__tolerance=tol         self.__tolerance=tol
# Line 1513  class LinearPDE(object): Line 1516  class LinearPDE(object):
1516           r=self.getCoefficientOfGeneralPDE("r")           r=self.getCoefficientOfGeneralPDE("r")
1517           homogeneous_constraint=True           homogeneous_constraint=True
1518           if not q.isEmpty() and not r.isEmpty():           if not q.isEmpty() and not r.isEmpty():
1519               if util.Lsup(q*r)>=1.e-13*util.Lsup(r):               if util.Lsup(q*r)>0.:
1520                 self.trace("Inhomogeneous constraint detected.")                 self.trace("Inhomogeneous constraint detected.")
1521                 self.__invalidateSystem()                 self.__invalidateSystem()
1522    
# Line 1538  class LinearPDE(object): Line 1541  class LinearPDE(object):
1541                   D=self.getCoefficientOfGeneralPDE("D")                   D=self.getCoefficientOfGeneralPDE("D")
1542                   if not D.isEmpty():                   if not D.isEmpty():
1543                       if self.getNumSolutions()>1:                       if self.getNumSolutions()>1:
1544                          D_times_e=util.matrixmult(D,numarray.ones((self.getNumSolutions(),)))                          #D_times_e=util.matrixmult(D,numarray.ones((self.getNumSolutions(),)))
1545                            D_times_e=util.matrix_mult(D,numarray.ones((self.getNumSolutions(),)))
1546                       else:                       else:
1547                          D_times_e=D                          D_times_e=D
1548                   else:                   else:
# Line 1546  class LinearPDE(object): Line 1550  class LinearPDE(object):
1550                   d=self.getCoefficientOfGeneralPDE("d")                   d=self.getCoefficientOfGeneralPDE("d")
1551                   if not d.isEmpty():                   if not d.isEmpty():
1552                       if self.getNumSolutions()>1:                       if self.getNumSolutions()>1:
1553                          d_times_e=util.matrixmult(d,numarray.ones((self.getNumSolutions(),)))                          #d_times_e=util.matrixmult(d,numarray.ones((self.getNumSolutions(),)))
1554                            d_times_e=util.matrix_mult(d,numarray.ones((self.getNumSolutions(),)))
1555                       else:                       else:
1556                          d_times_e=d                          d_times_e=d
1557                   else:                   else:

Legend:
Removed from v.727  
changed lines
  Added in v.969

  ViewVC Help
Powered by ViewVC 1.1.26