NAG FL Interface
d03pzf (dim1_​parab_​fd_​interp)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

d03pzf interpolates in the spatial coordinate the solution and derivative of a system of partial differential equations (PDEs). The solution must first be computed using one of the finite difference schemes d03pcf/​d03pca, d03phf/​d03pha or d03ppf/​d03ppa, or one of the Keller box schemes d03pef, d03pkf or d03prf.

2 Specification

Fortran Interface
Subroutine d03pzf ( npde, m, u, npts, x, xp, intpts, itype, up, ifail)
Integer, Intent (In) :: npde, m, npts, intpts, itype
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: u(npde,npts), x(npts), xp(intpts)
Real (Kind=nag_wp), Intent (Out) :: up(npde,intpts,itype)
C Header Interface
#include <nag.h>
void  d03pzf_ (const Integer *npde, const Integer *m, const double u[], const Integer *npts, const double x[], const double xp[], const Integer *intpts, const Integer *itype, double up[], Integer *ifail)
The routine may be called by the names d03pzf or nagf_pde_dim1_parab_fd_interp.

3 Description

d03pzf is an interpolation routine for evaluating the solution of a system of partial differential equations (PDEs), at a set of user-specified points. The solution of the system of equations (possibly with coupled ordinary differential equations) must be computed using a finite difference scheme or a Keller box scheme on a set of mesh points. d03pzf can then be employed to compute the solution at a set of points anywhere in the range of the mesh. It can also evaluate the first spatial derivative of the solution. It uses linear interpolation for approximating the solution.

4 References

None.

5 Arguments

Note: the arguments x, m, u, npts and npde must be supplied unchanged from the PDE routine.
1: npde Integer Input
On entry: the number of PDEs.
Constraint: npde1.
2: m Integer Input
On entry: the coordinate system used. If the call to d03pzf follows one of the finite difference routines then m must be the same argument m as used in that call. For the Keller box scheme only Cartesian coordinate systems are valid and so m must be set to zero. No check will be made by d03pzf in this case.
m=0
Indicates Cartesian coordinates.
m=1
Indicates cylindrical polar coordinates.
m=2
Indicates spherical polar coordinates.
Constraints:
  • 0m2 following a finite difference routine;
  • m=0 following a Keller box scheme routine.
3: u(npde,npts) Real (Kind=nag_wp) array Input
On entry: the PDE part of the original solution returned in the argument u by the PDE routine.
Constraint: npde1.
4: npts Integer Input
On entry: the number of mesh points.
Constraint: npts3.
5: x(npts) Real (Kind=nag_wp) array Input
On entry: x(i), for i=1,2,,npts, must contain the mesh points as used by the PDE routine.
6: xp(intpts) Real (Kind=nag_wp) array Input
On entry: xp(i), for i=1,2,,intpts, must contain the spatial interpolation points.
Constraint: x(1)xp(1)<xp(2)<<xp(intpts)x(npts).
7: intpts Integer Input
On entry: the number of interpolation points.
Constraint: intpts1.
8: itype Integer Input
On entry: specifies the interpolation to be performed.
itype=1
The solutions at the interpolation points are computed.
itype=2
Both the solutions and their first derivatives at the interpolation points are computed.
Constraint: itype=1 or 2.
9: up(npde,intpts,itype) Real (Kind=nag_wp) array Output
On exit: if itype=1, up(i,j,1), contains the value of the solution Ui(xj,tout), at the interpolation points xj=xp(j), for j=1,2,,intpts and i=1,2,,npde.
If itype=2, up(i,j,1) contains Ui(xj,tout) and up(i,j,2) contains Ui x at these points.
10: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of -1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value -1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, i=value, x(i)=value, j=value and x(j)=value.
Constraint: x(1)<x(2)<<x(npts).
On entry, intpts=value.
Constraint: intpts1.
On entry, itype=value.
Constraint: itype=1 or 2.
On entry, m=value.
Constraint: m=0, 1 or 2.
On entry, npde=value.
Constraint: npde>0.
On entry, npts=value.
Constraint: npts>2.
ifail=2
On entry, i=value, xp(i)=value, j=value and xp(j)=value.
Constraint: x(1)xp(1)<xp(2)<<xp(intpts)x(npts).
ifail=3
On entry, interpolating point value with the value value is outside the x range.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

See the PDE routine documents.

8 Parallelism and Performance

d03pzf is not threaded in any implementation.

9 Further Comments

None.

10 Example

See Section 10 in d03pcf/​d03pca, d03ppf/​d03ppa and d03prf.