petsc4py.PETSc.SNESLineSearch#

class petsc4py.PETSc.SNESLineSearch#

Bases: Object

Linesearch object used by SNES solvers.

See also

SNESLineSearch

Enumerations

Type

SNES linesearch type.

Methods Summary

create([comm])

Create a new linesearch object.

destroy()

Destroy the linesearch object.

getOrder()

Return the order of the linesearch.

getTolerances()

Return the tolerance parameters used in the linesearch.

getType()

Return the type of the linesearch.

setFromOptions()

Configure the linesearch from the options database.

setOrder(order)

Set the order of the linesearch.

setTolerances([minstep, maxstep, rtol, ...])

Set the tolerance parameters used in the linesearch.

setType(ls_type)

Set the type of the linesearch.

view([viewer])

View the linesearch object.

Methods Documentation

create(comm=None)#

Create a new linesearch object.

Collective.

Parameters:

comm (Comm, optional) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

Source code at petsc4py/PETSc/SNES.pyx:2734

destroy()#

Destroy the linesearch object.

Collective.

Source code at petsc4py/PETSc/SNES.pyx:2908

Return type:

None

getOrder()#

Return the order of the linesearch.

Not collective.

Source code at petsc4py/PETSc/SNES.pyx:2881

Return type:

int

getTolerances()#

Return the tolerance parameters used in the linesearch.

Not collective.

Returns:

  • minstep (float) – Minimum step length.

  • maxstep (float, optional) – Maximum step length.

  • rtol (float) – Relative tolerance.

  • atol (float) – Absolute tolerance.

  • ltol (float) – Lambda tolerance.

  • max_its (int) – Maximum number of iterations for the linesearch.

Return type:

tuple[float, float, float, float, float, int]

Source code at petsc4py/PETSc/SNES.pyx:2814

getType()#

Return the type of the linesearch.

Not collective.

Source code at petsc4py/PETSc/SNES.pyx:2786

Return type:

str

setFromOptions()#

Configure the linesearch from the options database.

Collective.

Source code at petsc4py/PETSc/SNES.pyx:2755

Return type:

None

setOrder(order)#

Set the order of the linesearch.

Logically collective.

Source code at petsc4py/PETSc/SNES.pyx:2895

Parameters:

order (int)

Return type:

None

setTolerances(minstep=None, maxstep=None, rtol=None, atol=None, ltol=None, max_its=None)#

Set the tolerance parameters used in the linesearch.

Logically collective.

Parameters:
  • minstep (float) – Minimum step length.

  • maxstep (float, optional) – Maximum step length.

  • rtol (float, optional) – Relative tolerance.

  • atol (float, optional) – Absolute tolerance.

  • ltol (float, optional) – Lambda tolerance.

  • max_its (int, optional) – Maximum number of iterations for the linesearch.

Return type:

None

Source code at petsc4py/PETSc/SNES.pyx:2843

setType(ls_type)#

Set the type of the linesearch.

Logically collective.

Source code at petsc4py/PETSc/SNES.pyx:2800

Parameters:

ls_type (Type | str)

Return type:

None

view(viewer=None)#

View the linesearch object.

Collective.

Parameters:

viewer (Viewer | None) – A Viewer instance or None for the default viewer.

Return type:

None

Source code at petsc4py/PETSc/SNES.pyx:2767