Package slepc4py :: Module SLEPc :: Class NEP
[hide private]
[frames] | no frames]

Class NEP


NEP
Nested Classes [hide private]
  ConvergedReason
  ErrorType
NEP error type to assess accuracy of computed solutions
  Type
NEP type
  Which
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
appendOptionsPrefix(self, prefix)
Appends to the prefix used for searching for all NEP options in the database.
 
cancelMonitor(self)
Clears all monitors for a NEP object.
 
computeError(self, int i, etype=None)
Computes the error (based on the residual norm) associated with the i-th computed eigenpair.
 
create(self, comm=None)
Creates the NEP object.
 
destroy(self)
Destroys the NEP object.
 
getBV(self)
Obtain the basis vectors object associated to the eigensolver.
 
getConverged(self)
Gets the number of converged eigenpairs.
 
getConvergedReason(self)
Gets the reason why the solve() iteration was stopped.
 
getDimensions(self)
Gets the number of eigenvalues to compute and the dimension of the subspace.
 
getEigenpair(self, int i, Vec Vr=None, Vec Vi=None)
Gets the i-th solution of the eigenproblem as computed by solve().
 
getErrorEstimate(self, int i)
Returns the error estimate associated to the i-th computed eigenpair.
 
getIterationNumber(self)
Gets the current iteration number.
 
getLagPreconditioner(self)
Indicates how often the preconditioner is rebuilt.
 
getOptionsPrefix(self)
Gets the prefix used for searching for all NEP options in the database.
 
getTolerances(self)
Gets the tolerance and maximum iteration count used by the default NEP convergence tests.
 
getTrackAll(self)
Returns the flag indicating whether all residual norms must be computed or not.
 
getType(self)
Gets the NEP type of this object.
 
getWhichEigenpairs(self)
Returns which portion of the spectrum is to be sought.
 
reset(self)
Resets the NEP object.
 
setBV(self, BV bv)
Associates a basis vectors object to the eigensolver.
 
setDimensions(self, nev=None, ncv=None, mpd=None)
Sets the number of eigenvalues to compute and the dimension of the subspace.
 
setFromOptions(self)
Sets NEP options from the options database.
 
setFunction(self, function, Mat F, Mat P=None, args=None, kargs=None)
Sets the function to compute the nonlinear Function T(lambda) as well as the location to store the matrix.
 
setInitialSpace(self, space)
Sets the initial space from which the eigensolver starts to iterate.
 
setJacobian(self, jacobian, Mat J, args=None, kargs=None)
Sets the function to compute Jacobian T'(lambda) as well as the location to store the matrix.
 
setLagPreconditioner(self, lag)
Determines when the preconditioner is rebuilt in the nonlinear solve.
 
setOptionsPrefix(self, prefix)
Sets the prefix used for searching for all NEP options in the database.
 
setSplitOperator(self, A, f, structure=None)
Sets the operator of the nonlinear eigenvalue problem in split form.
 
setTolerances(self, abstol=None, rtol=None, stol=None, maxit=None, maxf=None)
Sets various parameters used in convergence tests.
 
setTrackAll(self, trackall)
Specifies if the solver must compute the residual of all approximate eigenpairs or not.
 
setType(self, nep_type)
Selects the particular solver to be used in the NEP object.
 
setUp(self)
Sets up all the internal data structures necessary for the execution of the eigensolver.
 
setWhichEigenpairs(self, which)
Specifies which portion of the spectrum is to be sought.
 
solve(self)
Solves the eigensystem.
 
view(self, Viewer viewer=None)
Prints the NEP data structure.

Inherited from petsc4py.PETSc.Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from petsc4py.PETSc.Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

appendOptionsPrefix(self, prefix)

 

Appends to the prefix used for searching for all NEP options in the database.

Parameters

prefix: string
The prefix string to prepend to all NEP option requests.

computeError(self, int i, etype=None)

 

Computes the error (based on the residual norm) associated with the i-th computed eigenpair.

Parameters

i: int
Index of the solution to be considered.
etype: NEP.ErrorType enumerate
The error type to compute.

Returns

error: real
The error bound, computed in various ways from the residual norm ||T(lambda)x||_2 where lambda is the eigenvalue and x is the eigenvector.

create(self, comm=None)

 

Creates the NEP object.

Parameters

comm: Comm, optional.
MPI communicator. If not provided, it defaults to all processes.

destroy(self)

 
Destroys the NEP object.
Overrides: petsc4py.PETSc.Object.destroy

getBV(self)

 

Obtain the basis vectors object associated to the eigensolver.

Returns

bv: BV
The basis vectors context.

getConverged(self)

 

Gets the number of converged eigenpairs.

Returns

nconv: int
Number of converged eigenpairs.

getConvergedReason(self)

 

Gets the reason why the solve() iteration was stopped.

Returns

reason: NEP.ConvergedReason enumerate
Negative value indicates diverged, positive value converged.

getDimensions(self)

 

Gets the number of eigenvalues to compute and the dimension of the subspace.

Returns

nev: int
Number of eigenvalues to compute.
ncv: int
Maximum dimension of the subspace to be used by the solver.
mpd: int
Maximum dimension allowed for the projected problem.

getEigenpair(self, int i, Vec Vr=None, Vec Vi=None)

 

Gets the i-th solution of the eigenproblem as computed by solve(). The solution consists of both the eigenvalue and the eigenvector.

Parameters

i: int
Index of the solution to be obtained.
Vr: Vec, optional
Placeholder for the returned eigenvector (real part).
Vi: Vec, optional
Placeholder for the returned eigenvector (imaginary part).

Returns

e: scalar (possibly complex)
The computed eigenvalue.

getErrorEstimate(self, int i)

 

Returns the error estimate associated to the i-th computed eigenpair.

Parameters

i: int
Index of the solution to be considered.

Returns

error: real
Error estimate.

getIterationNumber(self)

 

Gets the current iteration number. If the call to solve() is complete, then it returns the number of iterations carried out by the solution method.

Returns

its: int
Iteration number.

getLagPreconditioner(self)

 

Indicates how often the preconditioner is rebuilt.

Returns

lag: int
The lag parameter.

getOptionsPrefix(self)

 

Gets the prefix used for searching for all NEP options in the database.

Returns

prefix: string
The prefix string set for this NEP object.
Overrides: petsc4py.PETSc.Object.getOptionsPrefix

getTolerances(self)

 

Gets the tolerance and maximum iteration count used by the default NEP convergence tests.

Returns

abstol: float
The absolute convergence tolerance.
rtol: float
The relative convergence tolerance.
stol: float
Convergence tolerance in terms of the norm of the change in the solution between steps, || delta x || < stol*|| x ||.
maxit: int
The maximum number of iterations.
maxf: int
The maximum number of function evaluations.

getTrackAll(self)

 

Returns the flag indicating whether all residual norms must be computed or not.

Returns

trackall: bool
Whether the solver compute all residuals or not.

getType(self)

 

Gets the NEP type of this object.

Returns

type: NEP.Type enumerate
The solver currently being used.
Overrides: petsc4py.PETSc.Object.getType

getWhichEigenpairs(self)

 

Returns which portion of the spectrum is to be sought.

Returns

which: NEP.Which enumerate
The portion of the spectrum to be sought by the solver.

setBV(self, BV bv)

 

Associates a basis vectors object to the eigensolver.

Parameters

bv: BV
The basis vectors context.

setDimensions(self, nev=None, ncv=None, mpd=None)

 

Sets the number of eigenvalues to compute and the dimension of the subspace.

Parameters

nev: int, optional
Number of eigenvalues to compute.
ncv: int, optional
Maximum dimension of the subspace to be used by the solver.
mpd: int, optional
Maximum dimension allowed for the projected problem.

setFromOptions(self)

 
Sets NEP options from the options database. This routine must be called before setUp() if the user is to be allowed to set the solver type.
Overrides: petsc4py.PETSc.Object.setFromOptions

setFunction(self, function, Mat F, Mat P=None, args=None, kargs=None)

 

Sets the function to compute the nonlinear Function T(lambda) as well as the location to store the matrix.

Parameters

function:
Function evaluation routine
F: Mat
Function matrix
P: Mat
preconditioner matrix (usually same as the Function)

setInitialSpace(self, space)

 

Sets the initial space from which the eigensolver starts to iterate.

Parameters

space: Vec or sequence of Vec
The initial space

setJacobian(self, jacobian, Mat J, args=None, kargs=None)

 

Sets the function to compute Jacobian T'(lambda) as well as the location to store the matrix.

Parameters

jacobian:
Jacobian evaluation routine
J: Mat
Jacobian matrix

setLagPreconditioner(self, lag)

 

Determines when the preconditioner is rebuilt in the nonlinear solve.

Parameters

lag: int
0 indicates NEVER rebuild, 1 means rebuild every time the Jacobian is computed within the nonlinear iteration, 2 means every second time the Jacobian is built, etc.

setOptionsPrefix(self, prefix)

 

Sets the prefix used for searching for all NEP options in the database.

Parameters

prefix: string
The prefix string to prepend to all NEP option requests.
Overrides: petsc4py.PETSc.Object.setOptionsPrefix

setSplitOperator(self, A, f, structure=None)

 

Sets the operator of the nonlinear eigenvalue problem in split form.

Parameters

A: Mat or sequence of Mat
Coefficient matrices of the split form.
f: sequence of FN
Scalar functions of the split form.
structure: PETSc.Mat.Structure enumerate, optional
Structure flag for matrices.

setTolerances(self, abstol=None, rtol=None, stol=None, maxit=None, maxf=None)

 

Sets various parameters used in convergence tests.

Parameters

abstol: float, optional
The absolute convergence tolerance.
rtol: float, optional
The relative convergence tolerance.
stol: float, optional
Convergence tolerance in terms of the norm of the change in the solution between steps, || delta x || < stol*|| x ||.
maxit: int, optional
The maximum number of iterations.
maxf: int, optional
The maximum number of function evaluations.

setTrackAll(self, trackall)

 

Specifies if the solver must compute the residual of all approximate eigenpairs or not.

Parameters

trackall: bool
Whether compute all residuals or not.

setType(self, nep_type)

 

Selects the particular solver to be used in the NEP object.

Parameters

nep_type: NEP.Type enumerate
The solver to be used.

setWhichEigenpairs(self, which)

 

Specifies which portion of the spectrum is to be sought.

Parameters

which: NEP.Which enumerate
The portion of the spectrum to be sought by the solver.

view(self, Viewer viewer=None)

 

Prints the NEP data structure.

Parameters

viewer: Viewer, optional.
Visualization context; if not provided, the standard output is used.
Overrides: petsc4py.PETSc.Object.view