slepc4py.SLEPc.RG#
- class slepc4py.SLEPc.RG#
Bases:
ObjectRegion.
The
RGpackage provides a way to define a region of the complex plane. This is used in various eigensolvers to specify where the wanted eigenvalues are located.Enumerations
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.
Compute box containing the region.
Compute points on the contour of 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.
Get the flag indicating whether the region is complemented or not.
Get the parameters that define the ellipse region.
Get the parameters that define the interval region.
Get the prefix used for searching for all RG options in the database.
Get the parameters that define the interval region.
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 axisymmetric.
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.
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.
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
If the region is the complement of the specified one.
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.
- 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) –
Trueif the problem matrices are real.- Returns:
Whether it is possible to use conjugates.
- Return type:
Notes
If some integration points are the conjugates of other points, then the associated computational cost can be saved. This depends on the problem matrices being real and also the region being symmetric with respect to the horizontal axis. The result is
falseif using real arithmetic or in the case of a flat region (height equal to zero).See also
- checkInside(a)#
Determine if a set of given points are inside the region or not.
Not collective.
- Parameters:
- Returns:
Computed result for each point (1=inside, 0=on the contour, -1=outside).
- Return type:
Notes
If a scaling factor was set, the points are scaled before checking.
See also
- computeBoundingBox()#
Compute box containing the region.
Not collective.
Determine the endpoints of a rectangle in the complex plane that contains the region.
- Returns:
- Return type:
See also
- computeContour(n)#
Compute points on the contour of 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:
See also
- 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:
- Returns:
z (
ArrayScalar) – Quadrature points.zn (
ArrayScalar) – Normalized quadrature points.w (
ArrayScalar) – Quadrature weights.
- Return type:
Notes
In complex scalars, the values returned in
zare often the same as those computed bycomputeContour(), but this is not the case in real scalars where all output arguments are real.The computed values change for different quadrature rules.
See also
- create(comm=None)#
Create the RG object.
Collective.
- Parameters:
comm (Comm | None) – MPI communicator; if not provided, it defaults to all processes.
- Return type:
See also
- destroy()#
Destroy the RG object.
Collective.
See also
Source code at slepc4py/SLEPc/RG.pyx:73
- Return type:
- getComplement()#
Get the flag indicating whether the region is complemented or not.
Not collective.
- Returns:
Whether the region is complemented or not.
- Return type:
See also
- getEllipseParameters()#
Get the parameters that define the ellipse region.
Not collective.
- Returns:
- Return type:
See also
- getIntervalEndpoints()#
Get the parameters that define the interval region.
Not collective.
- Returns:
- Return type:
See also
- 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:
- getPolygonVertices()#
Get the parameters that define the interval region.
Not collective.
- Returns:
The vertices.
- Return type:
See also
- getRingParameters()#
Get the parameters that define the ring region.
Not collective.
- Returns:
- Return type:
See also
- getScale()#
Get the scaling factor.
Not collective.
- Returns:
The scaling factor.
- Return type:
See also
- getType()#
Get the RG type of this object.
Not collective.
- Returns:
The region type currently being used.
- Return type:
- isAxisymmetric(vertical=False)#
Determine if the region is axisymmetric.
Not collective.
Determine if the region is symmetric with respect to the real or imaginary axis.
- Parameters:
vertical (bool) –
Trueif symmetry must be checked against the vertical axis.- Returns:
Trueif the region is axisymmetric.- Return type:
See also
- isTrivial()#
Tell whether it is the trivial region (whole complex plane).
Not collective.
- Returns:
Trueif 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:
See also
- setComplement(comp=True)#
Set a flag to indicate that the region is the complement of the specified one.
Logically collective.
See also
- setEllipseParameters(center, radius, vscale=None)#
Set the parameters defining the ellipse region.
Logically collective.
- Parameters:
- Return type:
Notes
When PETSc is built with real scalars, the center is restricted to a real value.
See also
- setFromOptions()#
Set RG options from the options database.
Collective.
Notes
To see all options, run your program with the
-helpoption.See also
Source code at slepc4py/SLEPc/RG.pyx:209
- Return type:
- setIntervalEndpoints(a, b, c, d)#
Set the parameters defining the interval region.
Logically collective.
- Parameters:
- Return type:
Notes
The region is defined as \([a,b] x [c,d]\). Particular cases are an interval on the real axis (\(c=d=0\)), similarly for the imaginary axis (\(a=b=0\)), the whole complex plane (\(a=-\infty,b=\infty,c=-\infty,d=\infty\)), and so on.
When PETSc is built with real scalars, the region must be symmetric with respect to the real axis.
See also
- 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:
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.
- setPolygonVertices(v)#
Set the vertices that define the polygon region.
Logically collective.
See also
- setRingParameters(center, radius, vscale, start_ang, end_ang, width)#
Set the parameters defining the ring region.
Logically collective.
- Parameters:
- Return type:
Notes
The values of
center,radiusandvscalehave the same meaning as in the ellipse region. Thestart_angandend_angdefine the span of the ring (by default it is the whole ring), while thewidthis the separation between the two concentric ellipses (above and below the radius bywidth/2).The start and end angles are expressed as a fraction of the circumference. The allowed range is \([0,\dots,1]\), with
0corresponding to 0 radians,0.25to \(\pi/2\) radians, and so on. It is allowed to havestart_ang>end_ang, in which case the ring region crosses over the zero angle.When PETSc is built with real scalars, the center is restricted to a real value, and the start and end angles must be such that the region is symmetric with respect to the real axis.
See also
- 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.
See also
- setType(rg_type)#
Set the type for the RG object.
Logically collective.
- 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:
See also
Attributes Documentation
- complement#
If the region is the complement of the specified one.
- scale#
The scaling factor to be used.