d03raf integrates a system of linear or nonlinear, time-dependent partial differential equations (PDEs) in two space dimensions on a rectangular domain. The method of lines is employed to reduce the PDEs to a system of ordinary differential equations (ODEs) which are solved using a backward differentiation formula (BDF) method. The resulting system of nonlinear equations is solved using a modified Newton method and a Bi-CGSTAB iterative linear solver with ILU preconditioning. Local uniform grid refinement is used to improve the accuracy of the solution. d03raf originates from the VLUGR2 package (see Blom and Verwer (1993) and Blom et al. (1996)).
The routine may be called by the names d03raf or nagf_pde_dim2_gen_order2_rectangle.
3Description
d03raf integrates the system of PDEs:
(1)
for and in the rectangular domain , , and time interval , where the vector is the set of solution values
and denotes partial differentiation with respect to , and similarly for etc.
The functions must be supplied by you in pdedef. Similarly the initial values of the functions must be specified at in pdeiv.
Note that whilst complete generality is offered by the master equations (1), d03raf is not appropriate for all PDEs. In particular, hyperbolic systems should not be solved using this routine. Also, at least one component of must appear in the system of PDEs.
The boundary conditions must be supplied by you in bndary in the form
(2)
for all when or and for all when or and
The domain is covered by a uniform coarse base grid of size specified by you, and nested finer uniform subgrids are subsequently created in regions with high spatial activity. The refinement is controlled using a space monitor which is computed from the current solution and a user-supplied space tolerance tols. A number of optional parameters, e.g., the maximum number of grid levels at any time, and some weighting factors, can be specified in the arrays opti and optr. Further details of the refinement strategy can be found in Section 9.
The system of PDEs and the boundary conditions are discretized in space on each grid using a standard second-order finite difference scheme (centred on the internal domain and one-sided at the boundaries), and the resulting system of ODEs is integrated in time using a second-order, two-step, implicit BDF method with variable step size. The time integration is controlled using a time monitor computed at each grid level from the current solution and a user-supplied time tolerance tolt, and some further optional user-specified weighting factors held in optr (see Section 9 for details). The time monitor is used to compute a new step size, subject to restrictions on the size of the change between steps, and (optional) user-specified maximum and minimum step sizes held in dt. The step size is adjusted so that the remaining integration interval is an integer number times . In this way a solution is obtained at .
A modified Newton method is used to solve the nonlinear equations arising from the time integration. You may specify (in opti) the maximum number of Newton iterations to be attempted. A Jacobian matrix is calculated at the beginning of each time step. If the Newton process diverges or the maximum number of iterations is exceeded, a new Jacobian is calculated using the most recent iterates and the Newton process is restarted. If convergence is not achieved after the (optional) user-specified maximum number of new Jacobian evaluations, the time step is retried with . The linear systems arising from the Newton iteration are solved using a Bi-CGSTAB iterative method, in combination with ILU preconditioning. The maximum number of iterations can be specified by you in opti.
The solution at all grid levels is stored in the workspace arrays, along with other information needed for a restart (i.e., a continuation call). It is not intended that you extract the solution from these arrays, indeed the necessary information regarding these arrays is not included. The user-supplied monitor monitr should be used to obtain the solution at particular levels and times. monitr is called at the end of every time step, with the last step being identified via the input argument tlast.
Within pdeiv, pdedef, bndary and monitr the data structure is as follows. Each point on a particular grid is given an index (ranging from to the total number of points on the grid) and all coordinate or solution information is stored in arrays according to this index, e.g., and contain the - and coordinate of point , and contains the th solution component at point .
Adjerid S and Flaherty J E (1988) A local refinement finite element method for two-dimensional parabolic systems SIAM J. Sci. Statist. Comput.9 792–811
Blom J G, Trompert R A and Verwer J G (1996) Algorithm 758. VLUGR2: A vectorizable adaptive grid solver for PDEs in 2D Trans. Math. Software22 302–328
Blom J G and Verwer J G (1993) VLUGR2: A vectorized local uniform grid refinement code for PDEs in 2D Report NM-R9306 CWI, Amsterdam
Brown P N, Hindmarsh A C and Petzold L R (1994) Using Krylov methods in the solution of large scale differential-algebraic systems SIAM J. Sci. Statist. Comput.15 1467–1488
Trompert R A (1993) Local uniform grid refinement and systems of coupled partial differential equations Appl. Numer. Maths12 331–355
Trompert R A and Verwer J G (1993) Analysis of the implicit Euler local uniform grid refinement method SIAM J. Sci. Comput.14 259–278
5Arguments
1: – IntegerInput
On entry: the number of PDEs in the system.
Constraint:
.
2: – Real (Kind=nag_wp)Input/Output
On entry: the initial value of the independent variable .
On exit: the value of which has been reached. Normally .
Constraint:
.
3: – Real (Kind=nag_wp)Input
On entry: the final value of to which the integration is to be carried out.
4: – Real (Kind=nag_wp) arrayInput/Output
On entry: the initial, minimum and maximum time step sizes respectively.
Specifies the initial time step size to be used on the first entry, i.e., when . If then the default value is used. On subsequent entries (), the value of is not referenced.
Specifies the minimum time step size to be attempted by the integrator. If the default value is used.
Specifies the maximum time step size to be attempted by the integrator. If the default value is used.
On exit: contains the time step size for the next time step. and are unchanged or set to their default values if zero on entry.
Constraints:
if , ;
if and , and , where the values of and will have been reset to their default values if zero on entry;
.
5: – Real (Kind=nag_wp)Input
6: – Real (Kind=nag_wp)Input
On entry: the extents of the rectangular domain in the -direction, i.e., the coordinates of the left and right boundaries respectively.
Constraint:
and xmax must be sufficiently distinguishable from xmin for the precision of the machine being used.
7: – Real (Kind=nag_wp)Input
8: – Real (Kind=nag_wp)Input
On entry: the extents of the rectangular domain in the -direction, i.e., the coordinates of the lower and upper boundaries respectively.
Constraint:
and ymax must be sufficiently distinguishable from ymin for the precision of the machine being used.
9: – IntegerInput
On entry: the number of grid points in the -direction (including the boundary points).
Constraint:
.
10: – IntegerInput
On entry: the number of grid points in the -direction (including the boundary points).
Constraint:
.
11: – Real (Kind=nag_wp)Input
On entry: the space tolerance used in the grid refinement strategy ( in equation (4)). See Section 9.2.
Constraint:
.
12: – Real (Kind=nag_wp)Input
On entry: the time tolerance used to determine the time step size ( in equation (7)). See Section 9.3.
Constraint:
.
13: – Subroutine, supplied by the user.External Procedure
pdedef must evaluate the functions
, for , in equation (1) which define the system of PDEs (i.e., the residuals of the resulting ODE system) at all interior points of the domain. Values at points on the boundaries of the domain are ignored and will be overwritten by bndary. pdedef is called for each subgrid in turn.
On entry: the number of grid points in the current grid.
2: – IntegerInput
On entry: the number of PDEs in the system.
3: – Real (Kind=nag_wp)Input
On entry: the current value of the independent variable .
4: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinate of the th grid point, for .
5: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinate of the th grid point, for .
6: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of the th PDE component at the th grid point, for and .
7: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
8: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
9: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
10: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
11: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
12: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
13: – Real (Kind=nag_wp) arrayOutput
On exit: must contain the value of , for , at the
th grid point, for , although the residuals at boundary points will be ignored (and overwritten later on) and so they need not be specified here.
pdedef must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d03raf is called. Arguments denoted as Input must not be changed by this procedure.
Note:pdedef should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d03raf. If your code inadvertently does return any NaNs or infinities, d03raf is likely to produce unexpected results.
14: – Subroutine, supplied by the user.External Procedure
bndary must evaluate the functions
, for , in equation (2) which define the boundary conditions at all boundary points of the domain. Residuals at interior points must not be altered by this subroutine.
On entry: the number of grid points in the current grid.
2: – IntegerInput
On entry: the number of PDEs in the system.
3: – Real (Kind=nag_wp)Input
On entry: the current value of the independent variable .
4: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinate of the th grid point, for .
5: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinate of the th grid point, for .
6: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of the th PDE component at the th grid point, for and .
7: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
8: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
9: – Real (Kind=nag_wp) arrayInput
On entry: contains the value of for the th PDE component at the th grid point, for and .
10: – IntegerInput
On entry: the number of boundary points in the grid.
11: – Integer arrayInput
On entry: contains the grid index for the th boundary point, for . Hence the th boundary point has coordinates and , and the corresponding solution values are , etc.
12: – Real (Kind=nag_wp) arrayInput/Output
On entry: contains the value of , for , at the
th grid point, for , as returned by pdedef. The residuals at the boundary points will be overwritten and so need not have been set by pdedef.
On exit: must contain the value of , for , at the
th boundary point, for .
Note: elements of res corresponding to interior points must not be altered.
bndary must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d03raf is called. Arguments denoted as Input must not be changed by this procedure.
Note:bndary should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d03raf. If your code inadvertently does return any NaNs or infinities, d03raf is likely to produce unexpected results.
15: – Subroutine, supplied by the user.External Procedure
pdeiv must specify the initial values of the PDE components at all points in the grid. pdeiv is not referenced if, on entry, .
On entry: the (initial) value of the independent variable .
4: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinate of the th grid point, for .
5: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinate of the th grid point, for .
6: – Real (Kind=nag_wp) arrayOutput
On exit: must contain the value of the th PDE component at the th grid point, for and .
pdeiv must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d03raf is called. Arguments denoted as Input must not be changed by this procedure.
Note:pdeiv should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d03raf. If your code inadvertently does return any NaNs or infinities, d03raf is likely to produce unexpected results.
16: – Subroutine, supplied by the user.External Procedure
monitr is called by d03raf at the end of every successful time step, and may be used to examine or print the solution or perform other tasks such as error calculations, particularly at the final time step, indicated by the argument tlast. The input arguments contain information about the grid and solution at all grid levels used.
monitr can also be used to force an immediate tidy termination of the solution process and return to the calling program.
On entry: the current value of the independent variable , i.e., the time at the end of the integration step just completed.
3: – Real (Kind=nag_wp)Input
On entry: the current time step size , i.e., the time step size used for the integration step just completed.
4: – Real (Kind=nag_wp)Input
On entry: the step size that will be used for the next time step.
5: – LogicalInput
On entry: indicates if intermediate or final time step. for an intermediate step, for the last call to monitr before returning to your program.
6: – IntegerInput
On entry: the number of grid levels used at time t.
7: – Integer arrayInput
On entry: contains the number of grid points at level , for .
8: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinates of the grid points in each level in turn, i.e.,
, for and .
So for level , , where , for and .
9: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinates of the grid points in each level in turn, i.e.,
, for and .
So for level , , where , for and .
10: – Integer arrayInput
On entry: contains the pointer to the solution in sol at grid level and time t. ( actually contains the array index immediately preceding the start of the solution in sol.)
11: – Real (Kind=nag_wp) arrayInput
On entry: contains the solution at time t for each grid level in turn, positioned according to lsol, i.e., for level , , for , and .
12: – IntegerInput/Output
On entry: will be set to .
On exit: should be set to to force a tidy termination and an immediate return to the calling program with . ierr should remain unchanged otherwise.
monitr must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d03raf is called. Arguments denoted as Input must not be changed by this procedure.
17: – Integer arrayInput
On entry: may be set to control various options available in the integrator.
All the default options are employed.
The default value of
, for , can be obtained by setting .
Specifies the maximum number of grid levels allowed (including the base grid). . The default value is .
Specifies the maximum number of Jacobian evaluations allowed during each nonlinear equations solution. . The default value is .
Specifies the maximum number of Newton iterations in each nonlinear equations solution. . The default value is .
Specifies the maximum number of iterations in each linear equations solution. . The default value is .
Constraint:
and if , , for .
18: – Real (Kind=nag_wp) arrayInput
On entry: may be used to specify the optional vectors , and in the space and time monitors (see Section 9).
If an optional vector is not required then all its components should be set to .
, for , specifies , the approximate maximum absolute value of the th component of , as used in (4) and (7).
, for .
, for , specifies , the weighting factors used in the space monitor (see (4)) to indicate the relative importance of the th component of on the space monitor.
, for .
, for , specifies , the weighting factors used in the time monitor (see (6)) to indicate the relative importance of the th component of on the time monitor.
, for .
Constraints:
, for ;
, for and .
19: – Real (Kind=nag_wp) arrayCommunication Array
20: – IntegerInput
On entry: the dimension of the array rwk as declared in the (sub)program from which d03raf is called.
The required value of lenrwk cannot be determined exactly in advance, but a suggested value is
where if and otherwise, and is the expected maximum number of grid points at any one level. If during the execution the supplied value is found to be too small then the routine returns with and an estimated required size is printed on the current error message unit (see x04aaf).
Constraint:
(the required size for the initial grid).
21: – Integer arrayCommunication Array
On entry: if , iwk need not be set. Otherwise iwk must remain unchanged from a previous call to d03raf.
On exit: the following components of the array iwk concern the efficiency of the integration. Here, is the maximum number of grid levels allowed ( if and otherwise), and is a grid level taking the values , where is the number of levels used.
Contains the number of steps taken in time.
Contains the number of rejected time steps.
Contains the total number of residual evaluations performed (i.e., the number of times pdedef was called) at grid level .
Contains the total number of Jacobian evaluations performed at grid level .
Contains the total number of Newton iterations performed at grid level .
Contains the total number of linear solver iterations performed at grid level .
Contains the maximum number of Newton iterations performed at any one time step at grid level .
Contains the maximum number of linear solver iterations performed at any one time step at grid level .
Note: the total and maximum numbers are cumulative over all calls to d03raf. If the specified maximum number of Newton or linear solver iterations is exceeded at any stage, the maximums above are set to the specified maximum plus one.
22: – IntegerInput
On entry: the dimension of the array iwk as declared in the (sub)program from which d03raf is called.
The required value of leniwk cannot be determined exactly in advance, but a suggested value is
where is the expected maximum number of grid points at any one level and if and otherwise. If during the execution the supplied value is found to be too small then the routine returns with and an estimated required size is printed on the current error message unit (see x04aaf).
Constraint:
(the required size for the initial grid).
23: – Logical arrayWorkspace
24: – IntegerInput
On entry: the dimension of the array lwk as declared in the (sub)program from which d03raf is called.
The required value of lenlwk cannot be determined exactly in advanced, but a suggested value is
where is the expected maximum number of grid points at any one level. If during the execution the supplied value is found to be too small then the routine returns with and an estimated required size is printed on the current error message unit (see x04aaf).
Constraint:
(the required size for the initial grid).
25: – IntegerInput
On entry: the level of trace information required from d03raf. itrace may take the value , , , or .
No output is generated.
Only warning messages are printed.
Output from the underlying solver is printed on the current advisory message unit (see x04abf). This output contains details of the time integration, the nonlinear iteration and the linear solver.
If , is assumed and similarly if , is assumed.
The advisory messages are given in greater detail as itrace increases. Setting allows you to monitor the progress of the integration without possibly excessive information.
26: – IntegerInput/Output
On entry: must be set to or , alternatively or .
Starts the integration in time. pdedef is assumed to be serial.
Continues the integration after an earlier exit from the routine. In this case, only the following parameters may be reset between calls to d03raf: tout, dt, tols, tolt, opti, optr, itrace and ifail. pdedef is assumed to be serial.
Starts the integration in time. pdedef is assumed to have been parallelized by you, as described in Section 8. In all other respects, this is equivalent to .
Continues the integration after an earlier exit from the routine. In this case, only the following parameters may be reset between calls to d03raf: tout, dt, tols, tolt, opti, optr, itrace and ifail. pdedef is assumed to have been parallelized by you, as described in Section 8. In all other respects, this is equivalent to .
Constraint:
or .
On exit: , if ind on input was or , or , if ind on input was or .
Note: for users of serial versions of the NAG Library, it is recommended that you only use or . See Section 8 for more information on the use of ind.
27: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, .
Constraint: if , .
On entry, and . Note that was reset to default if zero on entry.
Constraint: if , .
On entry, and . Note that was reset to default if zero on entry.
Constraint: if , .
Attempted time-step smaller than specified minimum. Check problem formulation in pdedef, bndary and pdeiv. Try increasing itrace for more information.
The time step size to be attempted is less than the specified minimum size. This may occur following time step failures and subsequent step size reductions caused by one or more of the following:
the requested accuracy could not be achieved, i.e., tolt is too small,
the maximum number of linear solver iterations, Newton iterations or Jacobian evaluations is too small,
ILU decomposition of the Jacobian matrix could not be performed, possibly due to singularity of the Jacobian.
Setting itrace to a higher value may provide further information.
In the latter two cases you are advised to check their problem formulation in pdedef and/or bndary, and the initial values in pdeiv if appropriate.
One or more of the workspace arrays are too small. Try increasing itrace for more information.
set to in monitr. Integration completed as far as ts:
.
Integration completed, but maximum number of levels too small for required accuracy.
The integration has been completed but the maximum number of levels specified in was insufficient at one or more time steps, meaning that the requested space accuracy could not be achieved. To avoid this warning either increase the value of or decrease the value of tols.
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.
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.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
There are three sources of error in the algorithm: space and time discretization, and interpolation (linear) between grid levels. The space and time discretization errors are controlled separately using the arguments tols and tolt described in the following section, and you should test the effects of varying these arguments. Interpolation errors are generally implicitly controlled by the refinement criterion since in areas where interpolation errors are potentially large, the space monitor will also be large. It can be shown that the global spatial accuracy is comparable to that which would be obtained on a uniform grid of the finest grid size. A full error analysis can be found in Trompert and Verwer (1993).
8Parallelism and Performance
d03raf requires a user-supplied routine pdedef to evaluate the functions , for . The parallelism within d03raf will be more efficient if pdedef can also be parallelized. This is often the case, but you must add some OpenMP directives to your version of pdedef to implement the parallelism. For example, if the body of code for pdedef is as follows (adapted from the first test case in the document for d03raf):
This example can be parallelized, as the updating of res for each value in the range is independent of every other value. Thus this should be parallelized in OpenMP (using an explicit loop rather than Fortran array syntax) as follows:
!$OMP DO
Do i = 1, npts
res(i,1:npde) = ut(i,1:npde) -diffusion*(uxx(i,1:npde)+uyy(i,1:npde &
)) - damkohler*(1.0E0_nag_wp+heat_release-u(i,1:npde))*exp(- &
activ_energy/u(i,1:npde))
End Do
!$OMP END DO
Note that the OpenMP PARALLEL directive must not be specified, as the OpenMP DO directive will bind to the PARALLEL region within the d03raf code. Also note that this assumes the default OpenMP behaviour that all variables are SHARED, except for loop indices that are PRIVATE.
To avoid problems for existing Library users, who will not have specified any OpenMP directives in their pdedef routine, the default assumption of d03raf is that pdedef has not been parallelized, and executes calls to pdedef in serial mode. You must indicate that pdedef has been parallelized by setting ind to or as appropriate. See Section 5 for details.
If the code within pdedef cannot be parallelized, you must not add any OpenMP directives to your code, and must not set ind to or . If ind is set to or and pdedef has not been parallelized, results on multiple threads will be unpredictable and may give rise to incorrect results and/or program crashes or deadlocks. Please contact NAG for advice if required. Overloading ind in this manner is not entirely satisfactory, consequently it is likely that replacement interfaces for d03raf will be included in a future NAG Library release.
9Further Comments
9.1Algorithm Outline
The local uniform grid refinement method is summarised as follows:
1.Initialize the course base grid, an initial solution and an initial time step.
2.Solve the system of PDEs on the current grid with the current time step.
3.If the required accuracy in space and the maximum number of grid levels have not yet been reached:
(a)Determine new finer grid at forward time level.
(b)Get solution values at previous time level(s) on new grid.
(c)Interpolate internal boundary values from old grid at forward time.
(d)Get initial values for the Newton process at forward time.
(e)Go to .
4.Update the coarser grid solution using the finer grid values.
5.Estimate error in time integration. If time error is acceptable advance time level.
6.Determine new step size then go to with coarse base as current grid.
9.2Refinement Strategy
For each grid point a space monitor is determined by
(3)
where and are the grid widths in the and directions; and , are the and coordinates at grid point . The argument is obtained from
(4)
where is the user-supplied space tolerance; is a weighting factor for the relative importance of the th PDE component on the space monitor; and is the approximate maximum absolute value of the th component. A value for must be supplied by you. Values for and must also be supplied but may be set to the value if little information about the solution is known.
A new level of refinement is created if
(5)
depending on the grid level at the previous step in order to avoid fluctuations in the number of grid levels between time steps. If (5) is satisfied then all grid points for which are flagged and surrounding cells are quartered in size.
No derefinement takes place as such, since at each time step the solution on the base grid is computed first and new finer grids are then created based on the new solution. Hence derefinement occurs implicitly. See Section 9.1.
9.3Time Integration
The time integration is controlled using a time monitor calculated at each level up to the maximum level used, given by
(6)
where is the total number of points on grid level ; ; is the current time step; is the time derivative of which is approximated by first-order finite differences; is the time equivalent of the space weighting factor ; and is given by
(7)
where is as before, and is the user-specified time tolerance.
An integration step is rejected and retried at all levels if
(8)
10Example
For this routine two examples are presented, with a main program and two example problems given in Example 1 (EX1) and Example 2 (EX2).
Example 1 (EX1)
This example stems from combustion theory and is a model for a single, one-step reaction of a mixture of two chemicals (see Adjerid and Flaherty (1988)). The PDE for the temperature of the mixture is
for and , with initial conditions for , and boundary conditions
The heat release argument , the Damkohler number , the activation energy , the reaction rate , and the diffusion argument .
For small times the temperature gradually increases in a circular region about the origin, and at about
‘ignition’ occurs causing the temperature to suddenly jump from near unity to , and a reaction front forms and propagates outwards, becoming steeper. Thus during the solution, just one grid level is used up to the ignition point, then two levels, and then three as the reaction front steepens.
Example 2 (EX2)
This example is taken from a multispecies food web model, in which predator-prey relationships in a spatial domain are simulated (see Brown et al. (1994)). In this example there is just one species each of prey and predator, and the two PDEs for the concentrations and of the prey and the predator respectively are
with
where and , and .
The initial conditions are taken to be simple peaked functions which satisfy the boundary conditions and very nearly satisfy the PDEs:
and the boundary conditions are of Neumann type, i.e., zero normal derivatives everywhere.
During the solution a number of peaks and troughs develop across the domain, and so the number of levels required increases with time. Since the solution varies rapidly in space across the whole of the domain, refinement at intermediate levels tends to occur at all points of the domain.