naginterfaces.library.pde.dim3_ellip_helmholtz¶
- naginterfaces.library.pde.dim3_ellip_helmholtz(xs, xf, l, lbdcnd, bdxs, bdxf, ys, yf, mbdcnd, bdys, bdyf, zs, zf, nbdcnd, bdzs, bdzf, lamda, f)[source]¶
dim3_ellip_helmholtz
solves the Helmholtz equation in Cartesian coordinates in three dimensions using the standard seven-point finite difference approximation. This function is designed to be particularly efficient on vector processors.For full information please refer to the NAG Library document for d03fa
https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/d03/d03faf.html
- Parameters
- xsfloat
The lower bound of the range of , i.e., .
- xffloat
The upper bound of the range of , i.e., .
- lint
The number of panels into which the interval is subdivided. Hence, there will be grid points in the -direction given by , for , where is the panel width.
- lbdcndint
Indicates the type of boundary conditions at and .
If the solution is periodic in , i.e., .
If the solution is specified at and .
If the solution is specified at and the derivative of the solution with respect to is specified at .
If the derivative of the solution with respect to is specified at and .
If the derivative of the solution with respect to is specified at and the solution is specified at .
- bdxsfloat, array-like, shape
The values of the derivative of the solution with respect to at . When or , , for , for .
When has any other value, is not referenced.
- bdxffloat, array-like, shape
The values of the derivative of the solution with respect to at . When or , , for , for .
When has any other value, is not referenced.
- ysfloat
The lower bound of the range of , i.e., .
- yffloat
The upper bound of the range of , i.e., .
- mbdcndint
Indicates the type of boundary conditions at and .
If the solution is periodic in , i.e., .
If the solution is specified at and .
If the solution is specified at and the derivative of the solution with respect to is specified at .
If the derivative of the solution with respect to is specified at and .
If the derivative of the solution with respect to is specified at and the solution is specified at .
- bdysfloat, array-like, shape
The values of the derivative of the solution with respect to at . When or , , for , for .
When has any other value, is not referenced.
- bdyffloat, array-like, shape
The values of the derivative of the solution with respect to at . When or , , for , for .
When has any other value, is not referenced.
- zsfloat
The lower bound of the range of , i.e., .
- zffloat
The upper bound of the range of , i.e., .
- nbdcndint
Specifies the type of boundary conditions at and .
if the solution is periodic in , i.e., .
if the solution is specified at and .
if the solution is specified at and the derivative of the solution with respect to is specified at .
if the derivative of the solution with respect to is specified at and .
if the derivative of the solution with respect to is specified at and the solution is specified at .
- bdzsfloat, array-like, shape
The values of the derivative of the solution with respect to at . When or , , for , for .
When has any other value, is not referenced.
- bdzffloat, array-like, shape
The values of the derivative of the solution with respect to at . When or , , for , for .
When has any other value, is not referenced.
- lamdafloat
The constant in the Helmholtz equation. For certain positive values of a solution to the differential equation may not exist, and close to these values the solution of the discretized problem will be extremely ill-conditioned. If ,
dim3_ellip_helmholtz
will set = 3, but will still attempt to find a solution. However, since in general the values of for which no solution exists cannot be predicted a priori, you are advised to treat any results computed with with great caution.- ffloat, array-like, shape
The values of the right-side of the Helmholtz equation and boundary values (if any).
On the boundaries is defined by
0
1
2
3
4
0
1
2
3
4
0
1
2
3
4
Note: if the table calls for both the solution and the right-hand side on a boundary, the solution must be specified.
- Returns
- ffloat, ndarray, shape
Contains the solution of the finite difference approximation for the grid point , for , for , for .
- pertrbfloat
, unless a solution to Poisson’s equation is required with a combination of periodic or derivative boundary conditions (, and or ). In this case a solution may not exist. is a constant, calculated and subtracted from the array , which ensures that a solution exists.
dim3_ellip_helmholtz
then computes this solution, which is a least squares solution to the original approximation. This solution is not unique and is unnormalized. The value of should be small compared to the right-hand side , otherwise a solution has been obtained to an essentially different problem. This comparison should always be made to ensure that a meaningful solution has been obtained.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: and .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: and .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint:
- (errno )
On entry, .
Constraint: and .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- Warns
- NagAlgorithmicWarning
- (errno )
in Helmholtz’s equation – a solution may not exist.
- Notes
No equivalent traditional C interface for this routine exists in the NAG Library.
dim3_ellip_helmholtz
solves the three-dimensional Helmholtz equation in Cartesian coordinates:This function forms the system of linear equations resulting from the standard seven-point finite difference equations, and then solves the system using a method based on the fast Fourier transform (FFT) described by Swarztrauber (1984). This function is based on the function HW3CRT from FISHPACK (see Swarztrauber and Sweet (1979)).
More precisely, the function replaces all the second derivatives by second-order central difference approximations, resulting in a block tridiagonal system of linear equations. The equations are modified to allow for the prescribed boundary conditions. Either the solution or the derivative of the solution may be specified on any of the boundaries, or the solution may be specified to be periodic in any of the three dimensions. By taking the discrete Fourier transform in the - and -directions, the equations are reduced to sets of tridiagonal systems of equations. The Fourier transforms required are computed using the multiple FFT functions found in submodule
sum
.
- References
Swarztrauber, P N, 1984, Fast Poisson solvers, Studies in Numerical Analysis, (ed G H Golub), Mathematical Association of America
Swarztrauber, P N and Sweet, R A, 1979, Efficient Fortran subprograms for the solution of separable elliptic partial differential equations, ACM Trans. Math. Software (5), 352–364