2D Grid Files: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
No edit summary
(+cat)
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
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.


{|class = "wikitable"
{|class="wikitable" style="border:1px #AAA solid;"  
|-
|-
|width="250"|GRID2D
|width="250"|GRID2D
Line 35: Line 35:
|}
|}
''Figure 1. 2D Grid File Format.''
''Figure 1. 2D Grid File Format.''
   
   
{|class = "wikitable"
{| class="wikitable" style="border:1px #AAA solid;"  
|-
|-
|GRID2D
|GRID2D
Line 68: Line 69:
Figure 2. Sample 2D Grid File.
Figure 2. Sample 2D Grid File.


==2D Grid Files Card Types==


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


{|class = "wikitable"
Card Type
|-
GRID2D
!Card Type
!GRID2D
Description
|-
File type identifier. Must be on first line of file. No fields.
!Description
|File type identifier. Must be on first line of file. No fields.
Required
|-  
YES
!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




{|class = "wikitable"
Card Type
|-
IJ
!Card Type
!colspan="3"|TYPE
Description
|-
Defines the orientation of the i,j indices.
!Description
|colspan="3"|Defines the type of grid as either cell- or mesh-centered.
Required
|-
YES
!Required
|colspan="3"| YES
Format
|-
IJ ±idir ±jdir
!Format
|colspan="3"|TYPE i
Sample
|-
IJ +x -y
!Sample
|colspan="3"|TYPE 0
Field
|-
Variable
!width="100"|Field
Value
!width="100"|Variable
Description
!width="100"|Value
!width="450"|Description
1
|-
±idir
| 1
±x,±y
| i
The direction corresponding to an increasing i index.
| 0,1
|The type code:
2
*i = 0 for mesh-centered
±jdir
*i = 1 for cell-centered
±x,±y
|}
The direction corresponding to an increasing j index.
   
   


{|class = "wikitable"
|-
!Card Type
!colspan="3"|IJ
|-
!Description
|colspan="3"|Defines the orientation of the i,j indices.
|-
!Required
|colspan="3"|YES
|-
!Format
|colspan="3"|IJ ±idir ±jdir
|-
!Sample
|colspan="3"|IJ +x -y
|-
!width="100"|Field
!width="100"|Variable
!width="100"|Value
!width="450"|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
   
   
{|class = "wikitable"
Format
|-
DIM nx ny
!Card Type
!colspan="3"|DIM
x1
|-
!Description
x2
|colspan="3"|Defines the dimensions of the grid.
|-
.
!Required
|colspan="3"|YES
.
|-
!Format
xnx
|colspan="3"|
:DIM nx ny
y1
:x1
:x2
y2
:.
:.
.
:xnx  
:y1
.
:y2
:.
yny
:.
   
:yny
|-  
Sample
!Sample
DIM 4 6
|colspan="3"|
:DIM 4 6  
0.0
:0.0
:1.0
1.0
:2.0
:4.0
2.0
:10.0
:12.0
4.0
:14.0
:16.0
10.0
:18.0
:20.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.
   
   
|-
!width="100"|Field
!width="100"|Variable
!width="100"|Value
!width="450"|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.
|}


   
   
{|class = "wikitable"
|-
!Card Type
!colspan="3"|DELEV
|-
!Description
|colspan="3"|Defines a default elevation for the grid.
|-
!Required
|colspan="3"|NO
|-
!Format
|colspan="3"|DELEV el
|-
!Sample
|colspan="3"|DELEV 100.0
|-
!width="100"|Field
!width="100"|Variable
!width="100"|Value
!width="450"|Description
|-
|1
| el
| ±
| The default elevation.
|}


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.


[[Main Page|Back to XMS]]
[[Category:File format]]
[[Category:File format]]
[[Category:SMS Cartesian Grid]]
[[Category:2D Grid|File]]

Revision as of 00:12, 23 August 2007

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.