This is the base class to define a general linear PDE-type problem for
for an unknown function u on a given domain defined
through a Domain object. The problem can be given as a single
equation or as a system of equations.
The class assumes that some sort of assembling process is required to
form a problem of the form
|
|
__init__(self,
domain,
numEquations=None,
numSolutions=None,
debug=False)
Initializes a linear problem. |
|
|
str
|
__str__(self)
Returns a string representation of the PDE. |
|
|
|
|
|
bool
|
|
bool
|
|
bool
|
|
|
Data
|
|
|
|
|
|
|
createRightHandSide(self)
Returns an instance of a new right hand side. |
|
|
|
|
createSolution(self)
Returns an instance of a new solution. |
|
|
|
Data
|
|
|
|
getCurrentOperator(self)
Returns the operator in its current state. |
|
|
|
|
getCurrentRightHandSide(self)
Returns the right hand side in its current state. |
|
|
|
|
getCurrentSolution(self)
Returns the solution in its current state. |
|
|
int
|
getDim(self)
Returns the spatial dimension of the PDE. |
|
|
|
Domain
|
getDomain(self)
Returns the domain of the PDE. |
|
|
|
FunctionSpace
|
|
|
FunctionSpace
|
|
|
FunctionSpace
|
|
int
|
|
int
|
|
|
|
getOperator(self)
Returns the operator of the linear problem. |
|
|
|
|
|
|
Data
|
|
tuple of int
|
|
|
Data
|
getSolution(self,
**options)
Returns the solution of the problem. |
|
|
tuple of int
|
|
string
|
|
int
|
|
tuple of Operator, and Data.
|
getSystem(self)
Returns the operator and right hand side of the PDE. |
|
|
|
|
getSystemType(self)
Returns the current system type. |
|
|
float
|
getTolerance(self)
Returns the tolerance currently set for the solution. |
|
|
bool
|
hasCoefficient(self,
name)
Returns True if name is the name of a coefficient. |
|
|
|
|
initializeSystem(self)
Resets the system clearing the operator, right hand side and
solution. |
|
|
|
|
|
|
|
invalidateOperator(self)
Indicates the operator has to be rebuilt next time it is used. |
|
|
|
|
invalidateRightHandSide(self)
Indicates the right hand side has to be rebuilt next time it is used. |
|
|
|
|
invalidateSolution(self)
Indicates the PDE has to be resolved if the solution is requested. |
|
|
|
|
invalidateSystem(self)
Announces that everything has to be rebuilt. |
|
|
|
|
isOperatorValid(self)
Returns True if the operator is still valid. |
|
|
|
|
isRightHandSideValid(self)
Returns True if the operator is still valid. |
|
|
|
|
isSolutionValid(self)
Returns True if the solution is still valid. |
|
|
bool
|
|
|
|
isSystemValid(self)
Returns True if the system (including solution) is still vaild. |
|
|
bool
|
isUsingLumping(self)
Checks if matrix lumping is the current solver method. |
|
|
bool
|
|
bool
|
|
|
|
resetAllCoefficients(self)
Resets all coefficients to their default values. |
|
|
|
|
resetOperator(self)
Makes sure that the operator is instantiated and returns it
initialized with zeros. |
|
|
|
|
resetRightHandSide(self)
Sets the right hand side to zero. |
|
|
|
|
resetSolution(self)
Sets the solution to zero. |
|
|
|
|
setDebug(self,
flag)
Switches debug output on if flag is True otherwise it is
switched off. |
|
|
|
|
setDebugOff(self)
Switches debug output off. |
|
|
|
|
setDebugOn(self)
Switches debug output on. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setReducedOrderOff(self)
Switches reduced order off for solution and equation representation |
|
|
|
|
setReducedOrderOn(self)
Switches reduced order on for solution and equation representation. |
|
|
|
|
setReducedOrderTo(self,
flag=False)
Sets order reduction state for both solution and equation
representation according to flag. |
|
|
|
|
setSolution(self,
u)
Sets the solution assuming that makes the system valid. |
|
|
|
|
setSolverMethod(self,
solver=None,
preconditioner=None)
Sets a new solver method and/or preconditioner. |
|
|
|
|
|
|
|
setSymmetryOff(self)
Clears the symmetry flag. |
|
|
|
|
setSymmetryOn(self)
Sets the symmetry flag. |
|
|
|
|
|
|
|
setTolerance(self,
tol=1e-08)
Resets the tolerance for the solver method to tol. |
|
|
|
|
setValue(self,
**coefficients)
Sets new values to coefficients. |
|
|
|
|
trace(self,
text)
Prints the text message if debug mode is switched on. |
|
|
|
|
updateSystemType(self)
Reassesses the system type and, if a new matrix is needed, resets the
system. |
|
|
|
|
validOperator(self)
Marks the operator as valid. |
|
|
|
|
validRightHandSide(self)
Marks the right hand side as valid. |
|
|
|
|
validSolution(self)
Marks the solution as valid. |
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__
|
|
|
AMG = 22
Algebraic Multi Grid
|
|
|
BICGSTAB = 6
The stabilized BiConjugate Gradient method
|
|
|
CGS = 5
The conjugate gradient square method
|
|
|
CHOLEVSKY = 2
The direct solver based on LDLt factorization (can only be applied
for symmetric PDEs)
|
|
|
CR = 4
The conjugate residual method
|
|
|
DEFAULT = 0
The default method used to solve the system of linear equations
|
|
|
DIRECT = 1
The direct solver based on LDU factorization
|
|
|
GMRES = 11
The Gram-Schmidt minimum residual method
|
|
|
GS = 28
Gauss-Seidel solver
|
|
|
ILU0 = 8
The incomplete LU factorization preconditioner with no fill-in
|
|
|
ILUT = 9
The incomplete LU factorization preconditioner with fill-in
|
|
|
ITERATIVE = 20
The default iterative solver
|
|
|
JACOBI = 10
The Jacobi preconditioner
|
|
|
LUMPING = 13
Matrix lumping
|
|
|
METHOD_KEY = 'method'
|
|
|
MINIMUM_FILL_IN = 18
Reorder matrix to reduce fill-in during factorization
|
|
|
MINRES = 27
Minimum residual method
|
|
|
MKL = 15
Intel's MKL solver library
|
|
|
NESTED_DISSECTION = 19
Reorder matrix to improve load balancing during factorization
|
|
|
NONLINEAR_GMRES = 25
|
|
|
NO_REORDERING = 17
No matrix reordering allowed
|
|
|
PACKAGE_KEY = 'package'
|
|
|
PASO = 21
PASO solver package
|
|
|
PCG = 3
The preconditioned conjugate gradient method (can only be applied for
symmetric PDEs)
|
|
|
PRECONDITIONER_KEY = 'preconditioner'
|
|
|
PRES20 = 12
Special GMRES with restart after 20 steps and truncation after 5
residuals
|
|
|
RILU = 23
Recursive ILU
|
|
|
SCSL = 14
SGI SCSL solver library
|
|
|
SMALL_TOLERANCE = 1e-13
|
|
|
SSOR = 7
The symmetric overrelaxation method
|
|
|
SYMMETRY_KEY = 'symmetric'
|
|
|
TFQMR = 26
Transport Free Quasi Minimal Residual method
|
|
|
TOLERANCE_KEY = 'tolerance'
|
|
|
TRILINOS = 24
The TRILINOS parallel solver class library from Sandia Natl Labs
|
|
|
UMFPACK = 16
The UMFPACK library
|