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

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: unpdenpts 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: xnpts Real (Kind=nag_wp) array Input
On entry: xi, for i=1,2,,npts, must contain the mesh points as used by the PDE routine.
6: xpintpts Real (Kind=nag_wp) array Input
On entry: xpi, for i=1,2,,intpts, must contain the spatial interpolation points.
Constraint: x1xp1<xp2<<xpintptsxnpts.
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: upnpdeintptsitype Real (Kind=nag_wp) array Output
On exit: if itype=1, upij1, contains the value of the solution Uixj,tout, at the interpolation points xj=xpj, for j=1,2,,intpts and i=1,2,,npde.
If itype=2, upij1 contains Uixj,tout and upij2 contains Ui x at these points.
10: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1. If you are unfamiliar with this argument you should refer to Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1 or 1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. 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, xi=value, j=value and xj=value.
Constraint: x1<x2<<xnpts.
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, xpi=value, j=value and xpj=value.
Constraint: x1xp1<xp2<<xpintptsxnpts.
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.