D03PZF (PDF version)
D03 Chapter Contents
D03 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

D03PZF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

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

SUBROUTINE D03PZF ( NPDE, M, U, NPTS, X, XP, INTPTS, ITYPE, UP, IFAIL)
INTEGER  NPDE, M, NPTS, INTPTS, ITYPE, IFAIL
REAL (KIND=nag_wp)  U(NPDE,NPTS), X(NPTS), XP(INTPTS), UP(NPDE,INTPTS,ITYPE)

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  Parameters

Note: the parameters X, M, U, NPTS and NPDE must be supplied unchanged from the PDE routine.
1:     NPDE – INTEGERInput
On entry: the number of PDEs.
Constraint: NPDE1.
2:     M – INTEGERInput
On entry: the coordinate system used. If the call to D03PZF follows one of the finite difference routines then M must be the same parameter 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) arrayInput
On entry: the PDE part of the original solution returned in the parameter U by the PDE routine.
Constraint: NPDE1.
4:     NPTS – INTEGERInput
On entry: the number of mesh points.
Constraint: NPTS3.
5:     XNPTS – REAL (KIND=nag_wp) arrayInput
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) arrayInput
On entry: XPi, for i=1,2,,INTPTS, must contain the spatial interpolation points.
Constraint: X1XP1<XP2<<XPINTPTSXNPTS.
7:     INTPTS – INTEGERInput
On entry: the number of interpolation points.
Constraint: INTPTS1.
8:     ITYPE – INTEGERInput
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) arrayOutput
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 – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction 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 parameter, 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,ITYPE1 or 2,
orINTPTS<1,
orNPDE<1,
orNPTS<3,
orM0, 1 or 2,
or the mesh points Xi, for i=1,2,,NPTS, are not in strictly increasing order.
IFAIL=2
On entry, the interpolation points XPi, for i=1,2,,INTPTS, are not in strictly increasing order.
IFAIL=3
You are attempting extrapolation, that is, one of the interpolation points XPi, for some i, lies outside the interval [X1,XNPTS]. Extrapolation is not permitted.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.8 in the Essential Introduction for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

7  Accuracy

See the PDE routine documents.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

See Section 10 in D03PCF/D03PCA, D03PPF/D03PPA and D03PRF.

D03PZF (PDF version)
D03 Chapter Contents
D03 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015