nag_pde_2d_gen_order2_checkgrid (d03ry) is designed to be used in conjunction with
nag_pde_2d_gen_order2_rectilinear (d03rb). It can be called from the
inidom to check the user-specified initial grid data and to obtain a simple graphical representation of the initial grid.
nag_pde_2d_gen_order2_checkgrid (d03ry) outputs a character array which can be printed to provide a simple graphical representation of the virtual and base grids supplied to
nag_pde_2d_gen_order2_rectilinear (d03rb). It must be called only from within the
inidom after all output arguments of
inidom (other than
ierr) have been set.
nag_pde_2d_gen_order2_checkgrid (d03ry) also checks the validity of the grid data specified in
inidom.
You are strongly advised to call
nag_pde_2d_gen_order2_checkgrid (d03ry) during the initial call of
nag_pde_2d_gen_order2_rectilinear (d03rb) (at least) and to print the resulting character array in order to check that the base grid is exactly as required.
nag_pde_2d_gen_order2_checkgrid (d03ry) writes a representation of each point in the virtual and base grids to the character array
pgrid as follows:
– |
internal base grid points are written as two dots (..); |
– |
boundary base grid points are written as the ilbnd value (i.e., the type) of the boundary; |
– |
points external to the base grid are written as XX. |
As an example, consider a rectangular domain with a rectangular hole in which the virtual domain extends by one base grid point beyond the actual domain in all directions. The output when each row of
pgrid is printed consecutively is as follows:
XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX 23 3 3 3 3 3 3 3 3 3 3 34 XX
XX 2 .. .. .. .. .. .. .. .. .. .. 4 XX
XX 2 .. .. .. .. .. .. .. .. .. .. 4 XX
XX 2 .. .. 14 1 1 1 1 21 .. .. 4 XX
XX 2 .. .. 4 XX XX XX XX 2 .. .. 4 XX
XX 2 .. .. 4 XX XX XX XX 2 .. .. 4 XX
XX 2 .. .. 4 XX XX XX XX 2 .. .. 4 XX
XX 2 .. .. 4 XX XX XX XX 2 .. .. 4 XX
XX 2 .. .. 4 XX XX XX XX 2 .. .. 4 XX
XX 2 .. .. 43 3 3 3 3 32 .. .. 4 XX
XX 2 .. .. .. .. .. .. .. .. .. .. 4 XX
XX 2 .. .. .. .. .. .. .. .. .. .. 4 XX
XX 12 1 1 1 1 1 1 1 1 1 1 41 XX
XX XX XX XX XX XX XX XX XX XX XX XX XX XX
None.
- 1:
– int64int32nag_int scalar
- 2:
– int64int32nag_int scalar
-
The number of virtual grid points in the - and -direction respectively (including the boundary points).
- 3:
– int64int32nag_int array
-
, for , contains the base grid index of the first grid point in base grid row .
Constraints:
- , for ;
- , for .
- 4:
– int64int32nag_int array
-
, for , contains the virtual grid row number that corresponds to base grid row .
Constraints:
- , for ;
- , for .
- 5:
– int64int32nag_int array
-
, for , contains the virtual grid column number that contains base grid point .
Constraint:
, for .
- 6:
– int64int32nag_int array
-
, for
, contains the element of
lbnd corresponding to the start of the
th boundary (or corner).
Constraints:
- , for ;
- , for .
- 7:
– int64int32nag_int array
-
, for
, contains the type of the
th boundary (or corner), as defined in
nag_pde_2d_gen_order2_rectilinear (d03rb).
Constraint:
must be equal to one of the following: , , , , , , , , , , or , for .
- 8:
– int64int32nag_int array
-
, for , contains the grid index of the th boundary point.
Constraint:
, for .
Not applicable.
None.
function d03ry_example
fprintf('d03ry example results\n\n');
nx = int64(11);
ny = int64(11);
lrow = int64([1, 4, 15:11:37, 46:11:79, 88, 97]);
irow = int64([0:10]);
icol = int64([0:2, 0:10, 0:10, 0:10, 0:5, 8:10, ...
0:10, 0:10, 0:10, 0:8, 0:9, 0:8]);
llbnd = int64([1, 2,11,18,19,24,31,37,42,48,53,55,56,58,59,60,61,62, ...
63,64,65,66,67,68,69,70,71,72]);
ilbnd = int64([1, 2, 3, 4, 1, 4, 1, 2, 3, 4, 3, 4, 1, 2,12,23,34,41, ...
14,41,12,23,34,41,43,14,21,32]);
lbnd = int64([2, 4, 15:11:37, 46:11:79, 88, 98:104, ...
96, 86:-1:82, 70:-11:48, 39:-11:6, 8:13, ...
18:11:40, 49, 60, 72:77, 67:-11:45, 36, 25, ...
33, 32, 42, 52, 53, 43, 1, 97, 105, 87, 81, ...
3, 7, 71, 78, 14, 31, 51, 54, 34]);
[pgrid, ifail] = d03ry(nx, ny, lrow, irow, icol, llbnd, ilbnd, lbnd);
disp('Textual representation of grid:');
disp(pgrid);