| Home | Trees | Index | Help |
|---|
| Package esys :: Package escript :: Module linearPDEs :: Class LinearPDE |
|
object --+
|
LinearPDE
AdvectivePDE,
Helmholtz,
LameEquation,
PoissonThis class is used to define a general linear, steady, second order
PDE for an unknown function u on a given domain
defined through a Domain object.
For a single PDE with a solution with a single component the linear PDE is defined in the following form:
-grad(A[j,l]*grad(u)[l]+B[j]u)[j]+C[l]*grad(u)[l]+D*u =-grad(X)[j,j]+Y
where grad(F) denotes the spatial derivative of F. Einstein's summation convention, ie. summation over
indexes appearing twice in a term of a sum is performed, is used. The
coefficients A, B, C, D, X and Y have to be specified through Data objects
in the Function on the PDE or objects that can be
converted into such Data objects. A is a
rank two, B, C and X are rank one and D and Y are scalar.
The following natural boundary conditions are considered:
n[j]*(A[i,j]*grad(u)[l]+B[j]*u)+d*u=n[j]*X[j]+y
where n is the outer normal field calculated by
getNormal of FunctionOnBoundary. Notice that the
coefficients A, B and X are defined in the PDE. The coefficients d and y are each a scalar in the FunctionOnBoundary.
Constraints for the solution prescribing the value of the solution at certain locations in the domain. They have the form
u=r where q>0
r and q are each scalar where q is the characteristic function defining where the constraint is applied. The constraints override any other condition set by the PDE or the boundary condition.
The PDE is symmetrical if
A[i,j]=A[j,i] and B[j]=C[j]
For a system of PDEs and a solution with several components the PDE has the form
-grad(A[i,j,k,l]*grad(u[k])[l]+B[i,j,k]*u[k])[j]+C[i,k,l]*grad(u[k])[l]+D[i,k]*u[k] =-grad(X[i,j])[j]+Y[i]
A is a ramk four, B and C are each a rank three, D and X are each a rank two and Y is a rank one. The natural boundary conditions take the form:
n[j]*(A[i,j,k,l]*grad(u[k])[l]+B[i,j,k]*u[k])+d[i,k]*u[k]=n[j]*X[i,j]+y[i]
The coefficient d is a rank two and y is a rank one both in the FunctionOnBoundary. Constraints take the
form
u[i]=r[i] where q[i]>0
r and q are each rank one. Notice that at some locations not necessarily all components must have a constraint.
The system of PDEs is symmetrical ifLinearPDE also supports solution
discontinuities over a contact region in the domain. To specify the
conditions across the discontinuity we are using the generalised flux J which is in the case of a systems of PDEs and several
components of the solution defined as
J[i,j]=A[i,j,k,l]*grad(u[k])[l]+B[i,j,k]*u[k]-X[i,j]
For the case of single solution component and single PDE J is defined
J_{j}=A[i,j]*grad(u)[j]+B[i]*u-X[i]
In the context of discontinuities n denotes the
normal on the discontinuity pointing from side 0 towards side 1
calculated from getNormal of FunctionOnContactZero. For a system of PDEs
the contact condition takes the form
n[j]*J0[i,j]=n[j]*J1[i,j]=y_contact[i]- d_contact[i,k]*jump(u)[k]
where J0 and J1 are the fluxes
on side 0 and side 1 of the discontinuity, respectively. jump(u), which is the difference of the solution at side
1 and at side 0, denotes the jump of u across
discontinuity along the normal calcualted by jump. The coefficient d_contact is a rank two and y_contact is a rank one both in the FunctionOnContactZero or FunctionOnContactOne. In case of a single
PDE and a single component solution the contact condition takes the
form
n[j]*J0_{j}=n[j]*J1_{j}=y_contact-d_contact*jump(u)
In this case the the coefficient d_contact and y_contact are eaach scalar both in theFunctionOnContactZero or FunctionOnContactOne.
| Method Summary | |
|---|---|
initializes a new linear PDE | |
str
|
returns string representation of the PDE |
announce that coefficient name has been changed | |
Data
|
applies the operator of the PDE to a given u or the solution of PDE if u is not present. |
Data
|
test the PDE for symmetry. |
Data
|
copies the constraint into u and returns u. |
Data
|
create a Data object corresponding to coefficient
name |
Data
|
returns a new instance of a coefficient for coefficient name of the general PDE |
Data
|
returns the value of the coefficient name |
Data
|
return the value of the coefficient name of the general PDE. |
int
|
returns the spatial dimension of the PDE |
Domain
|
returns the domain of the PDE |
Data
|
returns the flux J for a given u |
FunctionSpace
|
return the FunctionSpace to be used for coefficient
name |
FunctionSpace
|
return the FunctionSpace to be used for coefficient name
of the general PDE |
FunctionSpace
|
returns the FunctionSpace used to discretize the
equation |
FunctionSpace
|
returns the FunctionSpace used to represent the
solution |
int
|
returns the number of equations |
int
|
returns the number of unknowns |
Operator
|
provides access to the operator of the PDE |
Data
|
return the residual of u or the current solution if u is not present. |
Data
|
provides access to the right hand side of the PDE |
tuple of int
|
return the shape of the coefficient name |
tuple of int
|
return the shape of the coefficient name of the general PDE |
Data
|
returns the solution of the PDE. |
int
|
returns the solver method |
string
|
returns the name of the solver currently used |
int
|
returns the package of the solver |
tuple of Operator, and
Data.
|
return the operator and right hand side of the PDE |
float
|
returns the tolerance set for the solution |
bool
|
return True if name is the name of a coefficient |
bool
|
checks if name is a the name of a coefficient of the general PDE. |
bool
|
checks if symmetry is indicated. |
bool
|
checks if matrix lumping is used a solver method |
bool
|
return status for order reduction for equation |
bool
|
return status for order reduction for the solution |
resets all coefficients to there default values. | |
switches off debugging | |
switches on debugging | |
switches off reduced order for equation representation | |
switches on reduced order for equation representation | |
sets order for test functions according to flag | |
switches off reduced order for solution representation | |
switches on reduced order for solution representation | |
sets order for test functions according to flag | |
switches off reduced order for solution and equation representation | |
switches on reduced order for solution and equation representation | |
sets order reduction for both solution and equation representation according to flag. | |
sets a new solver | |
sets a new solver package | |
removes the symmetry flag. | |
sets the symmetry flag. | |
sets the symmetry flag to flag | |
resets the tolerance for the solver method to tol where for an appropriate norm |.| | |
sets new values to coefficients | |
print the text message if debugging is swiched on. | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
| Class Variable Summary | |
|---|---|
int |
AMG: algebraic multi grid |
int |
BICGSTAB: The stabilized BiConjugate Gradient method. |
int |
CGS: The conjugate gardient square method |
int |
CHOLEVSKY: The direct solver based on LDLt factorization (can only be applied for
symmetric PDEs) |
int |
CR: The conjugate residual method |
int |
DEFAULT: The default method used to solve the system of linear equations |
int |
DIRECT: The direct solver based on LDU factorization |
int |
GMRES: The Gram-Schmidt minimum residual method |
int |
ILU0: The incomplete LU factorization preconditioner with no fill in |
int |
ILUT: The incomplete LU factorization preconditioner with will in |
int |
ITERATIVE: The default iterative solver |
int |
JACOBI: The Jacobi preconditioner |
int |
LUMPING: Matrix lumping. |
int |
MINIMUM_FILL_IN: Reorder matrix to reduce fill-in during factorization |
int |
MKL: Intel's MKL solver library |
int |
NESTED_DISSECTION: Reorder matrix to improve load balancing during factorization |
int |
NO_REORDERING: No matrix reordering allowed |
int |
PASO: PASO solver package |
int |
PCG: The preconditioned conjugate gradient method (can only be applied for
symmetric PDEs) |
int |
PRES20: Special GMRES with restart after 20 steps and truncation after 5
residuals |
int |
RILU: recursive ILU |
int |
SCSL: SGI SCSL solver library |
float |
SMALL_TOLERANCE = 1e-13 |
int |
SSOR: The symmetric overrealaxtion method |
int |
UMFPACK: the UMFPACK library |
| Method Details |
|---|
__init__(self,
domain,
numEquations=None,
numSolutions=None,
debug=False)
initializes a new linear PDE
|
__str__(self)
returns string representation of the PDE
|
alteredCoefficient(self, name)announce that coefficient name has been changed
|
applyOperator(self, u=None)applies the operator of the PDE to a given u or the solution of PDE if u is not present.
|
checkSymmetry(self, verbose=True)test the PDE for symmetry.
|
copyConstraint(self, u)copies the constraint into u and returns u.
|
createCoefficient(self, name)create aData object corresponding to coefficient
name
|
createCoefficientOfGeneralPDE(self, name)returns a new instance of a coefficient for coefficient name of the general PDE
|
getCoefficient(self, name)returns the value of the coefficient name
|
getCoefficientOfGeneralPDE(self, name)return the value of the coefficient name of the general PDE.
|
getDim(self)returns the spatial dimension of the PDE
|
getDomain(self)returns the domain of the PDE
|
getFlux(self, u=None)returns the flux J for a given u J[i,j]=A[i,j,k,l]*grad(u[k])[l]+B[i,j,k]u[k]-X[i,j] or J[j]=A[i,j]*grad(u)[l]+B[j]u-X[j]
|
getFunctionSpaceForCoefficient(self, name)return theFunctionSpace to be used for coefficient
name
|
getFunctionSpaceForCoefficientOfGeneralPDE(self, name)return theFunctionSpace to be used for coefficient
name of the general PDE
|
getFunctionSpaceForEquation(self)returns theFunctionSpace used to discretize the
equation
|
getFunctionSpaceForSolution(self)returns theFunctionSpace used to represent the
solution
|
getNumEquations(self)returns the number of equations
|
getNumSolutions(self)returns the number of unknowns
|
getOperator(self)provides access to the operator of the PDE
|
getResidual(self, u=None)return the residual of u or the current solution if u is not present.
|
getRightHandSide(self)provides access to the right hand side of the PDE
|
getShapeOfCoefficient(self, name)return the shape of the coefficient name
|
getShapeOfCoefficientOfGeneralPDE(self, name)return the shape of the coefficient name of the general PDE
|
getSolution(self, **options)returns the solution of the PDE. If the solution is not valid the PDE is solved.
|
getSolverMethod(self)returns the solver method
|
getSolverMethodName(self)returns the name of the solver currently used
|
getSolverPackage(self)returns the package of the solver
|
getSystem(self)return the operator and right hand side of the PDE
|
getTolerance(self)returns the tolerance set for the solution
|
hasCoefficient(self, name)return True if name is the name of a coefficient
|
hasCoefficientOfGeneralPDE(self, name)checks if name is a the name of a coefficient of the general PDE.
|
isSymmetric(self)checks if symmetry is indicated.
|
isUsingLumping(self)checks if matrix lumping is used a solver method
|
reduceEquationOrder(self)return status for order reduction for equation
|
reduceSolutionOrder(self)return status for order reduction for the solution
|
resetCoefficients(self)resets all coefficients to there default values. |
setDebugOff(self)switches off debugging |
setDebugOn(self)switches on debugging |
setReducedOrderForEquationOff(self)switches off reduced order for equation representation
|
setReducedOrderForEquationOn(self)switches on reduced order for equation representation
|
setReducedOrderForEquationTo(self, flag=False)sets order for test functions according to flag
|
setReducedOrderForSolutionOff(self)switches off reduced order for solution representation
|
setReducedOrderForSolutionOn(self)switches on reduced order for solution representation
|
setReducedOrderForSolutionTo(self, flag=False)sets order for test functions according to flag
|
setReducedOrderOff(self)switches off reduced order for solution and equation representation
|
setReducedOrderOn(self)switches on reduced order for solution and equation representation
|
setReducedOrderTo(self, flag=False)sets order reduction for both solution and equation representation according to flag.
|
setSolverMethod(self, solver=None, preconditioner=None)sets a new solver |
setSolverPackage(self, package=None)sets a new solver package |
setSymmetryOff(self)removes the symmetry flag. |
setSymmetryOn(self)sets the symmetry flag. |
setSymmetryTo(self, flag=False)sets the symmetry flag to flag
|
setTolerance(self, tol=1e-08)resets the tolerance for the solver method to tol where for an appropriate norm |.| |
|
setValue(self, **coefficients)sets new values to coefficients
|
trace(self, text)print the text message if debugging is swiched on.
|
| Class Variable Details |
|---|
AMGalgebraic multi grid
|
BICGSTABThe stabilized BiConjugate Gradient method.
|
CGSThe conjugate gardient square method
|
CHOLEVSKYThe direct solver based on LDLt factorization (can only be applied for symmetric PDEs)
|
CRThe conjugate residual method
|
DEFAULTThe default method used to solve the system of linear equations
|
DIRECTThe direct solver based on LDU factorization
|
GMRESThe Gram-Schmidt minimum residual method
|
ILU0The incomplete LU factorization preconditioner with no fill in
|
ILUTThe incomplete LU factorization preconditioner with will in
|
ITERATIVEThe default iterative solver
|
JACOBIThe Jacobi preconditioner
|
LUMPINGMatrix lumping.
|
MINIMUM_FILL_INReorder matrix to reduce fill-in during factorization
|
MKLIntel's MKL solver library
|
NESTED_DISSECTIONReorder matrix to improve load balancing during factorization
|
NO_REORDERINGNo matrix reordering allowed
|
PASOPASO solver package
|
PCGThe preconditioned conjugate gradient method (can only be applied for symmetric PDEs)
|
PRES20Special GMRES with restart after 20 steps and truncation after 5 residuals
|
RILUrecursive ILU
|
SCSLSGI SCSL solver library
|
SMALL_TOLERANCE
|
SSORThe symmetric overrealaxtion method
|
UMFPACKthe UMFPACK library
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Apr 27 11:16:23 2006 | http://epydoc.sf.net |