2D Grid Files

From XMS Wiki
Revision as of 00:12, 23 August 2007 by Mwtoews (talk | contribs) (+cat)

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Two-dimensional grids are stored in 2D grid files. The grids can be either cell-centered or mesh-centered. If the grid is mesh-centered, a set of material IDs may be included in the file. The 2D grid file format is shown in Figure 1, and a sample file in Figure 2.

GRID2D /* File type */
TYPE i /* Type of grid. Mesh or Cell centered. */
IJ ±idir ±jdir /* Card for defining rows, columns. */
DIM nx ny /* # of cell boundaries in each direction. */
x1 /* X coord. of cell boundaries. */
x2
.
.
xnx
y1 /* Y coord. of cell boundaries. */
y2
.
.
yny
DELEV el /* Default elevation for grid. */

Figure 1. 2D Grid File Format.


GRID2D
ID 5758
TYPE 1
DELEV 0.000000000000000e+00
IJ -y +x
DIM 4 4
0.000000000000000e+00
3.333333333333334e+01
6.666666666666667e+01
1.000000000000000e+02
0.000000000000000e+00
3.333333333333334e+01
6.666666666666667e+01
1.000000000000000e+02

Figure 2. Sample 2D Grid File.


The card types used in the 2D grid file format are as follows:

Card Type

GRID2D

Description

File type identifier. Must be on first line of file. No fields.

Required

YES


Card Type

TYPE

Description

Defines the type of grid as either cell- or mesh-centered.

Required

YES

Format

TYPE i

Sample

TYPE 0

Field

Variable
Value
Description

1

i
0,1
The type code:
i = 0 for mesh-centered

i = 1 for cell-centered



Card Type

IJ

Description

Defines the orientation of the i,j indices.

Required

YES

Format

IJ ±idir ±jdir

Sample

IJ +x -y

Field

Variable
Value
Description

1

±idir
±x,±y
The direction corresponding to an increasing i index.

2

±jdir
±x,±y
The direction corresponding to an increasing j index.


Card Type

DIM

Description

Defines the dimensions of the grid.

Required

YES

Format

DIM nx ny

x1

x2

.

.

xnx

y1

y2

.

.

yny


Sample

DIM 4 6

0.0

1.0

2.0

4.0

10.0

12.0

14.0

16.0

18.0

20.0


Field

Variable
Value
Description

1

nx
+
The number of cell boundaries in the x direction.

2

ny
+
The number of cell boundaries in the y direction.

3 to (nx+2)

x1-xnx
±
The coordinates of the x boundaries.

(nx+3) to (nx+ny+2)

y1-yny
±
The coordinates of the y boundaries.


Card Type

DELEV

Description

Defines a default elevation for the grid.

Required

NO

Format

DELEV el

Sample

DELEV 100.0

Field

Variable
Value
Description

1

el
±
The default elevation.