slepc4py.SLEPc.RG#

class slepc4py.SLEPc.RG#

Bases: Object

RG.

Enumerations

QuadRule

RG quadrature rule for contour integral methods.

Type

RG type.

Methods Summary

appendOptionsPrefix([prefix])

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

canUseConjugates([realmats])

Half of integration points can be avoided (use their conjugates).

checkInside(a)

Determine if a set of given points are inside the region or not.

computeBoundingBox()

Endpoints of a rectangle in the complex plane containing the region.

computeContour(n)

Compute the coordinates of several points of the contour on the region.

computeQuadrature(quad, n)

Compute the values of the parameters used in a quadrature rule.

create([comm])

Create the RG object.

destroy()

Destroy the RG object.

getComplement()

Get the flag indicating whether the region is complemented or not.

getEllipseParameters()

Get the parameters that define the ellipse region.

getIntervalEndpoints()

Get the parameters that define the interval region.

getOptionsPrefix()

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

getPolygonVertices()

Get the parameters that define the interval region.

getRingParameters()

Get the parameters that define the ring region.

getScale()

Get the scaling factor.

getType()

Get the RG type of this object.

isAxisymmetric([vertical])

Determine if the region is symmetric wrt.

isTrivial()

Tell whether it is the trivial region (whole complex plane).

setComplement([comp])

Set a flag to indicate that the region is the complement of the specified one.

setEllipseParameters(center, radius[, vscale])

Set the parameters defining the ellipse region.

setFromOptions()

Set RG options from the options database.

setIntervalEndpoints(a, b, c, d)

Set the parameters defining the interval region.

setOptionsPrefix([prefix])

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

setPolygonVertices(v)

Set the vertices that define the polygon region.

setRingParameters(center, radius, vscale, ...)

Set the parameters defining the ring region.

setScale([sfactor])

Set the scaling factor to be used.

setType(rg_type)

Set the type for the RG object.

view([viewer])

Print the RG data structure.

Attributes Summary

complement

If the region is the complement of the specified one.

scale

The scaling factor to be used.

Methods Documentation

appendOptionsPrefix(prefix=None)#

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

Logically collective.

Parameters:

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

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:141

canUseConjugates(realmats=True)#

Half of integration points can be avoided (use their conjugates).

Not collective.

Used in contour integral methods to determine whether half of integration points can be avoided (use their conjugates).

Parameters:

realmats (bool) – True if the problem matrices are real.

Returns:

Whether it is possible to use conjugates.

Return type:

bool

Source code at slepc4py/SLEPc/RG.pyx:361

checkInside(a)#

Determine if a set of given points are inside the region or not.

Not collective.

Parameters:

a (Sequence[complex]) – The coordinates of the points.

Returns:

Computed result for each point (1=inside, 0=on the contour, -1=outside).

Return type:

ArrayInt

Source code at slepc4py/SLEPc/RG.pyx:274

computeBoundingBox()#

Endpoints of a rectangle in the complex plane containing the region.

Not collective.

Determine the endpoints of a rectangle in the complex plane that contains the region.

Returns:

  • a (float) – The left endpoint of the bounding box in the real axis

  • b (float) – The right endpoint of the bounding box in the real axis

  • c (float) – The left endpoint of the bounding box in the imaginary axis

  • d (float) – The right endpoint of the bounding box in the imaginary axis

Return type:

tuple[float, float, float, float]

Source code at slepc4py/SLEPc/RG.pyx:337

computeContour(n)#

Compute the coordinates of several points of the contour on the region.

Not collective.

Compute the coordinates of several points lying on the contour of the region.

Parameters:

n (int) – The number of points to compute.

Returns:

Computed points.

Return type:

list of complex

Source code at slepc4py/SLEPc/RG.pyx:306

computeQuadrature(quad, n)#

Compute the values of the parameters used in a quadrature rule.

Not collective.

Compute the values of the parameters used in a quadrature rule for a contour integral around the boundary of the region.

Parameters:
  • quad (QuadRule) – The type of quadrature.

  • n (int) – The number of quadrature points to compute.

Returns:

Return type:

tuple[ArrayScalar, ArrayScalar, ArrayScalar]

Source code at slepc4py/SLEPc/RG.pyx:385

create(comm=None)#

Create the RG object.

Collective.

Parameters:

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

Return type:

Self

Source code at slepc4py/SLEPc/RG.pyx:58

destroy()#

Destroy the RG object.

Collective.

Source code at slepc4py/SLEPc/RG.pyx:48

Return type:

Self

getComplement()#

Get the flag indicating whether the region is complemented or not.

Not collective.

Returns:

Whether the region is complemented or not.

Return type:

bool

Source code at slepc4py/SLEPc/RG.pyx:212

getEllipseParameters()#

Get the parameters that define the ellipse region.

Not collective.

Returns:

  • center (Scalar) – The center.

  • radius (float) – The radius.

  • vscale (float) – The vertical scale.

Return type:

tuple[Scalar, float, float]

Source code at slepc4py/SLEPc/RG.pyx:442

getIntervalEndpoints()#

Get the parameters that define the interval region.

Not collective.

Returns:

  • a (float) – The left endpoint in the real axis.

  • b (float) – The right endpoint in the real axis.

  • c (float) – The upper endpoint in the imaginary axis.

  • d (float) – The lower endpoint in the imaginary axis.

Return type:

tuple[float, float, float, float]

Source code at slepc4py/SLEPc/RG.pyx:486

getOptionsPrefix()#

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

Not collective.

Returns:

The prefix string set for this RG object.

Return type:

str

Source code at slepc4py/SLEPc/RG.pyx:126

getPolygonVertices()#

Get the parameters that define the interval region.

Not collective.

Returns:

The vertices.

Return type:

ArrayComplex

Source code at slepc4py/SLEPc/RG.pyx:534

getRingParameters()#

Get the parameters that define the ring region.

Not collective.

Returns:

  • center (Scalar) – The center.

  • radius (float) – The radius.

  • vscale (float) – The vertical scale.

  • start_ang (float) – The right-hand side angle.

  • end_ang (float) – The left-hand side angle.

  • width (float) – The width of the ring.

Return type:

tuple[Scalar, float, float, float, float, float]

Source code at slepc4py/SLEPc/RG.pyx:593

getScale()#

Get the scaling factor.

Not collective.

Returns:

The scaling factor.

Return type:

float

Source code at slepc4py/SLEPc/RG.pyx:259

getType()#

Get the RG type of this object.

Not collective.

Returns:

The inner product type currently being used.

Return type:

str

Source code at slepc4py/SLEPc/RG.pyx:90

isAxisymmetric(vertical=False)#

Determine if the region is symmetric wrt. the real or imaginary axis.

Not collective.

Determine if the region is symmetric with respect to the real or imaginary axis.

Parameters:

vertical (bool) – True if symmetry must be checked against the vertical axis.

Returns:

True if the region is axisymmetric.

Return type:

bool

Source code at slepc4py/SLEPc/RG.pyx:188

isTrivial()#

Tell whether it is the trivial region (whole complex plane).

Not collective.

Returns:

True if the region is equal to the whole complex plane, e.g., an interval region with all four endpoints unbounded or an ellipse with infinite radius.

Return type:

bool

Source code at slepc4py/SLEPc/RG.pyx:171

setComplement(comp=True)#

Set a flag to indicate that the region is the complement of the specified one.

Logically collective.

Parameters:

comp (bool) – Activate/deactivate the complementation of the region.

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:227

setEllipseParameters(center, radius, vscale=None)#

Set the parameters defining the ellipse region.

Logically collective.

Parameters:
  • center (Scalar) – The center.

  • radius (float) – The radius.

  • vscale (float | None) – The vertical scale.

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:421

setFromOptions()#

Set RG options from the options database.

Collective.

Notes

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

Source code at slepc4py/SLEPc/RG.pyx:156

Return type:

None

setIntervalEndpoints(a, b, c, d)#

Set the parameters defining the interval region.

Logically collective.

Parameters:
  • a (float) – The left endpoint in the real axis.

  • b (float) – The right endpoint in the real axis.

  • c (float) – The upper endpoint in the imaginary axis.

  • d (float) – The lower endpoint in the imaginary axis.

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:463

setOptionsPrefix(prefix=None)#

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

Logically collective.

Parameters:

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

Return type:

None

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.

Source code at slepc4py/SLEPc/RG.pyx:105

setPolygonVertices(v)#

Set the vertices that define the polygon region.

Logically collective.

Parameters:

v (Sequence[float] | Sequence[Scalar]) – The vertices.

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:510

setRingParameters(center, radius, vscale, start_ang, end_ang, width)#

Set the parameters defining the ring region.

Logically collective.

Parameters:
  • center (Scalar) – The center.

  • radius (float) – The radius.

  • vscale (float) – The vertical scale.

  • start_ang (float) – The right-hand side angle.

  • end_ang (float) – The left-hand side angle.

  • width (float) – The width of the ring.

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:556

setScale(sfactor=None)#

Set the scaling factor to be used.

Logically collective.

Set the scaling factor to be used when checking that a point is inside the region and when computing the contour.

Parameters:

sfactor (float) – The scaling factor (default=1).

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:241

setType(rg_type)#

Set the type for the RG object.

Logically collective.

Parameters:

rg_type (Type | str) – The inner product type to be used.

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:75

view(viewer=None)#

Print the RG data structure.

Collective.

Parameters:

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

Return type:

None

Source code at slepc4py/SLEPc/RG.pyx:33

Attributes Documentation

complement#

If the region is the complement of the specified one.

Source code at slepc4py/SLEPc/RG.pyx:625

scale#

The scaling factor to be used.

Source code at slepc4py/SLEPc/RG.pyx:632