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

Class IP


IP
Nested Classes [hide private]
  BilinearForm
IP bilinear form types
  OrthoType
IP orthogonalization types
  RefineType
IP orthogonalization refinement types
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
applyMatrix(self, Vec x, Vec y)
Multiplies a vector with the matrix associated to the bilinear form.
 
create(self, comm=None)
Creates the IP object.
 
destroy(self)
Destroys the IP object.
 
getBilinearForm(self)
Gets the bilinear form to be used for inner products.
 
getOptionsPrefix(self)
Gets the prefix used for searching for all IP options in the database.
 
getOrthogonalization(self)
Gets the orthogonalization settings from the IP object.
 
innerProduct(self, Vec x, Vec y)
Computes the inner product of two vectors.
 
norm(self, Vec x)
Computes the norm of a vector as the square root of the inner product (x,x) as defined by innerProduct().
 
orthogonalize(self, VS, Vec v, Vec work=None)
Orthogonalize a vector with respect to a set of vectors.
 
setBilinearForm(self, Mat mat=None, form=None)
Sets the bilinear form to be used for inner products.
 
setFromOptions(self)
Sets IP options from the options database.
 
setOptionsPrefix(self, prefix)
Sets the prefix used for searching for all IP options in the database.
 
setOrthogonalization(self, type=None, refine=None, eta=None)
Specifies the type of orthogonalization technique to be used (classical or modified Gram-Schmidt with or without refinement).
 
view(self, Viewer viewer=None)
Prints the IP data structure.

Inherited from petsc4py.PETSc.Object: __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassName, getComm, getCookie, getDict, getName, getRefCount, getType, incRef, query, setAttr, setName

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

Properties [hide private]

Inherited from petsc4py.PETSc.Object: comm, cookie, 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__

applyMatrix(self, Vec x, Vec y)

 

Multiplies a vector with the matrix associated to the bilinear form.

Parameters

x: Vec
The input vector.
y: Vec
The result vector.

Notes

If the bilinear form has no associated matrix this function copies the vector.

create(self, comm=None)

 

Creates the IP object.

Parameters

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

destroy(self)

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

getBilinearForm(self)

 

Gets the bilinear form to be used for inner products.

Returns

form: IP.BilinearForm enumerate
The type of bilinear form.

getOptionsPrefix(self)

 

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

Returns

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

getOrthogonalization(self)

 

Gets the orthogonalization settings from the IP object.

Returns

type: IP.OrthoType enumerate
The type of orthogonalization technique.
refine: IP.RefineType enumerate
The type of refinement.
eta: float
Parameter for selective refinement (used when the the refinement type IP.RefineType.IFNEEDED).

innerProduct(self, Vec x, Vec y)

 

Computes the inner product of two vectors.

Parameters

x: Vec
The first input vector.
y: Vec
The second input vector.

Returns

p: float
The result of the inner product.

Notes

This function will usually compute the standard dot product, (x,y)=y^H x. However this behaviour may be different if changed via setBilinearForm(). This allows use of other inner products such as the indefinite product y^T x for complex symmetric problems or the B-inner product for positive definite B, (x,y)_B=y^H Bx.

norm(self, Vec x)

 

Computes the norm of a vector as the square root of the inner product (x,x) as defined by innerProduct().

Parameters

x: Vec
The input vector.

Returns

norm: float
The computed norm.

Notes

This function will usually compute the 2-norm of a vector, ||x||_2. But this behaviour may be different if using a non-standard inner product changed via setBilinearForm(). For example, if using the B-inner product for positive definite B`, ``(x,y)_B=y^H Bx, then the computed norm is ||x||_B = sqrt( x^H Bx ).

orthogonalize(self, VS, Vec v, Vec work=None)

 

Orthogonalize a vector with respect to a set of vectors.

Parameters

VS: list of Vec
Set of orthonormal vectors.
v: Vec
Vector to be orthogonalized, modified on return.
work: Vec, optional
Workspace.

Returns

H: list of float
Coefficients computed during orthogonalization.
norm: float
The norm of the resulting vector.
lindep: boolean
Flag indicating that refinement did not improve the quality of orthogonalization.

Notes

This function applies an orthogonal projector to project vector v onto the orthogonal complement of the span of the columns of VS.

On exit, v0 = [V v]*H, where v0 is the original vector v.

This routine does not normalize the resulting vector.

setBilinearForm(self, Mat mat=None, form=None)

 

Sets the bilinear form to be used for inner products.

Parameters

mat: Mat, optional
The matrix of the bilinear form.
form: IP.BilinearForm enumerate, optional
The type of bilinear form.

setFromOptions(self)

 

Sets IP options from the options database.

Notes

To see all options, run your program with the -help option.

Overrides: petsc4py.PETSc.Object.setFromOptions

setOptionsPrefix(self, prefix)

 

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

Parameters

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

Notes

A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

Overrides: petsc4py.PETSc.Object.setOptionsPrefix

setOrthogonalization(self, type=None, refine=None, eta=None)

 

Specifies the type of orthogonalization technique to be used (classical or modified Gram-Schmidt with or without refinement).

Parameters

type: IP.OrthoType enumerate, optional
The type of orthogonalization technique.
refine: IP.RefineType enumerate, optional
The type of refinement.
eta: float, optional
Parameter for selective refinement.

Notes

The default settings work well for most problems.

The parameter eta should be a real value between 0 and 1 (or DEFAULT). The value of eta is used only when the refinement type is IP.RefineType.IFNEEDED.

When using several processors, IP.OrthoType.MGS is likely to result in bad scalability.

view(self, Viewer viewer=None)

 

Prints the IP data structure.

Parameters

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