2D Grid Files: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
(+cat)
 
No edit summary
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" style="border:1px #AAA solid;"  
{|border="1" style="text-align:left"  
|-
|-
|width="250"|GRID2D
|width="250"|GRID2D
Line 37: Line 37:


   
   
{| class="wikitable" style="border:1px #AAA solid;"  
{|border="1" style="text-align:left"
|-
|-
|GRID2D
|GRID2D
Line 73: Line 73:
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:


Card Type
{|border="1" style="text-align:left"
GRID2D
|-
!Card Type
Description
!GRID2D
File type identifier. Must be on first line of file. No fields.
|-
!Description
Required
|File type identifier. Must be on first line of file. No fields.
YES
|-
   
!Required
|YES
  |}




Card Type
{|border="1" style="text-align:left"
TYPE
|-
!Card Type
Description
!colspan="3"|TYPE
Defines the type of grid as either cell- or mesh-centered.
|-
!Description
Required
|colspan="3"|Defines the type of grid as either cell- or mesh-centered.
YES
|-
!Required
Format
|colspan="3"| YES
TYPE i
|-
!Format
Sample
|colspan="3"|TYPE i
TYPE 0
|-
!Sample
Field
|colspan="3"|TYPE 0
Variable
|-
Value
!width="100"|Field
Description
!width="100"|Variable
!width="100"|Value
1
!width="450"|Description
i
|-
0,1
| 1
The type code:
| i
i = 0 for mesh-centered
| 0,1
|The type code:
i = 1 for cell-centered
*i = 0 for mesh-centered  
*i = 1 for cell-centered
|}
   
   


{|border="1" style="text-align:left"
|-
!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
IJ
   
   
Description
{|border="1" style="text-align:left"
Defines the orientation of the i,j indices.
|-
!Card Type  
Required
!colspan="3"|DIM
YES
|-
!Description
Format
|colspan="3"|Defines the dimensions of the grid.
IJ ±idir ±jdir
|-
!Required
Sample
|colspan="3"|YES
IJ +x -y
|-
!Format
Field
|colspan="3"|
Variable
:DIM nx ny
Value
:x1
Description
:x2
:.
1
:.
±idir
:xnx  
±x,±y
:y1
The direction corresponding to an increasing i index.
:y2
:.
2
:.
±jdir
:yny
±x,±y
|-  
The direction corresponding to an increasing j index.
!Sample
|colspan="3"|
 
:DIM 4 6  
:0.0
 
:1.0
Card Type  
:2.0
DIM
:4.0
:10.0
Description
:12.0
Defines the dimensions of the grid.
:14.0
:16.0
Required
:18.0
YES
:20.0
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.
   
   
|-
!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.
|}


   
   
{|border="1" style="text-align:left"
|-
!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.


[[Category:File format]]
[[Category:File format]]

Revision as of 18:03, 25 October 2012

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.