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

Class IP


IP
Nested Classes [hide private]
  OrthogRefineType
IP orthogonalization refinement types
  OrthogType
IP orthogonalization types
  RefineType
IP orthogonalization refinement types
  Type
IP type
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.
 
getMatrix(self)
Retrieves the matrix representation of the inner produc
 
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.
 
getType(self)
Gets the IP type of this 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)
Orthogonalize a vector with respect to a set of vectors.
 
reset(self)
Resets the IP object.
 
setFromOptions(self)
Sets IP options from the options database.
 
setMatrix(self, Mat mat)
Sets the bilinear form to be used for inner products.
 
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).
 
setType(self, ip_type)
Selects the type for the IP object.
 
view(self, Viewer viewer=None)
Prints the IP 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, incRef, query, setAttr, setName

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__

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

getMatrix(self)

 

Retrieves the matrix representation of the inner produc

Returns

mat: the matrix of the inner product

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.OrthogType enumerate
The type of orthogonalization technique.
refine: IP.OrthogRefineType enumerate
The type of refinement.
eta: float
Parameter for selective refinement (used when the the refinement type IP.OrthogRefineType.IFNEEDED).

getType(self)

 

Gets the IP type of this object.

Returns

type: IP.Type enumerate
The inner product type currently being used.
Overrides: petsc4py.PETSc.Object.getType

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 setMatrix(). 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 setMatrix(). 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)

 

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.

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.

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

setMatrix(self, Mat mat)

 

Sets the bilinear form to be used for inner products.

Parameters

mat: Mat, optional
The matrix of the inner product.

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.OrthogType enumerate, optional
The type of orthogonalization technique.
refine: IP.OrthogRefineType 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.OrthogRefineType.IFNEEDED.

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

setType(self, ip_type)

 

Selects the type for the IP object.

Parameters

ip_type: IP.Type enumerate
The inner product type to be used.

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