NAG C Library Function Document

nag_pde_interp_1d_coll (d03pyc)


nag_pde_interp_1d_coll (d03pyc) may be used in conjunction with either nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc). It computes the solution and its first derivative at user-specified points in the spatial coordinate.


#include <nag.h>
#include <nagd03.h>
void  nag_pde_interp_1d_coll (Integer npde, const double u[], Integer nbkpts, const double xbkpts[], Integer npoly, Integer npts, const double xp[], Integer intpts, Integer itype, double up[], double rsave[], Integer lrsave, NagError *fail)


nag_pde_interp_1d_coll (d03pyc) is an interpolation function for evaluating the solution of a system of partial differential equations (PDEs), or the PDE components of a system of PDEs with coupled ordinary differential equations (ODEs), at a set of user-specified points. The solution of a system of equations can be computed using nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc) on a set of mesh points; nag_pde_interp_1d_coll (d03pyc) can then be employed to compute the solution at a set of points other than those originally used in nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc). It can also evaluate the first derivative of the solution. Polynomial interpolation is used between each of the break-points xbkpts[i-1], for i=1,2,,nbkpts. When the derivative is needed (itype=2), the array xp[intpts-1] must not contain any of the break-points, as the method, and consequently the interpolation scheme, assumes that only the solution is continuous at these points.




Note: the arguments u, npts, npde, xbkpts, nbkpts, rsave and lrsave must be supplied unchanged from either nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc).
1:     npde IntegerInput
On entry: the number of PDEs.
Constraint: npde1.
2:     u[npde×npts] const doubleInput
Note: the i,jth element of the matrix U is stored in u[j-1×npde+i-1].
On entry: the PDE part of the original solution returned in the argument u by the function nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc).
3:     nbkpts IntegerInput
On entry: the number of break-points.
Constraint: nbkpts2.
4:     xbkpts[nbkpts] const doubleInput
On entry: xbkpts[i-1], for i=1,2,,nbkpts, must contain the break-points as used by nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc).
Constraint: xbkpts[0]<xbkpts[1]<<xbkpts[nbkpts-1].
5:     npoly IntegerInput
On entry: the degree of the Chebyshev polynomial used for approximation as used by nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc).
Constraint: 1npoly49.
6:     npts IntegerInput
On entry: the number of mesh points as used by nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc).
Constraint: npts=nbkpts-1×npoly+1.
7:     xp[intpts] const doubleInput
On entry: xp[i-1], for i=1,2,,intpts, must contain the spatial interpolation points.
  • xbkpts[0]xp[0]<xp[1]<<xp[intpts-1]xbkpts[nbkpts-1];
  • if itype=2, xp[i-1]xbkpts[j-1], for i=1,2,,intpts and j=2,3,,nbkpts-1.
8:     intpts IntegerInput
On entry: the number of interpolation points.
Constraint: intpts1.
9:     itype IntegerInput
On entry: specifies the interpolation to be performed.
The solution at the interpolation points are computed.
Both the solution and the first derivative at the interpolation points are computed.
Constraint: itype=1 or 2.
10:   up[dim] doubleOutput
Note: the dimension, dim, of the array up must be at least npde×intpts×itype.
The element UPi,j,k is stored in the array element up[k-1×npde×intpts+j-1×npde+i-1].
On exit: if itype=1, UPi,j,1, contains the value of the solution Uixj,tout, at the interpolation points xj=xp[j-1], for j=1,2,,intpts and i=1,2,,npde.
If itype=2, UPi,j,1 contains Uixj,tout and UPi,j,2 contains Ui x  at these points.
11:   rsave[lrsave] doubleCommunication Array
The array rsave contains information required by nag_pde_interp_1d_coll (d03pyc) as returned by nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc). The contents of rsave must not be changed from the call to nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc). Some elements of this array are overwritten on exit.
12:   lrsave IntegerInput
On entry: the size of the workspace rsave, as in nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc).
13:   fail NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

Error Indicators and Warnings

Dynamic memory allocation failed.
See Section in How to Use the NAG Library and its Documentation for further information.
On entry, argument value had an illegal value.
Extrapolation is not allowed.
On entry, itype=2 and at least one interpolation point coincides with a break-point, i.e., interpolation point no value with value value is close to break-point value with value value.
On entry, intpts=value.
Constraint: intpts1.
On entry, itype=value.
Constraint: itype=1 or 2.
On entry, nbkpts=value.
Constraint: nbkpts2.
On entry, npde=value.
Constraint: npde>0.
On entry, npoly=value.
Constraint: npoly>0.
On entry, npts=value, nbkpts=value and npoly=value.
Constraint: npts=nbkpts-1×npoly+1.
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
On entry, i=value, xbkpts[i-1]=value, j=value and xbkpts[j-1]=value.
Constraint: xbkpts[0]<xbkpts[1]<<xbkpts[nbkpts-1].
On entry, i=value, xp[i-1]=value, j=value and xp[j-1]=value.
Constraint: xbkpts[0]xp[0]<xp[1]<<xp[intpts-1]xbkpts[nbkpts-1].


See the documents for nag_pde_parab_1d_coll (d03pdc) or nag_pde_parab_1d_coll_ode (d03pjc).

Parallelism and Performance

nag_pde_interp_1d_coll (d03pyc) is not threaded in any implementation.

Further Comments



See Section 10 in nag_pde_parab_1d_coll (d03pdc).