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

revision 1204 by gross, Sat Jun 23 11:43:12 2007 UTC revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC
# Line 1  Line 1
1    #
2  # \$Id\$  # \$Id\$
3    #
4    #######################################################
5    #
6    #           Copyright 2003-2007 by ACceSS MNRF
7    #       Copyright 2007 by University of Queensland
8    #
9    #                http://esscc.uq.edu.au
10    #        Primary Business: Queensland, Australia
13    #
14    #######################################################
15    #
16
17  """  """
18  The module provides an interface to define and solve linear partial  The module provides an interface to define and solve linear partial
19  differential equations (PDEs) within L{escript}. L{linearPDEs} does not provide any  differential equations (PDEs) within L{escript}. L{linearPDEs} does not provide any
# Line 112  class PDECoefficient(object): Line 127  class PDECoefficient(object):
127         @param reduced: indicates if reduced         @param reduced: indicates if reduced
128         @type reduced: C{bool}         @type reduced: C{bool}
129         """         """

130         super(PDECoefficient, self).__init__()         super(PDECoefficient, self).__init__()
131         self.what=where         self.what=where
132         self.pattern=pattern         self.pattern=pattern
# Line 365  class LinearPDE(object): Line 379  class LinearPDE(object):
379
380     The PDE is symmetrical if     The PDE is symmetrical if
381
382     M{A[i,j]=A[j,i]}  and M{B[j]=C[j]} and M{A_reduced[i,j]=A_reduced[j,i]}  and M{B_reduced[j]=C_reduced[j]     M{A[i,j]=A[j,i]}  and M{B[j]=C[j]} and M{A_reduced[i,j]=A_reduced[j,i]}  and M{B_reduced[j]=C_reduced[j]}
383
384     For a system of PDEs and a solution with several components the PDE has the form     For a system of PDEs and a solution with several components the PDE has the form
385
# Line 416  class LinearPDE(object): Line 430  class LinearPDE(object):
430     of the solution at side 1 and at side 0, denotes the jump of M{u} across discontinuity along the normal calcualted by     of the solution at side 1 and at side 0, denotes the jump of M{u} across discontinuity along the normal calcualted by
431     L{jump<util.jump>}.     L{jump<util.jump>}.
432     The coefficient M{d_contact} is a rank two and M{y_contact} is a rank one both in the L{FunctionOnContactZero<escript.FunctionOnContactZero>} or L{FunctionOnContactOne<escript.FunctionOnContactOne>}.     The coefficient M{d_contact} is a rank two and M{y_contact} is a rank one both in the L{FunctionOnContactZero<escript.FunctionOnContactZero>} or L{FunctionOnContactOne<escript.FunctionOnContactOne>}.
433      The coefficient M{d_contact_reduced} is a rank two and M{y_contact_reduced} is a rank one both in the L{ReducedFunctionOnContactZero<escript.ReducedFunctionOnContactZero>} or L{ReducedFunctionOnContactOne<escript.ReducedFunctionOnContactOne>}.     The coefficient M{d_contact_reduced} is a rank two and M{y_contact_reduced} is a rank one both in the L{ReducedFunctionOnContactZero<escript.ReducedFunctionOnContactZero>} or L{ReducedFunctionOnContactOne<escript.ReducedFunctionOnContactOne>}.
434     In case of a single PDE and a single component solution the contact condition takes the form     In case of a single PDE and a single component solution the contact condition takes the form
435
436     M{n[j]*J0_{j}=n[j]*J1_{j}=(y_contact+y_contact_reduced)-(d_contact+y_contact_reduced)*jump(u)}     M{n[j]*J0_{j}=n[j]*J1_{j}=(y_contact+y_contact_reduced)-(d_contact+y_contact_reduced)*jump(u)}
# Line 444  class LinearPDE(object): Line 458  class LinearPDE(object):
458     @cvar SCSL: SGI SCSL solver library     @cvar SCSL: SGI SCSL solver library
459     @cvar MKL: Intel's MKL solver library     @cvar MKL: Intel's MKL solver library
460     @cvar UMFPACK: the UMFPACK library     @cvar UMFPACK: the UMFPACK library
461       @cvar TRILINOS: the TRILINOS parallel solver class library from Sandia Natl Labs
462     @cvar ITERATIVE: The default iterative solver     @cvar ITERATIVE: The default iterative solver
463     @cvar AMG: algebraic multi grid     @cvar AMG: algebraic multi grid
464     @cvar RILU: recursive ILU     @cvar RILU: recursive ILU
# Line 473  class LinearPDE(object): Line 488  class LinearPDE(object):
488     PASO= 21     PASO= 21
489     AMG= 22     AMG= 22
490     RILU = 23     RILU = 23
491       TRILINOS = 24
492
493     SMALL_TOLERANCE=1.e-13     SMALL_TOLERANCE=1.e-13
494     __PACKAGE_KEY="package"     __PACKAGE_KEY="package"
# Line 935  class LinearPDE(object): Line 951  class LinearPDE(object):
951         @param preconditioner: sets a new solver method.         @param preconditioner: sets a new solver method.
952         @type preconditioner: one of L{DEFAULT}, L{JACOBI} L{ILU0}, L{ILUT},L{SSOR}, L{RILU}         @type preconditioner: one of L{DEFAULT}, L{JACOBI} L{ILU0}, L{ILUT},L{SSOR}, L{RILU}
953         """         """
954         if solver==None: solve=self.DEFAULT         if solver==None: solver=self.__solver_method
955           if preconditioner==None: preconditioner=self.__preconditioner
956           if solver==None: solver=self.DEFAULT
957         if preconditioner==None: preconditioner=self.DEFAULT         if preconditioner==None: preconditioner=self.DEFAULT
958         if not (solver,preconditioner)==self.getSolverMethod():         if not (solver,preconditioner)==self.getSolverMethod():
959             self.__solver_method=solver             self.__solver_method=solver
# Line 979  class LinearPDE(object): Line 997  class LinearPDE(object):
997         elif p==self.MKL: package= "MKL"         elif p==self.MKL: package= "MKL"
998         elif p==self.SCSL: package= "SCSL"         elif p==self.SCSL: package= "SCSL"
999         elif p==self.UMFPACK: package= "UMFPACK"         elif p==self.UMFPACK: package= "UMFPACK"
1000           elif p==self.TRILINOS: package= "TRILINOS"
1001         else : method="unknown"         else : method="unknown"
1002         return "%s solver of %s package"%(method,package)         return "%s solver of %s package"%(method,package)
1003
# Line 997  class LinearPDE(object): Line 1016  class LinearPDE(object):
1016         sets a new solver package         sets a new solver package
1017
1018         @param package: sets a new solver method.         @param package: sets a new solver method.
1019         @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}
1020         """         """
1021         if package==None: package=self.DEFAULT         if package==None: package=self.DEFAULT
1022         if not package==self.getSolverPackage():         if not package==self.getSolverPackage():

Legend:
 Removed from v.1204 changed lines Added in v.1312