slepc4py.SLEPc.MFN#

class slepc4py.SLEPc.MFN#

Bases: Object

MFN.

Enumerations

ConvergedReason

MFN convergence reasons.

Type

MFN type.

Methods Summary

appendOptionsPrefix([prefix])

Append to the prefix used for searching for all MFN options in the database.

cancelMonitor()

Clear all monitors for an MFN object.

create([comm])

Create the MFN object.

destroy()

Destroy the MFN object.

getBV()

Get the basis vector object associated to the MFN object.

getConvergedReason()

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

getDimensions()

Get the dimension of the subspace used by the solver.

getErrorIfNotConverged()

Get if solve() generates an error if the solver does not converge.

getFN()

Get the math function object associated to the MFN object.

getIterationNumber()

Get the current iteration number.

getMonitor()

Get the list of monitor functions.

getOperator()

Get the matrix associated with the MFN object.

getOptionsPrefix()

Get the prefix used for searching for all MFN options in the database.

getTolerances()

Get the tolerance and maximum iteration count.

getType()

Get the MFN type of this object.

reset()

Reset the MFN object.

setBV(bv)

Set a basis vector object associated to the MFN object.

setDimensions(ncv)

Set the dimension of the subspace to be used by the solver.

setErrorIfNotConverged([flg])

Set solve() to generate an error if the solver does not converge.

setFN(fn)

Set a math function object associated to the MFN object.

setFromOptions()

Set MFN options from the options database.

setMonitor(monitor[, args, kargs])

Append a monitor function to the list of monitors.

setOperator(A)

Set the matrix associated with the MFN object.

setOptionsPrefix([prefix])

Set the prefix used for searching for all MFN options in the database.

setTolerances([tol, max_it])

Set the tolerance and maximum iteration count.

setType(mfn_type)

Set the particular solver to be used in the MFN object.

setUp()

Set up all the necessary internal data structures.

solve(b, x)

Solve the matrix function problem.

solveTranspose(b, x)

Solve the transpose matrix function problem.

view([viewer])

Print the MFN data structure.

Attributes Summary

bv

The basis vectors (BV) object associated to the MFN object.

fn

The math function (FN) object associated to the MFN object.

max_it

The maximum iteration count used by the MFN convergence tests.

tol

The tolerance count used by the MFN convergence tests.

Methods Documentation

appendOptionsPrefix(prefix=None)#

Append to the prefix used for searching for all MFN options in the database.

Logically collective.

Parameters:

prefix (str | None) – The prefix string to prepend to all MFN option requests.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:154 <slepc4py/SLEPc/MFN.pyx#L154>`

cancelMonitor()#

Clear all monitors for an MFN object.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:367 <slepc4py/SLEPc/MFN.pyx#L367>`

Return type:

None

create(comm=None)#

Create the MFN object.

Collective.

Parameters:

comm (Comm | None) – MPI communicator. If not provided, it defaults to all processes.

Return type:

Self

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:77 <slepc4py/SLEPc/MFN.pyx#L77>`

destroy()#

Destroy the MFN object.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:59 <slepc4py/SLEPc/MFN.pyx#L59>`

Return type:

Self

getBV()#

Get the basis vector object associated to the MFN object.

Not collective.

Returns:

The basis vectors context.

Return type:

BV

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:282 <slepc4py/SLEPc/MFN.pyx#L282>`

getConvergedReason()#

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

Not collective.

Returns:

Negative value indicates diverged, positive value converged.

Return type:

ConvergedReason

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:444 <slepc4py/SLEPc/MFN.pyx#L444>`

getDimensions()#

Get the dimension of the subspace used by the solver.

Not collective.

Returns:

Maximum dimension of the subspace to be used by the solver.

Return type:

int

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:224 <slepc4py/SLEPc/MFN.pyx#L224>`

getErrorIfNotConverged()#

Get if solve() generates an error if the solver does not converge.

Not collective.

Get a flag indicating whether solve() will generate an error if the solver does not converge.

Returns:

True indicates you want the error generated.

Return type:

bool

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:473 <slepc4py/SLEPc/MFN.pyx#L473>`

getFN()#

Get the math function object associated to the MFN object.

Not collective.

Returns:

The math function context.

Return type:

FN

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:253 <slepc4py/SLEPc/MFN.pyx#L253>`

getIterationNumber()#

Get the current iteration number.

Not collective.

Get 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:

Iteration number.

Return type:

int

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:425 <slepc4py/SLEPc/MFN.pyx#L425>`

getMonitor()#

Get the list of monitor functions.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:363 <slepc4py/SLEPc/MFN.pyx#L363>`

Return type:

MFNMonitorFunction

getOperator()#

Get the matrix associated with the MFN object.

Collective.

Returns:

The matrix for which the matrix function is to be computed.

Return type:

petsc4py.PETSc.Mat

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:311 <slepc4py/SLEPc/MFN.pyx#L311>`

getOptionsPrefix()#

Get the prefix used for searching for all MFN options in the database.

Not collective.

Returns:

The prefix string set for this MFN object.

Return type:

str

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:124 <slepc4py/SLEPc/MFN.pyx#L124>`

getTolerances()#

Get the tolerance and maximum iteration count.

Not collective.

Get the tolerance and maximum iteration count used by the default MFN convergence tests.

Returns:

  • tol (float) – The convergence tolerance.

  • max_it (int) – The maximum number of iterations

Return type:

tuple[float, int]

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:181 <slepc4py/SLEPc/MFN.pyx#L181>`

getType()#

Get the MFN type of this object.

Not collective.

Returns:

The solver currently being used.

Return type:

str

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:109 <slepc4py/SLEPc/MFN.pyx#L109>`

reset()#

Reset the MFN object.

Collective.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:69 <slepc4py/SLEPc/MFN.pyx#L69>`

Return type:

None

setBV(bv)#

Set a basis vector object associated to the MFN object.

Collective.

Parameters:

bv (BV) – The basis vectors context.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:298 <slepc4py/SLEPc/MFN.pyx#L298>`

setDimensions(ncv)#

Set the dimension of the subspace to be used by the solver.

Logically collective.

Parameters:

ncv (int) – Maximum dimension of the subspace to be used by the solver.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:239 <slepc4py/SLEPc/MFN.pyx#L239>`

setErrorIfNotConverged(flg=True)#

Set solve() to generate an error if the solver does not converge.

Logically collective.

Parameters:

flg (bool) – True indicates you want the error generated.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:459 <slepc4py/SLEPc/MFN.pyx#L459>`

setFN(fn)#

Set a math function object associated to the MFN object.

Collective.

Parameters:

fn (FN) – The math function context.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:269 <slepc4py/SLEPc/MFN.pyx#L269>`

setFromOptions()#

Set MFN options from the options database.

Collective.

Set MFN options from the options database. This routine must be called before setUp() if the user is to be allowed to set the solver type.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:169 <slepc4py/SLEPc/MFN.pyx#L169>`

Return type:

None

setMonitor(monitor, args=None, kargs=None)#

Append a monitor function to the list of monitors.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:342 <slepc4py/SLEPc/MFN.pyx#L342>`

Parameters:
Return type:

None

setOperator(A)#

Set the matrix associated with the MFN object.

Collective.

Parameters:

A (Mat) – The problem matrix.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:327 <slepc4py/SLEPc/MFN.pyx#L327>`

setOptionsPrefix(prefix=None)#

Set the prefix used for searching for all MFN options in the database.

Logically collective.

Parameters:

prefix (str | None) – The prefix string to prepend to all MFN option requests.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:139 <slepc4py/SLEPc/MFN.pyx#L139>`

setTolerances(tol=None, max_it=None)#

Set the tolerance and maximum iteration count.

Logically collective.

Set the tolerance and maximum iteration count used by the default MFN convergence tests.

Parameters:
  • tol (float | None) – The convergence tolerance.

  • max_it (int | None) – The maximum number of iterations

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:202 <slepc4py/SLEPc/MFN.pyx#L202>`

setType(mfn_type)#

Set the particular solver to be used in the MFN object.

Logically collective.

Parameters:

mfn_type (Type | str) – The solver to be used.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:94 <slepc4py/SLEPc/MFN.pyx#L94>`

setUp()#

Set up all the necessary internal data structures.

Collective.

Set up all the internal data structures necessary for the execution of the eigensolver.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:378 <slepc4py/SLEPc/MFN.pyx#L378>`

Return type:

None

solve(b, x)#

Solve the matrix function problem.

Collective.

Given a vector \(b\), the vector \(x = f(A) b\) is returned.

Parameters:
  • b (Vec) – The right hand side vector.

  • x (Vec) – The solution.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:389 <slepc4py/SLEPc/MFN.pyx#L389>`

solveTranspose(b, x)#

Solve the transpose matrix function problem.

Collective.

Given a vector \(b\), the vector \(x = f(A^T) b\) is returned.

Parameters:
  • b (Vec) – The right hand side vector.

  • x (Vec) – The solution.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:407 <slepc4py/SLEPc/MFN.pyx#L407>`

view(viewer=None)#

Print the MFN data structure.

Collective.

Parameters:

viewer (Viewer | None) – Visualization context; if not provided, the standard output is used.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:44 <slepc4py/SLEPc/MFN.pyx#L44>`

Attributes Documentation

bv#

The basis vectors (BV) object associated to the MFN object.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:514 <slepc4py/SLEPc/MFN.pyx#L514>`

fn#

The math function (FN) object associated to the MFN object.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:507 <slepc4py/SLEPc/MFN.pyx#L507>`

max_it#

The maximum iteration count used by the MFN convergence tests.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:500 <slepc4py/SLEPc/MFN.pyx#L500>`

tol#

The tolerance count used by the MFN convergence tests.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:493 <slepc4py/SLEPc/MFN.pyx#L493>`